You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2021/06/10 10:09:35 UTC

[GitHub] [mynewt-mcumgr] utzig commented on a change in pull request #123: img_mgmt: Add interpretation of "image" parameter

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



##########
File path: cmd/img_mgmt/src/img_mgmt.c
##########
@@ -394,42 +394,49 @@ img_mgmt_upload(struct mgmt_ctxt *ctxt)
         .data_len = 0,
         .data_sha_len = 0,
         .upgrade = false,
+        .image = 0,
     };
 
     const struct cbor_attr_t off_attr[] = {
         [0] = {
+            .attribute = "image",
+            .type = CborAttrUnsignedIntegerType,
+            .addr.integer = &req.image,

Review comment:
       ```
   Error: repos/apache-mynewt-mcumgr/cmd/img_mgmt/src/img_mgmt.c: In function 'img_mgmt_upload':
   repos/apache-mynewt-mcumgr/cmd/img_mgmt/src/img_mgmt.c:404:29: error: pointer targets in initialization of 'long long int *' from 'long long unsigned int *' differ in signedness [-Werror=pointer-sign]
                .addr.integer = &req.image,
                                ^
   repos/apache-mynewt-mcumgr/cmd/img_mgmt/src/img_mgmt.c:404:29: note: (near initialization for 'off_attr[0].addr.integer')
   ```
   
   When building I get this error, since you chose the type to be `CborAttrUnsignedIntegerType`, this line should read `.addr.uinteger = &req.image`, what do you think?
   
   Otherwise the PR looks good.




-- 
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:
users@infra.apache.org