Subject: Eliminated 'unused variable' compiler warning generated with -DLWS_WITH_NO_L...
authorJesse Engle <jesse.engle@threatstack.com>
Mon, 17 Jul 2017 04:16:00 +0000 (04:16 +0000)
committerAndy Green <andy@warmcat.com>
Tue, 18 Jul 2017 20:11:57 +0000 (04:11 +0800)
The unused variable was only declared for use in a log macro that's
compiled out with the above compiler switch. I removed the declaration
and casted the variable at each use in the block.

AG: convert to void case reference irrespective of logging enabled.
AG: travis.yml: add -DLWS_WITH_NO_LOGS=ON that also enables lwsws + cgi code

.travis.yml
lib/context.c

index 0bc3c12..55cb766 100644 (file)
@@ -15,6 +15,7 @@ env:
     - LWS_METHOD=nossl CMAKE_ARGS="-DLWS_WITH_SSL=OFF"
     - LWS_METHOD=nodaemon CMAKE_ARGS="-DLWS_WITHOUT_DAEMONIZE=ON"
     - LWS_METHOD=cgi CMAKE_ARGS="-DLWS_WITH_CGI=ON"
+    - LWS_METHOD=nologs CMAKE_ARGS="-DLWS_WITH_NO_LOGS=ON"
 
 os:
   - linux
index 666f51e..f3b56ce 100644 (file)
@@ -386,6 +386,7 @@ lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason,
                {
                        struct lws_ssl_info *si = in;
 
+                       (void)si;
                        lwsl_notice("LWS_CALLBACK_SSL_INFO: where: 0x%x, ret: 0x%x\n",
                                        si->where, si->ret);
                }