From c262eafe97915dfc901f7cecace6e8305a529871 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Sun, 4 Oct 2015 22:31:57 +0200 Subject: [PATCH] Fix compiler warnings --- apps/webbrowser/webclient.c | 4 ++-- apps/webbrowser/www.c | 1 + apps/webserver/urlconv.c | 4 ++-- core/ctk/ctk-filedialog.c | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/webbrowser/webclient.c b/apps/webbrowser/webclient.c index 5d2ce0254..a6e6a6582 100644 --- a/apps/webbrowser/webclient.c +++ b/apps/webbrowser/webclient.c @@ -200,7 +200,7 @@ window_copy(int curptr, const char *data, unsigned char datalen) len = windowend - windowstart; } - strncpy(windowptr + windowstart, data, len); + strncpy((char *)(windowptr + windowstart), data, len); windowstart += len; return curptr + datalen; @@ -217,7 +217,7 @@ senddata(void) windowstart = s.getrequestptr; curptr = 0; windowend = windowstart + uip_mss(); - windowptr = (char *)uip_appdata - windowstart; + windowptr = (unsigned char *)uip_appdata - windowstart; curptr = window_copy(curptr, http_get, sizeof(http_get) - 1); curptr = window_copy(curptr, s.file, (unsigned char)strlen(s.file)); diff --git a/apps/webbrowser/www.c b/apps/webbrowser/www.c index 70af0332b..11ed1384a 100644 --- a/apps/webbrowser/www.c +++ b/apps/webbrowser/www.c @@ -864,6 +864,7 @@ htmlparser_newline(void) wptr = webpageptr - WWW_CONF_WEBPAGE_WIDTH; petsciiconv_topetscii(wptr, WWW_CONF_WEBPAGE_WIDTH); + (void)wptr; if(y == WWW_CONF_WEBPAGE_HEIGHT) { loading = 0; diff --git a/apps/webserver/urlconv.c b/apps/webserver/urlconv.c index 3d5e583df..d4f32f484 100644 --- a/apps/webserver/urlconv.c +++ b/apps/webserver/urlconv.c @@ -80,7 +80,7 @@ urlconv_tofilename(char *dest, char *source, unsigned char maxlen) *dest = ISO_slash; strncpy(dest + 1, wwwroot, wwwrootlen); len = 0; - from = source; to = dest + wwwrootlen; + from = (unsigned char *)source; to = (unsigned char *)dest + wwwrootlen; maxlen -= 2 + wwwrootlen; do { c = *(from++); @@ -139,7 +139,7 @@ urlconv_tofilename(char *dest, char *source, unsigned char maxlen) } } while(c); if(*to == ISO_slash && (len + sizeof(http_index_htm) - 3) < maxlen) { - strcpy(to, http_index_htm); // add index.htm + strcpy((char *)to, http_index_htm); // add index.htm } else { ++to; *to = 0; diff --git a/core/ctk/ctk-filedialog.c b/core/ctk/ctk-filedialog.c index 0bafcc4a8..f8626eab9 100644 --- a/core/ctk/ctk-filedialog.c +++ b/core/ctk/ctk-filedialog.c @@ -155,14 +155,14 @@ ctk_filedialog_eventhandler(struct ctk_filedialog_state *s, } return 1; } else if(ev == ctk_signal_keypress) { - if((ctk_arch_key_t)data == CH_CURS_UP) { + if((unsigned long)data == CH_CURS_UP) { clearptr(); if(fileptr > 0) { --fileptr; } showptr(); return 1; - } else if((ctk_arch_key_t)data == CH_CURS_DOWN) { + } else if((unsigned long)data == CH_CURS_DOWN) { clearptr(); if(fileptr < FILES_HEIGHT - 1) { ++fileptr;