From: George Nash Date: Thu, 9 Mar 2017 22:37:55 +0000 (-0800) Subject: csdk: Fixed compiler warnings in ocstack.c X-Git-Tag: 1.3.0~448 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b77ce94b2ebe07f231015149ead7183f820c06d1;p=platform%2Fupstream%2Fiotivity.git csdk: Fixed compiler warnings in ocstack.c -Wformat= warning fixed by changing the ssanf %lld flag to SCNd64 -Wunused-function fixed by removing the OCSetNetworkMonitorHandler function. Since the function is not used it is also not maintained it is best to remove the code. Change-Id: Ib82e6e77a561ac8713cc77bdecc44a5ce42cefff Signed-off-by: George Nash Reviewed-on: https://gerrit.iotivity.org/gerrit/17813 Reviewed-by: Mike Fenelon Tested-by: jenkins-iotivity Reviewed-by: Dan Mihai --- diff --git a/resource/csdk/stack/src/ocstack.c b/resource/csdk/stack/src/ocstack.c index 20bfbe6..85e1c1d 100755 --- a/resource/csdk/stack/src/ocstack.c +++ b/resource/csdk/stack/src/ocstack.c @@ -187,6 +187,10 @@ bool g_multicastServerStopped = false; #define MILLISECONDS_PER_SECOND (1000) +// handle case that SCNd64 is not defined in arduino's inttypes.h +#if defined(WITH_ARDUINO) && !defined(SCNd64) +#define SCNd64 "lld" +#endif //----------------------------------------------------------------------------- // Private internal function prototypes //----------------------------------------------------------------------------- @@ -434,14 +438,6 @@ static void OCDefaultAdapterStateChangedHandler(CATransportAdapter_t adapter, bo static void OCDefaultConnectionStateChangedHandler(const CAEndpoint_t *info, bool isConnected); /** - * Register network monitoring callback. - * Network status changes are delivered these callback. - * @param adapterHandler Adapter state monitoring callback. - * @param connectionHandler Connection state monitoring callback. - */ -static void OCSetNetworkMonitorHandler(CAAdapterStateChangedCB adapterHandler, - CAConnectionStateChangedCB connectionHandler); -/** * Map zoneId to endpoint address which scope is ipv6 link-local. * @param payload Discovery payload which has Endpoint information. * @param ifindex index which indicate network interface. @@ -5611,7 +5607,7 @@ OCStackResult OCUpdateResourceInsWithResponse(const char *requestUri, { // Arduino's AVR-GCC doesn't support strtoll(). int64_t queryIns; - int matchedItems = sscanf(query + 4, "%lld", &queryIns); + int matchedItems = sscanf(query + 4, "%" SCNd64, &queryIns); if (0 == matchedItems) { @@ -5796,14 +5792,6 @@ void OCDefaultConnectionStateChangedHandler(const CAEndpoint_t *info, bool isCon } } -void OCSetNetworkMonitorHandler(CAAdapterStateChangedCB adapterHandler, - CAConnectionStateChangedCB connectionHandler) -{ - OIC_LOG(DEBUG, TAG, "OCSetNetworkMonitorHandler"); - g_adapterHandler = adapterHandler; - g_connectionHandler = connectionHandler; -} - OCStackResult OCGetDeviceId(OCUUIdentity *deviceId) { OicUuid_t oicUuid;