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 5 commits into from Dec 30, 2013
Commits on Dec 30, 2013
  1. Remove typedef specifier from URLPARAM_RESULT enum

    ribbons committed Dec 30, 2013
    Remove the typedef storage class specifier from the declaration of the
    URLPARAM_RESULT enum as this is not required and causes gcc to emit the
    warning "'typedef' was ignored in this declaration" when compiling with
  2. Re-order initializer list to match member order

    ribbons committed Dec 30, 2013
    Correct the order of the initializer list so that gcc doesn't emit the
    warning "'WebServer::m_cmdCount' will be initialized after 'int
    WebServer::m_contentLength' when initialized here" when compiling using
  3. Add extra brackets to while loop in printP

    ribbons committed Dec 30, 2013
    Add an additional set of brackets around the while loop condition in
    WebServer::printP to stop gcc emitting the warning "suggest parentheses
    around assignment used as truth value" when compiling using -Wall.
  4. Change some ints and chars to unsigned

    ribbons committed Dec 30, 2013
    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.
  5. Hide warning when passing string to m_defaultCmd

    ribbons committed Dec 30, 2013
    The Command prototype has a char* parameter for the URL tail, but
    WebServer::dispatchCommand calls this with an empty string as a parameter
    if there is no URL.  As gcc treats empty strings as const char*s this
    causes a warning to be emitted when compiling using -Wall, so suppress it
    by explicitly casting it to char*.
You can’t perform that action at this time.