From c8583decfb5694de57c2480752b900bcfbecb196 Mon Sep 17 00:00:00 2001 From: George Nash Date: Thu, 2 Mar 2017 10:59:22 -0800 Subject: [PATCH] Fixed compilar warning in ocserver The -Wformat= warning was fixed by replacing the %lld flag with the PRId64 or SCNd64 macro from the inttypes. Change-Id: I79b289d79ee2b918ec0947815f2dc6e6d3c07f3c Signed-off-by: George Nash Reviewed-on: https://gerrit.iotivity.org/gerrit/17629 Tested-by: jenkins-iotivity Reviewed-by: Dan Mihai Reviewed-by: Rick Bell --- resource/csdk/stack/samples/linux/SimpleClientServer/ocserver.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resource/csdk/stack/samples/linux/SimpleClientServer/ocserver.cpp b/resource/csdk/stack/samples/linux/SimpleClientServer/ocserver.cpp index 656168e..2d857b7 100644 --- a/resource/csdk/stack/samples/linux/SimpleClientServer/ocserver.cpp +++ b/resource/csdk/stack/samples/linux/SimpleClientServer/ocserver.cpp @@ -35,6 +35,7 @@ #include #endif #include +#include #include "oic_malloc.h" #include #include "ocstack.h" @@ -187,7 +188,7 @@ bool checkIfQueryForPowerPassed(char * query) if (pointerToOperator) { int64_t powerRequested; - int matchedItems = sscanf((pointerToOperator + 1), "%lld", &powerRequested); + int matchedItems = sscanf((pointerToOperator + 1), "%" SCNd64, &powerRequested); if (1 != matchedItems) { @@ -196,7 +197,7 @@ bool checkIfQueryForPowerPassed(char * query) if (Light.power > powerRequested) { - OIC_LOG_V(INFO, TAG, "Current power: %lld. Requested: <%lld", Light.power, + OIC_LOG_V(INFO, TAG, "Current power: %" PRId64 ". Requested: <%" PRId64, Light.power, powerRequested); return false; } @@ -737,7 +738,7 @@ void *ChangeLightRepresentation (void *param) Light.power += 5; if (gLightUnderObservation) { - OIC_LOG_V(INFO, TAG, " =====> Notifying stack of new power level %lld\n", Light.power); + OIC_LOG_V(INFO, TAG, " =====> Notifying stack of new power level %" PRId64 "\n", Light.power); if (gObserveNotifyType == 1) { // Notify list of observers. Alternate observers on the list will be notified. -- 2.7.4