From: DoHyun Pyun Date: Sun, 16 Dec 2018 23:58:17 +0000 (+0900) Subject: Fix 64bit build error for tizen dlog print format X-Git-Tag: accepted/tizen/5.0/unified/20181217.142003~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cfcecbe298d6e67d29eabf0b17e20d9f86976f6a;p=platform%2Fupstream%2Fiotivity.git Fix 64bit build error for tizen dlog print format https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/371 (cherry picked from commit 526d318695746521886ecf8bb9a542d309cf7d28) Change-Id: Ieec0d515c0cadfe5fd1c1249f6f94a5025c619bd Signed-off-by: DoHyun Pyun --- diff --git a/resource/csdk/connectivity/src/adapter_util/caadapterutils.c b/resource/csdk/connectivity/src/adapter_util/caadapterutils.c old mode 100755 new mode 100644 index 6b31fb1..762949c --- a/resource/csdk/connectivity/src/adapter_util/caadapterutils.c +++ b/resource/csdk/connectivity/src/adapter_util/caadapterutils.c @@ -370,7 +370,7 @@ void CALogSendStateInfo(CATransportAdapter_t adapter, if (true == isSuccess) { - OIC_LOG_V(INFO, ANALYZER_TAG, "Send Success, sent length = [%d]", sentLen); + OIC_LOG_V(INFO, ANALYZER_TAG, "Send Success, sent length = [%zd]", sentLen); } else { @@ -379,7 +379,7 @@ void CALogSendStateInfo(CATransportAdapter_t adapter, } CALogAdapterTypeInfo(adapter); - OIC_LOG_V(DEBUG, ANALYZER_TAG, "Address = [%s]:[%d]", addr, port); + OIC_LOG_V(INFO, ANALYZER_TAG, "Address = [%s]:[%d]", addr, port); OIC_LOG(DEBUG, ANALYZER_TAG, "================================================="); // samsung log diff --git a/resource/csdk/connectivity/src/adapter_util/cafragmentation.c b/resource/csdk/connectivity/src/adapter_util/cafragmentation.c index 67bd00b..8e833bd 100644 --- a/resource/csdk/connectivity/src/adapter_util/cafragmentation.c +++ b/resource/csdk/connectivity/src/adapter_util/cafragmentation.c @@ -86,7 +86,7 @@ CAResult_t CAGenerateVariableForFragmentation(size_t dataLength, size_t *totalLength, uint16_t mtuSize) { - OIC_LOG_V(DEBUG, TAG, "IN, dataLength = %zu, mtu = %zu", dataLength, mtuSize); + OIC_LOG_V(DEBUG, TAG, "IN, dataLength = %zd, mtu = %hu", dataLength, mtuSize); size_t remainDataSize = 0; size_t dataOnlyLen = diff --git a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c index 2a6c02d..6fe1343 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c @@ -1182,9 +1182,6 @@ static void CALEServerSendDataThread(void *threadData) #if defined(__TIZEN__) || defined(__ANDROID__) // get MTU size - OIC_LOG_V(INFO, CALEADAPTER_TAG, "Get MTU size using API"); - - g_mtuSize = CALEServerGetMtuSize(bleData->remoteEndpoint->addr); #endif OIC_LOG_V(INFO, CALEADAPTER_TAG, "MTU size [%d]", g_mtuSize); @@ -1329,7 +1326,7 @@ static void CALEServerSendDataThread(void *threadData) OIC_LOG_V(DEBUG, CALEADAPTER_TAG, - "Server Sent Unicast First Data - data length [%zu]", + "Server Sent Unicast First Data - data length [%u]", length); result = CAGenerateHeader(dataHeader, @@ -1632,7 +1629,7 @@ static void CALEClientSendDataThread(void *threadData) } OIC_LOG_V(DEBUG, CALEADAPTER_TAG, - "Client Sent Unicast First Data - data length [%zu]", + "Client Sent Unicast First Data - data length [%u]", length); result = CAGenerateHeader(dataHeader, @@ -1694,7 +1691,7 @@ static void CALEClientSendDataThread(void *threadData) } OIC_LOG_V(DEBUG, CALEADAPTER_TAG, - "Client Sent Unicast %d Data - data(mtu) length [%zu]", + "Client Sent Unicast %d Data - data(mtu) length [%hu]", index + 1, g_mtuSize); } @@ -2489,7 +2486,7 @@ static ssize_t CALESecureSendDataCB(CAEndpoint_t *endpoint, const void *data, si VERIFY_NON_NULL(endpoint, CALEADAPTER_TAG, "endpoint is NULL"); VERIFY_NON_NULL(data, CALEADAPTER_TAG, "data is NULL"); OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "IN %s", __func__); - OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "encrypted datalen = %d", dataLen); + OIC_LOG_V(DEBUG, CALEADAPTER_TAG, "encrypted datalen = %zd", dataLen); CAResult_t result; CADataType_t dataType = g_dataType; @@ -2547,7 +2544,7 @@ CAResult_t CALESecureReceiveDataCB(const CASecureEndpoint_t *sep, const void *da VERIFY_NON_NULL(data, CALEADAPTER_TAG, "data is NULL"); OIC_LOG_V(DEBUG, CALEADAPTER_TAG, - "Secure Data Receive - decrypted datalen = %d", dataLen); + "Secure Data Receive - decrypted datalen = %zd", dataLen); if (dataLen <= 0) { @@ -3444,7 +3441,7 @@ static CAResult_t CALEAdapterClientReceivedData(const char *remoteAddress, // Create bleData to add to queue OIC_LOG_V(DEBUG, CALEADAPTER_TAG, - "Data received from LE Client layer [%zu]", + "Data received from LE Client layer [%u]", dataLength); CALEData_t * const bleData = diff --git a/resource/csdk/connectivity/src/ip_adapter/caipserver.c b/resource/csdk/connectivity/src/ip_adapter/caipserver.c index 77f4d02..f2e71f1 100644 --- a/resource/csdk/connectivity/src/ip_adapter/caipserver.c +++ b/resource/csdk/connectivity/src/ip_adapter/caipserver.c @@ -657,7 +657,7 @@ static CAResult_t CAReceiveMessage(CASocketFd_t fd, CATransportFlags_t flags) OIC_LOG_V(ERROR, TAG, "Recvfrom failed %s", strerror(errno)); return CA_STATUS_FAILED; } - OIC_LOG_V(DEBUG, TAG, "recvd %u bytes from recvmsg", recvLen); + OIC_LOG_V(DEBUG, TAG, "recvd %zd bytes from recvmsg", recvLen); if (flags & CA_MULTICAST) { diff --git a/resource/csdk/connectivity/src/tcp_adapter/catcpadapter.c b/resource/csdk/connectivity/src/tcp_adapter/catcpadapter.c index ee25ead..5fc9828 100644 --- a/resource/csdk/connectivity/src/tcp_adapter/catcpadapter.c +++ b/resource/csdk/connectivity/src/tcp_adapter/catcpadapter.c @@ -217,7 +217,7 @@ CAResult_t CATCPPacketReceivedCB(const CASecureEndpoint_t *sep, const void *data } else { - OIC_LOG_V(DEBUG, TAG, "%u bytes required for complete CoAP", + OIC_LOG_V(DEBUG, TAG, "%zd bytes required for complete CoAP", svritem->totalLen - svritem->len); } } @@ -236,7 +236,7 @@ static ssize_t CATCPPacketSendCB(CAEndpoint_t *endpoint, const void *data, size_ OIC_LOG_BUFFER(DEBUG, TAG, data, dataLength); ssize_t ret = CATCPSendData(endpoint, data, dataLength); - OIC_LOG_V(DEBUG, TAG, "Out %s : %d bytes sent", __func__, ret); + OIC_LOG_V(DEBUG, TAG, "Out %s : %zd bytes sent", __func__, ret); return ret; } #endif diff --git a/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c b/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c index e4dd27e..ba1d224 100644 --- a/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c +++ b/resource/csdk/connectivity/src/tcp_adapter/catcpserver.c @@ -512,7 +512,7 @@ CAResult_t CAConstructCoAP(CATCPSessionInfo_t *svritem, unsigned char **data, unsigned char *inBuffer = *data; size_t inLen = *dataLength; - OIC_LOG_V(DEBUG, TAG, "before-datalength : %u", *dataLength); + OIC_LOG_V(DEBUG, TAG, "before-datalength : %zd", *dataLength); if (NULL == svritem->data && inLen > 0) { @@ -616,7 +616,7 @@ CAResult_t CAConstructCoAP(CATCPSessionInfo_t *svritem, unsigned char **data, *data = inBuffer; *dataLength = inLen; - OIC_LOG_V(DEBUG, TAG, "after-datalength : %u", *dataLength); + OIC_LOG_V(DEBUG, TAG, "after-datalength : %zd", *dataLength); OIC_LOG_V(DEBUG, TAG, "Out %s", __func__); return CA_STATUS_OK; } @@ -656,7 +656,7 @@ static void CAReceiveMessage(int fd) //[3][4] bytes in tls header are tls payload length tlsLength = TLS_HEADER_SIZE + (size_t)((svritem->tlsdata[3] << 8) | svritem->tlsdata[4]); - OIC_LOG_V(DEBUG, TAG, "total tls length = %u", tlsLength); + OIC_LOG_V(DEBUG, TAG, "total tls length = %zd", tlsLength); if (tlsLength > TLS_DATA_MAX_SIZE) { OIC_LOG_V(ERROR, TAG, "total tls length is too big (buffer size : %u)", @@ -683,7 +683,7 @@ static void CAReceiveMessage(int fd) else { svritem->tlsLen += len; - OIC_LOG_V(DEBUG, TAG, "nb_read : %u bytes , recv() : %d bytes, svritem->tlsLen : %u bytes", + OIC_LOG_V(DEBUG, TAG, "nb_read : %zd bytes , recv() : %d bytes, svritem->tlsLen : %zd bytes", nbRead, len, svritem->tlsLen); if (tlsLength > 0 && tlsLength == svritem->tlsLen) { diff --git a/resource/csdk/security/provisioning/sample/provisioningclient.c b/resource/csdk/security/provisioning/sample/provisioningclient.c index 301a625..408bd23 100644 --- a/resource/csdk/security/provisioning/sample/provisioningclient.c +++ b/resource/csdk/security/provisioning/sample/provisioningclient.c @@ -1540,7 +1540,7 @@ static int removeSubOwner(void) int so_cnt = 0; while(subOwner) { - printf(" [%zu] ", ++so_cnt); + printf(" [%d] ", ++so_cnt); printUuid(&subOwner->uuid); printf("\n"); subOwner = subOwner->next; diff --git a/resource/csdk/security/provisioning/src/secureresourceprovider.c b/resource/csdk/security/provisioning/src/secureresourceprovider.c index 6804381..081cccd 100644 --- a/resource/csdk/security/provisioning/src/secureresourceprovider.c +++ b/resource/csdk/security/provisioning/src/secureresourceprovider.c @@ -568,7 +568,7 @@ OCStackResult SRPSaveTrustCertChain(uint8_t *trustCertChain, size_t chainSize, // because we use 3 Cert, 6K is enough size for saving Certs. if (6144 <= chainSize) { - OIC_LOG_V(ERROR, TAG, "chainSize(%u) is invalid", chainSize); + OIC_LOG_V(ERROR, TAG, "chainSize(%zd) is invalid", chainSize); return OC_STACK_INVALID_PARAM; } diff --git a/resource/csdk/security/src/credresource.c b/resource/csdk/security/src/credresource.c index b105de9..0bdaa5f 100644 --- a/resource/csdk/security/src/credresource.c +++ b/resource/csdk/security/src/credresource.c @@ -1169,7 +1169,7 @@ OicSecCred_t * GenerateCredential(const OicUuid_t * subject, OicSecCredType_t cr OIC_LOG_BUFFER(DEBUG, TAG, cred->subject.id, sizeof(cred->subject.id)); if (cred->privateData.data) { - OIC_LOG_V(DEBUG, TAG, "GenerateCredential : privateData len: %u", cred->privateData.len); + OIC_LOG_V(DEBUG, TAG, "GenerateCredential : privateData len: %zd", cred->privateData.len); OIC_LOG_BUFFER(DEBUG, TAG, cred->privateData.data, cred->privateData.len); } #if defined(__WITH_DTLS__) || defined(__WITH_TLS__) @@ -1179,13 +1179,13 @@ OicSecCred_t * GenerateCredential(const OicUuid_t * subject, OicSecCredType_t cr } if (cred->publicData.data) { - OIC_LOG_V(DEBUG, TAG, "GenerateCredential : publicData len: %u", cred->publicData.len); + OIC_LOG_V(DEBUG, TAG, "GenerateCredential : publicData len: %zd", cred->publicData.len); OIC_LOG_BUFFER(DEBUG, TAG, cred->publicData.data, cred->publicData.len); } if (cred->optionalData.data) { - OIC_LOG_V(DEBUG, TAG, "GenerateCredential : optionalData len: %u", cred->optionalData.len); + OIC_LOG_V(DEBUG, TAG, "GenerateCredential : optionalData len: %zd", cred->optionalData.len); OIC_LOG_BUFFER(DEBUG, TAG, cred->optionalData.data, cred->optionalData.len); OIC_LOG_V(DEBUG, TAG, "GenerateCredential : optionalData revstat: %d", cred->optionalData.revstat); } diff --git a/resource/csdk/security/src/doxmresource.c b/resource/csdk/security/src/doxmresource.c index 4fbd45c..320425f 100644 --- a/resource/csdk/security/src/doxmresource.c +++ b/resource/csdk/security/src/doxmresource.c @@ -931,7 +931,7 @@ static size_t GetSubOwnerSize() } } - OIC_LOG_V(DEBUG, TAG, "Numer of registered sub-owner=%d", numberOfSubOwner); + OIC_LOG_V(DEBUG, TAG, "Numer of registered sub-owner=%zd", numberOfSubOwner); OIC_LOG_V(DEBUG, TAG, "Out %s", __func__); return numberOfSubOwner; @@ -1010,7 +1010,7 @@ void MultipleOwnerDTLSHandshakeCB(const CAEndpoint_t *endpoint, } else { - OIC_LOG_V(ERROR, TAG, "Number of sub-owner exceeded : (MAX SIZE=%d)", gMaxSubOwnerSize); + OIC_LOG_V(ERROR, TAG, "Number of sub-owner exceeded : (MAX SIZE=%zd)", gMaxSubOwnerSize); //Close DTLS session if (CA_STATUS_OK != CAcloseSslSession(endpoint)) @@ -2376,11 +2376,11 @@ OCStackResult SetNumberOfSubOwner(size_t numOfSubOwner) #ifdef MULTIPLE_OWNER if (MAX_SUBOWNER_SIZE < numOfSubOwner || MIN_SUBOWNER_SIZE > numOfSubOwner) { - OIC_LOG_V(ERROR, TAG, "Invalid number of sub owner : %d", numOfSubOwner); + OIC_LOG_V(ERROR, TAG, "Invalid number of sub owner : %zd", numOfSubOwner); return OC_STACK_INVALID_PARAM; } gMaxSubOwnerSize = numOfSubOwner; - OIC_LOG_V(DEBUG, TAG, "Number of SubOwner = %d", gMaxSubOwnerSize); + OIC_LOG_V(DEBUG, TAG, "Number of SubOwner = %zd", gMaxSubOwnerSize); OIC_LOG_V(DEBUG, TAG, "Out %s", __func__); return OC_STACK_OK; #else diff --git a/resource/csdk/security/src/pkix_interface.c b/resource/csdk/security/src/pkix_interface.c index 6a487a9..805f793 100644 --- a/resource/csdk/security/src/pkix_interface.c +++ b/resource/csdk/security/src/pkix_interface.c @@ -344,7 +344,7 @@ void CheckInvalidDERSignature(uint8_t *crtBuf, size_t *crtBufLen) exit: mbedtls_x509_crt_free(&deviceCert); OICFree(derCrtBufTmp); - OIC_LOG_V(DEBUG, TAG, "Cert chain length = %u", *crtBufLen); + OIC_LOG_V(DEBUG, TAG, "Cert chain length = %zd", *crtBufLen); OIC_LOG_V(DEBUG, TAG, "Out %s", __func__); } @@ -381,7 +381,7 @@ static bool GetPkixInfoFromHw(PkiInfo_t * inf) // check and fix invalid cert signature CheckInvalidDERSignature(inf->crt.data, &inf->crt.len); - OIC_LOG_V(INFO, TAG, "Cert chain length = %u", inf->crt.len); + OIC_LOG_V(INFO, TAG, "Cert chain length = %zd", inf->crt.len); OIC_LOG_V(INFO, TAG, "Out %s", __func__); return true; }