utzig commented on a change in pull request #112:
URL: https://github.com/apache/mynewt-mcumgr/pull/112#discussion_r576426576



##########
File path: cborattr/src/cborattr.c
##########
@@ -67,6 +67,11 @@ valid_attr_type(CborType ct, CborAttrType at)
         }
        break;
 #if FLOAT_SUPPORT
+    case CborAttrHalfFloatType:
+        if (ct == CborHalfFloatType) {
+            return 1;
+        }
+        break;

Review comment:
       Since you are representing a half-float using an integer type, are you 
sure you need to add it under `FLOAT_SUPPORT`?

##########
File path: cborattr/include/cborattr/cborattr.h
##########
@@ -85,6 +86,9 @@ struct cbor_array_t {
         struct {
             double *store;
         } reals;
+        struct{
+            int *store;
+        } halffloats;

Review comment:
       I never used a half-float before, but I'd assume it is 16-bit long (half 
a float!), so why use `int` instead of `uint16_t`?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to