From 24ebddbfc76d1ef20634d07a85eef2755796ec50 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 9 Nov 2019 22:28:28 -0600 Subject: [PATCH] Update: implement f_number_signed and f_number_unsigned, as either 32-bit, 64-bit, or 128-bit Provide the types f_number_signed and f_number_unsigned as a way to define the default "number" type to be used for string to number conversions and array indexes. By providing 32-bit, 64-bit (default), and 128-bit types, the type can then be adjusted to more easily work on limited hardware or expand to more capable hardware. This will be the recommended number data type to use in FLL functions going forward. --- level_0/f_console/c/console.h | 10 +-- level_0/f_conversion/c/conversion.c | 138 ++++++++++++++++++------------------ level_0/f_conversion/c/conversion.h | 117 ++++++++++++++++++++++-------- level_0/f_string/c/string.h | 22 +++--- level_0/f_type/c/type.h | 131 +++++++++++++++++++++++++++------- level_0/f_utf/c/utf.h | 32 +++++---- level_1/fl_console/c/console.c | 4 +- level_1/fl_console/c/console.h | 8 +-- 8 files changed, 303 insertions(+), 159 deletions(-) diff --git a/level_0/f_console/c/console.h b/level_0/f_console/c/console.h index dce50d7..537ddaa 100644 --- a/level_0/f_console/c/console.h +++ b/level_0/f_console/c/console.h @@ -104,7 +104,7 @@ extern "C" { * - other: parameters using neither minus nor plus sign, such as 'build'. */ #ifndef _di_f_console_types_ - typedef unsigned short f_console_id; + typedef uint16_t f_console_id; enum { f_console_result_none = 1, @@ -174,7 +174,8 @@ extern "C" { #ifndef _di_f_console_parameters_ typedef struct { f_console_parameter *parameter; - f_array_length used; + + f_array_length used; } f_console_parameters; #define f_console_parameters_initialize { 0, 0 } @@ -194,7 +195,8 @@ extern "C" { typedef struct { f_console_parameter_id *id; - f_array_length used; + + f_array_length used; } f_console_parameter_ids; #define f_console_parameter_ids_initialize { 0, 0 } @@ -209,7 +211,7 @@ extern "C" { */ #ifndef _di_f_console_arguments_ typedef struct { - const unsigned long argc; + const f_number_unsigned argc; const f_string *argv; } f_console_arguments; diff --git a/level_0/f_conversion/c/conversion.c b/level_0/f_conversion/c/conversion.c index bd7990c..869d489 100644 --- a/level_0/f_conversion/c/conversion.c +++ b/level_0/f_conversion/c/conversion.c @@ -74,7 +74,7 @@ extern "C" { #endif // _di_f_conversion_character_is_octal_ #ifndef _di_f_conversion_character_to_binary_ - f_return_status f_conversion_character_to_binary(const int8_t character, uint64_t *number) { + f_return_status f_conversion_character_to_binary(const int8_t character, f_number_unsigned *number) { #ifndef _di_level_0_parameter_checking_ if (number == 0) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -91,7 +91,7 @@ extern "C" { #endif // _di_f_conversion_character_to_binary_ #ifndef _di_f_conversion_character_to_decimal_ - f_return_status f_conversion_character_to_decimal(const int8_t character, uint64_t *number) { + f_return_status f_conversion_character_to_decimal(const int8_t character, f_number_unsigned *number) { #ifndef _di_level_0_parameter_checking_ if (number == 0) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -116,7 +116,7 @@ extern "C" { #endif // _di_f_conversion_character_to_decimal_ #ifndef _di_f_conversion_character_to_duodecimal_ - f_return_status f_conversion_character_to_duodecimal(const int8_t character, uint64_t *decimal) { + f_return_status f_conversion_character_to_duodecimal(const int8_t character, f_number_unsigned *decimal) { #ifndef _di_level_0_parameter_checking_ if (decimal == 0) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -145,7 +145,7 @@ extern "C" { #endif // _di_f_conversion_character_to_duodecimal_ #ifndef _di_f_conversion_character_to_hexidecimal_ - f_return_status f_conversion_character_to_hexidecimal(const int8_t character, uint64_t *decimal) { + f_return_status f_conversion_character_to_hexidecimal(const int8_t character, f_number_unsigned *decimal) { #ifndef _di_level_0_parameter_checking_ if (decimal == 0) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -182,7 +182,7 @@ extern "C" { #endif // _di_f_conversion_character_to_hexidecimal_ #ifndef _di_f_conversion_character_to_octal_ - f_return_status f_conversion_character_to_octal(const int8_t character, uint64_t *number) { + f_return_status f_conversion_character_to_octal(const int8_t character, f_number_unsigned *number) { #ifndef _di_level_0_parameter_checking_ if (number == 0) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_ @@ -205,7 +205,7 @@ extern "C" { #endif // _di_f_conversion_character_to_octal_ #ifndef _di_f_conversion_string_to_binary_signed_ - f_return_status f_conversion_string_to_binary_signed(const f_string string, int64_t *number, const f_string_location location, const bool negative) { + f_return_status f_conversion_string_to_binary_signed(const f_string string, f_number_signed *number, const f_string_location location, const bool negative) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return f_status_set_error(f_invalid_parameter); if (number == 0) return f_status_set_error(f_invalid_parameter); @@ -214,20 +214,16 @@ extern "C" { #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; - uint64_t digit = 0; - uint64_t converted = 0; + f_number_unsigned digit = 0; + f_number_unsigned converted = 0; for (f_string_length i = location.start; i <= location.stop; i++) { if (f_conversion_character_to_binary(string[i], &digit) == f_none) { if (scale) { scale++; - if (scale > 63) { - return f_status_set_error(f_overflow); - } - if (negative) { - if (scale > 63) { + if (scale > f_conversion_scale_binary_signed) { return f_status_set_error(f_underflow); } @@ -235,7 +231,7 @@ extern "C" { converted -= digit; } else { - if (scale > 63) { + if (scale > f_conversion_scale_binary_signed) { return f_status_set_error(f_overflow); } @@ -265,7 +261,7 @@ extern "C" { #endif // _di_f_conversion_string_to_binary_signed_ #ifndef _di_f_conversion_string_to_binary_unsigned_ - f_return_status f_conversion_string_to_binary_unsigned(const f_string string, uint64_t *number, const f_string_location location) { + f_return_status f_conversion_string_to_binary_unsigned(const f_string string, f_number_unsigned *number, const f_string_location location) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return f_status_set_error(f_invalid_parameter); if (number == 0) return f_status_set_error(f_invalid_parameter); @@ -274,15 +270,15 @@ extern "C" { #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; - uint64_t digit = 0; - uint64_t converted = 0; + f_number_unsigned digit = 0; + f_number_unsigned converted = 0; for (f_string_length i = location.start; i <= location.stop; i++) { if (f_conversion_character_to_binary(string[i], &digit) == f_none) { if (scale) { scale++; - if (scale > 64) { + if (scale > f_conversion_scale_binary_unsigned) { return f_status_set_error(f_overflow); } @@ -305,7 +301,7 @@ extern "C" { #endif // _di_f_conversion_string_to_binary_unsigned_ #ifndef _di_f_conversion_string_to_decimal_signed_ - f_return_status f_conversion_string_to_decimal_signed(const f_string string, int64_t *number, const f_string_location location, const bool negative) { + f_return_status f_conversion_string_to_decimal_signed(const f_string string, f_number_signed *number, const f_string_location location, const bool negative) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return f_status_set_error(f_invalid_parameter); if (number == 0) return f_status_set_error(f_invalid_parameter); @@ -314,8 +310,8 @@ extern "C" { #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; - uint64_t digit = 0; - uint64_t converted = 0; + f_number_unsigned digit = 0; + f_number_unsigned converted = 0; for (f_string_length i = location.start; i <= location.stop; i++) { if (f_conversion_character_to_decimal(string[i], &digit) == f_none) { @@ -324,8 +320,8 @@ extern "C" { scale++; if (negative) { - if (scale > 18) { - if ((converted * 10) - digit < LLONG_MIN || (converted * 10) - digit > converted) { + if (scale > f_conversion_scale_decimal_signed) { + if ((converted * 10) - digit < f_type_number_size_negative || (converted * 10) - digit > converted) { return f_status_set_error(f_underflow); } } @@ -334,8 +330,8 @@ extern "C" { converted -= digit; } else { - if (scale > 18) { - if ((converted * 10) + digit > LLONG_MAX || (converted * 10) + digit < converted) { + if (scale > f_conversion_scale_decimal_signed) { + if ((converted * 10) + digit > f_type_number_size_positive || (converted * 10) + digit < converted) { return f_status_set_error(f_overflow); } } @@ -366,7 +362,7 @@ extern "C" { #endif // _di_f_conversion_string_to_decimal_signed_ #ifndef _di_f_conversion_string_to_decimal_unsigned_ - f_return_status f_conversion_string_to_decimal_unsigned(const f_string string, uint64_t *number, const f_string_location location) { + f_return_status f_conversion_string_to_decimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_location location) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return f_status_set_error(f_invalid_parameter); if (number == 0) return f_status_set_error(f_invalid_parameter); @@ -375,8 +371,8 @@ extern "C" { #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; - uint64_t digit = 0; - uint64_t converted = 0; + f_number_unsigned digit = 0; + f_number_unsigned converted = 0; for (f_string_length i = location.start; i <= location.stop; i++) { if (f_conversion_character_to_decimal(string[i], &digit) == f_none) { @@ -384,8 +380,8 @@ extern "C" { if (scale) { scale++; - if (scale > 18) { - if ((converted * 10) + digit > ULLONG_MAX || (converted * 10) + digit < converted) { + if (scale > f_conversion_scale_decimal_unsigned) { + if ((converted * 10) + digit > f_type_number_size_unsigned || (converted * 10) + digit < converted) { return f_status_set_error(f_overflow); } } @@ -409,7 +405,7 @@ extern "C" { #endif // _di_f_conversion_string_to_decimal_unsigned_ #ifndef _di_f_conversion_string_to_duodecimal_signed_ - f_return_status f_conversion_string_to_duodecimal_signed(const f_string string, int64_t *number, const f_string_location location, const bool negative) { + f_return_status f_conversion_string_to_duodecimal_signed(const f_string string, f_number_signed *number, const f_string_location location, const bool negative) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return f_status_set_error(f_invalid_parameter); if (number == 0) return f_status_set_error(f_invalid_parameter); @@ -418,8 +414,8 @@ extern "C" { #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; - uint64_t digit = 0; - uint64_t converted = 0; + f_number_unsigned digit = 0; + f_number_unsigned converted = 0; for (f_string_length i = location.start; i <= location.stop; i++) { if (f_conversion_character_to_duodecimal(string[i], &digit) == f_none) { @@ -428,8 +424,8 @@ extern "C" { scale++; if (negative) { - if (scale > 15) { - if ((converted * 12) - digit < LLONG_MIN || (converted * 12) - digit > converted) { + if (scale > f_conversion_scale_duodecimal_signed) { + if ((converted * 12) - digit < f_type_number_size_negative || (converted * 12) - digit > converted) { return f_status_set_error(f_underflow); } } @@ -438,8 +434,8 @@ extern "C" { converted -= digit; } else { - if (scale > 15) { - if ((converted * 12) + digit > LLONG_MAX || (converted * 12) + digit < converted) { + if (scale > f_conversion_scale_duodecimal_signed) { + if ((converted * 12) + digit > f_type_number_size_positive || (converted * 12) + digit < converted) { return f_status_set_error(f_overflow); } } @@ -470,7 +466,7 @@ extern "C" { #endif // _di_f_conversion_string_to_duodecimal_signed_ #ifndef _di_f_conversion_string_to_duodecimal_unsigned_ - f_return_status f_conversion_string_to_duodecimal_unsigned(const f_string string, uint64_t *number, const f_string_location location) { + f_return_status f_conversion_string_to_duodecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_location location) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return f_status_set_error(f_invalid_parameter); if (number == 0) return f_status_set_error(f_invalid_parameter); @@ -479,8 +475,8 @@ extern "C" { #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; - uint64_t digit = 0; - uint64_t converted = 0; + f_number_unsigned digit = 0; + f_number_unsigned converted = 0; for (f_string_length i = location.start; i <= location.stop; i++) { if (f_conversion_character_to_duodecimal(string[i], &digit) == f_none) { @@ -488,8 +484,8 @@ extern "C" { if (scale) { scale++; - if (scale > 16) { - if ((converted * 12) + digit > ULLONG_MAX || (converted * 12) + digit < converted) { + if (scale > f_conversion_scale_duodecimal_unsigned) { + if ((converted * 12) + digit > f_type_number_size_unsigned || (converted * 12) + digit < converted) { return f_status_set_error(f_overflow); } } @@ -513,7 +509,7 @@ extern "C" { #endif // _di_f_conversion_string_to_duodecimal_unsigned_ #ifndef _di_f_conversion_string_to_hexidecimal_signed_ - f_return_status f_conversion_string_to_hexidecimal_signed(const f_string string, int64_t *number, const f_string_location location, const bool negative) { + f_return_status f_conversion_string_to_hexidecimal_signed(const f_string string, f_number_signed *number, const f_string_location location, const bool negative) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return f_status_set_error(f_invalid_parameter); if (number == 0) return f_status_set_error(f_invalid_parameter); @@ -522,8 +518,8 @@ extern "C" { #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; - uint64_t digit = 0; - uint64_t converted = 0; + f_number_unsigned digit = 0; + f_number_unsigned converted = 0; for (f_string_length i = location.start; i <= location.stop; i++) { if (f_conversion_character_to_hexidecimal(string[i], &digit) == f_none) { @@ -532,8 +528,8 @@ extern "C" { scale++; if (negative) { - if (scale > 15) { - if ((converted << 4) - digit < LLONG_MIN || (converted << 4) - digit > converted) { + if (scale > f_conversion_scale_hexidecimal_signed) { + if ((converted << 4) - digit < f_type_number_size_negative || (converted << 4) - digit > converted) { return f_status_set_error(f_underflow); } } @@ -542,8 +538,8 @@ extern "C" { converted -= digit; } else { - if (scale > 15) { - if ((converted << 4) + digit > LLONG_MAX || (converted << 4) + digit < converted) { + if (scale > f_conversion_scale_hexidecimal_signed) { + if ((converted << 4) + digit > f_type_number_size_positive || (converted << 4) + digit < converted) { return f_status_set_error(f_overflow); } } @@ -574,7 +570,7 @@ extern "C" { #endif // _di_f_conversion_string_to_hexidecimal_signed_ #ifndef _di_f_conversion_string_to_hexidecimal_unsigned_ - f_return_status f_conversion_string_to_hexidecimal_unsigned(const f_string string, uint64_t *number, const f_string_location location) { + f_return_status f_conversion_string_to_hexidecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_location location) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return f_status_set_error(f_invalid_parameter); if (number == 0) return f_status_set_error(f_invalid_parameter); @@ -583,8 +579,8 @@ extern "C" { #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; - uint64_t digit = 0; - uint64_t converted = 0; + f_number_unsigned digit = 0; + f_number_unsigned converted = 0; for (f_string_length i = location.start; i <= location.stop; i++) { if (f_conversion_character_to_hexidecimal(string[i], &digit) == f_none) { @@ -592,8 +588,10 @@ extern "C" { if (scale) { scale++; - if (scale > 16) { - return f_status_set_error(f_overflow); + if (scale > f_conversion_scale_hexidecimal_unsigned) { + if ((converted << 4) + digit > f_type_number_size_unsigned || (converted << 4) + digit < converted) { + return f_status_set_error(f_overflow); + } } converted <<= 4; @@ -615,7 +613,7 @@ extern "C" { #endif // _di_f_conversion_string_to_hexidecimal_unsigned_ #ifndef _di_f_conversion_string_to_octal_signed_ - f_return_status f_conversion_string_to_octal_signed(const f_string string, int64_t *number, const f_string_location location, const bool negative) { + f_return_status f_conversion_string_to_octal_signed(const f_string string, f_number_signed *number, const f_string_location location, const bool negative) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return f_status_set_error(f_invalid_parameter); if (number == 0) return f_status_set_error(f_invalid_parameter); @@ -624,8 +622,8 @@ extern "C" { #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; - uint64_t digit = 0; - uint64_t converted = 0; + f_number_unsigned digit = 0; + f_number_unsigned converted = 0; for (f_string_length i = location.start; i <= location.stop; i++) { if (f_conversion_character_to_octal(string[i], &digit) == f_none) { @@ -634,8 +632,8 @@ extern "C" { scale++; if (negative) { - if (scale > 19) { - if ((converted << 3) - digit < LLONG_MIN || (converted << 3) - digit > converted) { + if (scale > f_conversion_scale_octal_signed) { + if ((converted << 3) - digit < f_type_number_size_negative || (converted << 3) - digit > converted) { return f_status_set_error(f_underflow); } } @@ -644,8 +642,8 @@ extern "C" { converted -= digit; } else { - if (scale > 19) { - if ((converted << 3) + digit > LLONG_MAX || (converted << 3) + digit < converted) { + if (scale > f_conversion_scale_octal_signed) { + if ((converted << 3) + digit > f_type_number_size_positive || (converted << 3) + digit < converted) { return f_status_set_error(f_overflow); } } @@ -676,7 +674,7 @@ extern "C" { #endif // _di_f_conversion_string_to_octal_signed_ #ifndef _di_f_conversion_string_to_octal_unsigned_ - f_return_status f_conversion_string_to_octal_unsigned(const f_string string, uint64_t *number, const f_string_location location) { + f_return_status f_conversion_string_to_octal_unsigned(const f_string string, f_number_unsigned *number, const f_string_location location) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return f_status_set_error(f_invalid_parameter); if (number == 0) return f_status_set_error(f_invalid_parameter); @@ -685,8 +683,8 @@ extern "C" { #endif // _di_level_0_parameter_checking_ uint8_t scale = 0; - uint64_t digit = 0; - uint64_t converted = 0; + f_number_unsigned digit = 0; + f_number_unsigned converted = 0; for (f_string_length i = location.start; i <= location.stop; i++) { if (f_conversion_character_to_octal(string[i], &digit) == f_none) { @@ -694,8 +692,8 @@ extern "C" { if (scale) { scale++; - if (scale > 20) { - if ((converted << 3) + digit > ULLONG_MAX || (converted << 3) + digit < converted) { + if (scale > f_conversion_scale_octal_unsigned) { + if ((converted << 3) + digit > f_type_number_size_unsigned || (converted << 3) + digit < converted) { return f_status_set_error(f_overflow); } } @@ -719,7 +717,7 @@ extern "C" { #endif // _di_f_conversion_string_to_octal_unsigned_ #ifndef _di_f_conversion_string_to_number_signed_ - f_return_status f_conversion_string_to_number_signed(const f_string string, int64_t *number, const f_string_location location) { + f_return_status f_conversion_string_to_number_signed(const f_string string, f_number_signed *number, const f_string_location location) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return f_status_set_error(f_invalid_parameter); if (number == 0) return f_status_set_error(f_invalid_parameter); @@ -832,7 +830,7 @@ extern "C" { break; } - return f_status_set_error(f_negative_number); + return f_status_set_error(f_invalid_number); } // for if (mode == 0) { @@ -864,7 +862,7 @@ extern "C" { #endif // _di_f_conversion_string_to_number_signed_ #ifndef _di_f_conversion_string_to_number_unsigned_ - f_return_status f_conversion_string_to_number_unsigned(const f_string string, uint64_t *number, const f_string_location location) { + f_return_status f_conversion_string_to_number_unsigned(const f_string string, f_number_unsigned *number, const f_string_location location) { #ifndef _di_level_0_parameter_checking_ if (string == 0) return f_status_set_error(f_invalid_parameter); if (number == 0) return f_status_set_error(f_invalid_parameter); @@ -964,7 +962,7 @@ extern "C" { break; } - return f_status_set_error(f_negative_number); + return f_status_set_error(f_invalid_number); } // for if (mode == 0) { diff --git a/level_0/f_conversion/c/conversion.h b/level_0/f_conversion/c/conversion.h index 16fac6c..a90ab8b 100644 --- a/level_0/f_conversion/c/conversion.h +++ b/level_0/f_conversion/c/conversion.h @@ -12,7 +12,6 @@ // libc includes #include -#include #include // fll-0 includes @@ -26,6 +25,64 @@ extern "C" { #endif /** + * Provide custom conversion scale limits based on selected type sizes. + * + * Utilize the f_type_number_* defines to determine the expected sizes to use for the sxcales. + * + * 64-bit is the designed default. + */ +#ifndef _di_f_type_number_64_ + #define f_conversion_scale_binary_unsigned 64 + #define f_conversion_scale_binary_signed 63 + + #define f_conversion_scale_octal_unsigned 21 + #define f_conversion_scale_octal_signed 20 + + #define f_conversion_scale_decimal_unsigned 19 + #define f_conversion_scale_decimal_signed 18 + + #define f_conversion_scale_duodecimal_unsigned 17 + #define f_conversion_scale_duodecimal_signed 17 + + #define f_conversion_scale_hexidecimal_unsigned 15 + #define f_conversion_scale_hexidecimal_signed 15 +#endif // _di_f_type_number_64_ + +#ifdef _en_f_type_number_32_ + #define f_conversion_scale_binary_unsigned 32 + #define f_conversion_scale_binary_signed 31 + + #define f_conversion_scale_octal_unsigned 10 + #define f_conversion_scale_octal_signed 10 + + #define f_conversion_scale_decimal_unsigned 9 + #define f_conversion_scale_decimal_signed 9 + + #define f_conversion_scale_duodecimal_unsigned 8 + #define f_conversion_scale_duodecimal_signed 8 + + #define f_conversion_scale_hexidecimal_unsigned 7 + #define f_conversion_scale_hexidecimal_signed 7 +#endif // _en_f_type_number_32_ + +#ifdef _en_f_type_number_128_ + #define f_conversion_scale_binary_unsigned 128 + #define f_conversion_scale_binary_signed 127 + + #define f_conversion_scale_octal_unsigned 42 + #define f_conversion_scale_octal_signed 42 + + #define f_conversion_scale_decimal_unsigned 38 + #define f_conversion_scale_decimal_signed 38 + + #define f_conversion_scale_duodecimal_unsigned 35 + #define f_conversion_scale_duodecimal_signed 35 + + #define f_conversion_scale_hexidecimal_unsigned 31 + #define f_conversion_scale_hexidecimal_signed 31 +#endif // _en_f_type_number_128_ + +/** * Convert a single character into the binary digit that it represents. * * @param character @@ -110,7 +167,7 @@ extern "C" { * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_binary_ - extern f_return_status f_conversion_character_to_binary(const int8_t character, uint64_t *number); + extern f_return_status f_conversion_character_to_binary(const int8_t character, f_number_unsigned *number); #endif // _di_f_conversion_character_to_binary_ /** @@ -128,7 +185,7 @@ extern "C" { * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_decimal_ - extern f_return_status f_conversion_character_to_decimal(const int8_t character, uint64_t *number); + extern f_return_status f_conversion_character_to_decimal(const int8_t character, f_number_unsigned *number); #endif // _di_f_conversion_character_to_decimal_ /** @@ -146,7 +203,7 @@ extern "C" { * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_duodecimal_ - extern f_return_status f_conversion_character_to_duodecimal(const int8_t character, uint64_t *number); + extern f_return_status f_conversion_character_to_duodecimal(const int8_t character, f_number_unsigned *number); #endif // _di_f_conversion_character_to_duodecimal_ /** @@ -164,7 +221,7 @@ extern "C" { * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_hexidecimal_ - extern f_return_status f_conversion_character_to_hexidecimal(const int8_t character, uint64_t *number); + extern f_return_status f_conversion_character_to_hexidecimal(const int8_t character, f_number_unsigned *number); #endif // _di_f_conversion_character_to_hexidecimal_ /** @@ -182,11 +239,11 @@ extern "C" { * f_invalid_parameter (with error bit) if a parameter is invalid. */ #ifndef _di_f_conversion_character_to_octal_ - extern f_return_status f_conversion_character_to_octal(const int8_t character, uint64_t *number); + extern f_return_status f_conversion_character_to_octal(const int8_t character, f_number_unsigned *number); #endif // _di_f_conversion_character_to_octal_ /** - * Convert a series of positive or negative binary number characters into a int64_t. + * Convert a series of positive or negative binary number characters into a f_number_signed. * * This will stop at one of the following: location.stop or a non-digit. * This will ignore NULL values. @@ -210,11 +267,11 @@ extern "C" { * f_underflow (with error bit) on integer underflow. */ #ifndef _di_f_conversion_string_to_binary_signed_ - extern f_return_status f_conversion_string_to_binary_signed(const f_string string, int64_t *number, const f_string_location location, const bool negative); + extern f_return_status f_conversion_string_to_binary_signed(const f_string string, f_number_signed *number, const f_string_location location, const bool negative); #endif // _di_f_conversion_string_to_binary_signed_ /** - * Convert a series of positive binary number characters into a uint64_t. + * Convert a series of positive binary number characters into a f_number_unsigned. * * This will stop at one of the following: location.stop or a non-digit. * This will ignore NULL values. @@ -235,11 +292,11 @@ extern "C" { * f_overflow (with error bit) on integer overflow. */ #ifndef _di_f_conversion_string_to_binary_unsigned_ - extern f_return_status f_conversion_string_to_binary_unsigned(const f_string string, uint64_t *number, const f_string_location location); + extern f_return_status f_conversion_string_to_binary_unsigned(const f_string string, f_number_unsigned *number, const f_string_location location); #endif // _di_f_conversion_string_to_binary_unsigned_ /** - * Convert a series of positive or negative decimal number characters into an int64_t. + * Convert a series of positive or negative decimal number characters into an f_number_signed. * * This will stop at one of the following: location.stop or a non-digit. * This will ignore NULL values. @@ -263,11 +320,11 @@ extern "C" { * f_underflow (with error bit) on integer underflow. */ #ifndef _di_f_conversion_string_to_decimal_signed_ - extern f_return_status f_conversion_string_to_decimal_signed(const f_string string, int64_t *number, const f_string_location location, const bool negative); + extern f_return_status f_conversion_string_to_decimal_signed(const f_string string, f_number_signed *number, const f_string_location location, const bool negative); #endif // _di_f_conversion_string_to_decimal_signed_ /** - * Convert a series of positive decimal number characters into an uint64_t. + * Convert a series of positive decimal number characters into an f_number_unsigned. * * This will stop at one of the following: location.stop or a non-digit. * This will ignore NULL values. @@ -288,11 +345,11 @@ extern "C" { * f_overflow (with error bit) on integer overflow. */ #ifndef _di_f_conversion_string_to_decimal_unsigned_ - extern f_return_status f_conversion_string_to_decimal_unsigned(const f_string string, uint64_t *number, const f_string_location location); + extern f_return_status f_conversion_string_to_decimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_location location); #endif // _di_f_conversion_string_to_decimal_unsigned_ /** - * Convert a series of positive or negative duodecimal number characters into an int64_t. + * Convert a series of positive or negative duodecimal number characters into an f_number_signed. * * This will stop at one of the following: location.stop or a non-digit. * This will ignore NULL values. @@ -316,11 +373,11 @@ extern "C" { * f_underflow (with error bit) on integer underflow. */ #ifndef _di_f_conversion_string_to_duodecimal_signed_ - extern f_return_status f_conversion_string_to_duodecimal_signed(const f_string string, int64_t *number, const f_string_location location, const bool negative); + extern f_return_status f_conversion_string_to_duodecimal_signed(const f_string string, f_number_signed *number, const f_string_location location, const bool negative); #endif // _di_f_conversion_string_to_duodecimal_signed_ /** - * Convert a series of positive duodecimal number characters into an uint64_t. + * Convert a series of positive duodecimal number characters into an f_number_unsigned. * * This will stop at one of the following: location.stop or a non-digit. * This will ignore NULL values. @@ -341,11 +398,11 @@ extern "C" { * f_overflow (with error bit) on integer overflow. */ #ifndef _di_f_conversion_string_to_duodecimal_unsigned_ - extern f_return_status f_conversion_string_to_duodecimal_unsigned(const f_string string, uint64_t *number, const f_string_location location); + extern f_return_status f_conversion_string_to_duodecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_location location); #endif // _di_f_conversion_string_to_duodecimal_unsigned_ /** - * Convert a series of positive or negative hexidecimal number characters into an int64_t. + * Convert a series of positive or negative hexidecimal number characters into an f_number_signed. * * This will stop at one of the following: location.stop or a non-digit. * This will ignore NULL values. @@ -369,11 +426,11 @@ extern "C" { * f_underflow (with error bit) on integer underflow. */ #ifndef _di_f_conversion_string_to_hexidecimal_signed_ - extern f_return_status f_conversion_string_to_hexidecimal_signed(const f_string string, int64_t *number, const f_string_location location, const bool negative); + extern f_return_status f_conversion_string_to_hexidecimal_signed(const f_string string, f_number_signed *number, const f_string_location location, const bool negative); #endif // _di_f_conversion_string_to_hexidecimal_signed_ /** - * Convert a series of positive hexidecimal number characters into an uint64_t. + * Convert a series of positive hexidecimal number characters into an f_number_unsigned. * * This will stop at one of the following: location.stop or a non-digit. * This will ignore NULL values. @@ -394,11 +451,11 @@ extern "C" { * f_overflow (with error bit) on integer overflow. */ #ifndef _di_f_conversion_string_to_hexidecimal_unsigned_ - extern f_return_status f_conversion_string_to_hexidecimal_unsigned(const f_string string, uint64_t *number, const f_string_location location); + extern f_return_status f_conversion_string_to_hexidecimal_unsigned(const f_string string, f_number_unsigned *number, const f_string_location location); #endif // _di_f_conversion_string_to_hexidecimal_unsigned_ /** - * Convert a series of positive or negative octal number characters into an int64_t. + * Convert a series of positive or negative octal number characters into an f_number_signed. * * This will stop at one of the following: location.stop or a non-digit. * This will ignore NULL values. @@ -421,11 +478,11 @@ extern "C" { * f_overflow (with error bit) on integer overflow. */ #ifndef _di_f_conversion_string_to_octal_signed_ - extern f_return_status f_conversion_string_to_octal_signed(const f_string string, int64_t *number, const f_string_location location, const bool negative); + extern f_return_status f_conversion_string_to_octal_signed(const f_string string, f_number_signed *number, const f_string_location location, const bool negative); #endif // _di_f_conversion_string_to_octal_signed_ /** - * Convert a series of positive octal number characters into an uint64_t. + * Convert a series of positive octal number characters into an f_number_unsigned. * * This will stop at one of the following: location.stop or a non-digit. * This will ignore NULL values. @@ -446,11 +503,11 @@ extern "C" { * f_overflow (with error bit) on integer overflow. */ #ifndef _di_f_conversion_string_to_octal_unsigned_ - extern f_return_status f_conversion_string_to_octal_unsigned(const f_string string, uint64_t *number, const f_string_location location); + extern f_return_status f_conversion_string_to_octal_unsigned(const f_string string, f_number_unsigned *number, const f_string_location location); #endif // _di_f_conversion_string_to_octal_unsigned_ /** - * Convert a series of positive or negative number characters into an int64_t. + * Convert a series of positive or negative number characters into an f_number_signed. * * This will stop at one of the following: location.stop or a non-digit. * This will ignore NULL values. @@ -488,11 +545,11 @@ extern "C" { * @see strtoll() */ #ifndef _di_f_conversion_string_to_number_signed_ - extern f_return_status f_conversion_string_to_number_signed(const f_string string, int64_t *number, const f_string_location location); + extern f_return_status f_conversion_string_to_number_signed(const f_string string, f_number_signed *number, const f_string_location location); #endif // _di_f_conversion_string_to_number_signed_ /** - * Convert a series of positive number characters into an uint64_t. + * Convert a series of positive number characters into an f_number_unsigned. * * This will stop at one of the following: location.stop or a non-digit. * This will ignore NULL values. @@ -531,7 +588,7 @@ extern "C" { * @see strtoull() */ #ifndef _di_f_conversion_string_to_number_unsigned_ - extern f_return_status f_conversion_string_to_number_unsigned(const f_string string, uint64_t *number, const f_string_location location); + extern f_return_status f_conversion_string_to_number_unsigned(const f_string string, f_number_unsigned *number, const f_string_location location); #endif // _di_f_conversion_string_to_number_unsigned_ #ifdef __cplusplus diff --git a/level_0/f_string/c/string.h b/level_0/f_string/c/string.h index 116965e..c03678c 100644 --- a/level_0/f_string/c/string.h +++ b/level_0/f_string/c/string.h @@ -79,7 +79,7 @@ extern "C" { #ifndef _di_f_string_ typedef char *f_string; - #define f_string_max_size f_type_size_32_signed + #define f_string_max_size f_type_number_size_unsigned #define f_string_initialize f_string_eos #define f_macro_string_new(status, string, length) status = f_memory_new((void **) & string, sizeof(f_string), length) @@ -94,7 +94,7 @@ extern "C" { #endif // _di_f_string_ #ifndef _di_f_string_length_ - typedef uint64_t f_string_length; + typedef f_number_unsigned f_string_length; #define f_string_length_printf string_format_long_integer @@ -119,8 +119,9 @@ extern "C" { #ifndef _di_f_string_lengths_ typedef struct { f_string_length *array; - f_array_length size; - f_array_length used; + + f_array_length size; + f_array_length used; } f_string_lengths; #define f_string_lengths_initialize { 0, 0, 0 } @@ -177,8 +178,9 @@ extern "C" { #ifndef _di_f_string_locations_ typedef struct { f_string_location *array; - f_array_length size; - f_array_length used; + + f_array_length size; + f_array_length used; } f_string_locations; #define f_string_locations_initialize {0, 0, 0} @@ -205,7 +207,8 @@ extern "C" { */ #ifndef _di_f_string_dynamic_ typedef struct { - f_string string; + f_string string; + f_string_length size; f_string_length used; } f_string_dynamic; @@ -264,8 +267,9 @@ extern "C" { #ifndef _di_f_string_dynamics_ typedef struct { f_string_dynamic *array; - f_string_length size; - f_string_length used; + + f_string_length size; + f_string_length used; } f_string_dynamics; #define f_string_dynamics_initialize { 0, 0, 0 } diff --git a/level_0/f_type/c/type.h b/level_0/f_type/c/type.h index 3a22311..b318f55 100644 --- a/level_0/f_type/c/type.h +++ b/level_0/f_type/c/type.h @@ -55,38 +55,119 @@ extern "C" { * * The size is to be the (max supported size - 1) such that that last number can be used for overflow operations. * + * For example, f_type_size_8_negative is 2^7, or -1 to -128, therefore the max size here is -128 - 1 or -127. + * For example, f_type_size_8_positive is 2^7, or 0 to 127, therefore the max size here is 127 - 1 or 126. * For example, f_type_size_8_unsigned is 2^8, or 0 to 255, therefore the max size here is 255 - 1 or 254. - * For example, f_type_size_8_signed is 2^7, or 0 to 127, therefore the max size here is 127 - 1 or 126. * * The max_size is provided for actual max sizes. + * For example, f_type_size_8_negative is 2^7, or -1 to -128, therefore the max size here is -128. + * For example, f_type_size_8_positive is 2^7, or 0 to 127, therefore the max size here is 127. * For example, f_type_size_8_unsigned is 2^8, or 0 to 255, therefore the max size here is 255. - * For example, f_type_size_8_signed is 2^7, or 0 to 127, therefore the max size here is 127. */ #ifndef _di_f_type_sizes_ - #define f_type_size_8_unsigned 0xfe - #define f_type_size_8_signed 0x7e - #define f_type_size_16_unsigned 0xfffe - #define f_type_size_16_signed 0x7ffe - #define f_type_size_32_unsigned 0xfffffffe - #define f_type_size_32_signed 0x7ffffffe - #define f_type_size_64_unsigned 0xfffffffffffffffe - #define f_type_size_64_signed 0x7ffffffffffffffe - //#define f_type_size_128_unsigned 0xfffffffffffffffffffffffe - //#define f_type_size_128_signed 0x7ffffffffffffffffffffffe - - #define f_type_size_max_8_unsigned 0xff - #define f_type_size_max_8_signed 0x7f - #define f_type_size_max_16_unsigned 0xffff - #define f_type_size_max_16_signed 0x7fff - #define f_type_size_max_32_unsigned 0xffffffff - #define f_type_size_max_32_signed 0x7fffffff - #define f_type_size_max_64_unsigned 0xffffffffffffffff - #define f_type_size_max_64_signed 0x7fffffffffffffff - //#define f_type_size_max_128_unsigned 0xffffffffffffffffffffffff - //#define f_type_size_max_128_signed 0x7fffffffffffffffffffffff + #define f_type_size_8_negative 0x7f + #define f_type_size_8_positive 0x7e + #define f_type_size_8_unsigned 0xfe + + #define f_type_size_16_negative 0x7fff + #define f_type_size_16_positive 0x7ffe + #define f_type_size_16_unsigned 0xfffe + + #define f_type_size_32_negative 0x7fffffff + #define f_type_size_32_positive 0x7ffffffe + #define f_type_size_32_unsigned 0xfffffffe + + #define f_type_size_64_negative 0x7fffffffffffffff + #define f_type_size_64_positive 0x7ffffffffffffffe + #define f_type_size_64_unsigned 0xfffffffffffffffe + + #ifndef _di_f_type_int_128_ + #define f_type_size_128_negative 0x7fffffffffffffffffffffff + #define f_type_size_128_positive 0x7ffffffffffffffffffffffe + #define f_type_size_128_unsigned 0xfffffffffffffffffffffffe + #else + #define f_type_size_128_negative f_type_size_64_negative + #define f_type_size_128_positive f_type_size_64_positive + #define f_type_size_128_unsigned f_type_size_64_unsigned + #endif // _di_f_type_int_128_ + + #define f_type_size_max_8_negative 0x80 + #define f_type_size_max_8_positive 0x7f + #define f_type_size_max_8_unsigned 0xff + + #define f_type_size_max_16_negative 0x8000 + #define f_type_size_max_16_positive 0x7fff + #define f_type_size_max_16_unsigned 0xffff + + #define f_type_size_max_32_negative 0x80000000 + #define f_type_size_max_32_positive 0x7fffffff + #define f_type_size_max_32_unsigned 0xffffffff + + #define f_type_size_max_64_negative 0x8000000000000000 + #define f_type_size_max_64_positive 0x7fffffffffffffff + #define f_type_size_max_64_unsigned 0xffffffffffffffff + + #ifndef _di_f_type_int_128_ + #define f_type_size_max_128_negative 0x800000000000000000000000 + #define f_type_size_max_128_positive 0x7fffffffffffffffffffffff + #define f_type_size_max_128_unsigned 0xffffffffffffffffffffffff + #else + #define f_type_size_max_128_negative f_type_size_max_64_negative + #define f_type_size_max_128_positive f_type_size_max_64_positive + #define f_type_size_max_128_unsigned f_type_size_max_64_unsigned + #endif // _di_f_type_int_128_ #endif // _di_f_type_sizes_ /** + * Custom data type to be used throughout the project to represent general numbers. + * + * This is intended to be used in buffers, such as strings, and in argument parameters. + * + * Provides additional custom types so that it can be more easily be overwritten. + * Specifically, there is support for using 32-bit, 64-bit or 128-bit lengths. + * + * 64-bit is the designed default. + */ +#ifndef _di_f_type_number_64_ + typedef int64_t f_number_signed; + typedef uint64_t f_number_unsigned; + + #define f_type_number_size_unsigned f_type_size_64_unsigned + #define f_type_number_size_positive f_type_size_64_positive + #define f_type_number_size_negative f_type_size_64_negative + + #define f_type_number_size_max_unsigned f_type_size_max_64_unsigned + #define f_type_number_size_max_positive f_type_size_max_64_positive + #define f_type_number_size_max_negative f_type_size_max_64_negative +#endif // _di_f_type_number_64_ + +#ifdef _en_f_type_number_32_ + typedef int32_t f_number_signed; + typedef uint32_t f_number_unsigned; + + #define f_type_number_size_unsigned f_type_size_32_unsigned + #define f_type_number_size_positive f_type_size_32_positive + #define f_type_number_size_negative f_type_size_32_negative + + #define f_type_number_size_max_unsigned f_type_size_max_32_unsigned + #define f_type_number_size_max_positive f_type_size_max_32_positive + #define f_type_number_size_max_negative f_type_size_max_32_negative +#endif // _en_f_type_number_32_ + +#ifdef _en_f_type_number_128_ + typedef f_int_128 f_number_signed; + typedef f_uint_128 f_number_unsigned; + + #define f_type_number_size_unsigned f_type_size_128_unsigned + #define f_type_number_size_positive f_type_size_128_positive + #define f_type_number_size_negative f_type_size_128_negative + + #define f_type_number_size_max_unsigned f_type_size_max_128_unsigned + #define f_type_number_size_max_positive f_type_size_max_128_positive + #define f_type_number_size_max_negative f_type_size_max_128_negative +#endif // _en_f_type_number_128_ + +/** * Standard Input/Output types. * * For most systems, there is no standard warning nor is there a standard debug. @@ -104,9 +185,7 @@ extern "C" { * Defines a variable to be used by arrays. */ #ifndef _di_f_array_length_ - typedef uint64_t f_array_length; - typedef uint32_t f_array_length_short; - typedef f_int_128 f_array_length_long; + typedef f_number_unsigned f_array_length; #endif // _di_f_array_length_ /** diff --git a/level_0/f_utf/c/utf.h b/level_0/f_utf/c/utf.h index 67272dc..67e6b9c 100644 --- a/level_0/f_utf/c/utf.h +++ b/level_0/f_utf/c/utf.h @@ -124,15 +124,15 @@ extern "C" { #define f_macro_utf_character_to_char_1(character) (((character) & f_utf_character_mask_char_1) >> 24) // grab first byte. #define f_macro_utf_character_to_char_2(character) (((character) & f_utf_character_mask_char_2) >> 16) // grab second byte. - #define f_macro_utf_character_to_char_3(character) (((character) & f_utf_character_mask_char_3) >> 8) // grab third byte. - #define f_macro_utf_character_to_char_4(character) ((character) & f_utf_character_mask_char_4) // grab fourth byte. + #define f_macro_utf_character_to_char_3(character) (((character) & f_utf_character_mask_char_3) >> 8) // grab third byte. + #define f_macro_utf_character_to_char_4(character) ((character) & f_utf_character_mask_char_4) // grab fourth byte. #define f_macro_utf_character_from_char_1(character) ((character) << 24) // shift the first byte. #define f_macro_utf_character_from_char_2(character) ((character) << 16) // shift the second byte. - #define f_macro_utf_character_from_char_3(character) ((character) << 8) // shift the third byte. - #define f_macro_utf_character_from_char_4(character) ((character)) // shift the fourth byte. + #define f_macro_utf_character_from_char_3(character) ((character) << 8) // shift the third byte. + #define f_macro_utf_character_from_char_4(character) ((character)) // shift the fourth byte. - #define f_macro_utf_character_width(character) (f_macro_utf_byte_width(f_macro_utf_character_to_char_1(character))) + #define f_macro_utf_character_width(character) (f_macro_utf_byte_width(f_macro_utf_character_to_char_1(character))) #define f_macro_utf_character_width_is(character) (f_macro_utf_byte_width_is(f_macro_utf_character_to_char_1(character))) #endif // _di_f_utf_character_ @@ -154,7 +154,7 @@ extern "C" { #ifndef _di_f_utf_string_ typedef f_utf_character *f_utf_string; - #define f_utf_string_max_size f_type_size_32_signed + #define f_utf_string_max_size f_type_number_size_unsigned #define f_utf_string_initialize f_utf_character_eos #define f_macro_utf_string_new(status, string, length) status = f_memory_new((void **) & string, sizeof(f_utf_string), length) @@ -170,7 +170,7 @@ extern "C" { * Provide a type specifically for UTF-8 strings. */ #ifndef _di_f_utf_string_length_ - typedef long f_utf_string_length; + typedef f_number_unsigned f_utf_string_length; #define f_macro_utf_string_length_new(status, string, length) status = f_memory_new((void **) & string, sizeof(f_utf_string_length), length) @@ -188,8 +188,9 @@ extern "C" { #ifndef _di_f_utf_string_lengths_ typedef struct { f_utf_string_length *array; - f_array_length size; - f_array_length used; + + f_array_length size; + f_array_length used; } f_utf_string_lengths; #define f_utf_string_lengths_initialize { 0, 0, 0 } @@ -237,8 +238,9 @@ extern "C" { #ifndef _di_f_utf_string_locations_ typedef struct { f_utf_string_location *array; - f_array_length size; - f_array_length used; + + f_array_length size; + f_array_length used; } f_utf_string_locations; #define f_utf_string_locations_initialize {0, 0, 0} @@ -263,7 +265,8 @@ extern "C" { */ #ifndef _di_f_utf_string_dynamic_ typedef struct { - f_utf_string string; + f_utf_string string; + f_utf_string_length size; f_utf_string_length used; } f_utf_string_dynamic; @@ -321,8 +324,9 @@ extern "C" { #ifndef _di_f_utf_string_dynamics_ typedef struct { f_utf_string_dynamic *array; - f_utf_string_length size; - f_utf_string_length used; + + f_utf_string_length size; + f_utf_string_length used; } f_utf_string_dynamics; #define f_utf_string_dynamics_initialize { 0, 0, 0 } diff --git a/level_1/fl_console/c/console.c b/level_1/fl_console/c/console.c index 4ce0e4e..244d864 100644 --- a/level_1/fl_console/c/console.c +++ b/level_1/fl_console/c/console.c @@ -5,7 +5,7 @@ extern "C" { #endif #ifndef _fl_console_parameter_to_number_signed_ - f_return_status fl_console_parameter_to_number_signed(const f_string argument, int64_t *number) { + f_return_status fl_console_parameter_to_number_signed(const f_string argument, f_number_signed *number) { #ifndef _di_level_0_parameter_checking_ if (argument == 0) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_f @@ -23,7 +23,7 @@ extern "C" { #endif // _fl_console_parameter_to_number_signed_ #ifndef _fl_console_parameter_to_number_unsigned_ - f_return_status fl_console_parameter_to_number_unsigned(const f_string argument, uint64_t *number) { + f_return_status fl_console_parameter_to_number_unsigned(const f_string argument, f_number_unsigned *number) { #ifndef _di_level_0_parameter_checking_ if (argument == 0) return f_status_set_error(f_invalid_parameter); #endif // _di_level_0_parameter_checking_f diff --git a/level_1/fl_console/c/console.h b/level_1/fl_console/c/console.h index e1486fc..39ee897 100644 --- a/level_1/fl_console/c/console.h +++ b/level_1/fl_console/c/console.h @@ -27,7 +27,7 @@ extern "C" { #endif /** - * Convert a console parameter additional argument to a signed 64-bit integer. + * Convert a console parameter additional argument to a signed integer. * * This will detect based types as follows: * - hexidecimals begin with either '0x' or '0X'. @@ -58,11 +58,11 @@ extern "C" { * @see f_conversion_string_to_number_signed() */ #ifndef _fl_console_parameter_to_number_signed_ - f_return_status fl_console_parameter_to_number_signed(const f_string argument, int64_t *number); + f_return_status fl_console_parameter_to_number_signed(const f_string argument, f_number_signed *number); #endif // _fl_console_parameter_to_number_signed_ /** - * Convert a console parameter additional argument to an unsigned 64-bit integer. + * Convert a console parameter additional argument to an unsigned integer. * * This will detect based types as follows: * - hexidecimals begin with either '0x' or '0X'. @@ -93,7 +93,7 @@ extern "C" { * @see f_conversion_string_to_number_unsigned() */ #ifndef _fl_console_parameter_to_number_unsigned_ - f_return_status fl_console_parameter_to_number_unsigned(const f_string argument, uint64_t *number); + f_return_status fl_console_parameter_to_number_unsigned(const f_string argument, f_number_unsigned *number); #endif // _fl_console_parameter_to_number_unsigned_ /** -- 1.8.3.1