From 363b0a82dad9901dabf263a597824cd1bd7f448e Mon Sep 17 00:00:00 2001 From: Abitha Shankar Date: Wed, 7 Sep 2016 17:24:05 +0530 Subject: [PATCH] Removed build warning: Two different environments in C++ wrapper Removed unUsed variable warnings Removed warnings for printing variables Change-Id: I5d6ba48df298c91f46ba7388ea355bc6a833a679 Signed-off-by: Abitha Shankar Reviewed-on: https://gerrit.iotivity.org/gerrit/11501 Reviewed-by: Hun-je Yeon Tested-by: jenkins-iotivity Reviewed-by: Chihyun Cho Reviewed-by: Madan Lanka --- .../notification/cpp-wrapper/consumer/SConscript | 7 ++++++- .../cpp-wrapper/consumer/src/NSConsumerService.cpp | 3 ++- .../cpp-wrapper/consumer/src/NSProvider.cpp | 2 +- .../notification/cpp-wrapper/provider/SConscript | 21 ++++++++++++++++++++- .../cpp-wrapper/provider/src/NSProviderService.cpp | 4 +++- 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/service/notification/cpp-wrapper/consumer/SConscript b/service/notification/cpp-wrapper/consumer/SConscript index 9244922..e476623 100755 --- a/service/notification/cpp-wrapper/consumer/SConscript +++ b/service/notification/cpp-wrapper/consumer/SConscript @@ -79,14 +79,19 @@ if env.get('WITH_CLOUD') == True: ###################################################################### # Source files and Targets ###################################################################### +Import('notificationCommonStaticObjs') +Import('notificationCommonSharedObjs') notification_consumer_src = [ - env.Glob('src/*.cpp'),env.Glob('../common/*.cpp')] + env.Glob('src/*.cpp'),notificationCommonSharedObjs] consumersdk = notification_env.SharedLibrary('notification_consumer_wrapper', notification_consumer_src) notification_env.InstallTarget(consumersdk, 'libnotification_consumer_wrapper') notification_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer_wrapper') +notification_consumer_src = [ + env.Glob('src/*.cpp'),notificationCommonStaticObjs] + consumersdk = notification_env.StaticLibrary('notification_consumer_wrapper', notification_consumer_src) notification_env.InstallTarget(consumersdk, 'libnotification_consumer_wrapper') notification_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer_wrapper') diff --git a/service/notification/cpp-wrapper/consumer/src/NSConsumerService.cpp b/service/notification/cpp-wrapper/consumer/src/NSConsumerService.cpp index 2c083e3..1399e70 100755 --- a/service/notification/cpp-wrapper/consumer/src/NSConsumerService.cpp +++ b/service/notification/cpp-wrapper/consumer/src/NSConsumerService.cpp @@ -125,7 +125,7 @@ namespace OIC NSMessage *nsMessage = new NSMessage(message); - NS_LOG_V(DEBUG, "getAcceptedProviders Size : %d", + NS_LOG_V(DEBUG, "getAcceptedProviders Size : %d", (int) NSConsumerService::getInstance()->getAcceptedProviders().size()); for (auto it : NSConsumerService::getInstance()->getAcceptedProviders()) { @@ -217,6 +217,7 @@ namespace OIC NSResult NSConsumerService::enableRemoteService(const std::string &serverAddress) { NS_LOG(DEBUG, "enableRemoteService - IN"); + NS_LOG_V(DEBUG, "Server Address : %s", serverAddress.c_str()); NSResult result = NSResult::ERROR; #ifdef WITH_CLOUD result = (NSResult) NSConsumerEnableRemoteService(OICStrdup(serverAddress.c_str())); diff --git a/service/notification/cpp-wrapper/consumer/src/NSProvider.cpp b/service/notification/cpp-wrapper/consumer/src/NSProvider.cpp index e00e151..efce8e5 100755 --- a/service/notification/cpp-wrapper/consumer/src/NSProvider.cpp +++ b/service/notification/cpp-wrapper/consumer/src/NSProvider.cpp @@ -154,7 +154,7 @@ namespace OIC while (iter) { NS_LOG_V(DEBUG, "Topic Name : %s", iter->topicName); - NS_LOG_V(DEBUG, "Topic State : %d", iter->state); + NS_LOG_V(DEBUG, "Topic State : %d", (int) iter->state); iter = iter->next; } } diff --git a/service/notification/cpp-wrapper/provider/SConscript b/service/notification/cpp-wrapper/provider/SConscript index 0ead67f..040dd21 100755 --- a/service/notification/cpp-wrapper/provider/SConscript +++ b/service/notification/cpp-wrapper/provider/SConscript @@ -78,14 +78,33 @@ if env.get('WITH_CLOUD') == True: ###################################################################### # Source files and Targets ###################################################################### +notificationCommonStaticObjs = [ + notification_env.Object('../common/NSMediaContents.cpp'), + notification_env.Object('../common/NSMessage.cpp'), + notification_env.Object('../common/NSSyncInfo.cpp'), + notification_env.Object('../common/NSTopic.cpp'), + notification_env.Object('../common/NSTopicsList.cpp')] + +notificationCommonSharedObjs = [ + notification_env.SharedObject('../common/NSMediaContents.cpp'), + notification_env.SharedObject('../common/NSMessage.cpp'), + notification_env.SharedObject('../common/NSSyncInfo.cpp'), + notification_env.SharedObject('../common/NSTopic.cpp'), + notification_env.SharedObject('../common/NSTopicsList.cpp')] notification_provider_src = [ - env.Glob('src/*.cpp'),env.Glob('../common/*.cpp')] + env.Glob('src/*.cpp'),notificationCommonSharedObjs] providersdk = notification_env.SharedLibrary('notification_provider_wrapper', notification_provider_src) notification_env.InstallTarget(providersdk, 'libnotification_provider_wrapper') notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider_wrapper') +notification_provider_src = [ + env.Glob('src/*.cpp'),notificationCommonStaticObjs] + providersdk = notification_env.StaticLibrary('notification_provider_wrapper', notification_provider_src) notification_env.InstallTarget(providersdk, 'libnotification_provider_wrapper') notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider_wrapper') + +Export('notificationCommonStaticObjs') +Export('notificationCommonSharedObjs') diff --git a/service/notification/cpp-wrapper/provider/src/NSProviderService.cpp b/service/notification/cpp-wrapper/provider/src/NSProviderService.cpp index 2e180ae..4e943ae 100755 --- a/service/notification/cpp-wrapper/provider/src/NSProviderService.cpp +++ b/service/notification/cpp-wrapper/provider/src/NSProviderService.cpp @@ -122,6 +122,7 @@ namespace OIC NSResult NSProviderService::enableRemoteService(const std::string &serverAddress) { NS_LOG(DEBUG, "enableRemoteService - IN"); + NS_LOG_V(DEBUG, "Server Address : %s", serverAddress.c_str()); NSResult result = NSResult::ERROR; #ifdef WITH_CLOUD result = (NSResult) NSProviderEnableRemoteService(OICStrdup(serverAddress.c_str())); @@ -135,6 +136,7 @@ namespace OIC NSResult NSProviderService::disableRemoteService(const std::string &serverAddress) { NS_LOG(DEBUG, "disableRemoteService - IN"); + NS_LOG_V(DEBUG, "Server Address : %s", serverAddress.c_str()); NSResult result = NSResult::ERROR; #ifdef WITH_CLOUD result = (NSResult) NSProviderDisableRemoteService(OICStrdup(serverAddress.c_str())); @@ -180,7 +182,7 @@ namespace OIC ::NSMessage *message = NSCreateMessage(); NSMessage *nsMessage = new NSMessage(message); - NS_LOG_V(DEBUG, "Message ID : %lld", nsMessage->getMessageId()); + NS_LOG_V(DEBUG, "Message ID : %lld", (long long int) nsMessage->getMessageId()); NS_LOG_V(DEBUG, "Provider ID : %s", nsMessage->getProviderId().c_str()); NS_LOG(DEBUG, "createMessage - OUT"); -- 2.7.4