From: George Nash Date: Mon, 17 Oct 2016 22:37:11 +0000 (-0700) Subject: Fix for "UNUSED" redefined warning X-Git-Tag: 1.3.0~1054^2~76 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d9b56826e2210de8b5ba2bc2f31608a0dac9c50;p=platform%2Fupstream%2Fiotivity.git Fix for "UNUSED" redefined warning 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 Reviewed-on: https://gerrit.iotivity.org/gerrit/13353 Reviewed-by: Larry Sachs Tested-by: jenkins-iotivity Reviewed-by: Rick Bell --- diff --git a/resource/csdk/logger/include/logger.h b/resource/csdk/logger/include/logger.h index 4304d23..7ccb51c 100644 --- a/resource/csdk/logger/include/logger.h +++ b/resource/csdk/logger/include/logger.h @@ -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 diff --git a/service/coap-http-proxy/samples/proxy_client.c b/service/coap-http-proxy/samples/proxy_client.c index c2b7a2d..520d092 100644 --- a/service/coap-http-proxy/samples/proxy_client.c +++ b/service/coap-http-proxy/samples/proxy_client.c @@ -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); diff --git a/service/coap-http-proxy/src/CoapHttpHandler.c b/service/coap-http-proxy/src/CoapHttpHandler.c index 688d780..8e719cd 100644 --- a/service/coap-http-proxy/src/CoapHttpHandler.c +++ b/service/coap-http-proxy/src/CoapHttpHandler.c @@ -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) { diff --git a/service/coap-http-proxy/src/CoapHttpParser.c b/service/coap-http-proxy/src/CoapHttpParser.c index c24edff..f9c5ee4 100644 --- a/service/coap-http-proxy/src/CoapHttpParser.c +++ b/service/coap-http-proxy/src/CoapHttpParser.c @@ -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"); }