fix c99 types mess; clean up after merges

pull/140/merge
Thorsten von Eicken 9 years ago
parent 06ec5d46f1
commit d2bd118f0b
  1. 6
      esp-link/main.c
  2. 8
      rest/rest.c
  3. 2
      syslog/syslog.c

@ -81,7 +81,7 @@ HttpdBuiltInUrl builtInUrls[] = {
{ "/pins", cgiPins, NULL }, { "/pins", cgiPins, NULL },
#ifdef MQTT #ifdef MQTT
{ "/mqtt", cgiMqtt, NULL }, { "/mqtt", cgiMqtt, NULL },
#endif #endif
{ "*", cgiEspFsHook, NULL }, //Catch-all cgi function for the filesystem { "*", cgiEspFsHook, NULL }, //Catch-all cgi function for the filesystem
{ NULL, NULL, NULL } { NULL, NULL, NULL }
}; };
@ -151,8 +151,8 @@ void user_init(void) {
uint32_t fid = spi_flash_get_id(); uint32_t fid = spi_flash_get_id();
NOTICE("Flash map %s, manuf 0x%02X chip 0x%04X", flash_maps[system_get_flash_size_map()], NOTICE("Flash map %s, manuf 0x%02X chip 0x%04X", flash_maps[system_get_flash_size_map()],
fid & 0xff, (fid&0xff00)|((fid>>16)&0xff)); fid & 0xff, (fid&0xff00)|((fid>>16)&0xff));
NOTICE("** esp-link ready"); NOTICE("** %s: ready, heap=%ld", esp_link_version, (unsigned long)system_get_free_heap_size());
// Init SNTP service // Init SNTP service
cgiServicesSNTPInit(); cgiServicesSNTPInit();
#ifdef MQTT #ifdef MQTT

@ -375,7 +375,7 @@ REST_Request(CmdPacket *cmd) {
realLen = cmdArgLen(&req); realLen = cmdArgLen(&req);
if (realLen > 2048) goto fail; if (realLen > 2048) goto fail;
} }
DBG_REST(" bodyLen=%ld", realLen); DBG_REST(" bodyLen=%d", realLen);
// we need to allocate memory for the header plus the body. First we count the length of the // we need to allocate memory for the header plus the body. First we count the length of the
// header (including some extra counted "%s" and then we add the body length. We allocate the // header (including some extra counted "%s" and then we add the body length. We allocate the
@ -394,7 +394,7 @@ REST_Request(CmdPacket *cmd) {
if (client->data) os_free(client->data); if (client->data) os_free(client->data);
client->data = (char*)os_zalloc(headerLen + realLen); client->data = (char*)os_zalloc(headerLen + realLen);
if (client->data == NULL) goto fail; if (client->data == NULL) goto fail;
DBG_REST(" totLen=%ld data=%p", headerLen + realLen, client->data); DBG_REST(" totLen=%d data=%p", headerLen + realLen, client->data);
client->data_len = os_sprintf((char*)client->data, headerFmt, method, path, client->host, client->data_len = os_sprintf((char*)client->data, headerFmt, method, path, client->host,
client->header, realLen, client->content_type, client->user_agent); client->header, realLen, client->content_type, client->user_agent);
DBG_REST(" hdrLen=%d", client->data_len); DBG_REST(" hdrLen=%d", client->data_len);
@ -413,7 +413,7 @@ REST_Request(CmdPacket *cmd) {
espconn_regist_reconcb(client->pCon, tcpclient_recon_cb); espconn_regist_reconcb(client->pCon, tcpclient_recon_cb);
if(UTILS_StrToIP((char *)client->host, &client->pCon->proto.tcp->remote_ip)) { if(UTILS_StrToIP((char *)client->host, &client->pCon->proto.tcp->remote_ip)) {
DBG_REST("REST: Connect to ip %s:%ld\n",client->host, client->port); DBG_REST("REST: Connect to ip %s:%d\n",client->host, client->port);
//if(client->security){ //if(client->security){
// espconn_secure_connect(client->pCon); // espconn_secure_connect(client->pCon);
//} //}
@ -421,7 +421,7 @@ REST_Request(CmdPacket *cmd) {
espconn_connect(client->pCon); espconn_connect(client->pCon);
//} //}
} else { } else {
DBG_REST("REST: Connect to host %s:%ld\n", client->host, client->port); DBG_REST("REST: Connect to host %s:%d\n", client->host, client->port);
espconn_gethostbyname(client->pCon, (char *)client->host, &client->ip, rest_dns_found); espconn_gethostbyname(client->pCon, (char *)client->host, &client->ip, rest_dns_found);
} }

@ -413,7 +413,7 @@ syslog_compose(uint8_t facility, uint8_t severity, const char *tag, const char *
// add HOSTNAME APP-NAME PROCID MSGID // add HOSTNAME APP-NAME PROCID MSGID
if (flashConfig.syslog_showtick) if (flashConfig.syslog_showtick)
p += os_sprintf(p, "%s %s %lu.%06lu %lu ", flashConfig.hostname, tag, se->tick / 1000000, p += os_sprintf(p, "%s %s %u.%06u %u ", flashConfig.hostname, tag, se->tick / 1000000,
se->tick % 1000000, syslog_msgid++); se->tick % 1000000, syslog_msgid++);
else else
p += os_sprintf(p, "%s %s - %u ", flashConfig.hostname, tag, syslog_msgid++); p += os_sprintf(p, "%s %s - %u ", flashConfig.hostname, tag, syslog_msgid++);

Loading…
Cancel
Save