You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/02/21 08:36:02 UTC
[GitHub] [incubator-nuttx] no1wudi opened a new pull request #5572: vncserver: Corret size calculation of rfb_setencodings_s
no1wudi opened a new pull request #5572:
URL: https://github.com/apache/incubator-nuttx/pull/5572
## Summary
Fix
```
video/vnc/vnc_negotiate.c:426:29: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
DEBUGASSERT(nrecvd >= SIZEOF_RFB_SETENCODINGS_S(0));
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/huang/Work/nx/nuttx/include/nuttx/video/rfb.h:359:51: note: expanded from macro 'SIZEOF_RFB_SETENCODINGS_S'
(sizeof(struct rfb_setencodings_s) + (((n) - 1) << 2))
^
/home/huang/Work/nx/nuttx/include/assert.h:56:33: note: expanded from macro 'DEBUGASSERT'
~~~~~~~^~
/home/huang/Work/nx/nuttx/include/assert.h:51:37: note: expanded from macro 'ASSERT'
```
## Impact
VNC Server
## Testing
sim:vncserver
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #5572: vncserver: Corret size calculation of rfb_setencodings_s
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #5572:
URL: https://github.com/apache/incubator-nuttx/pull/5572#issuecomment-1047009248
@no1wudi please rebase your patch to the latest.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] no1wudi commented on pull request #5572: vncserver: Corret size calculation of rfb_setencodings_s
Posted by GitBox <gi...@apache.org>.
no1wudi commented on pull request #5572:
URL: https://github.com/apache/incubator-nuttx/pull/5572#issuecomment-1046611581
Fixed a typo in commit message.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5572: vncserver: Corret size calculation of rfb_setencodings_s
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5572:
URL: https://github.com/apache/incubator-nuttx/pull/5572#discussion_r810991624
##########
File path: include/nuttx/video/rfb.h
##########
@@ -356,7 +356,7 @@ struct rfb_setencodings_s
};
#define SIZEOF_RFB_SETENCODINGS_S(n) \
- (sizeof(struct rfb_setencodings_s) + (((n) - 1) << 2))
+ (sizeof(struct rfb_setencodings_s) + (n == 0 ? -4 : (n - 1) << 2))
Review comment:
```suggestion
(sizeof(struct rfb_setencodings_s) + ((n) == 0 ? -4 : ((n) - 1) << 2))
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #5572: vncserver: Corret size calculation of rfb_setencodings_s
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #5572:
URL: https://github.com/apache/incubator-nuttx/pull/5572
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5572: vncserver: Corret size calculation of rfb_setencodings_s
Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5572:
URL: https://github.com/apache/incubator-nuttx/pull/5572#discussion_r810903081
##########
File path: include/nuttx/video/rfb.h
##########
@@ -356,7 +356,7 @@ struct rfb_setencodings_s
};
#define SIZEOF_RFB_SETENCODINGS_S(n) \
- (sizeof(struct rfb_setencodings_s) + (((n) - 1) << 2))
+ (sizeof(struct rfb_setencodings_s) + (n == 0 ? -4 : (n - 1) << 2))
Review comment:
Just as an alternative, but will require `#include <nuttx/compiler.h>`
```suggestion
(offsetof(struct rfb_setencodings_s, encodings) + ((n) << 2))
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org