Fix all braces on own line violations in C stack source files.
authorMandeep Shetty <mandeep.shetty@intel.com>
Wed, 29 Apr 2015 00:15:29 +0000 (17:15 -0700)
committerErich Keane <erich.keane@intel.com>
Wed, 29 Apr 2015 16:27:54 +0000 (16:27 +0000)
This commit only has braces on own line and style changes.

Change-Id: I6e3cb9be2d91088a42f69debe8e0889aae9417bc
Signed-off-by: Mandeep Shetty <mandeep.shetty@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/862
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/stack/src/ocresource.c
resource/csdk/stack/src/ocstack.c

index d3bdccf..35dd8d4 100644 (file)
@@ -51,7 +51,8 @@
 extern OCResource *headResource;
 static cJSON *savedDeviceInfo = NULL;
 
-static const char * VIRTUAL_RSRCS[] = {
+static const char * VIRTUAL_RSRCS[] =
+{
        "/oc/core",
        "/oc/core/d",
        "/oc/core/types/d",
@@ -64,7 +65,8 @@ static const char * VIRTUAL_RSRCS[] = {
 // Default resource entity handler function
 //-----------------------------------------------------------------------------
 OCEntityHandlerResult defaultResourceEHandler(OCEntityHandlerFlag flag,
-        OCEntityHandlerRequest * request) {
+        OCEntityHandlerRequest * request)
+{
     //TODO ("Implement me!!!!");
     // TODO:  remove silence unused param warnings
     (void) flag;
@@ -444,8 +446,10 @@ OCResource *FindResourceByUri(const char* resourceUri)
     }
 
     OCResource * pointer = headResource;
-    while (pointer) {
-        if (strcmp(resourceUri, pointer->uri) == 0) {
+    while (pointer)
+    {
+        if (strcmp(resourceUri, pointer->uri) == 0)
+        {
             return pointer;
         }
         pointer = pointer->next;
index ef609f8..2600747 100644 (file)
 //-----------------------------------------------------------------------------
 // Typedefs
 //-----------------------------------------------------------------------------
-typedef enum {
-    OC_STACK_UNINITIALIZED = 0, OC_STACK_INITIALIZED, OC_STACK_UNINIT_IN_PROGRESS
+typedef enum
+{
+    OC_STACK_UNINITIALIZED = 0,
+    OC_STACK_INITIALIZED,
+    OC_STACK_UNINIT_IN_PROGRESS
 } OCStackState;
+
 #ifdef WITH_PRESENCE
-typedef enum {
-    OC_PRESENCE_UNINITIALIZED = 0, OC_PRESENCE_INITIALIZED
+typedef enum
+{
+    OC_PRESENCE_UNINITIALIZED = 0,
+    OC_PRESENCE_INITIALIZED
 } OCPresenceState;
 #endif
 
@@ -1623,7 +1629,8 @@ bool ParseIPv4Address(char * ipAddrStr, uint8_t * ipAddr, uint16_t * port)
     }
     ipAddrStr = itr;
 
-    while (*ipAddrStr) {
+    while (*ipAddrStr)
+    {
         if (isdigit(*ipAddrStr))
         {
             ipAddr[index] *= 10;
@@ -2467,7 +2474,8 @@ OCStackResult OCCreateResource(OCResourceHandle *handle,
 
     // Make sure resourceProperties bitmask has allowed properties specified
     if (resourceProperties
-            > (OC_ACTIVE | OC_DISCOVERABLE | OC_OBSERVABLE | OC_SLOW | OC_SECURE)) {
+            > (OC_ACTIVE | OC_DISCOVERABLE | OC_OBSERVABLE | OC_SLOW | OC_SECURE))
+    {
         OC_LOG(ERROR, TAG, PCF("Invalid property"));
         return OC_STACK_INVALID_PARAM;
     }
@@ -3331,7 +3339,8 @@ OCStackResult initResources()
 
 void insertResource(OCResource *resource)
 {
-    if (!headResource) {
+    if (!headResource)
+    {
         headResource = resource;
         tailResource = resource;
     }
@@ -3801,11 +3810,8 @@ CAResult_t OCSelectNetwork()
     CAResult_t retResult = CA_STATUS_FAILED;
     CAResult_t caResult = CA_STATUS_OK;
 
-    CAConnectivityType_t connTypes[] = {
-            CA_ETHERNET,
-            CA_WIFI,
-            CA_EDR,
-            CA_LE};
+    CAConnectivityType_t connTypes[] = {CA_ETHERNET, CA_WIFI, CA_EDR, CA_LE};
+
     int numConnTypes = sizeof(connTypes)/sizeof(connTypes[0]);
 
     for(int i = 0; i<numConnTypes; i++)