From: Ossama Othman Date: Fri, 11 Nov 2016 22:33:38 +0000 (-0800) Subject: [connectivity] Fix parameter type mismatches. X-Git-Tag: 1.3.0~1052^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef769168298a833172bd4d8b961a793b7625f1f6;p=platform%2Fupstream%2Fiotivity.git [connectivity] Fix parameter type mismatches. To match the corresponding callback function prototype (e.g. CANetworkPacketReceivedCallback and CAErrorHandleCallback), the data length parameter for a few callback function implementations should have been of type size_t instead uint32_t. This addresses several parameter type mismatch warnings on 64 bit platforms. Change-Id: Iaa5740a9fdb9d59fa13832eb3b87335d3355bd37 Signed-off-by: Ossama Othman Reviewed-on: https://gerrit.iotivity.org/gerrit/14237 Tested-by: jenkins-iotivity Reviewed-by: Dan Mihai Reviewed-by: Ziran Sun Reviewed-by: Mike Fenelon --- diff --git a/resource/csdk/connectivity/inc/caprotocolmessage.h b/resource/csdk/connectivity/inc/caprotocolmessage.h index 6e23174..cc31ccc 100644 --- a/resource/csdk/connectivity/inc/caprotocolmessage.h +++ b/resource/csdk/connectivity/inc/caprotocolmessage.h @@ -191,7 +191,7 @@ CAResult_t CAGetInfoFromPDU(const coap_pdu_t *pdu, const CAEndpoint_t *endpoint, * @param[in] endpoint endpoint information. * @return coap_pdu_t value. */ -coap_pdu_t *CAParsePDU(const char *data, uint32_t length, uint32_t *outCode, +coap_pdu_t *CAParsePDU(const char *data, size_t length, uint32_t *outCode, const CAEndpoint_t *endpoint); /** diff --git a/resource/csdk/connectivity/src/cainterfacecontroller.c b/resource/csdk/connectivity/src/cainterfacecontroller.c index 8d740ba..fbc0364 100644 --- a/resource/csdk/connectivity/src/cainterfacecontroller.c +++ b/resource/csdk/connectivity/src/cainterfacecontroller.c @@ -215,7 +215,7 @@ CAResult_t CASetAdapterRAInfo(const CARAInfo_t *caraInfo) #endif static void CAReceivedPacketCallback(const CASecureEndpoint_t *sep, - const void *data, uint32_t dataLen) + const void *data, size_t dataLen) { if (g_networkPacketReceivedCallback != NULL) { @@ -265,7 +265,7 @@ static void CAConnectionChangedCallback(const CAEndpoint_t *info, bool isConnect #endif static void CAAdapterErrorHandleCallback(const CAEndpoint_t *endpoint, - const void *data, uint32_t dataLen, + const void *data, size_t dataLen, CAResult_t result) { OIC_LOG(DEBUG, TAG, "received error from adapter in interfacecontroller"); diff --git a/resource/csdk/connectivity/src/camessagehandler.c b/resource/csdk/connectivity/src/camessagehandler.c index d2365b3..53efbd1 100644 --- a/resource/csdk/connectivity/src/camessagehandler.c +++ b/resource/csdk/connectivity/src/camessagehandler.c @@ -72,7 +72,7 @@ static CAErrorCallback g_errorHandler = NULL; static CANetworkMonitorCallback g_nwMonitorHandler = NULL; static void CAErrorHandler(const CAEndpoint_t *endpoint, - const void *data, uint32_t dataLen, + const void *data, size_t dataLen, CAResult_t result); static CAData_t* CAGenerateHandlerData(const CAEndpoint_t *endpoint, @@ -728,7 +728,7 @@ static bool CADropSecondMessage(CAHistory_t *history, const CAEndpoint_t *ep, ui } static void CAReceivedPacketCallback(const CASecureEndpoint_t *sep, - const void *data, uint32_t dataLen) + const void *data, size_t dataLen) { VERIFY_NON_NULL_VOID(sep, TAG, "remoteEndpoint"); VERIFY_NON_NULL_VOID(data, TAG, "data"); @@ -1282,7 +1282,7 @@ static void CALogPayloadInfo(CAInfo_t *info) } void CAErrorHandler(const CAEndpoint_t *endpoint, - const void *data, uint32_t dataLen, + const void *data, size_t dataLen, CAResult_t result) { OIC_LOG(DEBUG, TAG, "CAErrorHandler IN"); diff --git a/resource/csdk/connectivity/src/caprotocolmessage.c b/resource/csdk/connectivity/src/caprotocolmessage.c index ae10ab2..0937de0 100644 --- a/resource/csdk/connectivity/src/caprotocolmessage.c +++ b/resource/csdk/connectivity/src/caprotocolmessage.c @@ -179,7 +179,7 @@ coap_pdu_t *CAGeneratePDU(uint32_t code, const CAInfo_t *info, const CAEndpoint_ return pdu; } -coap_pdu_t *CAParsePDU(const char *data, uint32_t length, uint32_t *outCode, +coap_pdu_t *CAParsePDU(const char *data, size_t length, uint32_t *outCode, const CAEndpoint_t *endpoint) { VERIFY_NON_NULL_RET(data, TAG, "data", NULL); @@ -193,7 +193,8 @@ coap_pdu_t *CAParsePDU(const char *data, uint32_t length, uint32_t *outCode, } #endif - coap_pdu_t *outpdu = coap_new_pdu2(transport, length); + coap_pdu_t *outpdu = + coap_pdu_init2(0, 0, ntohs(COAP_INVALID_TID), length, transport); if (NULL == outpdu) { OIC_LOG(ERROR, TAG, "outpdu is null");