Fix for "UNUSED" redefined warning
authorGeorge Nash <george.nash@intel.com>
Mon, 17 Oct 2016 22:37:11 +0000 (15:37 -0700)
committerRick Bell <richard.s.bell@intel.com>
Thu, 27 Oct 2016 23:16:45 +0000 (23:16 +0000)
The #define UNUSED is present in openjdk's jni.h and
in the arduino libraries. Resulting in the compilar
warning.

We already have OC_UNUSED defined in octypes.h which
was already avalible for all of the files that were
using UNUSED from logger.h.

The #define UNUSED was deleted from logger.h.
Any place UNUSED was used was renamed to OC_UNUSED.

Change-Id: If94ac13dc29eb3323e036eec750a18893895fb3d
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13353
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
resource/csdk/logger/include/logger.h
service/coap-http-proxy/samples/proxy_client.c
service/coap-http-proxy/src/CoapHttpHandler.c
service/coap-http-proxy/src/CoapHttpParser.c

index 4304d23..7ccb51c 100644 (file)
@@ -42,11 +42,6 @@ extern "C"
 {
 #endif
 
-/**
-* Helper for unused warning.
-*/
-#define UNUSED(x) (void)(x)
-
 // Use the PCF macro to wrap strings stored in FLASH on the Arduino
 // Example:  OIC_LOG(INFO, TAG, PCF("Entering function"));
 #ifdef ARDUINO
index c2b7a2d..520d092 100644 (file)
@@ -97,8 +97,8 @@ static void PrintUsage()
 OCStackApplicationResult putReqCB(void* ctx, OCDoHandle handle,
                                   OCClientResponse* clientResponse)
 {
-    UNUSED(ctx);
-    UNUSED(handle);
+    OC_UNUSED(ctx);
+    OC_UNUSED(handle);
     if (clientResponse)
     {
         OIC_LOG_V(INFO, TAG, "StackResult: %u", clientResponse->result);
@@ -115,8 +115,8 @@ OCStackApplicationResult putReqCB(void* ctx, OCDoHandle handle,
 OCStackApplicationResult postReqCB(void* ctx, OCDoHandle handle,
                                    OCClientResponse* clientResponse)
 {
-    UNUSED(ctx);
-    UNUSED(handle);
+    OC_UNUSED(ctx);
+    OC_UNUSED(handle);
     if (clientResponse)
     {
         OIC_LOG_V(INFO, TAG, "StackResult: %u", clientResponse->result);
@@ -134,8 +134,8 @@ OCStackApplicationResult deleteReqCB(void* ctx,
                                      OCDoHandle handle,
                                      OCClientResponse* clientResponse)
 {
-    UNUSED(ctx);
-    UNUSED(handle);
+    OC_UNUSED(ctx);
+    OC_UNUSED(handle);
     if (clientResponse)
     {
         OIC_LOG_V(INFO, TAG, "StackResult: %d",  clientResponse->result);
@@ -152,8 +152,8 @@ OCStackApplicationResult deleteReqCB(void* ctx,
 OCStackApplicationResult getReqCB(void* ctx, OCDoHandle handle,
                                   OCClientResponse* clientResponse)
 {
-    UNUSED(ctx);
-    UNUSED(handle);
+    OC_UNUSED(ctx);
+    OC_UNUSED(handle);
     if (!clientResponse)
     {
         OIC_LOG_V(INFO, TAG, "%s received NULL clientResponse", __func__);
@@ -245,8 +245,8 @@ int InitProxyRequest()
 OCStackApplicationResult discoveryReqCB(void* ctx, OCDoHandle handle,
                                         OCClientResponse* clientResponse)
 {
-    UNUSED(ctx);
-    UNUSED(handle);
+    OC_UNUSED(ctx);
+    OC_UNUSED(handle);
     if (clientResponse)
     {
         OIC_LOG_V(INFO, TAG, "StackResult: %d", clientResponse->result);
index 688d780..8e719cd 100644 (file)
@@ -194,7 +194,7 @@ OCEntityHandlerResult CHPEntityHandler(OCEntityHandlerFlag flag,
                                        void* callbackParam)
 {
     OIC_LOG(INFO, TAG, "Proxy request received");
-    UNUSED(callbackParam);
+    OC_UNUSED(callbackParam);
 
     if (!g_isCHProxyInitialized)
     {
index c24edff..f9c5ee4 100644 (file)
@@ -132,7 +132,7 @@ static void CHPFreeContext(CHPContext_t *ctxt)
 static void *CHPParserExecuteMultiHandle(void* data)
 {
     OIC_LOG_V(DEBUG, TAG, "%s IN", __func__);
-    UNUSED(data);
+    OC_UNUSED(data);
     /*
      * These fd sets will be fetched from curl multi handle and monitored to execute
      * curl_multi_perform()
@@ -242,7 +242,7 @@ static void *CHPParserExecuteMultiHandle(void* data)
                 {
                     char buf[20] = {0};
                     ssize_t len = read(g_refreshFds[0], buf, sizeof(buf));
-                    UNUSED(len);
+                    OC_UNUSED(len);
                     // new easy handles added, call multi_perform and refresh fds.
                     OIC_LOG(ERROR, TAG, "New easy handle added");
                 }