From a5d4a27ae155d0e155e7225aaa2a06dee228de5e Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Tue, 26 Apr 2016 20:53:25 +0200 Subject: [PATCH] Fix compile warnings (==errors) in new httpd --- src/apps/httpd/httpd.c | 8 ++++---- src/include/lwip/apps/httpd_opts.h | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/apps/httpd/httpd.c b/src/apps/httpd/httpd.c index 5d2a97b7..4b2007ba 100644 --- a/src/apps/httpd/httpd.c +++ b/src/apps/httpd/httpd.c @@ -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) { diff --git a/src/include/lwip/apps/httpd_opts.h b/src/include/lwip/apps/httpd_opts.h index 58a8eacf..e1e7c066 100644 --- a/src/include/lwip/apps/httpd_opts.h +++ b/src/include/lwip/apps/httpd_opts.h @@ -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