ccollins476ad commented on a change in pull request #2180: sys/config: Support 
for unsigned integer types
URL: https://github.com/apache/mynewt-core/pull/2180#discussion_r378422805
 
 

 ##########
 File path: sys/config/src/config.c
 ##########
 @@ -252,6 +283,21 @@ conf_str_from_value(enum conf_type type, void *vp, char 
*buf, int buf_len)
     case CONF_INT64:
         snprintf(buf, buf_len, "%lld", *(long long *)vp);
         return buf;
+    case CONF_UINT8:
+    case CONF_UINT16:
+    case CONF_UINT32:
+        if (type == CONF_UINT8) {
+            uval = *(uint8_t *)vp;
+        } else if (type == CONF_UINT16) {
+            uval = *(uint16_t *)vp;
+        } else {
+            uval = *(uint32_t *)vp;
+        }
+        snprintf(buf, buf_len, "%lu", (unsigned long)uval);
+        return buf;
+    case CONF_UINT64:
+        snprintf(buf, buf_len, "%llu", *(unsigned long long *)vp);
 
 Review comment:
   Thanks, I agree here too.  I would rather not change the old code and risk 
breaking something.  And I don't change the old code, I think it is best to 
keep the new code consistent with the old.

----------------------------------------------------------------
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


With regards,
Apache Git Services

Reply via email to