summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/tinycbor/src/cbor.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/tinycbor/src/cbor.h')
-rw-r--r--src/3rdparty/tinycbor/src/cbor.h4
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;
}