Skip to content

Commit

Permalink
Comments tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
PJK committed Apr 25, 2015
1 parent 2c7409a commit be53347
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/cbor.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@

#define CBOR_VERSION TO_STR(CBOR_MAJOR_VERSION) "." TO_STR(CBOR_MINOR_VERSION) "." TO_STR(CBOR_PATCH_VERSION)

/*
* TODO work around this on <=32 bit platforms - now arrays and bytestrings can
* be up to 2^64-1 items/bytes long -- how do we ensure real size won't overflow
* size_t???
*/
_Static_assert(sizeof(size_t) >= 8, "size_t must be at least 64 bits");
_Static_assert(sizeof(size_t) >= 8, "size_t must be at least 64 bits"); /* Otherwise we cannot support reasonably sized chunks */

/*
* Packed bitfield
Expand All @@ -42,7 +37,7 @@ typedef enum { /* Corresponding Major Type */
CBOR_TYPE_STRING, /* 3 */
CBOR_TYPE_ARRAY, /* 4 */
CBOR_TYPE_MAP, /* 5 */
CBOR_TYPE_TAG, /* 6 - additional semantics*/
CBOR_TYPE_TAG, /* 6 - additional semantics */
CBOR_TYPE_FLOAT_CTRL /* 7 - also bool, null, undefined, and others */
} cbor_type;

Expand All @@ -62,7 +57,7 @@ typedef enum {
} cbor_int_width;

typedef enum {
CBOR_FLOAT_0, /* Registered for internal use - breaks and such*/
CBOR_FLOAT_0, /* Registered for internal use - breaks and such */
CBOR_FLOAT_16,
CBOR_FLOAT_32,
CBOR_FLOAT_64
Expand Down
1 change: 1 addition & 0 deletions src/cbor_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ void _cbor_builder_append(cbor_item_t * item, struct _cbor_decoder_context * ctx
{
/* We use 0 and 1 subitems to distinguish between keys and values in indefinite items */
if (ctx->stack->top->subitems % 2) {
/* Odd record, this is a value */
cbor_map_handle(ctx->stack->top->item)[cbor_map_size(ctx->stack->top->item) - 1].value = item;
} else {
/* Even record, this is a key */
Expand Down

0 comments on commit be53347

Please sign in to comment.