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 2020/03/30 15:33:00 UTC

[GitHub] [incubator-nuttx-apps] Ouss4 opened a new pull request #152: examples/tcpblaster: When a host PC is used, take its implementation of hton/ntoh functions.

Ouss4 opened a new pull request #152: examples/tcpblaster: When a host PC is used, take its implementation of hton/ntoh functions.
URL: https://github.com/apache/incubator-nuttx-apps/pull/152
 
 
   @yamt This should address #150 
   Please take a look.

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] Ouss4 commented on a change in pull request #152: examples/tcpblaster: When a host PC is used, take its implementation of hton/ntoh functions.

Posted by GitBox <gi...@apache.org>.
Ouss4 commented on a change in pull request #152: examples/tcpblaster: When a host PC is used, take its implementation of hton/ntoh functions.
URL: https://github.com/apache/incubator-nuttx-apps/pull/152#discussion_r400294932
 
 

 ##########
 File path: examples/tcpblaster/tcpblaster.h
 ##########
 @@ -52,33 +52,17 @@
  ****************************************************************************/
 
 #ifdef TCPBLASTER_HOST
-#undef HTONS
-#ifdef CONFIG_ENDIAN_BIG
-#  define HTONS(ns) (ns)
-#else
-#  define HTONS(ns) \
-     (unsigned short) \
-       (((((unsigned short)(ns)) & 0x00ff) << 8) | \
-        ((((unsigned short)(ns)) >> 8) & 0x00ff))
-#endif
-
-#undef HTONL
-#ifdef CONFIG_ENDIAN_BIG
-#  define HTONL(nl) (nl)
-#else
-#  define HTONL(nl) \
-     (unsigned long) \
-       (((((unsigned long)(nl)) & 0x000000ffUL) << 24) | \
-        ((((unsigned long)(nl)) & 0x0000ff00UL) <<  8) | \
-        ((((unsigned long)(nl)) & 0x00ff0000UL) >>  8) | \
-        ((((unsigned long)(nl)) & 0xff000000UL) >> 24))
-#endif
+/* HTONS/L macros are unique to uIP */
 
 Review comment:
   I copied it from the UDP one.
   Fixed now.

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 merged pull request #152: examples/tcpblaster: When a host PC is used, take its implementation of hton/ntoh functions.

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #152: examples/tcpblaster: When a host PC is used, take its implementation of hton/ntoh functions.
URL: https://github.com/apache/incubator-nuttx-apps/pull/152
 
 
   

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] yamt commented on issue #152: examples/tcpblaster: When a host PC is used, take its implementation of hton/ntoh functions.

Posted by GitBox <gi...@apache.org>.
yamt commented on issue #152: examples/tcpblaster: When a host PC is used, take its implementation of hton/ntoh functions.
URL: https://github.com/apache/incubator-nuttx-apps/pull/152#issuecomment-606351843
 
 
   lgtm. thank you.

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


With regards,
Apache Git Services

[GitHub] [incubator-nuttx-apps] patacongo commented on a change in pull request #152: examples/tcpblaster: When a host PC is used, take its implementation of hton/ntoh functions.

Posted by GitBox <gi...@apache.org>.
patacongo commented on a change in pull request #152: examples/tcpblaster: When a host PC is used, take its implementation of hton/ntoh functions.
URL: https://github.com/apache/incubator-nuttx-apps/pull/152#discussion_r400293029
 
 

 ##########
 File path: examples/tcpblaster/tcpblaster.h
 ##########
 @@ -52,33 +52,17 @@
  ****************************************************************************/
 
 #ifdef TCPBLASTER_HOST
-#undef HTONS
-#ifdef CONFIG_ENDIAN_BIG
-#  define HTONS(ns) (ns)
-#else
-#  define HTONS(ns) \
-     (unsigned short) \
-       (((((unsigned short)(ns)) & 0x00ff) << 8) | \
-        ((((unsigned short)(ns)) >> 8) & 0x00ff))
-#endif
-
-#undef HTONL
-#ifdef CONFIG_ENDIAN_BIG
-#  define HTONL(nl) (nl)
-#else
-#  define HTONL(nl) \
-     (unsigned long) \
-       (((((unsigned long)(nl)) & 0x000000ffUL) << 24) | \
-        ((((unsigned long)(nl)) & 0x0000ff00UL) <<  8) | \
-        ((((unsigned long)(nl)) & 0x00ff0000UL) >>  8) | \
-        ((((unsigned long)(nl)) & 0xff000000UL) >> 24))
-#endif
+/* HTONS/L macros are unique to uIP */
 
 Review comment:
   It is kind of weird to be calling these uIP macros.  Yes, a dozen years ago some parts of the network came from uIP.  But I think "HTONS/L macros unique to NuttX" would be more relevant today.

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


With regards,
Apache Git Services