Fix compile warnings (==errors) in new httpd

This commit is contained in:
Dirk Ziegelmeier 2016-04-26 20:53:25 +02:00
parent afd9ee9147
commit a5d4a27ae1
2 changed files with 4 additions and 9 deletions

View File

@ -112,7 +112,7 @@
#else /* LWIP_HTTPD_SSI */
/** Default: don't copy if the data is sent from file-system directly */
#define HTTP_IS_DATA_VOLATILE(hs) (((hs->file != NULL) && (hs->handle != NULL) && (hs->file == \
(char*)hs->handle->data + hs->handle->len - hs->left)) \
(const char*)hs->handle->data + hs->handle->len - hs->left)) \
? 0 : TCP_WRITE_FLAG_COPY)
#endif /* LWIP_HTTPD_SSI */
#endif
@ -332,11 +332,11 @@ strnstr(const char* buffer, const char* token, size_t n)
const char* p;
int tokenlen = (int)strlen(token);
if (tokenlen == 0) {
return (char *)buffer;
return (char *)(size_t)buffer;
}
for (p = buffer; *p && (p + tokenlen <= buffer + n); p++) {
if ((*p == *token) && (strncmp(p, token, tokenlen) == 0)) {
return (char *)p;
return (char *)(size_t)p;
}
}
return NULL;
@ -373,7 +373,7 @@ stricmp(const char* str1, const char* str2)
}
#endif /* LWIP_HTTPD_STRICMP_PRIVATE */
#if LWIP_HTTPD_ITOA_PRIVATE
#if LWIP_HTTPD_ITOA_PRIVATE && LWIP_HTTPD_DYNAMIC_HEADERS
static void
httpd_itoa(int value, char* result)
{

View File

@ -153,11 +153,6 @@
#define LWIP_HTTPD_STRICMP_PRIVATE 0
#endif
/** Set this to 1 on platforms where stricmp is not available */
#ifndef LWIP_HTTPD_ITOA_PRIVATE
#define LWIP_HTTPD_ITOA_PRIVATE 1
#endif
/** Define this to a smaller function if you have itoa() at hand... */
#ifndef LWIP_HTTPD_ITOA
#ifndef LWIP_HTTPD_ITOA_PRIVATE