Skip to content

Commit

Permalink
merge from dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurence Lundblade committed Nov 22, 2024
2 parents a388df3 + 82634b6 commit c2022bd
Show file tree
Hide file tree
Showing 8 changed files with 306 additions and 245 deletions.
38 changes: 20 additions & 18 deletions inc/qcbor/qcbor_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,25 @@ typedef enum {
* occurred in the decode input. */
QCBOR_ERR_TAGS_DISABLED = 51,

// TODO: maybe reduce number of conformance codes to not use up unrecoverable errors

/** Decoded CBOR is does not conform to preferred serialization. The CBOR head's argument is not encoded in shortest form, or indefinite lengths are used.*/
QCBOR_ERR_PREFERRED_CONFORMANCE = 52,

/** Decoded CBOR does not conform to CDE. This occurs when a map is not sorted. Other
* CDE issues are reported as QCBOR_ERR_PREFERRED_CONFORMANCE. */
QCBOR_ERR_CDE_CONFORMANCE = 53,

/** Decoded CBOR does not conform to dCBOR. Floating point numbers are not reduced to integers.
* Other issues are reported as either QCBOR_ERR_CDE_CONFORMANCE or QCBOR_ERR_PREFERRED_CONFORMANCE. */
QCBOR_ERR_DCBOR_CONFORMANCE = 54,

/** A map is unsorted and should be for CDE or dCBOR. */
QCBOR_ERR_UNSORTED = 55,

/** Conformance checking requested, preferred serialization disabled, float in the input. */
QCBOR_ERR_CANT_CHECK_FLOAT_CONFORMANCE = 56,

#define QCBOR_END_OF_UNRECOVERABLE_DECODE_ERRORS 59

/** More than @ref QCBOR_MAX_TAGS_PER_ITEM tags encountered for a
Expand Down Expand Up @@ -530,7 +549,7 @@ typedef enum {
/** Attempt to output non-preferred, non-CDE or non-dCBOR when not
* allowed by mode. See QCBOREncode_SerializationPreferred(),
* QCBOREncode_SerializationCDE(),
* QCBOREncode_SerializationdCBOR().
* QCBOREncode_SerializationdCBOR() and @ref QCBOR_ENCODE_CONFIG_DISALLOW_NON_PREFERRED_NUMBERS.
*/
QCBOR_ERR_NOT_PREFERRED = 79,

Expand All @@ -544,23 +563,6 @@ typedef enum {
* a @ref QCBORStringAllocate. */
QCBOR_ERR_CANNOT_ENTER_ALLOCATED_STRING = 81,

/** Decoded CBOR is does not conform to preferred serialization. The CBOR head's argument is not encoded in shortest form, or indefinite lengths are used.*/
QCBOR_ERR_PREFERRED_CONFORMANCE = 82,

/** Decoded CBOR does not conform to CDE. This occurs when a map is not sorted. Other
* CDE issues are reported as QCBOR_ERR_PREFERRED_CONFORMANCE. */
QCBOR_ERR_CDE_CONFORMANCE = 83,

/** Decoded CBOR does not conform to dCBOR. Floating point numbers are not reduced to integers.
* Other issues are reported as either QCBOR_ERR_CDE_CONFORMANCE or QCBOR_ERR_PREFERRED_CONFORMANCE. */
QCBOR_ERR_DCBOR_CONFORMANCE = 84,

/** A map is unsorted and should be for CDE or dCBOR. */
QCBOR_ERR_UNSORTED = 85,

/** Conformance checking requested, preferred serialization disabled, float in the input. */
QCBOR_ERR_CANT_CHECK_FLOAT_CONFORMANCE = 86,

/* Can't output a negative zero big num */
QCBOR_ERR_NO_NEGATIVE_ZERO = 87,

Expand Down
3 changes: 1 addition & 2 deletions inc/qcbor/qcbor_decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -1004,8 +1004,7 @@ QCBORDecode_SetUpAllocator(QCBORDecodeContext *pCtx,
* configured to handle indefinite-length strings as other than
* that, this implementation does no dynamic memory allocation.
*
* | Error | Description |
* | ---- | ---- |
* x
* | __Not well-formed errors__ ||
* | @ref QCBOR_ERR_HIT_END | Partial data item; need more input bytes to complete decoding |
* | @ref QCBOR_ERR_UNSUPPORTED | Input contains CBOR with reserved additional info values |
Expand Down
Loading

0 comments on commit c2022bd

Please sign in to comment.