sys/cbor: change array initializer from const variable to #define
OS X clang complains "folded to constant array as an extension" [-Wgnu-folding-constant]
This commit is contained in:
parent
be8f63769c
commit
e93fd66dbb
@ -81,6 +81,9 @@
|
|||||||
/* Extra defines not related to the protocol itself */
|
/* Extra defines not related to the protocol itself */
|
||||||
#define CBOR_STREAM_PRINT_BUFFERSIZE 1024 /* bytes */
|
#define CBOR_STREAM_PRINT_BUFFERSIZE 1024 /* bytes */
|
||||||
|
|
||||||
|
/* Array size */
|
||||||
|
#define MAX_TIMESTRING_LENGTH (21)
|
||||||
|
|
||||||
#ifndef INFINITY
|
#ifndef INFINITY
|
||||||
#define INFINITY (1.0/0.0)
|
#define INFINITY (1.0/0.0)
|
||||||
#endif
|
#endif
|
||||||
@ -694,7 +697,6 @@ size_t cbor_deserialize_date_time(const cbor_stream_t *stream, size_t offset, st
|
|||||||
|
|
||||||
size_t cbor_serialize_date_time(cbor_stream_t *stream, struct tm *val)
|
size_t cbor_serialize_date_time(cbor_stream_t *stream, struct tm *val)
|
||||||
{
|
{
|
||||||
static const int MAX_TIMESTRING_LENGTH = 21;
|
|
||||||
CBOR_ENSURE_SIZE(stream, MAX_TIMESTRING_LENGTH + 1); /* + 1 tag byte */
|
CBOR_ENSURE_SIZE(stream, MAX_TIMESTRING_LENGTH + 1); /* + 1 tag byte */
|
||||||
|
|
||||||
char time_str[MAX_TIMESTRING_LENGTH];
|
char time_str[MAX_TIMESTRING_LENGTH];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user