From 0b91dc0bb8b27ffa837154dd94f72312cad9d8c3 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Mon, 30 Dec 2013 12:44:22 +0000 Subject: [PATCH] Change some ints and chars to unsigned Convert some of the int and char variables to be unsigned int and unsigned char types. This prevents gcc generating the warnings "comparison between signed and unsigned integer expressions" and "array subscript has type 'char'", as well as having a nice side-effect of shaving 42 bytes off the compiled size when building for the Uno. --- WebServer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WebServer.h b/WebServer.h index 791b22f..74b0502 100644 --- a/WebServer.h +++ b/WebServer.h @@ -308,7 +308,7 @@ class WebServer: public Print const char *m_urlPrefix; unsigned char m_pushback[32]; - char m_pushbackDepth; + unsigned char m_pushbackDepth; int m_contentLength; char m_authCredentials[51]; @@ -321,7 +321,7 @@ class WebServer: public Print const char *verb; Command *cmd; } m_commands[8]; - char m_cmdCount; + unsigned char m_cmdCount; UrlPathCommand *m_urlPathCmd; void reset(); @@ -480,9 +480,9 @@ bool WebServer::dispatchCommand(ConnectionType requestType, char *verb, // if the first character is a slash, there's more after it. if (verb[0] == '/') { - char i; + unsigned char i; char *qm_loc; - int verb_len; + unsigned int verb_len; int qm_offset; // Skip over the leading "/", because it makes the code more // efficient and easier to understand.