pkarashchenko commented on code in PR #6482:
URL: https://github.com/apache/incubator-nuttx/pull/6482#discussion_r903389057


##########
include/netinet/in.h:
##########
@@ -217,26 +217,16 @@
 /* This macro to convert a 16/32-bit constant values quantity from host byte
  * order to network byte order.  The 16-bit version of this macro is required
  * for uIP:
- *
- *   Author Adam Dunkels <a...@dunkels.com>
- *   Copyright (c) 2001-2003, Adam Dunkels.
- *   All rights reserved.
  */
 
 #ifdef CONFIG_ENDIAN_BIG
 # define HTONS(ns) (ns)
 # define HTONL(nl) (nl)
+#elif defined (CONFIG_ENDIAN_LITTLE)
+# define HTONS(ns) ((uint16_t)__swap_uint16(((uint16_t) (ns))))
+# define HTONL(nl) ((uint32_t)__swap_uint32(((uint32_t) (nl))))

Review Comment:
   ```suggestion
   #  define HTONS(ns) (__swap_uint16(ns))
   #  define HTONL(nl) (__swap_uint32(nl))
   ```



-- 
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-unsubscr...@nuttx.apache.org

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

Reply via email to