Add casts to macros
Fixes for a number of warnings on Windows after the update
of the rep macros. Windows issues warnings when comparing
addresses of string constants.
Tested-by: IoTivity Jenkins
@@ -59,7 +59,7 @@ int oc_rep_finalize(void);
#define oc_rep_set_text_string(object, key, value) \
do { \
- if (value != NULL) { \
+ if ((const char *)value != NULL) { \
g_err |= cbor_encode_text_string(&object##_map, #key, strlen(#key)); \
g_err |= cbor_encode_text_string(&object##_map, value, strlen(value)); \
} \
@@ -96,11 +96,11 @@ int oc_rep_finalize(void);
g_err |= cbor_encoder_close_container(&g_encoder, &root_map)
#define oc_rep_add_byte_string(parent, value) \
- if (value != NULL) \
+ if ((const char *)value != NULL) \
g_err |= cbor_encode_byte_string(&parent##_array, value, strlen(value))
#define oc_rep_add_text_string(parent, value) \
- if (value != NULL) \
+ if ((const char *)value != NULL) \
g_err |= cbor_encode_text_string(&parent##_array, value, strlen(value))
#define oc_rep_add_double(parent, value) \
@@ -113,7 +113,7 @@ int oc_rep_finalize(void);
g_err |= cbor_encode_boolean(&parent##_array, value)
#define oc_rep_set_key(parent, key) \
- if (key != NULL) \
+ if ((const char *)key != NULL) \
g_err |= cbor_encode_text_string(&parent, key, strlen(key))
#define oc_rep_set_array(object, key) \
