]> Kevux Git Server - fll/commitdiff
Bugfix: The f_int_128_t is using incorrect size and change f_int_128_t to f_int128_t.
authorKevin Day <thekevinday@gmail.com>
Sat, 14 Jan 2023 06:50:25 +0000 (00:50 -0600)
committerKevin Day <thekevinday@gmail.com>
Sat, 14 Jan 2023 06:50:25 +0000 (00:50 -0600)
The wrong wrapping define macros are being used.
- Use __SIZEOF_INT128__ instead of _di_f_int_128_t_.
- Use #ifdef instead of #ifndef.

Use f_int128_t to more closely match core types like int64_t.

level_0/f_print/c/print/common.h
level_0/f_type/c/type.h
level_1/fl_print/c/print.h
level_1/fl_print/c/private-print.c

index 84b42b5e4ea39d2e4ae3b3759713dcd89a31fbd7..d84329b3cdb3b3ede71f22438326c3f3fffeaedb 100644 (file)
@@ -332,7 +332,7 @@ extern "C" {
  *   - signed_16:                "ii", "II",   Type is a int16_t digit.
  *   - signed_32:                "i", "I",     Type is a int32_t digit.
  *   - signed_64:                "il", "IL",   Type is a signed int64_t digit.
- *   - signed_128:               "ill", "ILL", Type is a f_int_128_t digit.
+ *   - signed_128:               "ill", "ILL", Type is a f_int128_t digit.
  *   - number:                   "in", "IN",   Type is a f_number_signed_t digit.
  *   - size:                     "z", "Z",     Type is a size_t digit.
  *   - string:                   "s",          Type is a NULL terminated string, where the string is printed as-is.
@@ -345,7 +345,7 @@ extern "C" {
  *   - unsigned_16:              "ui", "UI",   Type is a uint16_t digit.
  *   - unsigned_32:              "u", "U",     Type is a uint32_t digit.
  *   - unsigned_64:              "ul", "UL",   Type is a uint64_t digit.
- *   - unsigned_128:             "ull", "ULL", Type is a f_uint_128_t digit.
+ *   - unsigned_128:             "ull", "ULL", Type is a f_uint128_t digit.
  *   - unsigned_number:          "un", "UN",   Type is a f_number_unsigned_t digit (which by default is what f_array_length_t is a type of).
  *
  * @see fprintf()
index 9126b303414adde96b74e56f8f5f1b813e1fa6bc..3e0d7c80b28f36bc3ad66a4169bfa8db5d0348fb 100644 (file)
@@ -147,15 +147,15 @@ extern "C" {
  * This should work in GCC, but other compilers this may not be available.
  * When not supported, these will fallback to 64-bit.
  */
-#ifndef _di_f_int_128_t_
+#ifndef _di_f_int128_t_
   #ifdef __SIZEOF_INT128__
-    typedef __int128_t  f_int_128_t;
-    typedef __uint128_t f_uint_128_t;
+    typedef __int128_t  f_int128_t;
+    typedef __uint128_t f_uint128_t;
   #else
-    typedef int64_t  f_int_128_t;
-    typedef uint64_t f_uint_128_t;
+    typedef int64_t  f_int128_t;
+    typedef uint64_t f_uint128_t;
   #endif // __SIZEOF_INT128__
-#endif // _di_f_int_128_t_
+#endif // _di_f_int128_t_
 
 /**
  * Defines the maximum size to be supported.
@@ -188,7 +188,7 @@ extern "C" {
   #define F_type_size_64_positive_d 0x7ffffffffffffffe
   #define F_type_size_64_unsigned_d 0xfffffffffffffffe
 
-  #ifndef _di_f_int_128_t_
+  #ifdef __SIZEOF_INT128__
     #define F_type_size_128_negative_d 0x7fffffffffffffffffffffff
     #define F_type_size_128_positive_d 0x7ffffffffffffffffffffffe
     #define F_type_size_128_unsigned_d 0xfffffffffffffffffffffffe
@@ -196,7 +196,7 @@ extern "C" {
     #define F_type_size_128_negative_d F_type_size_64_negative_d
     #define F_type_size_128_positive_d F_type_size_64_positive_d
     #define F_type_size_128_unsigned_d F_type_size_64_unsigned_d
-  #endif // _di_f_int_128_t_
+  #endif // __SIZEOF_INT128__
 
   #define F_type_size_max_8_negative_d 0x80
   #define F_type_size_max_8_positive_d 0x7f
@@ -214,7 +214,7 @@ extern "C" {
   #define F_type_size_max_64_positive_d 0x7fffffffffffffff
   #define F_type_size_max_64_unsigned_d 0xffffffffffffffff
 
-  #ifndef _di_f_int_128_t_
+  #ifdef __SIZEOF_INT128__
     #define F_type_size_max_128_negative_d 0x800000000000000000000000
     #define F_type_size_max_128_positive_d 0x7fffffffffffffffffffffff
     #define F_type_size_max_128_unsigned_d 0xffffffffffffffffffffffff
@@ -222,7 +222,7 @@ extern "C" {
     #define F_type_size_max_128_negative_d F_type_size_max_64_negative_d
     #define F_type_size_max_128_positive_d F_type_size_max_64_positive_d
     #define F_type_size_max_128_unsigned_d F_type_size_max_64_unsigned_d
-  #endif // _di_f_int_128_t_
+  #endif // __SIZEOF_INT128__
 #endif // _di_f_type_sizes_d_
 
 /**
@@ -264,8 +264,8 @@ extern "C" {
   #define F_number_t_size_max_positive_d F_type_size_max_32_positive_d
   #define F_number_t_size_max_negative_d F_type_size_max_32_negative_d
 #elif defined(_en_f_type_number_128_t_)
-  typedef f_int_128_t  f_number_signed_t;
-  typedef f_uint_128_t f_number_unsigned_t;
+  typedef f_int128_t  f_number_signed_t;
+  typedef f_uint128_t f_number_unsigned_t;
 
   #define f_number_signed_t_initialize 0
   #define f_number_unsigned_t_initialize 0
@@ -951,8 +951,7 @@ extern "C" {
  *
  * This provides the types without the normal "f_" leading prefixes to be more in line with the core types like int64_t.
  */
-#ifndef __SIZEOF_INT128__
-
+#ifdef __SIZEOF_INT128__
   #ifndef _di_f_int128_t_
     typedef __int128_t int128_t;
   #endif // _di_f_int128_t_
@@ -960,9 +959,7 @@ extern "C" {
   #ifndef _di_f_uint128_t_
     typedef __uint128_t uint128_t;
   #endif // _di_f_uint128_t_
-
 #else // __SIZEOF_INT128__
-
   #ifndef _di_f_int128_t_
     typedef int64_t int128_t;
   #endif // _di_f_int128_t_
@@ -970,7 +967,6 @@ extern "C" {
   #ifndef _di_f_uint128_t_
     typedef uint64_t uint128_t;
   #endif // _di_f_uint128_t_
-
 #endif // __SIZEOF_INT128__
 
 /**
index 2c43059eaac85a5938f95a42c6f08a50ae6720ec..ba1a581743fd3b2808c375ea44b2bada279e198c 100644 (file)
@@ -128,8 +128,8 @@ extern "C" {
  *   - "iii" "III":  Type is a int8_t digit.
  *   - "ii", "II":   Type is a int16_t digit.
  *   - "i", "I":     Type is a int32_t digit.
- *   - "il", "IL":   Type is a signed int64_t digit.
- *   - "ill", "ILL": Type is a f_int_128_t digit.
+ *   - "il", "IL":   Type is a int64_t digit.
+ *   - "ill", "ILL": Type is a f_int128_t digit.
  *   - "in", "IN":   Type is a f_number_signed_t digit.
  *   - "z", "Z":     Type is a size_t digit.
  *   - "s":          Type is a NULL terminated string, where the string is printed as-is.
@@ -142,7 +142,7 @@ extern "C" {
  *   - "ui", "UI":   Type is a uint16_t digit.
  *   - "u", "U":     Type is a uint32_t digit.
  *   - "ul", "UL":   Type is a uint64_t digit.
- *   - "ull", "ULL": Type is a f_uint_128_t digit.
+ *   - "ull", "ULL": Type is a f_uint128_t digit.
  *   - "un", "UN":   Type is a f_number_unsigned_t digit (which by default is what f_array_length_t is a type of).
  *
  * The following are control characters and their replacements for "safe" printing (unknown is used for invalid UTF-8 sequences):
index 29c28dcf4014f2e2c84189a1eaae4fe876594de2..c97eab1ec7a96544a043b435107a2ae5a62ff5ff 100644 (file)
@@ -1044,7 +1044,7 @@ extern "C" {
             *status = f_conversion_number_signed_print((f_number_signed_t) va_arg(apl, int64_t), conversion_data, file);
           }
           else if (type == f_print_format_type_signed_128_e) {
-            *status = f_conversion_number_signed_print((f_number_signed_t) va_arg(apl, f_int_128_t), conversion_data, file);
+            *status = f_conversion_number_signed_print((f_number_signed_t) va_arg(apl, f_int128_t), conversion_data, file);
           }
           else if (type == f_print_format_type_signed_number_e) {
             *status = f_conversion_number_signed_print(va_arg(apl, f_number_signed_t), conversion_data, file);
@@ -1069,7 +1069,7 @@ extern "C" {
             *status = f_conversion_number_unsigned_print((f_number_unsigned_t) va_arg(apl, uint64_t), conversion_data, file);
           }
           else if (type == f_print_format_type_unsigned_128_e) {
-            *status = f_conversion_number_unsigned_print((f_number_unsigned_t) va_arg(apl, f_uint_128_t), conversion_data, file);
+            *status = f_conversion_number_unsigned_print((f_number_unsigned_t) va_arg(apl, f_uint128_t), conversion_data, file);
           }
           else if (type == f_print_format_type_unsigned_number_e) {
             *status = f_conversion_number_unsigned_print(va_arg(apl, f_number_unsigned_t), conversion_data, file);