diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2018-09-20 20:30:46 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2019-04-08 20:12:35 +0000 |
commit | c2a1360b3f0aa33d00882bd6cc4b1990c18e04b8 (patch) | |
tree | 0b48a972a88c746b627d68b9074cf071d6d028c2 /src/3rdparty/tinycbor/src/cbor.h | |
parent | f7949df24319cda7363aed354ca6d60dc6512788 (diff) |
Update TinyCBOR with bugfixes
Updated to https://github.com/thiagomacieira/tinycbor commit
ac9369d8ec8511bc7516266ae6b07f7da860c954.
Fabrice Fontaine (1):
fix undefined encode_half in json2cbor
Pedro Oliveira (1):
Fixed minor error in the example code.
Svyatoslav Phirsov (2):
Typo fixed in stdlib fread(...) usage
typo in dumprecursive return type
Thiago Macieira (9):
Install the tinycbor-version.h header.
Update version number for a possible but unlikely 0.5.3 release
Fix #137: off-by-one error in UTF-8 decoding
Update Travis CI to Ubuntu Xenial
Pretty: fix use of uninitialised variable
Validation: fix out-of-bounds access when content ends in a string
Parser: apply the same memory-check update
Tests: remove useless comment
Tests: Catch an earlier QCOMPARE failure in compare()
phirsov (6):
Fix off-by-one causing buffer overflow in open_memstream
Protect macro argument expansion using parentheses
eliminating misleading messages in case .config file not yet created
Run check silently in Travis
Make AppVeyor test suit run silent as in Travis
enhancement #149 implemented: access half-precision floating point data as single float
Change-Id: I9e3d261ad9bf41cfb2b6fffd159088f1cc9b3b02
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/3rdparty/tinycbor/src/cbor.h')
-rw-r--r-- | src/3rdparty/tinycbor/src/cbor.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/3rdparty/tinycbor/src/cbor.h b/src/3rdparty/tinycbor/src/cbor.h index 5c7ba74e39..3672bd0d98 100644 --- a/src/3rdparty/tinycbor/src/cbor.h +++ b/src/3rdparty/tinycbor/src/cbor.h @@ -257,6 +257,7 @@ CBOR_INLINE_API CborError cbor_encode_undefined(CborEncoder *encoder) CBOR_INLINE_API CborError cbor_encode_half_float(CborEncoder *encoder, const void *value) { return cbor_encode_floating_point(encoder, CborHalfFloatType, value); } +CBOR_API CborError cbor_encode_float_as_half_float(CborEncoder *encoder, float value); CBOR_INLINE_API CborError cbor_encode_float(CborEncoder *encoder, float value) { return cbor_encode_floating_point(encoder, CborFloatType, &value); } CBOR_INLINE_API CborError cbor_encode_double(CborEncoder *encoder, double value) @@ -593,12 +594,13 @@ CBOR_API CborError cbor_value_map_find_value(const CborValue *map, const char *s /* Floating point */ CBOR_INLINE_API bool cbor_value_is_half_float(const CborValue *value) { return value->type == CborHalfFloatType; } +CBOR_API CborError cbor_value_get_half_float_as_float(const CborValue *value, float *result); CBOR_INLINE_API CborError cbor_value_get_half_float(const CborValue *value, void *result) { assert(cbor_value_is_half_float(value)); assert((value->flags & CborIteratorFlag_IntegerValueTooLarge) == 0); - /* size has been computed already */ + /* size has already been computed */ memcpy(result, &value->extra, sizeof(value->extra)); return CborNoError; } |