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/06/03 14:35:09 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6351: arch: Define WCHAR_[MIN|MAX] in arch/include/limits.h

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


##########
arch/z80/include/ez80/limits.h:
##########
@@ -67,17 +67,28 @@
 
 #define PTR_MIN     (-PTR_MAX - 1)
 #ifdef CONFIG_EZ80_Z80MODE
-#define PTR_MAX     32767
-#define UPTR_MAX    65535U
+#  define PTR_MAX   32767
+#  define UPTR_MAX  65535U
 #else
-#define PTR_MAX     8388607
-#define UPTR_MAX    16777215U
+#  define PTR_MAX   8388607
+#  define UPTR_MAX  16777215U
 #endif
 
 #ifdef __clang__
-#define LLONG_MIN       (-LLONG_MAX - 1)
-#define LLONG_MAX       9223372036854775807LL
-#define ULLONG_MAX      18446744073709551615ULL
+#  define LLONG_MIN  (-LLONG_MAX - 1)

Review Comment:
   Just wondering. So there is not LLONG in case of non-clang?



##########
arch/risc-v/include/limits.h:
##########
@@ -55,37 +55,44 @@
 /* These change on 32-bit and 64-bit platforms */
 
 #if defined(CONFIG_ARCH_RV32)
+#  define LONG_MIN  (-LONG_MAX - 1)
+#  define LONG_MAX  2147483647L
+#  define ULONG_MAX 4294967295UL
 
-#define LONG_MIN    (-LONG_MAX - 1)
-#define LONG_MAX    2147483647L
-#define ULONG_MAX   4294967295UL
-
-#define LLONG_MIN   (-LLONG_MAX - 1)
-#define LLONG_MAX   9223372036854775807LL
-#define ULLONG_MAX  18446744073709551615ULL
+#  define LLONG_MIN  (-LLONG_MAX - 1)
+#  define LLONG_MAX  9223372036854775807LL
+#  define ULLONG_MAX 18446744073709551615ULL
 
 /* A pointer is 4 bytes */
 
-#define PTR_MIN     (-PTR_MAX - 1)
-#define PTR_MAX     2147483647
-#define UPTR_MAX    4294967295U
-
+#  define PTR_MIN   (-PTR_MAX - 1)
+#  define PTR_MAX   2147483647
+#  define UPTR_MAX  4294967295U
 #endif /* defined(CONFIG_ARCH_RV32) */
 
 #if defined(CONFIG_ARCH_RV64)

Review Comment:
   Not a big deal, but possibly we can re-arrange this to follow style like in
   ```
   #ifdef CONFIG_ARCH_RV64
   typedef signed int         _int32_t;
   typedef unsigned int       _uint32_t;
   
   typedef signed long        _int64_t;
   typedef unsigned long      _uint64_t;
   #else /* CONFIG_ARCH_RV64 */
   typedef signed long        _int32_t;
   typedef unsigned long      _uint32_t;
   
   typedef signed long long   _int64_t;
   typedef unsigned long long _uint64_t;
   #endif /* CONFIG_ARCH_RV64 */
   ```
   instead of two separate `#if` cases.
   Please feedback if you will do it or not



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