From: George Nash Date: Tue, 7 Mar 2017 21:30:45 +0000 (-0800) Subject: csdk: prevent release build compiler warning from log tags X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9d4731dfeec875d5772f04ed4c7d8f3e27d2e5a;p=contrib%2Fiotivity.git csdk: prevent release build compiler warning from log tags Changed `static char const TAG[]` used for logging to `#define TAG` to prevent -Wunused-const-variable= warning when building code in release mode. Change-Id: Idaebfb26863a3a812573c8c40065ad9ff6ea356d Signed-off-by: George Nash Reviewed-on: https://gerrit.iotivity.org/gerrit/17753 Tested-by: jenkins-iotivity Reviewed-by: Dan Mihai --- diff --git a/resource/csdk/connectivity/src/bt_le_adapter/linux/advertisement.c b/resource/csdk/connectivity/src/bt_le_adapter/linux/advertisement.c index 980d9de..02b29c1 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/advertisement.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/advertisement.c @@ -26,7 +26,7 @@ // Logging tag. -static char const TAG[] = "BLE_ADVERTISEMENT"; +#define TAG "BLE_ADVERTISEMENT" bool CALEAdvertisementInitialize(CALEAdvertisement * a, GDBusConnection * connection, diff --git a/resource/csdk/connectivity/src/bt_le_adapter/linux/caleinterface.c b/resource/csdk/connectivity/src/bt_le_adapter/linux/caleinterface.c index ce3417f..87d245c 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/caleinterface.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/caleinterface.c @@ -37,7 +37,7 @@ #define MICROSECS_PER_SEC 1000000 // Logging tag. -static char const TAG[] = "BLE_INTERFACE"; +#define TAG "BLE_INTERFACE" /* The IoTivity adapter interface currently doesn't provide a means to diff --git a/resource/csdk/connectivity/src/bt_le_adapter/linux/central.c b/resource/csdk/connectivity/src/bt_le_adapter/linux/central.c index 39daf5e..7ca88e6 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/central.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/central.c @@ -28,7 +28,7 @@ // Logging tag. -static char const TAG[] = "BLE_CENTRAL"; +#define TAG "BLE_CENTRAL" static bool CACentralGetBooleanProperty(GDBusProxy * device, char const * property) diff --git a/resource/csdk/connectivity/src/bt_le_adapter/linux/characteristic.c b/resource/csdk/connectivity/src/bt_le_adapter/linux/characteristic.c index ea30505..03fc8c7 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/characteristic.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/characteristic.c @@ -31,7 +31,7 @@ // Logging tag. -static char const TAG[] = "BLE_CHARACTERISTIC"; +#define TAG "BLE_CHARACTERISTIC" // --------------------------------------------------------------------- // GATT Request Handling diff --git a/resource/csdk/connectivity/src/bt_le_adapter/linux/client.c b/resource/csdk/connectivity/src/bt_le_adapter/linux/client.c index 299f54e..bc9b123 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/client.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/client.c @@ -34,7 +34,7 @@ // Logging tag. -static char const TAG[] = "BLE_CLIENT"; +#define TAG "BLE_CLIENT" typedef struct _CAGattClientContext { diff --git a/resource/csdk/connectivity/src/bt_le_adapter/linux/descriptor.c b/resource/csdk/connectivity/src/bt_le_adapter/linux/descriptor.c index 82ceb71..9995427 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/descriptor.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/descriptor.c @@ -29,7 +29,7 @@ // Logging tag. -static char const TAG[] = "BLE_DESCRIPTOR"; +#define TAG "BLE_DESCRIPTOR" /** * Implementation of the @c org.bluez.GattDescriptor1.ReadValue() diff --git a/resource/csdk/connectivity/src/bt_le_adapter/linux/peripheral.c b/resource/csdk/connectivity/src/bt_le_adapter/linux/peripheral.c index cd29611..6b70b32 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/peripheral.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/peripheral.c @@ -31,7 +31,7 @@ #define MICROSECS_PER_SEC 1000000 // Logging tag. -static char const TAG[] = "BLE_PERIPHERAL"; +#define TAG "BLE_PERIPHERAL" static CAPeripheralContext g_context = { .lock = NULL diff --git a/resource/csdk/connectivity/src/bt_le_adapter/linux/recv.c b/resource/csdk/connectivity/src/bt_le_adapter/linux/recv.c index 921fbd6..3b2346a 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/recv.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/recv.c @@ -27,7 +27,7 @@ // Logging tag. -static char const TAG[] = "BLE_RECV"; +#define TAG "BLE_RECV" static CAGattRecvInfo const g_null_info = { diff --git a/resource/csdk/connectivity/src/bt_le_adapter/linux/server.c b/resource/csdk/connectivity/src/bt_le_adapter/linux/server.c index be7302d..4eab0e8 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/server.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/server.c @@ -27,7 +27,7 @@ // Logging tag. -static char const TAG[] = "BLE_SERVER"; +#define TAG "BLE_SERVER" static CAResult_t CAGattServerSendResponseNotificationImpl( CAGattService * service, diff --git a/resource/csdk/connectivity/src/bt_le_adapter/linux/service.c b/resource/csdk/connectivity/src/bt_le_adapter/linux/service.c index bf89417..3cef691 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/service.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/service.c @@ -31,7 +31,7 @@ // Logging tag. -static char const TAG[] = "BLE_SERVICE"; +#define TAG "BLE_SERVICE" static GVariant * CAGattServiceGetProperties(GattService1 * service) { diff --git a/resource/csdk/connectivity/src/bt_le_adapter/linux/utils.c b/resource/csdk/connectivity/src/bt_le_adapter/linux/utils.c index 50148bd..82536dc 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/linux/utils.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/linux/utils.c @@ -25,7 +25,7 @@ // Logging tag. -static char const TAG[] = "BLE_UTILS"; +#define TAG "BLE_UTILS" bool CAGetBlueZManagedObjectProxies(GList ** proxies, char const * interface, diff --git a/resource/csdk/resource-directory/unittests/rddatabase.cpp b/resource/csdk/resource-directory/unittests/rddatabase.cpp index 7a73174..1e2666f 100644 --- a/resource/csdk/resource-directory/unittests/rddatabase.cpp +++ b/resource/csdk/resource-directory/unittests/rddatabase.cpp @@ -59,7 +59,7 @@ namespace itst = iotivity::test; //----------------------------------------------------------------------------- // Private variables //----------------------------------------------------------------------------- -static const char TAG[] = "RDDatabaseTests"; +#define TAG "RDDatabaseTests" std::chrono::seconds const SHORT_TEST_TIMEOUT = std::chrono::seconds(5); diff --git a/resource/csdk/resource-directory/unittests/rdtests.cpp b/resource/csdk/resource-directory/unittests/rdtests.cpp index de33ce7..919510f 100644 --- a/resource/csdk/resource-directory/unittests/rdtests.cpp +++ b/resource/csdk/resource-directory/unittests/rdtests.cpp @@ -58,7 +58,7 @@ namespace itst = iotivity::test; //----------------------------------------------------------------------------- // Private variables //----------------------------------------------------------------------------- -static const char TAG[] = "RDTests"; +#define TAG "RDTests" std::chrono::seconds const SHORT_TEST_TIMEOUT = std::chrono::seconds(5); diff --git a/resource/csdk/stack/test/android/stacktests.cpp b/resource/csdk/stack/test/android/stacktests.cpp index 973edbf..03fb61a 100644 --- a/resource/csdk/stack/test/android/stacktests.cpp +++ b/resource/csdk/stack/test/android/stacktests.cpp @@ -45,7 +45,7 @@ using namespace std; //----------------------------------------------------------------------------- // Private variables //----------------------------------------------------------------------------- -static const char TAG[] = "TestHarness"; +#define TAG "TestHarness" static OCUri SERVICE_URI = "coap://127.0.0.1:5683/"; void EXPECT_EQ(int a, int b) { diff --git a/resource/csdk/stack/test/stacktests.cpp b/resource/csdk/stack/test/stacktests.cpp index 9be7007..a5e024d 100644 --- a/resource/csdk/stack/test/stacktests.cpp +++ b/resource/csdk/stack/test/stacktests.cpp @@ -63,7 +63,7 @@ namespace itst = iotivity::test; //----------------------------------------------------------------------------- // Private variables //----------------------------------------------------------------------------- -static const char TAG[] = "TestHarness"; +#define TAG "TestHarness" char gDeviceUUID[] = "fe3f9a68-4931-4cb0-9ea4-81702b43116c"; char gDevicePIID[] = "32684bf3-4c44-47b0-99fe-6a9a59b73a8d";