csdk: prevent release build compiler warning from log tags
authorGeorge Nash <george.nash@intel.com>
Tue, 7 Mar 2017 21:30:45 +0000 (13:30 -0800)
committerDan Mihai <Daniel.Mihai@microsoft.com>
Fri, 10 Mar 2017 08:30:31 +0000 (08:30 +0000)
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 <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17753
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
15 files changed:
resource/csdk/connectivity/src/bt_le_adapter/linux/advertisement.c
resource/csdk/connectivity/src/bt_le_adapter/linux/caleinterface.c
resource/csdk/connectivity/src/bt_le_adapter/linux/central.c
resource/csdk/connectivity/src/bt_le_adapter/linux/characteristic.c
resource/csdk/connectivity/src/bt_le_adapter/linux/client.c
resource/csdk/connectivity/src/bt_le_adapter/linux/descriptor.c
resource/csdk/connectivity/src/bt_le_adapter/linux/peripheral.c
resource/csdk/connectivity/src/bt_le_adapter/linux/recv.c
resource/csdk/connectivity/src/bt_le_adapter/linux/server.c
resource/csdk/connectivity/src/bt_le_adapter/linux/service.c
resource/csdk/connectivity/src/bt_le_adapter/linux/utils.c
resource/csdk/resource-directory/unittests/rddatabase.cpp
resource/csdk/resource-directory/unittests/rdtests.cpp
resource/csdk/stack/test/android/stacktests.cpp
resource/csdk/stack/test/stacktests.cpp

index 980d9de..02b29c1 100644 (file)
@@ -26,7 +26,7 @@
 
 
 // Logging tag.
-static char const TAG[] = "BLE_ADVERTISEMENT";
+#define TAG "BLE_ADVERTISEMENT"
 
 bool CALEAdvertisementInitialize(CALEAdvertisement * a,
                                  GDBusConnection * connection,
index ce3417f..87d245c 100644 (file)
@@ -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
index 39daf5e..7ca88e6 100644 (file)
@@ -28,7 +28,7 @@
 
 
 // Logging tag.
-static char const TAG[] = "BLE_CENTRAL";
+#define TAG "BLE_CENTRAL"
 
 static bool CACentralGetBooleanProperty(GDBusProxy * device,
                                         char const * property)
index ea30505..03fc8c7 100644 (file)
@@ -31,7 +31,7 @@
 
 
 // Logging tag.
-static char const TAG[] = "BLE_CHARACTERISTIC";
+#define TAG "BLE_CHARACTERISTIC"
 
 // ---------------------------------------------------------------------
 //                      GATT Request Handling
index 299f54e..bc9b123 100644 (file)
@@ -34,7 +34,7 @@
 
 
 // Logging tag.
-static char const TAG[] = "BLE_CLIENT";
+#define TAG "BLE_CLIENT"
 
 typedef struct _CAGattClientContext
 {
index 82ceb71..9995427 100644 (file)
@@ -29,7 +29,7 @@
 
 
 // Logging tag.
-static char const TAG[] = "BLE_DESCRIPTOR";
+#define TAG "BLE_DESCRIPTOR"
 
 /**
  * Implementation of the @c org.bluez.GattDescriptor1.ReadValue()
index cd29611..6b70b32 100644 (file)
@@ -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
index 921fbd6..3b2346a 100644 (file)
@@ -27,7 +27,7 @@
 
 
 // Logging tag.
-static char const TAG[] = "BLE_RECV";
+#define TAG "BLE_RECV"
 
 static CAGattRecvInfo const g_null_info =
     {
index be7302d..4eab0e8 100644 (file)
@@ -27,7 +27,7 @@
 
 
 // Logging tag.
-static char const TAG[] = "BLE_SERVER";
+#define TAG "BLE_SERVER"
 
 static CAResult_t CAGattServerSendResponseNotificationImpl(
     CAGattService * service,
index bf89417..3cef691 100644 (file)
@@ -31,7 +31,7 @@
 
 
 // Logging tag.
-static char const TAG[] = "BLE_SERVICE";
+#define TAG "BLE_SERVICE"
 
 static GVariant * CAGattServiceGetProperties(GattService1 * service)
 {
index 50148bd..82536dc 100644 (file)
@@ -25,7 +25,7 @@
 
 
 // Logging tag.
-static char const TAG[] = "BLE_UTILS";
+#define TAG "BLE_UTILS"
 
 bool CAGetBlueZManagedObjectProxies(GList ** proxies,
                                     char const * interface,
index 7a73174..1e2666f 100644 (file)
@@ -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);
 
index de33ce7..919510f 100644 (file)
@@ -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);
 
index 973edbf..03fb61a 100644 (file)
@@ -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)  {
index 9be7007..a5e024d 100644 (file)
@@ -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";