Commit cdd10bfc authored by Pawel Winogrodzki's avatar Pawel Winogrodzki Committed by Ashok Babu Channa

IOT-1583: Removing /W3 warnings inside connectivity/ (part 4)

Removing the /W3 warnings in order to add the /WX option to prevent new
ones from being added inside the resource/csdk/connectivity/ directory.

Change-Id: I0a6eb91c6c2cd940e9939f54a454aab2a01ec954
Signed-off-by: default avatarPawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17551Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarAlex Kelley <alexke@microsoft.com>
Reviewed-by: default avatarAshok Babu Channa <ashok.channa@samsung.com>
parent 29579f59
......@@ -25,7 +25,6 @@
* functions to write to the pipe and read from the pipe.
*/
#include <cinttypes>
#include <string.h>
#include <errno.h>
#include "messageHandler.h"
......
......@@ -36,7 +36,6 @@
#include <stdlib.h>
#include <stdio.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <string.h>
#include <string>
#include <math.h>
......
......@@ -20,7 +20,6 @@
//
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include "stringbuffer.h"
#include "writer.h"
#include "curlClient.h"
......
......@@ -17,6 +17,9 @@ print "Given OS is %s" % target_os
print "BUILD_SAMPLE is %s" % build_sample
print "MQ flag is %s" % with_mq
if target_os in ['msys_nt', 'windows']:
connectivity_env.AppendUnique(CCFLAGS=['/W3', '/WX'])
targets_disallow_multitransport = ['arduino']
if target_os in targets_disallow_multitransport:
......
......@@ -603,7 +603,7 @@ typedef struct
#else
int netlinkFd; /**< netlink */
int shutdownFds[2]; /**< fds used to signal threads to stop */
int maxfd; /**< highest fd (for select) */
CASocketFd_t maxfd; /**< highest fd (for select) */
#endif
int selectTimeout; /**< in seconds */
bool started; /**< the IP adapter has started */
......@@ -646,7 +646,7 @@ typedef struct
#else
int shutdownFds[2]; /**< shutdown pipe */
int connectionFds[2]; /**< connection pipe */
int maxfd; /**< highest fd (for select) */
CASocketFd_t maxfd; /**< highest fd (for select) */
#endif
bool started; /**< the TCP adapter has started */
volatile bool terminate;/**< the TCP adapter needs to stop */
......
......@@ -25,7 +25,6 @@
#include "logger.h"
#include "oic_malloc.h"
#include <inttypes.h>
#include <stdio.h>
#include <assert.h>
......
......@@ -34,7 +34,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "caadapterutils.h"
#include "cainterface.h"
......@@ -730,7 +729,7 @@ CAResult_t CASendErrorMessage(const coap_pdu_t *pdu, uint8_t status,
}
else
{
CAInfo_t responseData = { .tokenLength = pdu->transport_hdr->udp.token_length };
CAInfo_t responseData = { .tokenLength = (uint8_t)pdu->transport_hdr->udp.token_length };
responseData.token = (CAToken_t) OICMalloc(responseData.tokenLength);
if (!responseData.token)
{
......@@ -1413,7 +1412,7 @@ CAResult_t CAAddBlockOption(coap_pdu_t **pdu, const CAInfo_t *info,
if (info->payload)
{
dataLength = (unsigned int)info->payloadSize;
OIC_LOG_V(DEBUG, TAG, "dataLength - %" PRIuPTR, dataLength);
OIC_LOG_V(DEBUG, TAG, "dataLength - %u", dataLength);
}
CABlockDataID_t* blockDataID = CACreateBlockDatablockId(
......
......@@ -45,9 +45,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef TB_LOG
#include <inttypes.h>
#endif
#ifndef SINGLE_THREAD
#ifdef HAVE_UNISTD_H
......
......@@ -27,7 +27,6 @@
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h>
#include "cainterface.h"
#include "caipnwmonitor.h"
......
......@@ -21,7 +21,6 @@
#ifndef LOGGER_H_
#define LOGGER_H_
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
......@@ -33,13 +32,19 @@
#elif defined(__TIZEN__)
#include <dlog.h>
#elif defined(ARDUINO)
#include <inttypes.h>
#include "Arduino.h"
#include "avr/pgmspace.h"
#endif
#ifdef __cplusplus
#ifndef ARDUINO
#include <cinttypes>
#endif
extern "C"
{
#else
#include <inttypes.h>
#endif
// Use the PCF macro to wrap strings stored in FLASH on the Arduino
......
......@@ -858,7 +858,7 @@ void RMSendDeleteToNeighbourNodes()
RTMGatewayEntry_t *entry = (RTMGatewayEntry_t *) u_linklist_get_data(iterTable);
if (entry)
{
for (uint32_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
for (size_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
{
RTMDestIntfInfo_t *dest = u_arraylist_get(entry->destination->destIntfAddr, i);
if (!dest)
......
......@@ -570,7 +570,7 @@ OCStackResult RTMAddObserver(uint32_t obsID, CAEndpoint_t devAddr, u_linklist_t
{
RTMGatewayEntry_t *entry = u_linklist_get_data(iterTable);
for (uint32_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
for (size_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
{
RTMDestIntfInfo_t *destCheck = u_arraylist_get(entry->destination->destIntfAddr, i);
if (NULL != destCheck &&
......@@ -614,7 +614,7 @@ bool RTMIsObserverPresent(CAEndpoint_t devAddr, OCObservationId *obsID,
OIC_LOG(ERROR, TAG, "entry is NULL");
return false;
}
for (uint32_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
for (size_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
{
RTMDestIntfInfo_t *destCheck =
u_arraylist_get(entry->destination->destIntfAddr, i);
......@@ -712,7 +712,7 @@ OCStackResult RTMRemoveGatewayDestEntry(uint32_t gatewayId, uint32_t nextHop,
// Update the time for NextHop entry.
if (NULL != entry->destination && nextHop == entry->destination->gatewayId)
{
for (uint32_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
for (size_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
{
RTMDestIntfInfo_t *destCheck = u_arraylist_get(entry->destination->destIntfAddr, i);
if(!destCheck)
......@@ -999,7 +999,7 @@ OCStackResult RTMUpdateDestinationIntfAdr(uint32_t gatewayId, RTMDestIntfInfo_t
{
if (addAdr)
{
for (uint32_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
for (size_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
{
RTMDestIntfInfo_t *destCheck =
u_arraylist_get(entry->destination->destIntfAddr, i);
......@@ -1042,7 +1042,7 @@ OCStackResult RTMUpdateDestinationIntfAdr(uint32_t gatewayId, RTMDestIntfInfo_t
return OC_STACK_DUPLICATE_REQUEST;
}
for (uint32_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
for (size_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
{
RTMDestIntfInfo_t *removeAdr =
u_arraylist_get(entry->destination->destIntfAddr, i);
......@@ -1156,7 +1156,7 @@ OCStackResult RTMUpdateDestAddrValidity(u_linklist_t **invalidTable, u_linklist_
}
else if (1 == entry->routeCost)
{
for (uint32_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
for (size_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
{
RTMDestIntfInfo_t *destCheck = u_arraylist_get(entry->destination->destIntfAddr, i);
if (!destCheck)
......@@ -1207,7 +1207,7 @@ OCStackResult RTMRemoveInvalidGateways(u_linklist_t **invalidTable, u_linklist_t
}
else if (NULL != entry->destination && (1 == entry->routeCost))
{
for (uint32_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
for (size_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
{
RTMDestIntfInfo_t *destCheck = u_arraylist_get(entry->destination->destIntfAddr, i);
if (!destCheck && !destCheck->isValid)
......@@ -1270,7 +1270,7 @@ OCStackResult RTMUpdateEntryParameters(uint32_t gatewayId, uint32_t seqNum,
}
if (NULL != entry->destination && gatewayId == entry->destination->gatewayId)
{
for (uint32_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
for (size_t i = 0; i < u_arraylist_length(entry->destination->destIntfAddr); i++)
{
RTMDestIntfInfo_t *destCheck =
u_arraylist_get(entry->destination->destIntfAddr, i);
......@@ -1335,7 +1335,7 @@ void RTMPrintTable(const u_linklist_t *gatewayTable, const u_linklist_t *endpoin
if (1 == hop->routeCost && NULL != hop->destination &&
hop->destination->destIntfAddr != NULL)
{
for (uint32_t i = 0; i < u_arraylist_length(hop->destination->destIntfAddr); i++)
for (size_t i = 0; i < u_arraylist_length(hop->destination->destIntfAddr); i++)
{
RTMDestIntfInfo_t *dest = u_arraylist_get(hop->destination->destIntfAddr, i);
if (NULL != dest)
......
......@@ -204,11 +204,11 @@ void printStringArray(stringArray_t *list)
return;
}
OIC_LOG_V(INFO, TAG, "List contains %zu items", list->length);
OIC_LOG_V(INFO, TAG, "List contains %" PRIuPTR " items", list->length);
for (size_t i = 0; i < list->length; i++)
{
OIC_LOG_V(INFO, TAG, "item[%zu] = %s", i, list->array[i]);
OIC_LOG_V(INFO, TAG, "item[%" PRIuPTR "] = %s", i, list->array[i]);
}
}
......@@ -295,7 +295,7 @@ bool readFile(const char *name, OCByteString *out)
size_t realCount = fread(buffer, length, count, file);
if (realCount != count)
{
OIC_LOG_V(ERROR, TAG, "Read %d bytes %zu times instead of %zu", length, realCount, count);
OIC_LOG_V(ERROR, TAG, "Read %d bytes %" PRIuPTR " times instead of %" PRIuPTR, length, realCount, count);
goto exit;
}
......
......@@ -1977,7 +1977,7 @@ static size_t printUuidList(const OCUuidList_t* uid_lst)
size_t lst_cnt = 0;
for( ; lst; )
{
printf(" [%zu] ", ++lst_cnt);
printf(" [%" PRIuPTR "] ", ++lst_cnt);
printUuid((const OicUuid_t*) &lst->dev);
printf("\n");
lst = lst->next;
......
......@@ -782,7 +782,7 @@ OCStackResult SRPProvisionCredentials(void *ctx, OicSecCredType_t type, size_t k
static void registerResultForACLProvisioning(ACLData_t *aclData,
OCStackResult stackresult)
{
OIC_LOG_V(INFO, TAG, "Inside registerResultForACLProvisioning aclData->numOfResults is %d\n",
OIC_LOG_V(INFO, TAG, "Inside registerResultForACLProvisioning aclData->numOfResults is %d",
aclData->numOfResults);
memcpy(aclData->resArr[(aclData->numOfResults)].deviceId.id,
aclData->deviceInfo->doxm->deviceID.id, UUID_LENGTH);
......@@ -943,7 +943,7 @@ static void registerResultForDirectPairingProvisioning(PconfData_t *pconfData,
OCStackResult stackresult)
{
OIC_LOG_V(INFO, TAG, "Inside registerResultForDirectPairingProvisioning "
"pconfData->numOfResults is %d\n", pconfData->numOfResults);
"pconfData->numOfResults is %d", pconfData->numOfResults);
memcpy(pconfData->resArr[(pconfData->numOfResults)].deviceId.id,
pconfData->deviceInfo->doxm->deviceID.id, UUID_LENGTH);
pconfData->resArr[(pconfData->numOfResults)].res = stackresult;
......@@ -1098,7 +1098,7 @@ static void registerResultForUnlinkDevices(UnlinkData_t *unlinkData, OCStackResu
{
if (NULL != unlinkData)
{
OIC_LOG_V(INFO, TAG, "Inside registerResultForUnlinkDevices unlinkData->numOfResults is %d\n",
OIC_LOG_V(INFO, TAG, "Inside registerResultForUnlinkDevices unlinkData->numOfResults is %d",
unlinkData->numOfResults);
OIC_LOG_V(INFO, TAG, "Stack result :: %d", stackresult);
......@@ -1145,7 +1145,7 @@ static OCStackResult SendDeleteCredentialRequest(void* ctx,
destDev->endpoint.addr);
if (OC_STACK_OK != result)
{
OIC_LOG_V(ERROR, TAG, "SendDeleteCredentialRequest : encoding error %d\n", result);
OIC_LOG_V(ERROR, TAG, "SendDeleteCredentialRequest : encoding error %d", result);
return OC_STACK_ERROR;
}
......@@ -1165,12 +1165,12 @@ static OCStackResult SendDeleteCredentialRequest(void* ctx,
OICFree(subID);
if (snRet < 0)
{
OIC_LOG_V(ERROR, TAG, "SendDeleteCredentialRequest : Error (snprintf) %d\n", snRet);
OIC_LOG_V(ERROR, TAG, "SendDeleteCredentialRequest : Error (snprintf) %d", snRet);
return OC_STACK_ERROR;
}
else if ((size_t)snRet >= sizeof(reqBuf))
{
OIC_LOG_V(ERROR, TAG, "SendDeleteCredentialRequest : Truncated (snprintf) %d\n", snRet);
OIC_LOG_V(ERROR, TAG, "SendDeleteCredentialRequest : Truncated (snprintf) %d", snRet);
return OC_STACK_ERROR;
}
......@@ -1221,7 +1221,7 @@ static OCStackResult SendDeleteACLRequest(void* ctx,
destDev->endpoint.addr);
if (OC_STACK_OK != result)
{
OIC_LOG_V(ERROR, TAG, "SendDeleteCredentialRequest : encoding error %d\n", result);
OIC_LOG_V(ERROR, TAG, "SendDeleteCredentialRequest : encoding error %d", result);
return OC_STACK_ERROR;
}
......@@ -1233,12 +1233,12 @@ static OCStackResult SendDeleteACLRequest(void* ctx,
OICFree(subID);
if (snRet < 0)
{
OIC_LOG_V(ERROR, TAG, "SendDeleteACLRequest : Error (snprintf) %d\n", snRet);
OIC_LOG_V(ERROR, TAG, "SendDeleteACLRequest : Error (snprintf) %d", snRet);
return OC_STACK_ERROR;
}
else if ((size_t)snRet >= sizeof(reqBuf))
{
OIC_LOG_V(ERROR, TAG, "SendDeleteACLRequest : Truncated (snprintf) %d\n", snRet);
OIC_LOG_V(ERROR, TAG, "SendDeleteACLRequest : Truncated (snprintf) %d", snRet);
return OC_STACK_ERROR;
}
......@@ -1502,7 +1502,7 @@ static void DeleteRemoveData_t(RemoveData_t* pRemoveData)
static void registerResultForRemoveDevice(RemoveData_t *removeData, OicUuid_t *pLinkedDevId,
OCStackResult stackresult, bool hasError)
{
OIC_LOG_V(INFO, TAG, "Inside registerResultForRemoveDevice removeData->numOfResults is %zu\n",
OIC_LOG_V(INFO, TAG, "Inside registerResultForRemoveDevice removeData->numOfResults is %" PRIuPTR,
removeData->numOfResults + 1);
if (pLinkedDevId)
{
......@@ -1539,7 +1539,7 @@ static void registerResultForRemoveDevice(RemoveData_t *removeData, OicUuid_t *p
static void registerResultForResetDevice(RemoveData_t *removeData, OicUuid_t *pLinkedDevId,
OCStackResult stackresult, bool hasError)
{
OIC_LOG_V(INFO, TAG, "Inside registerResultForResetDevice removeData->numOfResults is %zu\n",
OIC_LOG_V(INFO, TAG, "Inside registerResultForResetDevice removeData->numOfResults is %" PRIuPTR,
removeData->numOfResults + 1);
if (pLinkedDevId)
{
......@@ -2427,7 +2427,7 @@ static void registerResultForGetCredResourceCB(GetSecData_t *GetSecData,
OCStackResult stackresult)
{
OIC_LOG_V(INFO, TAG, "Inside registerResultForGetCredResourceCB "
"GetSecData->numOfResults is %d\n", GetSecData->numOfResults);
"GetSecData->numOfResults is %d", GetSecData->numOfResults);
memcpy(GetSecData->resArr[(GetSecData->numOfResults)].deviceId.id,
GetSecData->deviceInfo->doxm->deviceID.id, UUID_LENGTH);
GetSecData->resArr[(GetSecData->numOfResults)].res = stackresult;
......@@ -2549,7 +2549,7 @@ static void registerResultForGetACLResourceCB(GetSecData_t *GetSecData,
OCStackResult stackresult)
{
OIC_LOG_V(INFO, TAG, "Inside registerResultForGetACLResourceCB "
"GetSecData->numOfResults is %d\n", GetSecData->numOfResults);
"GetSecData->numOfResults is %d", GetSecData->numOfResults);
memcpy(GetSecData->resArr[(GetSecData->numOfResults)].deviceId.id,
GetSecData->deviceInfo->doxm->deviceID.id, UUID_LENGTH);
GetSecData->resArr[(GetSecData->numOfResults)].res = stackresult;
......
......@@ -89,7 +89,7 @@ void printCrl(const OicSecCrl_t *crl)
OIC_LOG(INFO, TAG, "crl:");
OIC_LOG_V(INFO, TAG, "encoding = %d", crl->CrlData.encoding);
OIC_LOG_V(INFO, TAG, "data (length = %zu):", crl->CrlData.len);
OIC_LOG_V(INFO, TAG, "data (length = %" PRIuPTR "):", crl->CrlData.len);
OIC_LOG_BUFFER(INFO, TAG, crl->CrlData.data, crl->CrlData.len);
}
......
......@@ -174,7 +174,7 @@ OCStackResult ReadDatabaseFromPS(const char *databaseName, const char *resourceN
VERIFY_NOT_NULL(TAG, ps, ERROR);
fileSize = GetDatabaseSize(ps, databaseName);
OIC_LOG_V(DEBUG, TAG, "File Read Size: %zu", fileSize);
OIC_LOG_V(DEBUG, TAG, "File Read Size: %" PRIuPTR, fileSize);
if (fileSize)
{
fsData = (uint8_t *) OICCalloc(1, fileSize);
......
......@@ -22,6 +22,7 @@
#include "pbkdf2.h"
#include <stdlib.h>
#include <stdint.h>
#include <cinttypes>
/*
* Tests for the PBKDF2 implementation.
......@@ -59,7 +60,7 @@ static void print_vector(const char* label,
printf("%s\n", label);
print_buffer("Password", passwd, pLen);
print_buffer("Salt", salt, saltLen);
printf("Iterations: %zu\n", iterations);
printf("Iterations: %" PRIuPTR "\n", iterations);
print_buffer("Derived Key", derivedKey, keyLen);
}
......
......@@ -21,7 +21,6 @@
#ifndef PAYLOAD_LOGGING_H_
#define PAYLOAD_LOGGING_H_
#include "logger.h"
#ifdef __TIZEN__
#include <dlog.h>
#endif
......@@ -33,7 +32,7 @@
#define __STDC_LIMIT_MACROS
#endif
#include <inttypes.h>
#include "logger.h"
#include "oic_malloc.h"
#include "ocpayload.h"
#include "ocstack.h"
......@@ -90,7 +89,7 @@ INLINE_API void OCPayloadLogRepValues(LogLevel level, OCRepPayloadValue* val)
switch(val->arr.type)
{
case OCREP_PROP_INT:
OIC_LOG_V(level, PL_TAG, "\t\t%s(int array):%zu x %zu x %zu: ",
OIC_LOG_V(level, PL_TAG, "\t\t%s(int array):%" PRIuPTR " x %" PRIuPTR " x %" PRIuPTR ": ",
val->name,
val->arr.dimensions[0], val->arr.dimensions[1],
val->arr.dimensions[2]);
......@@ -101,7 +100,7 @@ INLINE_API void OCPayloadLogRepValues(LogLevel level, OCRepPayloadValue* val)
}
break;
case OCREP_PROP_DOUBLE:
OIC_LOG_V(level, PL_TAG, "\t\t%s(double array):%zu x %zu x %zu: ",
OIC_LOG_V(level, PL_TAG, "\t\t%s(double array):%" PRIuPTR " x %" PRIuPTR " x %" PRIuPTR ": ",
val->name,
val->arr.dimensions[0], val->arr.dimensions[1],
val->arr.dimensions[2]);
......@@ -112,7 +111,7 @@ INLINE_API void OCPayloadLogRepValues(LogLevel level, OCRepPayloadValue* val)
}
break;
case OCREP_PROP_BOOL:
OIC_LOG_V(level, PL_TAG, "\t\t%s(bool array):%zu x %zu x %zu: ",
OIC_LOG_V(level, PL_TAG, "\t\t%s(bool array):%" PRIuPTR " x %" PRIuPTR " x %" PRIuPTR ": ",
val->name,
val->arr.dimensions[0], val->arr.dimensions[1],
val->arr.dimensions[2]);
......@@ -123,7 +122,7 @@ INLINE_API void OCPayloadLogRepValues(LogLevel level, OCRepPayloadValue* val)
}
break;
case OCREP_PROP_STRING:
OIC_LOG_V(level, PL_TAG, "\t\t%s(string array):%zu x %zu x %zu: ",
OIC_LOG_V(level, PL_TAG, "\t\t%s(string array):%" PRIuPTR " x %" PRIuPTR " x %" PRIuPTR ": ",
val->name,
val->arr.dimensions[0], val->arr.dimensions[1],
val->arr.dimensions[2]);
......@@ -134,7 +133,7 @@ INLINE_API void OCPayloadLogRepValues(LogLevel level, OCRepPayloadValue* val)
}
break;
case OCREP_PROP_BYTE_STRING:
OIC_LOG_V(level, PL_TAG, "\t\t%s(byte array):%zu x %zu x %zu: ",
OIC_LOG_V(level, PL_TAG, "\t\t%s(byte array):%" PRIuPTR " x %" PRIuPTR " x %" PRIuPTR ": ",
val->name,
val->arr.dimensions[0], val->arr.dimensions[1],
val->arr.dimensions[2]);
......@@ -145,7 +144,7 @@ INLINE_API void OCPayloadLogRepValues(LogLevel level, OCRepPayloadValue* val)
}
break;
case OCREP_PROP_OBJECT:
OIC_LOG_V(level, PL_TAG, "\t\t%s(object array):%zu x %zu x %zu: ",
OIC_LOG_V(level, PL_TAG, "\t\t%s(object array):%" PRIuPTR " x %" PRIuPTR " x %" PRIuPTR ": ",
val->name,
val->arr.dimensions[0], val->arr.dimensions[1],
val->arr.dimensions[2]);
......
......@@ -19,7 +19,6 @@
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include "iotivity_config.h"
#include <cinttypes>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -35,7 +35,6 @@
#include <pthread.h>
#endif
#include <array>
#include <cinttypes>
#include "oic_malloc.h"
#include <getopt.h>
#include "ocstack.h"
......
......@@ -19,7 +19,6 @@
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#include "iotivity_config.h"
#include <cinttypes>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......
......@@ -60,7 +60,7 @@ OCStackResult OCParsePayload(OCPayload **outPayload, OCPayloadType payloadType,
VERIFY_PARAM_NON_NULL(TAG, outPayload, "Conversion of outPayload failed");
VERIFY_PARAM_NON_NULL(TAG, payload, "Invalid cbor payload value");
OIC_LOG_V(INFO, TAG, "CBOR Parsing size: %zu of Payload Type: %d, Payload:",
OIC_LOG_V(INFO, TAG, "CBOR Parsing size: %" PRIuPTR " of Payload Type: %d, Payload:",
payloadSize, payloadType);
CborParser parser;
......
......@@ -39,7 +39,6 @@
#include "iotivity_config.h"
#include "iotivity_debug.h"
#include <stdlib.h>
#include <inttypes.h>
#include <string.h>
#include <ctype.h>
#ifdef HAVE_UNISTD_H
......@@ -1013,7 +1012,7 @@ OCStackResult OCEncodeAddressForRFC6874(char *outputAddress,
{
OIC_LOG_V(ERROR, TAG,
"OCEncodeAddressForRFC6874 failed: "
"outputSize (%zu) < inputSize (%zu)",
"outputSize (%" PRIuPTR ") < inputSize (%" PRIuPTR ")",
outputSize, inputSize);
return OC_STACK_ERROR;
......
......@@ -254,7 +254,7 @@ static int ReadFile(const char *name, OCByteString *crl)
realLen = fread(buffer, length, 1, file);
if (realLen != (size_t)length)
{
OIC_LOG_V(ERROR, TAG, "Length mismatch: read %zu instead of %d bytes", realLen, length);
OIC_LOG_V(ERROR, TAG, "Length mismatch: read %" PRIuPTR " instead of %d bytes", realLen, length);
goto exit;
}
......
......@@ -24,7 +24,6 @@
#include <string>
#include <map>
#include <cstdlib>
#include <cinttypes>
#include <pthread.h>
#include <mutex>
#include <condition_variable>
......@@ -410,7 +409,7 @@ static int InputACL(OicSecAcl_t *acl)
//Set Resource.
size_t resourcesLen = 0;
printf("Num. of Resource : ");
ret = scanf("%zu", &resourcesLen);
ret = scanf("%" PRIuPTR, &resourcesLen);
if ((1 != ret) || (resourcesLen <= 0 || resourcesLen > 50))
{
deleteACL(acl);
......@@ -431,7 +430,7 @@ static int InputACL(OicSecAcl_t *acl)
LL_APPEND(ace->resources, rsrc);
printf("[%zu]Resource : ", i + 1);
printf("[%" PRIuPTR "]Resource : ", i + 1);
ret = scanf("%64ms", &temp_rsc);
if (1 != ret)
{
......@@ -666,7 +665,7 @@ static OicSecPdAcl_t* InputPdACL()
//Set Resource.
printf("Num. of Resource : ");
ret = scanf("%zu", &acl->resourcesLen);
ret = scanf("%" PRIuPTR, &acl->resourcesLen);
if ((1 != ret) || (acl->resourcesLen <= 0 || acl->resourcesLen > 50))
{
printf("Error while input\n");
......@@ -684,7 +683,7 @@ static OicSecPdAcl_t* InputPdACL()
}
for (size_t i = 0; i < acl->resourcesLen; i++)
{
printf("[%zu]Resource : ", i + 1);
printf("[%" PRIuPTR "]Resource : ", i + 1);
ret = scanf("%64ms", &temp_rsc);
if (1 != ret)
{
......
......@@ -371,9 +371,9 @@ void CHPHandleHttpResponse(const HttpResponse_t *httpResponse, void *context)
response.numSendVendorSpecificHeaderOptions = 0;
OCHeaderOption *optionsPointer = response.sendVendorSpecificHeaderOptions;
uint8_t tempOptionNumber = u_arraylist_length(httpResponse->headerOptions);
for (int numOptions = 0; numOptions < tempOptionNumber &&
response.numSendVendorSpecificHeaderOptions < MAX_HEADER_OPTIONS;
size_t tempOptionNumber = u_arraylist_length(httpResponse->headerOptions);
for (size_t numOptions = 0; (numOptions < tempOptionNumber) &&
(response.numSendVendorSpecificHeaderOptions < MAX_HEADER_OPTIONS);
numOptions++)
{
HttpHeaderOption_t *httpOption = u_arraylist_get(httpResponse->headerOptions, numOptions);
......
......@@ -798,8 +798,8 @@ static OCStackResult CHPInitializeEasyHandle(CURL** easyHandle, HttpRequest_t *r
if (req->headerOptions)
{
HttpHeaderOption_t *option = NULL;
int headerCount = u_arraylist_length(req->headerOptions);
for(int i = 0; i < headerCount; i++)
size_t headerCount = u_arraylist_length(req->headerOptions);
for(size_t i = 0; i < headerCount; i++)
{
option = u_arraylist_get(req->headerOptions, i);
if(option)
......
......@@ -436,7 +436,7 @@ namespace OIC
}
}
OIC_LOG_V(INFO, CONTAINER_TAG, "Container get request for %s finished, %zu attributes",strResourceUri.c_str(), attr.size());
OIC_LOG_V(INFO, CONTAINER_TAG, "Container get request for %s finished, %