pkarashchenko commented on code in PR #6482: URL: https://github.com/apache/incubator-nuttx/pull/6482#discussion_r905307132
########## libs/libc/string/lib_ffsll.c: ########## @@ -57,10 +57,12 @@ int ffsll(long long j) if (j != 0) { -#ifdef CONFIG_HAVE_BUILTIN_CTZ +#ifdef CONFIG_HAVE_BUILTIN_FFSLL + ret = __builtin_ffs(j); Review Comment: Should it be ``` ret = __builtin_ffsll(j); ``` ? ########## libs/libc/string/lib_ffsl.c: ########## @@ -48,14 +48,15 @@ * 0, then ffsl() will return 0. * ****************************************************************************/ - int ffsl(long j) { int ret = 0; if (j != 0) { -#ifdef CONFIG_HAVE_BUILTIN_CTZ +#ifdef CONFIG_HAVE_BUILTIN_FFSL + ret = __builtin_ffs(j); Review Comment: Should it be ``` ret = __builtin_ffsl(j); ``` ? ########## include/nuttx/compiler.h: ########## @@ -61,6 +61,14 @@ # define CONFIG_C99_BOOL 1 #endif +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +# define CONFIG_C11_BOOL 1 Review Comment: Where is it used? ########## include/nuttx/compiler.h: ########## @@ -61,6 +61,14 @@ # define CONFIG_C99_BOOL 1 #endif +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +# define CONFIG_C11_BOOL 1 +#endif + +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201710L +# define CONFIG_C17_BOOL 1 Review Comment: Where is it used? ########## include/netinet/in.h: ########## @@ -217,26 +217,14 @@ /* 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) +# define HTONS(ns) (ns) +# define HTONL(nl) (nl) #else -# define HTONS(ns) \ - (unsigned short) \ - (((((unsigned short)(ns)) & 0x00ff) << 8) | \ - ((((unsigned short)(ns)) >> 8) & 0x00ff)) -# 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)) +# define HTONS(ns) (__swap_uint16(ns)) +# define HTONL(nl) (__swap_uint32(nl)) Review Comment: ```suggestion # define HTONS(ns) __swap_uint16(ns) # define HTONL(nl) __swap_uint32(nl) ``` Or ```suggestion # define HTONS __swap_uint16 # define HTONL __swap_uint32 ``` -- 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