service: clean up compiler warning 21/22221/2
authorGeorge Nash <george.nash@intel.com>
Fri, 14 Jul 2017 20:36:08 +0000 (13:36 -0700)
committerRick Bell <richard.s.bell@intel.com>
Thu, 21 Sep 2017 16:51:07 +0000 (16:51 +0000)
Clean up the implicit-function-declaration warning in
CoapHttpHandler.c. The compiler is not finding the
OCParsePayload function so it is interpreting it as a
function that takes 4 parameters and returns an int.
This is a result of how old C compilers handle
implicit-functions.

The fact that OCParsePayload was used incorrectly was hidden
it should have 5 parameters not 4.  The code now includes the
internal header ocpayloadcbor.h and fixes the call to
OCParsePayload.

Change-Id: I894e3d423617c15c1ce2cf35825637984d1babd8
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21459
Reviewed-by: Larry Sachs <larry.j.sachs@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
(cherry picked from commit 35bcc24dde8e62832360092fa4da44b60e24305f)

service/coap-http-proxy/src/CoapHttpHandler.c

index 28a4b26..f59a2d6 100644 (file)
@@ -25,6 +25,7 @@
 #include "logger.h"
 #include <coap/pdu.h>
 #include "ocpayload.h"
+#include "internal/ocpayloadcbor.h"
 #include "uarraylist.h"
 #include "CoapHttpParser.h"
 #include "CoapHttpMap.h"
@@ -323,7 +324,7 @@ void CHPHandleHttpResponse(const HttpResponse_t *httpResponse, void *context)
         {
             case OC_FORMAT_CBOR:
                 OIC_LOG(DEBUG, TAG, "Payload format is CBOR");
-                result = OCParsePayload(&response.payload, PAYLOAD_TYPE_REPRESENTATION,
+                result = OCParsePayload(&response.payload, OC_FORMAT_CBOR, PAYLOAD_TYPE_REPRESENTATION,
                                         httpResponse->payload, httpResponse->payloadLength);
                 if (result != OC_STACK_OK)
                 {