xiaoxiang781216 commented on code in PR #7468:
URL: https://github.com/apache/incubator-nuttx/pull/7468#discussion_r1008792515


##########
include/endian.h:
##########
@@ -52,36 +52,36 @@
 /* Common byte swapping macros */
 
 #ifdef CONFIG_HAVE_BUILTIN_BSWAP16
-#  define __swap_uint16 __builtin_bswap16
+#  define __swap_uint16(n) ((uint16_t)__builtin_bswap16(n))
 #else
 #  define __swap_uint16(n) \
-    (uint16_t)(((((uint16_t)(n)) & 0x00ff) << 8) | \
-               ((((uint16_t)(n)) >> 8) & 0x00ff))
+    ((uint16_t)(((((uint16_t)(n)) & 0x00ff) << 8) | \
+                ((((uint16_t)(n)) >> 8) & 0x00ff)))
 #endif
 
 #ifdef CONFIG_HAVE_BUILTIN_BSWAP32
-#  define __swap_uint32 __builtin_bswap32
+#  define __swap_uint32(n) ((uint32_t)__builtin_bswap32(n))

Review Comment:
   Done.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to