Merge "Revert "Replace to_string and stoi""
authorErich Keane <erich.keane@intel.com>
Thu, 18 Sep 2014 17:32:45 +0000 (10:32 -0700)
committerGerrit Code Review <gerrit@oicreview.vlan14.01.org>
Thu, 18 Sep 2014 17:32:45 +0000 (10:32 -0700)
csdk/libcoap-4.1.1/debug.h
csdk/stack/src/ocobserve.c
src/OCPlatform.cpp

index d3d39aa..7896f28 100644 (file)
@@ -53,7 +53,7 @@ void coap_log_impl(coap_log_t level, const char *format, ...);
 #define coap_log(...) coap_log_impl(__VA_ARGS__)
 #endif
 
-#ifndef TB_LOG
+#if !defined(TB_LOG) && !defined(NDEBUG)
 #define NDEBUG
 #endif
 
index b426e8a..41b4bc0 100644 (file)
@@ -163,7 +163,7 @@ OCStackResult ProcessObserveRequest (OCResource *resource, OCRequest *request)
 
         observationInfo.obsId = obsId;
         // Register the observation request with entity handler
-        ehRet = resource->entityHandler ((OC_REQUEST_FLAG | OC_OBSERVE_FLAG),
+        ehRet = resource->entityHandler ((OCEntityHandlerFlag)(OC_REQUEST_FLAG | OC_OBSERVE_FLAG),
                                          request->entityHandlerRequest);
         if (ehRet == OC_EH_OK)
         {
@@ -209,7 +209,7 @@ OCStackResult ProcessObserveRequest (OCResource *resource, OCRequest *request)
         observationInfo.obsId = resObs->observeId;
         // Deregister the observation with entity handler. Ignoring return value
         // from entity handler and deleting the observation from stack
-        resource->entityHandler ((OC_REQUEST_FLAG | OC_OBSERVE_FLAG),
+        resource->entityHandler ((OCEntityHandlerFlag)(OC_REQUEST_FLAG | OC_OBSERVE_FLAG),
                                  request->entityHandlerRequest);
         stackRet = DeleteObserverUsingToken (obs->token);
         if(stackRet != OC_STACK_OK)
@@ -415,9 +415,9 @@ ResourceObserver* GetObserverUsingToken (const OCCoAPToken * token)
 {
     ResourceObserver *out = NULL;
 
-    if(token) 
+    if(token)
     {
-        LL_FOREACH (serverObsList, out) 
+        LL_FOREACH (serverObsList, out)
         {
             OC_LOG(INFO, TAG,PCF("comparing tokens"));
             OC_LOG_BUFFER(INFO, TAG, token->token, token->tokenLength);
@@ -457,7 +457,7 @@ void DeleteObserverList()
 {
     ResourceObserver *out = NULL;
     ResourceObserver *tmp = NULL;
-    LL_FOREACH_SAFE (serverObsList, out, tmp) 
+    LL_FOREACH_SAFE (serverObsList, out, tmp)
     {
         DeleteObserverUsingToken (out->token);
     }
index 5af916a..f699a21 100644 (file)
@@ -71,7 +71,7 @@ namespace OC
                 // TODO Logging
                 printf("\tGoing from stack for List of Observers: Payload: %s\n", (char*)pBuffer);
 
-                result = OCNotifyListOfObservers(resourceHandle, &observationIds[0], 
+                result = OCNotifyListOfObservers(resourceHandle, &observationIds[0],
                                                  observationIds.size(), pBuffer);
 
                 delete(pBuffer);
@@ -80,9 +80,8 @@ namespace OC
             {
                 throw e;
             }
-
-            return result;
         }
+        return result;
     }
 
     void OCPlatform::init(const PlatformConfig& config)
@@ -206,7 +205,7 @@ namespace OC
                 }
             }
         }
-        catch(std::exception e) // TODO : define our own exception 
+        catch(std::exception e) // TODO : define our own exception
         {
             throw e;
         }
@@ -297,8 +296,8 @@ namespace OC
 
     }
 
-    OCStackResult OCPlatform::startPresence(const unsigned int announceDurationSeconds)            
-    { 
+    OCStackResult OCPlatform::startPresence(const unsigned int announceDurationSeconds)
+    {
         if(m_server)
         {
             return m_server->startPresence(announceDurationSeconds);
@@ -321,7 +320,7 @@ namespace OC
         }
     }
 
-    OCStackResult OCPlatform::subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host, 
+    OCStackResult OCPlatform::subscribePresence(OCPresenceHandle& presenceHandle, const std::string& host,
         SubscribeCallback presenceHandler)
     {
         if(m_client)