This fixes a handful of the warnings present on master.
Change-Id: Idc39f9c8f8c73e0107831bc340738028a1294604
Signed-off-by: Erich Keane <erich.keane@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1804
Reviewed-by: Joseph Morrow <joseph.l.morrow@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
])
if target_os not in ['arduino', 'windows', 'winrt']:
- libcoap_env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '_BSD_SOURCE'])
+ libcoap_env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '_DEFAULT_SOURCE'])
libcoap_env.AppendUnique(CFLAGS = ['-std=gnu99','-fPIC'])
if target_os not in ['windows', 'winrt']:
*/
inline static int bits_setb(uint8_t *vec, size_t size, uint8_t bit)
{
- if (size <= (bit >> 3))
+ if (size <= (size_t)(bit >> 3))
return -1;
*(vec + (bit >> 3)) |= (uint8_t)(1 << (bit & 0x07));
*/
inline static int bits_clrb(uint8_t *vec, size_t size, uint8_t bit)
{
- if (size <= (bit >> 3))
+ if (size <= (size_t)(bit >> 3))
return -1;
*(vec + (bit >> 3)) &= (uint8_t)(~(1 << (bit & 0x07)));
*/
inline static int bits_getb(const uint8_t *vec, size_t size, uint8_t bit)
{
- if (size <= (bit >> 3))
+ if (size <= (size_t)(bit >> 3))
return -1;
return (*(vec + (bit >> 3)) & (1 << (bit & 0x07))) != 0;
* @{
*/
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
#ifdef WITH_LWIP
#include <stdint.h>
/* skip following separator (the first segment might not have one) */
- if (strchr(s,*(pi->pos)))
+ if (strchr((const char*)s,*(pi->pos)))
{
++pi->pos;
--pi->n;
p = pi->pos;
- while ((pi->segment_length < pi->n) && (!strchr(s,*p))
+ while ((pi->segment_length < pi->n) && (!strchr((const char*)s,*p))
&& (!strnchr(pi->delim, pi->dlen, *p)))
{
++p;
static CAData_t* CAGenerateHandlerData(const CAEndpoint_t *endpoint, const void *data,
CADataType_t dataType);
+#ifdef SINGLE_THREAD
static void CAProcessReceivedData(CAData_t *data);
+#endif
static void CADataDestroyer(void *data, uint32_t size);
static void CALogPayloadInfo(CAInfo_t *info);
static bool CADropSecondRequest(const CAEndpoint_t *endpoint, uint16_t messageId);
OIC_LOG(DEBUG, TAG, "CADataDestroyer OUT");
}
+#ifdef SINGLE_THREAD
static void CAProcessReceivedData(CAData_t *data)
{
OIC_LOG(DEBUG, TAG, "CAProcessReceivedData IN");
g_errorHandler(rep, data->errorInfo);
}
-
-#ifdef SINGLE_THREAD
CADataDestroyer(data, sizeof(CAData_t));
-#endif
OIC_LOG(DEBUG, TAG, "CAProcessReceivedData OUT");
}
+#endif
#ifndef SINGLE_THREAD
// For details on compatibility and glibc support,
// Refer http://www.gnu.org/software/libc/manual/html_node/BSD-Random.html
#define _DEFAULT_SOURCE
-#define _BSD_SOURCE
#include <stdio.h>
#include <stdlib.h>
// For details on compatibility and glibc support,
// Refer http://www.gnu.org/software/libc/manual/html_node/BSD-Random.html
#define _DEFAULT_SOURCE
-#define _BSD_SOURCE
// Defining _POSIX_C_SOURCE macro with 199309L (or greater) as value
// causes header files to expose definitions
, CA_ADAPTER_REMOTE_ACCESS
#endif
};
- const char * connTypes[] = {"ip" , "ble", "edr"
- #ifdef RA_ADAPTER
- , "ra"
- #endif
- };
+
int size = sizeof(CAConnTypes)/ sizeof(CATransportAdapter_t);
CATransportAdapter_t adapter = responseEndpoint.adapter;