Fix 64bit build error for tizen dlog print format 26/195626/1 accepted/tizen/unified/20181217.142341 submit/tizen/20181217.021058
authorDoHyun Pyun <dh79.pyun@samsung.com>
Sun, 16 Dec 2018 23:58:17 +0000 (08:58 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 17 Dec 2018 02:08:37 +0000 (11:08 +0900)
https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/371
(cherry picked from commit 526d318695746521886ecf8bb9a542d309cf7d28)

Change-Id: If27fd08ce8edb15675fa6e264a09bf9fc5b6455c
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
resource/csdk/connectivity/src/adapter_util/caadapterutils.c [changed mode: 0755->0644]
resource/csdk/connectivity/src/adapter_util/cafragmentation.c
resource/csdk/connectivity/src/bt_le_adapter/caleadapter.c
resource/csdk/connectivity/src/ip_adapter/caipserver.c
resource/csdk/connectivity/src/tcp_adapter/catcpadapter.c
resource/csdk/connectivity/src/tcp_adapter/catcpserver.c
resource/csdk/security/provisioning/sample/provisioningclient.c
resource/csdk/security/provisioning/src/secureresourceprovider.c
resource/csdk/security/src/credresource.c
resource/csdk/security/src/doxmresource.c
resource/csdk/security/src/pkix_interface.c

old mode 100755 (executable)
new mode 100644 (file)
index 6b31fb1..762949c
@@ -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
index 67bd00b..8e833bd 100644 (file)
@@ -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 =
index 2a6c02d..6fe1343 100644 (file)
@@ -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 =
index 77f4d02..f2e71f1 100644 (file)
@@ -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)
     {
index ee25ead..5fc9828 100644 (file)
@@ -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
index e4dd27e..ba1d224 100644 (file)
@@ -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)
             {
index 301a625..408bd23 100644 (file)
@@ -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;
index 6804381..081cccd 100644 (file)
@@ -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;
     }
 
index b105de9..0bdaa5f 100644 (file)
@@ -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);
     }
index 4fbd45c..320425f 100644 (file)
@@ -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
index 6a487a9..805f793 100644 (file)
@@ -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;
     }