Skip to content

Commit

Permalink
Change some ints and chars to unsigned
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ribbons committed Dec 30, 2013
1 parent 8388e16 commit 0b91dc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions WebServer.h
Expand Up @@ -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];
Expand All @@ -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();
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 0b91dc0

Please sign in to comment.