From: Kevin Day Date: Fri, 30 Jul 2021 03:36:13 +0000 (-0500) Subject: Progress: continue string and convert changes, fixing bugs. X-Git-Tag: 0.5.5~23 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=b9630fc076319f8d54b1f2c6a0a739d43fcf6c7c;p=fll Progress: continue string and convert changes, fixing bugs. The byte comparison should be against 0xf and not 0x7. As a result some numbers, such as 8, were being turned into 0. The private convert function wasn't correctly converted when it was restructured. Wrong parameters were used and the digits were being incorrectly set when the number is 0. Looks like I needed a double pointer and not a single pointer. I may redesign this to not depend on a double pointer. The design will be to change the behavior to operate more like fprintf() in that a number of bytes printed is returned. This would put the return type in a non-standard (non FLL standards that is) but acceptable state. The byte_dump program had the parameters placed in the wrong location. Another consideration is that I might implement f_print_color() (which would operate similar to the now removed f_color_print()). This would only be for a single color for simplicity purpose and would only accept a single color set after the string. Such as: f_print_color("My name is %S.", main.context.set.title, main.output.stream, name); Which is cleaner than: f_print_string("%[My name is %S.%]", main.output.stream, main.context.set.title, name, main.context.set.title); This is likely to cover a common case and so I believe is an acceptable compliment to f_print_string(). --- diff --git a/level_0/f_conversion/c/conversion.c b/level_0/f_conversion/c/conversion.c index 4e9f2ce..a5a4023 100644 --- a/level_0/f_conversion/c/conversion.c +++ b/level_0/f_conversion/c/conversion.c @@ -99,7 +99,7 @@ extern "C" { #endif // _di_level_0_parameter_checking_ if (character > 0x29 && character < 0x40) { - *number = 0x7 & character; + *number = 0xf & character; return F_none; } @@ -115,13 +115,13 @@ extern "C" { #endif // _di_level_0_parameter_checking_ if (character > 0x29 && character < 0x40) { - *number = 0x7 & character; + *number = 0xf & character; return F_none; } if (character > 0x40 && character < 0x43 || character > 0x60 && character < 0x63) { - *number = 9 + (0x7 & character); + *number = 9 + (0xf & character); return F_none; } @@ -137,13 +137,13 @@ extern "C" { #endif // _di_level_0_parameter_checking_ if (character > 0x29 && character < 0x40) { - *number = 0x7 & character; + *number = 0xf & character; return F_none; } if (character > 0x40 && character < 0x47 || character > 0x60 && character < 0x67) { - *number = 9 + (0x7 & character); + *number = 9 + (0xf & character); return F_none; } @@ -162,7 +162,7 @@ extern "C" { return F_status_set_error(F_number); } - *number = 0x7 & character; + *number = 0xf & character; return F_none; } diff --git a/level_0/f_conversion/c/private-conversion.c b/level_0/f_conversion/c/private-conversion.c index 025bdb4..4a17d78 100644 --- a/level_0/f_conversion/c/private-conversion.c +++ b/level_0/f_conversion/c/private-conversion.c @@ -10,9 +10,14 @@ extern "C" { int digits = 0; - for (register f_number_unsigned_t remaining = number; remaining; ++digits) { - remaining /= data.base; - } // for + if (number) { + for (register f_number_unsigned_t remaining = number; remaining; ++digits) { + remaining /= data.base; + } // for + } + else { + digits = 1; + } if (data.flag & f_conversion_data_flag_base_prepend) { const int used = digits + 2 + (data.flag & f_conversion_data_flag_sign_always & f_conversion_data_flag_sign_pad ? 1 : 0); @@ -96,10 +101,6 @@ extern "C" { } } else if (number) { - if (F_status_is_error(private_f_conversion_digit_to_file_prefix(data, negative, output))) { - return F_status_set_error(F_output); - } - if (F_status_is_error(private_f_conversion_digit_to_file_number(data, number, digits, output))) { return F_status_set_error(F_output); } @@ -127,13 +128,13 @@ extern "C" { f_number_unsigned_t current = number; f_number_unsigned_t work = 0; - for (char c = 0; power; --power) { + for (char c = 0; power; --digits) { work = current / power; current -= work * power; power /= data.base; - switch (number) { + switch (work) { case 0: c = f_string_ascii_0_s[0]; break; diff --git a/level_1/fl_print/c/print.c b/level_1/fl_print/c/print.c index d4cc32d..9162d16 100644 --- a/level_1/fl_print/c/print.c +++ b/level_1/fl_print/c/print.c @@ -18,12 +18,12 @@ extern "C" { va_start(ap, output); - for (char *current = string; *current; current = current + 1) { + for (f_string_t current = string; *current; current = current + 1) { if (*current == f_string_ascii_percent_s[0]) { current = current + 1; - status = private_fl_print_string_convert(current, output, &ap); + status = private_fl_print_string_convert(¤t, output, &ap); if (F_status_is_error(status)) break; if (!*current) break; @@ -40,7 +40,7 @@ extern "C" { #endif // _di_fl_print_string_ #ifndef _di_fl_print_string_convert_ - f_status_t fl_print_string_convert(char *current, FILE *output, va_list *ap) { + f_status_t fl_print_string_convert(f_string_t *current, FILE *output, va_list *ap) { #ifndef _di_level_1_parameter_checking_ if (!output) return F_status_set_error(F_parameter); if (!ap) return F_status_set_error(F_parameter); @@ -60,12 +60,12 @@ extern "C" { f_status_t status = F_none; - for (char *current = string; *current; current = current + 1) { + for (f_string_t current = string; *current; current = current + 1) { if (*current == f_string_ascii_percent_s[0]) { current = current + 1; - status = private_fl_print_string_convert(current, output, ap); + status = private_fl_print_string_convert(¤t, output, ap); if (F_status_is_error(status)) break; if (!*current) break; diff --git a/level_1/fl_print/c/print.h b/level_1/fl_print/c/print.h index ec2b554..a6a4217 100644 --- a/level_1/fl_print/c/print.h +++ b/level_1/fl_print/c/print.h @@ -129,7 +129,7 @@ extern "C" { * @see f_print_terminated() */ #ifndef _di_fl_print_string_convert_ - extern f_status_t fl_print_string_convert(char *current, FILE *output, va_list *ap); + extern f_status_t fl_print_string_convert(f_string_t *current, FILE *output, va_list *ap); #endif // _di_fl_print_string_convert_ /** diff --git a/level_1/fl_print/c/private-print.c b/level_1/fl_print/c/private-print.c index de3dbc1..ac36158 100644 --- a/level_1/fl_print/c/private-print.c +++ b/level_1/fl_print/c/private-print.c @@ -6,10 +6,10 @@ extern "C" { #endif #if !defined(_di_fl_print_string_convert_) || !defined(_di_fl_print_string_) - f_status_t private_fl_print_string_convert(char *current, FILE *output, va_list *ap) { + f_status_t private_fl_print_string_convert(f_string_t *current, FILE *output, va_list *ap) { // An unpaired '%' character must not be at the end of the string. - if (!*current) { + if (!**current) { return F_status_set_error(F_valid_not); } @@ -20,33 +20,32 @@ extern "C" { unsigned int width = 1; unsigned int precision = 1; - for (; *current; current = current + 1) { + for (; **current; *current = *current + 1) { - if (*current == f_string_ascii_minus_s[0]) { + if (**current == f_string_ascii_minus_s[0]) { flag |= f_print_format_flag_align_left; } - else if (*current == f_string_ascii_pound_s[0]) { + else if (**current == f_string_ascii_pound_s[0]) { flag |= f_print_format_flag_convert; } - else if (*current == f_string_ascii_colon_semi_s[0]) { + else if (**current == f_string_ascii_colon_semi_s[0]) { flag |= f_print_format_flag_ignore_index; } - else if (*current == f_string_ascii_colon_s[0]) { + else if (**current == f_string_ascii_colon_s[0]) { flag |= f_print_format_flag_ignore_range; } - else if (*current == f_string_ascii_plus_s[0]) { + else if (**current == f_string_ascii_plus_s[0]) { flag |= f_print_format_flag_sign_always; } - else if (*current == f_string_ascii_space_s[0]) { + else if (**current == f_string_ascii_space_s[0]) { flag |= f_print_format_flag_sign_pad; } - else if (*current == f_string_ascii_equal_s[0]) { + else if (**current == f_string_ascii_equal_s[0]) { flag |= f_print_format_flag_trim; } - /* @fixme - else if (*current > 0x29 && *current < 0x40) { + else if (**current > 0x29 && **current < 0x40) { if (!(flag & f_print_format_flag_width)) { - if (*current == f_string_ascii_0_s[0]) { + if (**current == f_string_ascii_0_s[0]) { flag |= f_print_format_flag_zeros_leading; } else { @@ -60,39 +59,41 @@ extern "C" { else { return F_status_set_error(F_valid_not); } - }*/ - else if (*current == f_string_ascii_dollar_s[0]) { + } + else if (**current == f_string_ascii_dollar_s[0]) { // If followed immediately by a '$' this is ignored. // Use '%$' to separate, such as '%l%$l' would allow for '0l' to be printed where '%ll' would interpret the 'l', resulting in a long long. return F_none; } - else if (*current == f_string_ascii_exclamation_s[0]) { + else if (**current == f_string_ascii_exclamation_s[0]) { base = 2; } - else if (*current == f_string_ascii_sign_at_s[0]) { + else if (**current == f_string_ascii_sign_at_s[0]) { base = 8; } - else if (*current == f_string_ascii_caret_s[0]) { + else if (**current == f_string_ascii_caret_s[0]) { base = 10; } - else if (*current == f_string_ascii_ampersand_s[0]) { + else if (**current == f_string_ascii_ampersand_s[0]) { base = 12; } - else if (*current == f_string_ascii_underscore_s[0]) { + else if (**current == f_string_ascii_underscore_s[0]) { base = 16; } - else if (*current == f_string_ascii_period_s[0]) { - if (!*(current + 1)) { + else if (**current == f_string_ascii_period_s[0]) { + if (!*(*current + 1)) { return F_status_set_error(F_valid_not); } - // @fixme this looks wrong here, probably needs to handle the current + 1 and not current. - /*if (private_fl_print_convert_number(current, ap, &precision)) { + *current = *current + 1; + + // @todo this probably needs to check to see if *current + 1 is in fact a number. + if (private_fl_print_convert_number(current, ap, &precision)) { break; - }*/ + } } else { - if (*current == f_string_ascii_c_s[0]) { + if (**current == f_string_ascii_c_s[0]) { // char. const char value = (char) va_arg(*ap, int); @@ -103,67 +104,67 @@ extern "C" { return F_none; } - else if (*current == f_string_ascii_C_s[0]) { + else if (**current == f_string_ascii_C_s[0]) { // safe character. char value[1] = { (char) va_arg(*ap, int) }; return f_print_safely(value, 1, output); } - else if (*current == f_string_ascii_i_s[0]) { + else if (**current == f_string_ascii_i_s[0]) { type = f_print_format_type_signed; - if (*(current + 1) == f_string_ascii_i_s[0]) { - if (*(current + 2) == f_string_ascii_i_s[0]) { + if (*(*current + 1) == f_string_ascii_i_s[0]) { + if (*(*current + 2) == f_string_ascii_i_s[0]) { type = f_print_format_type_signed_8; - current = current + 2; + *current = *current + 2; } else { type = f_print_format_type_signed_16; - current = current + 1; + *current = *current + 1; } } } - else if (*current == f_string_ascii_I_s[0]) { + else if (**current == f_string_ascii_I_s[0]) { type = f_print_format_type_signed; flag |= f_print_format_flag_uppercase; - if (*(current + 1) == f_string_ascii_I_s[0]) { - if (*(current + 2) == f_string_ascii_I_s[0]) { + if (*(*current + 1) == f_string_ascii_I_s[0]) { + if (*(*current + 2) == f_string_ascii_I_s[0]) { type = f_print_format_type_signed_8; - current = current + 2; + *current = *current + 2; } else { type = f_print_format_type_signed_16; - current = current + 1; + *current = *current + 1; } } } - else if (*current == f_string_ascii_l_s[0]) { + else if (**current == f_string_ascii_l_s[0]) { type = f_print_format_type_long; - if (*(current + 1) == f_string_ascii_l_s[0]) { + if (*(*current + 1) == f_string_ascii_l_s[0]) { type = f_print_format_type_long_long; - current = current + 1; + *current = *current + 1; } } - else if (*current == f_string_ascii_L_s[0]) { + else if (**current == f_string_ascii_L_s[0]) { type = f_print_format_type_long; flag |= f_print_format_flag_uppercase; - if (*(current + 1) == f_string_ascii_L_s[0]) { + if (*(*current + 1) == f_string_ascii_L_s[0]) { type = f_print_format_type_long_long; - current = current + 1; + *current = *current + 1; } } - else if (*current == f_string_ascii_n_s[0]) { + else if (**current == f_string_ascii_n_s[0]) { type = f_print_format_type_number; } - else if (*current == f_string_ascii_N_s[0]) { + else if (**current == f_string_ascii_N_s[0]) { type = f_print_format_type_number; flag |= f_print_format_flag_uppercase; } - else if (*current == f_string_ascii_q_s[0]) { + else if (**current == f_string_ascii_q_s[0]) { // static/dynamic string. const f_string_static_t value = va_arg(*ap, f_string_static_t); @@ -216,7 +217,7 @@ extern "C" { return f_print_dynamic(value, output); } - else if (*current == f_string_ascii_Q_s[0]) { + else if (**current == f_string_ascii_Q_s[0]) { // safe static/dynamic string. const f_string_static_t value = va_arg(*ap, f_string_static_t); @@ -269,7 +270,7 @@ extern "C" { return f_print_dynamic_safely(value, output); } - else if (*current == f_string_ascii_r_s[0]) { + else if (**current == f_string_ascii_r_s[0]) { // raw static/dynamic string. const f_string_static_t value = va_arg(*ap, f_string_static_t); @@ -322,89 +323,85 @@ extern "C" { return f_print_dynamic_raw(value, output); } - else if (*current == f_string_ascii_s_s[0]) { + else if (**current == f_string_ascii_s_s[0]) { // NULL terminated string. const f_string_t value = va_arg(*ap, f_string_t); return f_print_terminated(value, output); } - else if (*current == f_string_ascii_S_s[0]) { + else if (**current == f_string_ascii_S_s[0]) { // NULL terminated safe string. const f_string_t value = va_arg(*ap, f_string_t); return f_print_safely_terminated(value, output); } - else if (*current == f_string_ascii_u_s[0]) { + else if (**current == f_string_ascii_u_s[0]) { type = f_print_format_type_unsigned; - if (*(current + 1)) { - if (*(current + 1) == f_string_ascii_i_s[0]) { - if (*(current + 2) == f_string_ascii_i_s[0]) { - type = f_print_format_type_unsigned_8; - current = current + 2; - } - else { - type = f_print_format_type_unsigned_16; - current = current + 1; - } + if (*(*current + 1) == f_string_ascii_i_s[0]) { + if (*(*current + 2) == f_string_ascii_i_s[0]) { + type = f_print_format_type_unsigned_8; + *current = *current + 2; } - else if (*(current + 1) == f_string_ascii_n_s[0]) { - if (*(current + 2) == f_string_ascii_l_s[0]) { - type = f_print_format_type_unsigned_long_long; - current = current + 2; - } - else { - type = f_print_format_type_unsigned_long; - current = current + 1; - } + else { + type = f_print_format_type_unsigned_16; + *current = *current + 1; } - else if (*(current + 1) == f_string_ascii_n_s[0]) { - type = f_print_format_type_unsigned_number; - current = current + 1; + } + else if (*(*current + 1) == f_string_ascii_l_s[0]) { + if (*(*current + 2) == f_string_ascii_l_s[0]) { + type = f_print_format_type_unsigned_long_long; + *current = *current + 2; + } + else { + type = f_print_format_type_unsigned_long; + *current = *current + 1; } } + else if (*(*current + 1) == f_string_ascii_n_s[0]) { + type = f_print_format_type_unsigned_number; + *current = *current + 1; + } } - else if (*current == f_string_ascii_U_s[0]) { + else if (**current == f_string_ascii_U_s[0]) { type = f_print_format_type_unsigned; flag |= f_print_format_flag_uppercase; - if (*(current + 1)) { - if (*(current + 1) == f_string_ascii_I_s[0]) { - if (*(current + 2) == f_string_ascii_I_s[0]) { - type = f_print_format_type_unsigned_8; - current = current + 2; - } - else { - type = f_print_format_type_unsigned_16; - current = current + 1; - } + if (*(*current + 1) == f_string_ascii_I_s[0]) { + if (*(*current + 2) == f_string_ascii_I_s[0]) { + type = f_print_format_type_unsigned_8; + *current = *current + 2; } - else if (*(current + 1) == f_string_ascii_N_s[0]) { - if (*(current + 2) == f_string_ascii_L_s[0]) { - type = f_print_format_type_unsigned_long_long; - current = current + 2; - } - else { - type = f_print_format_type_unsigned_long; - current = current + 1; - } + else { + type = f_print_format_type_unsigned_16; + *current = *current + 1; } - else if (*(current + 1) == f_string_ascii_N_s[0]) { - type = f_print_format_type_unsigned_number; - current = current + 1; + } + else if (*(*current + 1) == f_string_ascii_L_s[0]) { + if (*(*current + 2) == f_string_ascii_L_s[0]) { + type = f_print_format_type_unsigned_long_long; + *current = *current + 2; } + else { + type = f_print_format_type_unsigned_long; + *current = *current + 1; + } + } + else if (*(*current + 1) == f_string_ascii_N_s[0]) { + type = f_print_format_type_unsigned_number; + *current = *current + 1; } } - else if (*current == f_string_ascii_z_s[0]) { + else if (**current == f_string_ascii_z_s[0]) { type = f_print_format_type_size; } - else if (*current == f_string_ascii_Z_s[0]) { + else if (**current == f_string_ascii_Z_s[0]) { type = f_print_format_type_size; flag |= f_print_format_flag_uppercase; } - else if (*current == f_string_ascii_bracket_open_s[0]) { + else if (**current == f_string_ascii_bracket_open_s[0]) { const f_color_set_t value = va_arg(*ap, f_color_set_t); if (value.before) { @@ -413,7 +410,7 @@ extern "C" { return F_none; } - else if (*current == f_string_ascii_bracket_close_s[0]) { + else if (**current == f_string_ascii_bracket_close_s[0]) { const f_color_set_t value = va_arg(*ap, f_color_set_t); if (value.after) { @@ -530,7 +527,7 @@ extern "C" { } } // for - if (*current) { + if (**current) { return F_none; } @@ -539,52 +536,52 @@ extern "C" { #endif // !defined(_di_fl_print_string_convert_) || !defined(_di_fl_print_string_) #if !defined(_di_fl_print_string_convert_) || !defined(_di_fl_print_string_) - f_status_t private_fl_print_convert_number(char *current, va_list *ap, unsigned int *number) { + f_status_t private_fl_print_convert_number(f_string_t *current, va_list *ap, unsigned int *number) { *number = 0; - for (; *current; current = current + 1) { + for (; **current; *current = *current + 1) { - if (*current == f_string_ascii_0_s[0]) { + if (**current == f_string_ascii_0_s[0]) { *number *= 10; } - else if (*current == f_string_ascii_1_s[0]) { + else if (**current == f_string_ascii_1_s[0]) { *number *= 10; *number += 1; } - else if (*current == f_string_ascii_2_s[0]) { + else if (**current == f_string_ascii_2_s[0]) { *number *= 10; *number += 2; } - else if (*current == f_string_ascii_3_s[0]) { + else if (**current == f_string_ascii_3_s[0]) { *number *= 10; *number += 3; } - else if (*current == f_string_ascii_4_s[0]) { + else if (**current == f_string_ascii_4_s[0]) { *number *= 10; *number += 4; } - else if (*current == f_string_ascii_5_s[0]) { + else if (**current == f_string_ascii_5_s[0]) { *number *= 10; *number += 5; } - else if (*current == f_string_ascii_6_s[0]) { + else if (**current == f_string_ascii_6_s[0]) { *number *= 10; *number += 6; } - else if (*current == f_string_ascii_7_s[0]) { + else if (**current == f_string_ascii_7_s[0]) { *number *= 10; *number += 7; } - else if (*current == f_string_ascii_8_s[0]) { + else if (**current == f_string_ascii_8_s[0]) { *number *= 10; *number += 8; } - else if (*current == f_string_ascii_9_s[0]) { + else if (**current == f_string_ascii_9_s[0]) { *number *= 10; *number += 9; } - else if (*current == f_string_ascii_asterisk_s[0]) { + else if (**current == f_string_ascii_asterisk_s[0]) { *number = va_arg(*ap, unsigned int); break; @@ -592,13 +589,13 @@ extern "C" { else { // reset position non-number. - current = current - 1; + *current = *current - 1; break; } } // for - if (*current) { + if (**current) { return F_false; } diff --git a/level_1/fl_print/c/private-print.h b/level_1/fl_print/c/private-print.h index 0025154..23e84cf 100644 --- a/level_1/fl_print/c/private-print.h +++ b/level_1/fl_print/c/private-print.h @@ -64,7 +64,7 @@ extern "C" { * @see private_fl_print_convert_number() */ #if !defined(_di_fl_print_string_convert_) || !defined(_di_fl_print_string_) - extern f_status_t private_fl_print_string_convert(char *current, FILE *output, va_list *ap) f_attribute_visibility_internal; + extern f_status_t private_fl_print_string_convert(f_string_t *current, FILE *output, va_list *ap) f_attribute_visibility_internal; #endif // !defined(_di_fl_print_string_convert_) || !defined(_di_fl_print_string_) /** @@ -88,7 +88,7 @@ extern "C" { * @see va_arg() */ #if !defined(_di_fl_print_string_convert_) || !defined(_di_fl_print_string_) - extern f_status_t private_fl_print_convert_number(char *current, va_list *ap, unsigned int *number) f_attribute_visibility_internal; + extern f_status_t private_fl_print_convert_number(f_string_t *current, va_list *ap, unsigned int *number) f_attribute_visibility_internal; #endif // !defined(_di_fl_print_string_convert_) || !defined(_di_fl_print_string_) /** diff --git a/level_2/fll_print/c/print.c b/level_2/fll_print/c/print.c index d91f552..ccfa8af 100644 --- a/level_2/fll_print/c/print.c +++ b/level_2/fll_print/c/print.c @@ -414,7 +414,7 @@ extern "C" { #endif // _di_fll_print_string_ #ifndef _di_fll_print_string_convert_ - f_status_t fll_print_string_convert(char *current, FILE *output, va_list *ap) { + f_status_t fll_print_string_convert(f_string_t *current, FILE *output, va_list *ap) { flockfile(output); diff --git a/level_2/fll_print/c/print.h b/level_2/fll_print/c/print.h index d1f0170..215d54c 100644 --- a/level_2/fll_print/c/print.h +++ b/level_2/fll_print/c/print.h @@ -910,7 +910,7 @@ extern "C" { * @see fl_print_string_convert() */ #ifndef _di_fll_print_string_convert_ - extern f_status_t fll_print_string_convert(char *current, FILE *output, va_list *ap); + extern f_status_t fll_print_string_convert(f_string_t *current, FILE *output, va_list *ap); #endif // _di_fll_print_string_convert_ /** diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index 45b34a7..a74ac08 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -233,7 +233,7 @@ extern "C" { if (main->parameters[byte_dump_parameter_width].result == f_console_result_found) { flockfile(main->error.to.stream); - fl_print_string("%[%sThe parameter '%]", main->error.to.stream, fll_error_print_error, main->context.set.error, main->context.set.error); + fl_print_string("%[%sThe parameter '%]", main->error.to.stream, main->context.set.error, fll_error_print_error, main->context.set.error); fl_print_string("%[%S%S%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_width, main->context.set.notable); fl_print_string("%[' was specified, but no value was given.%]%c", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s[0]); @@ -253,7 +253,7 @@ extern "C" { if (F_status_is_error(status) || number < 1 || number >= 0xfb) { flockfile(main->error.to.stream); - fl_print_string("%[%sThe parameter '%]", main->error.to.stream, fll_error_print_error, main->context.set.error, main->context.set.error); + fl_print_string("%[%sThe parameter '%]", main->error.to.stream, main->context.set.error, fll_error_print_error, main->context.set.error); fl_print_string("%[%S%S%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_width, main->context.set.notable); fl_print_string("%[' value can only be a number (inclusively) between %]", main->error.to.stream, main->context.set.error, main->context.set.error); fl_print_string("%[1%]", main->error.to.stream, main->context.set.notable, main->context.set.notable); @@ -273,7 +273,7 @@ extern "C" { if (main->parameters[byte_dump_parameter_first].result == f_console_result_found) { flockfile(main->error.to.stream); - fl_print_string("%[%sThe parameter '%]", main->error.to.stream, fll_error_print_error, main->context.set.error, main->context.set.error); + fl_print_string("%[%sThe parameter '%]", main->error.to.stream, main->context.set.error, fll_error_print_error, main->context.set.error); fl_print_string("%[%S%S%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_first, main->context.set.notable); fl_print_string("%[' was specified, but no value was given.%]%c", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s[0]); @@ -293,7 +293,7 @@ extern "C" { if (F_status_is_error(status) || number > f_number_t_size_unsigned) { flockfile(main->error.to.stream); - fl_print_string("%[%sThe parameter '%]", main->error.to.stream, fll_error_print_error, main->context.set.error, main->context.set.error); + fl_print_string("%[%sThe parameter '%]", main->error.to.stream, main->context.set.error, fll_error_print_error, main->context.set.error); fl_print_string("%[%S%S%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_first, main->context.set.notable); fl_print_string("%[' value can only be a number (inclusively) between %]", main->error.to.stream, main->context.set.error, main->context.set.error); fl_print_string("%[0%]", main->error.to.stream, main->context.set.notable, main->context.set.notable); @@ -313,7 +313,7 @@ extern "C" { if (main->parameters[byte_dump_parameter_last].result == f_console_result_found) { flockfile(main->error.to.stream); - fl_print_string("%[%sThe parameter '%]", main->error.to.stream, fll_error_print_error, main->context.set.error, main->context.set.error); + fl_print_string("%[%sThe parameter '%]", main->error.to.stream, main->context.set.error, fll_error_print_error, main->context.set.error); fl_print_string("%[%S%S%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last, main->context.set.notable); fl_print_string("%[' was specified, but no value was given.%]%c", main->error.to.stream, main->context.set.error, main->context.set.error, f_string_eol_s[0]); @@ -333,7 +333,7 @@ extern "C" { if (F_status_is_error(status) || number < 0 || number > f_number_t_size_unsigned) { flockfile(main->error.to.stream); - fl_print_string("%[%sThe parameter '%]", main->error.to.stream, fll_error_print_error, main->context.set.error, main->context.set.error); + fl_print_string("%[%sThe parameter '%]", main->error.to.stream, main->context.set.error, fll_error_print_error, main->context.set.error); fl_print_string("%[%S%S%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last, main->context.set.notable); fl_print_string("%[' value can only be a number (inclusively) between %]", main->error.to.stream, main->context.set.error, main->context.set.error); fl_print_string("%[0%]", main->error.to.stream, main->context.set.notable, main->context.set.notable); @@ -354,7 +354,7 @@ extern "C" { if (main->first > main->last) { flockfile(main->error.to.stream); - fl_print_string("%[%sThe parameter '%]", main->error.to.stream, fll_error_print_error, main->context.set.error, main->context.set.error); + fl_print_string("%[%sThe parameter '%]", main->error.to.stream, main->context.set.error, fll_error_print_error, main->context.set.error); fl_print_string("%[%S%S%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_first, main->context.set.notable); fl_print_string("%[' value cannot be greater than the parameter '%]", main->error.to.stream, main->context.set.error, main->context.set.error); fl_print_string("%[%S%S%]", main->error.to.stream, main->context.set.notable, f_console_symbol_long_enable_s, byte_dump_long_last, main->context.set.notable); diff --git a/level_3/byte_dump/c/private-byte_dump.c b/level_3/byte_dump/c/private-byte_dump.c index 63e81f8..dd45481 100644 --- a/level_3/byte_dump/c/private-byte_dump.c +++ b/level_3/byte_dump/c/private-byte_dump.c @@ -276,7 +276,7 @@ extern "C" { // @todo: determine what the error is and display it. flockfile(main.error.to.stream); - fl_print_string("%[%Sread() failed for '%]", main.error.to.stream, fll_error_print_error, main.context.set.error, main.context.set.error); + fl_print_string("%[%Sread() failed for '%]", main.error.to.stream, main.context.set.error, fll_error_print_error, main.context.set.error); fl_print_string("%[%S%]", main.error.to.stream, main.context.set.notable, file_name ? file_name : "-", main.context.set.notable); fl_print_string("%['.%]%c%c", main.error.to.stream, main.context.set.error, main.context.set.error, f_string_eol_s[0], f_string_eol_s[0]);