Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings generated when compiling with -Wall flag. #44

Merged
merged 5 commits into from Dec 30, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 12 additions & 12 deletions WebServer.h
Expand Up @@ -147,11 +147,11 @@ extern "C" unsigned long millis(void);
* when you call nextURLparam AFTER the last parameter is read. The
* last actual parameter gets an "OK" return code. */

typedef enum URLPARAM_RESULT { URLPARAM_OK,
URLPARAM_NAME_OFLO,
URLPARAM_VALUE_OFLO,
URLPARAM_BOTH_OFLO,
URLPARAM_EOS // No params left
enum URLPARAM_RESULT { URLPARAM_OK,
URLPARAM_NAME_OFLO,
URLPARAM_VALUE_OFLO,
URLPARAM_BOTH_OFLO,
URLPARAM_EOS // No params left
};

class WebServer: public Print
Expand Down 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 @@ -353,10 +353,10 @@ WebServer::WebServer(const char *urlPrefix, int port) :
m_client(255),
m_urlPrefix(urlPrefix),
m_pushbackDepth(0),
m_cmdCount(0),
m_contentLength(0),
m_failureCmd(&defaultFailCmd),
m_defaultCmd(&defaultFailCmd),
m_cmdCount(0),
m_urlPathCmd(NULL)
{
}
Expand Down Expand Up @@ -439,7 +439,7 @@ void WebServer::printP(const unsigned char *str)
uint8_t buffer[32];
size_t bufferEnd = 0;

while (buffer[bufferEnd++] = pgm_read_byte(str++))
while ((buffer[bufferEnd++] = pgm_read_byte(str++)))
{
if (bufferEnd == 32)
{
Expand All @@ -465,7 +465,7 @@ bool WebServer::dispatchCommand(ConnectionType requestType, char *verb,
// trailing slash or if the URL is just the slash
if ((verb[0] == 0) || ((verb[0] == '/') && (verb[1] == 0)))
{
m_defaultCmd(*this, requestType, "", tail_complete);
m_defaultCmd(*this, requestType, (char*)"", tail_complete);
return true;
}
// if the URL is just a slash followed by a question mark
Expand All @@ -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