From: Kevin Day Date: Fri, 25 Jun 2021 01:36:50 +0000 (-0500) Subject: Cleanup: Change post-increment to pre-increment where possible. X-Git-Tag: 0.5.4~6 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=fb282b59d107f5b1d8840c9c266611256fb04330;p=fll Cleanup: Change post-increment to pre-increment where possible. --- diff --git a/level_0/f_console/c/console.c b/level_0/f_console/c/console.c index 92e2aba..1ee4318 100644 --- a/level_0/f_console/c/console.c +++ b/level_0/f_console/c/console.c @@ -93,7 +93,7 @@ extern "C" { parameters.parameter[i].result = f_console_result_additional; parameters.parameter[i].values.array[parameters.parameter[i].values.used++] = location; - needs_value.used--; + --needs_value.used; // Pop the matched parameter off of the top of the needs_value array. for (f_array_length_t i = 0; i < needs_value.used; ++i) { diff --git a/level_0/f_directory/c/directory_type.h b/level_0/f_directory/c/directory_type.h index d58ab1d..416a338 100644 --- a/level_0/f_directory/c/directory_type.h +++ b/level_0/f_directory/c/directory_type.h @@ -151,7 +151,7 @@ extern "C" { #define macro_f_directory_statuss_t_delete_simple(structures) \ structures.used = structures.size; \ while (structures.used > 0) { \ - structures.used--; \ + --structures.used; \ macro_f_directory_status_t_delete_simple(structures.array[structures.used]); \ } \ if (!structures.size) { \ @@ -163,7 +163,7 @@ extern "C" { #define macro_f_directory_statuss_t_destroy_simple(structures) \ structures.used = structures.size; \ while (structures.used > 0) { \ - structures.used--; \ + --structures.used; \ macro_f_directory_status_t_destroy_simple(structures.array[structures.used]); \ } \ if (!structures.size) { \ diff --git a/level_0/f_file/c/private-file.c b/level_0/f_file/c/private-file.c index 5c10515..c2682f4 100644 --- a/level_0/f_file/c/private-file.c +++ b/level_0/f_file/c/private-file.c @@ -798,7 +798,7 @@ extern "C" { write_amount = total / file.size_write; if (total % file.size_write) { - write_amount++; + ++write_amount; } } diff --git a/level_0/f_iki/c/iki-common.h b/level_0/f_iki/c/iki-common.h index 7967740..c7d864f 100644 --- a/level_0/f_iki/c/iki-common.h +++ b/level_0/f_iki/c/iki-common.h @@ -271,7 +271,7 @@ extern "C" { #define macro_f_iki_seek_whitespace(status, buffer, range, width_max, condition) \ while (range->start <= range->stop && range->start < buffer->used) { \ if (buffer->string[range->start] == f_iki_syntax_placeholder) { \ - range->start++; \ + ++range->start; \ continue; \ } \ macro_f_iki_determine_width_max(buffer, range, width_max); \ @@ -298,7 +298,7 @@ extern "C" { #define macro_f_iki_seek_word_dash_plus(status, buffer, range, width_max, condition) \ while (range->start <= range->stop && range->start < buffer->used) { \ if (buffer->string[range->start] == f_iki_syntax_placeholder) { \ - range->start++; \ + ++range->start; \ continue; \ } \ macro_f_iki_determine_width_max(buffer, range, width_max); \ diff --git a/level_0/f_memory/c/memory-common.h b/level_0/f_memory/c/memory-common.h index 52641dd..a26767f 100644 --- a/level_0/f_memory/c/memory-common.h +++ b/level_0/f_memory/c/memory-common.h @@ -246,7 +246,7 @@ extern "C" { #define macro_f_memory_structures_delete(status, structures, type_structure, type_structures) \ structures.used = structures.size; \ while (structures.used) { \ - structures.used--; \ + --structures.used; \ status = f_memory_structure_resize(0, sizeof(type_structure), (void **) &structures.array[structures.used].array, &structures.array[structures.used].used, &structures.array[structures.used].size); \ if (F_status_is_error(status)) break; \ } \ @@ -265,7 +265,7 @@ extern "C" { #define macro_f_memory_structures_destroy(status, structures, type_structure, type_structures) \ structures.used = structures.size; \ while (structures.used) { \ - structures.used--; \ + --structures.used; \ status = f_memory_structure_adjust(0, sizeof(type_structure), (void **) &structures.array[structures.used].array, &structures.array[structures.used].used, &structures.array[structures.used].size); \ if (F_status_is_error(status)) break; \ } \ @@ -283,7 +283,7 @@ extern "C" { #define macro_f_memory_structures_delete_simple(structures, type_structure, type_structures) \ structures.used = structures.size; \ while (structures.used) { \ - structures.used--; \ + --structures.used; \ f_memory_structure_resize(0, sizeof(type_structure), (void **) &structures.array[structures.used].array, &structures.array[structures.used].used, &structures.array[structures.used].size); \ } \ f_memory_structure_resize(0, sizeof(type_structures), (void **) & structures.array, &structures.used, &structures.size); @@ -300,7 +300,7 @@ extern "C" { #define macro_f_memory_structures_destroy_simple(structures, type_structure, type_structures) \ structures.used = structures.size; \ while (structures.used) { \ - structures.used--; \ + --structures.used; \ f_memory_structure_adjust(0, sizeof(type_structure), (void **) &structures.array[structures.used].array, &structures.array[structures.used].used, &structures.array[structures.used].size); \ } \ f_memory_structure_adjust(0, sizeof(type_structures), (void **) & structures.array, &structures.used, &structures.size); diff --git a/level_0/f_serialize/c/serialize.c b/level_0/f_serialize/c/serialize.c index ece3e06..a1db7e6 100644 --- a/level_0/f_serialize/c/serialize.c +++ b/level_0/f_serialize/c/serialize.c @@ -81,7 +81,7 @@ extern "C" { memcpy(strings->array[strings->used].string, serialize.string + start, total); strings->array[strings->used].used = total; - strings->used++; + ++strings->used; } if (i + width > serialize.used) { diff --git a/level_0/f_string/c/string_dynamic.c b/level_0/f_string/c/string_dynamic.c index 10f2192..9ff1874 100644 --- a/level_0/f_string/c/string_dynamic.c +++ b/level_0/f_string/c/string_dynamic.c @@ -802,7 +802,7 @@ extern "C" { if (buffer.string[range->start] == f_string_eol_s[0]) return F_none_eol; - range->start++; + ++range->start; if (range->start >= buffer.used) return F_none_eos; if (range->start > range->stop) return F_none_stop; @@ -822,7 +822,8 @@ extern "C" { if (range->start > range->stop) return F_data_not_stop; while (buffer.string[range->start] != seek_to_this) { - range->start++; + + ++range->start; if (range->start >= buffer.used) return F_none_eos; if (range->start > range->stop) return F_none_stop; diff --git a/level_0/f_utf/c/utf_dynamic.c b/level_0/f_utf/c/utf_dynamic.c index 14e62bb..3a04aea 100644 --- a/level_0/f_utf/c/utf_dynamic.c +++ b/level_0/f_utf/c/utf_dynamic.c @@ -861,7 +861,7 @@ extern "C" { #endif // _di_level_0_parameter_checking_ if (destination->used) { - for (; destination->used; destination->used--) { + for (; destination->used; --destination->used) { if (!destination->string[destination->used - 1]) continue; break; diff --git a/level_1/fl_conversion/c/conversion.c b/level_1/fl_conversion/c/conversion.c index 494d703..13aa6da 100644 --- a/level_1/fl_conversion/c/conversion.c +++ b/level_1/fl_conversion/c/conversion.c @@ -241,7 +241,7 @@ extern "C" { if (f_conversion_character_to_duodecimal(string[i], &digit) == F_none) { if (digits) { - digits++; + ++digits; if (negative) { if (digits > f_conversion_digits_duodecimal_signed) { diff --git a/level_1/fl_environment/c/environment.c b/level_1/fl_environment/c/environment.c index 8da70b0..404388e 100644 --- a/level_1/fl_environment/c/environment.c +++ b/level_1/fl_environment/c/environment.c @@ -427,7 +427,7 @@ extern "C" { if (F_status_is_error(status)) return status; part.string[part.used - 1] = f_path_separator_s[0]; - part.used++; + ++part.used; } } diff --git a/level_1/fl_fss/c/fss_basic_list.c b/level_1/fl_fss/c/fss_basic_list.c index d47af1e..4437dc7 100644 --- a/level_1/fl_fss/c/fss_basic_list.c +++ b/level_1/fl_fss/c/fss_basic_list.c @@ -81,7 +81,7 @@ extern "C" { slash_first = range->start; slash_count = 1; - for (range->start++; range->start <= range->stop && range->start < buffer.used; range->start++) { + for (++range->start; range->start <= range->stop && range->start < buffer.used; ++range->start) { if (state.interrupt) { status = state.interrupt((void *) &state, 0); @@ -682,7 +682,7 @@ extern "C" { status = f_string_dynamic_increase_by(slash_count, destination); if (F_status_is_error(status)) break; - while (slash_count--) { + while (--slash_count) { destination->string[destination->used++] = f_fss_delimit_slash; } // while @@ -820,7 +820,7 @@ extern "C" { destination->string[destination->used++] = content.string[range->start]; has_graph = F_true; - for (range->start++; range->start <= range->stop && range->start < content.used; range->start++) { + for (++range->start; range->start <= range->stop && range->start < content.used; ++range->start) { if (state.interrupt) { status = state.interrupt((void *) &state, 0); @@ -835,7 +835,7 @@ extern "C" { if (content.string[range->start] != f_fss_delimit_slash) break; destination->string[destination->used++] = f_fss_delimit_slash; - slash_count++; + ++slash_count; } // for if (content.string[range->start] == f_fss_basic_list_open) { @@ -850,7 +850,7 @@ extern "C" { status = f_string_dynamic_increase_by(slash_count + 3, destination); if (F_status_is_error(status)) break; - while (slash_count--) { + while (--slash_count) { destination->string[destination->used++] = f_fss_delimit_slash; } // while diff --git a/level_1/fl_fss/c/fss_embedded_list.c b/level_1/fl_fss/c/fss_embedded_list.c index 3fdcc34..35df6c3 100644 --- a/level_1/fl_fss/c/fss_embedded_list.c +++ b/level_1/fl_fss/c/fss_embedded_list.c @@ -624,7 +624,7 @@ extern "C" { } if (buffer.string[range->start] == f_fss_eol) { - depth++; + ++depth; if (depth >= positions_start.size) { macro_f_array_lengths_t_resize(status, positions_start, positions_start.size + state.step_small); @@ -1269,7 +1269,7 @@ extern "C" { if (F_status_is_error(status)) break; if (content.string[range->start] == f_fss_embedded_list_open) { - while (slash_count--) { + while (--slash_count) { destination->string[destination->used++] = f_fss_delimit_slash; } // while } diff --git a/level_1/fl_fss/c/fss_extended_list.c b/level_1/fl_fss/c/fss_extended_list.c index df37cb9..b6d8dea 100644 --- a/level_1/fl_fss/c/fss_extended_list.c +++ b/level_1/fl_fss/c/fss_extended_list.c @@ -108,7 +108,7 @@ extern "C" { } } - if (buffer.string[range->start] == f_fss_delimit_slash) slash_count++; + if (buffer.string[range->start] == f_fss_delimit_slash) ++slash_count; status = f_utf_buffer_increment(buffer, range, 1); if (F_status_is_error(status)) break; @@ -598,7 +598,7 @@ extern "C" { status = f_string_dynamic_increase_by(width, destination); if (F_status_is_error(status)) break; - for (i = 0; i < width; i++) { + for (i = 0; i < width; ++i) { destination->string[destination->used++] = object.string[range->start + i]; } // for } @@ -659,7 +659,7 @@ extern "C" { status = f_string_dynamic_increase_by(slash_count, destination); if (F_status_is_error(status)) break; - while (slash_count--) { + while (--slash_count) { destination->string[destination->used++] = f_fss_delimit_slash; } // while diff --git a/level_1/fl_fss/c/private-fss.c b/level_1/fl_fss/c/private-fss.c index 397ee3f..e174742 100644 --- a/level_1/fl_fss/c/private-fss.c +++ b/level_1/fl_fss/c/private-fss.c @@ -88,7 +88,7 @@ extern "C" { const f_array_length_t rear = destination_range.start + 1; - for (; destination_range.start > front; destination_range.start--) { + for (; destination_range.start > front; --destination_range.start) { if (state.interrupt) { status = state.interrupt((void *) &state, 0); diff --git a/level_1/fl_string/c/private-string.c b/level_1/fl_string/c/private-string.c index 717e407..213b378 100644 --- a/level_1/fl_string/c/private-string.c +++ b/level_1/fl_string/c/private-string.c @@ -11,25 +11,25 @@ extern "C" { f_array_length_t i1 = offset1; f_array_length_t i2 = offset2; - for (; i1 < stop1 && i2 < stop2; i1++, i2++) { + for (; i1 < stop1 && i2 < stop2; ++i1, ++i2) { // skip past NULL in string1. - while (i1 < stop1 && !string1[i1]) i1++; + while (i1 < stop1 && !string1[i1]) ++i1; if (i1 == stop1) break; // skip past NULL in string2. - while (i2 < stop2 && !string2[i2]) i2++; + while (i2 < stop2 && !string2[i2]) ++i2; if (i2 == stop2) break; if (string1[i1] != string2[i2]) return F_equal_to_not; } // for // only return F_equal_to if all remaining characters are NULL. - for (; i1 < stop1; i1++) { + for (; i1 < stop1; ++i1) { if (string1[i1] != 0) return F_equal_to_not; } // for - for (; i2 < stop2; i2++) { + for (; i2 < stop2; ++i2) { if (string2[i2] != 0) return F_equal_to_not; } // for @@ -49,25 +49,25 @@ extern "C" { while (i1 < stop1 && i2 < stop2) { // skip past NULL in string1. - while (i1 < stop1 && !string1[i1]) i1++; + while (i1 < stop1 && !string1[i1]) ++i1; if (i1 == stop1) break; // skip past NULL in string2. - while (i2 < stop2 && !string2[i2]) i2++; + while (i2 < stop2 && !string2[i2]) ++i2; if (i2 == stop2) break; // skip past except characters in string1. - while (e1 < except1.used && except1.array[e1] < i1) e1++; + while (e1 < except1.used && except1.array[e1] < i1) ++e1; if (e1 < except1.used && except1.array[e1] == i1) { - i1++; + ++i1; continue; } // skip past except characters in string2. - while (e2 < except2.used && except2.array[e2] < i2) e2++; + while (e2 < except2.used && except2.array[e2] < i2) ++e2; if (e2 < except2.used && except2.array[e2] == i2) { - i2++; + ++i2; continue; } @@ -76,15 +76,15 @@ extern "C" { return F_equal_to_not; } - i1++; - i2++; + ++i1; + ++i2; } // while // only return F_equal_to if all remaining characters are NULL or are designated to be ignored. for (; i1 < stop1; i1++) { // skip past except characters in string1. - while (e1 < except1.used && except1.array[e1] < i1) e1++; + while (e1 < except1.used && except1.array[e1] < i1) ++e1; if (e1 < except1.used && except1.array[e1] == i1) continue; if (string1[i1] != 0) { @@ -92,10 +92,10 @@ extern "C" { } } // for - for (; i2 < stop2; i2++) { + for (; i2 < stop2; ++i2) { // skip past except characters in string2. - while (e2 < except2.used && except2.array[e2] < i2) e2++; + while (e2 < except2.used && except2.array[e2] < i2) ++e2; if (e2 < except2.used && except2.array[e2] == i2) continue; if (string2[i2] != 0) { @@ -125,11 +125,11 @@ extern "C" { for (; i1 < stop1; i1 += width) { // skip past NULL in string1. - while (i1 < stop1 && !string1[i1]) i1++; + while (i1 < stop1 && !string1[i1]) ++i1; if (i1 == stop1) break; // skip past except characters in string1. - while (e1 < except1.used && except1.array[e1] < i1) e1++; + while (e1 < except1.used && except1.array[e1] < i1) ++e1; if (e1 < except1.used && except1.array[e1] == i1) { width = 1; @@ -156,11 +156,11 @@ extern "C" { for (; i2 < stop2; i2 += width) { // skip past NULL in string2. - while (i2 < stop2 && !string2[i2]) i2++; + while (i2 < stop2 && !string2[i2]) ++i2; if (i2 == stop2) break; // skip past except characters in string2. - while (e2 < except2.used && except2.array[e2] < i2) e2++; + while (e2 < except2.used && except2.array[e2] < i2) ++e2; if (e2 < except2.used && except2.array[e2] == i2) { width = 1; @@ -198,11 +198,11 @@ extern "C" { for (j = i1; j < stop1; j += width) { // skip past NULL in string1. - while (j < stop1 && !string1[j]) j++; + while (j < stop1 && !string1[j]) ++j; if (j == stop1) break; // skip past except characters in string1. - while (ej < except1.used && except1.array[ej] < j) ej++; + while (ej < except1.used && except1.array[ej] < j) ++ej; if (ej < except1.used && except1.array[ej] == j) { width = 1; @@ -235,11 +235,11 @@ extern "C" { for (j = i2; j < stop2; j += width) { // skip past NULL in string2. - while (j < stop2 && !string2[j]) j++; + while (j < stop2 && !string2[j]) ++j; if (j == stop2) break; // skip past except characters in string2. - while (ej < except2.used && except2.array[ej] < j) ej++; + while (ej < except2.used && except2.array[ej] < j) ++ej; if (ej < except2.used && except2.array[ej] == j) { width = 1; continue; @@ -272,27 +272,27 @@ extern "C" { while (i1 <= last1 && i2 <= last2) { // skip past NULL in string1. - while (i1 <= last1 && !string1[i1]) i1++; + while (i1 <= last1 && !string1[i1]) ++i1; if (i1 > last1) break; // skip past NULL in string2. - while (i2 <= last2 && !string2[i2]) i2++; + while (i2 <= last2 && !string2[i2]) ++i2; if (i2 > last2) break; // skip past except characters in string1. - while (e1 < except1.used && except1.array[e1] < i1) e1++; + while (e1 < except1.used && except1.array[e1] < i1) ++e1; if (e1 < except1.used && except1.array[e1] == i1) { - i1++; + ++i1; continue; } // skip past except characters in string2. - while (e2 < except2.used && except2.array[e2] < i2) e2++; + while (e2 < except2.used && except2.array[e2] < i2) ++e2; if (e2 < except2.used && except2.array[e2] == i2) { - i2++; + ++i2; continue; } @@ -301,29 +301,29 @@ extern "C" { return F_equal_to_not; } - i1++; - i2++; + ++i1; + ++i2; } // while // only return F_equal_to if all remaining characters are NULL. - for (; i1 <= last1; i1++) { + for (; i1 <= last1; ++i1) { if (string1[i1] != 0) { // skip past except characters in string1. - while (e1 < except1.used && except1.array[e1] < i1) e1++; + while (e1 < except1.used && except1.array[e1] < i1) ++e1; if (e1 < except1.used && except1.array[e1] == i1) continue; return F_equal_to_not; } } // for - for (; i2 <= last2; i2++) { + for (; i2 <= last2; ++i2) { if (string2[i2] != 0) { // skip past except characters in string1. - while (e2 < except2.used && except2.array[e2] < i2) e2++; + while (e2 < except2.used && except2.array[e2] < i2) ++e2; if (e2 < except2.used && except2.array[e2] == i2) continue; return F_equal_to_not; @@ -348,7 +348,7 @@ extern "C" { for (; i1 < stop1; i1 += width) { // skip past NULL in string1. - while (i1 < stop1 && !string1[i1]) i1++; + while (i1 < stop1 && !string1[i1]) ++i1; if (i1 == stop1) break; width_max = (stop1 - i1) + 1; @@ -371,7 +371,7 @@ extern "C" { for (; i2 < stop2; i2 += width) { // skip past NULL in string2. - while (i2 < stop2 && !string2[i2]) i2++; + while (i2 < stop2 && !string2[i2]) ++i2; if (i2 == stop2) break; width_max = (stop2 - i2) + 1; @@ -402,7 +402,7 @@ extern "C" { for (f_array_length_t j = i1; j < stop1; j += width) { // skip past NULL in string1. - while (j < stop1 && !string1[j]) j++; + while (j < stop1 && !string1[j]) ++j; if (j == stop1) break; width_max = (stop1 - j) + 1; @@ -420,7 +420,7 @@ extern "C" { if (status == F_false) { last1 = j; - size1++; + ++size1; } } // for @@ -428,7 +428,7 @@ extern "C" { for (f_array_length_t j = i2; j < stop2; j += width) { // skip past NULL in string2. - while (j < stop2 && !string2[j]) j++; + while (j < stop2 && !string2[j]) ++j; if (j == stop2) break; width_max = (stop2 - j) + 1; @@ -446,7 +446,7 @@ extern "C" { if (status == F_false) { last2 = j; - size2++; + ++size2; } } // for @@ -455,14 +455,14 @@ extern "C" { } } - for (; i1 < last1 && i2 < last2; i1++, i2++) { + for (; i1 < last1 && i2 < last2; ++i1, ++i2) { // skip past NULL in string1. - while (i1 < last1 && !string1[i1]) i1++; + while (i1 < last1 && !string1[i1]) ++i1; if (i1 == last1) break; // skip past NULL in string2. - while (i2 < last2 && !string2[i2]) i2++; + while (i2 < last2 && !string2[i2]) ++i2; if (i2 == last2) break; if (string1[i1] != string2[i2]) { @@ -474,13 +474,13 @@ extern "C" { while (i1 < last1) { if (string1[i1] != 0) return F_equal_to_not; - i1++; + ++i1; } // while while (i2 < last2) { if (string2[i2] != 0) return F_equal_to_not; - i2++; + ++i2; } // while return F_equal_to; @@ -500,7 +500,7 @@ extern "C" { for (; *start <= *stop; *start += width) { // skip past NULL. - while (*start < *stop && !source[*start]) (*start)++; + while (*start < *stop && !source[*start]) ++(*start); if (*start > *stop) break; status = f_utf_is_whitespace(source + *start, (*stop - *start) + 1); @@ -518,10 +518,10 @@ extern "C" { width = macro_f_utf_byte_width(source[*start]); } // for - for (; *stop > *start; (*stop)--) { + for (; *stop > *start; --(*stop)) { // skip past NULL. - while (*stop > *start && !source[*stop]) (*stop)--; + while (*stop > *start && !source[*stop]) --(*stop); if (!source[*stop]) continue; if (*stop == *start) break; @@ -533,7 +533,7 @@ extern "C" { width = macro_f_utf_byte_width_is(source[*stop]); if (width == 1) { - (*stop)--; + --(*stop); if (*stop == *start) break; } diff --git a/level_1/fl_utf/c/private-utf.c b/level_1/fl_utf/c/private-utf.c index 1117ae7..3b42bf8 100644 --- a/level_1/fl_utf/c/private-utf.c +++ b/level_1/fl_utf/c/private-utf.c @@ -11,25 +11,25 @@ extern "C" { f_array_length_t i1 = offset1; f_array_length_t i2 = offset2; - for (; i1 < stop1 && i2 < stop2; i1++, i2++) { + for (; i1 < stop1 && i2 < stop2; ++i1, ++i2) { // skip past NULL in string1. - while (i1 < stop1 && !string1[i1]) i1++; + while (i1 < stop1 && !string1[i1]) ++i1; if (i1 == stop1) break; // skip past NULL in string2. - while (i2 < stop2 && !string2[i2]) i2++; + while (i2 < stop2 && !string2[i2]) ++i2; if (i2 == stop2) break; if (string1[i1] != string2[i2]) return F_equal_to_not; } // for // only return F_equal_to if all remaining characters are NULL. - for (; i1 < stop1; i1++) { + for (; i1 < stop1; ++i1) { if (string1[i1] != 0) return F_equal_to_not; } // for - for (; i2 < stop2; i2++) { + for (; i2 < stop2; ++i2) { if (string2[i2] != 0) return F_equal_to_not; } // for @@ -46,10 +46,10 @@ extern "C" { f_status_t status = F_none; // skip past leading whitespace in string1. - for (; i1 < stop1; i1++) { + for (; i1 < stop1; ++i1) { // skip past NULL in string1. - while (i1 < stop1 && !string1[i1]) i1++; + while (i1 < stop1 && !string1[i1]) ++i1; if (i1 == stop1) break; status = f_utf_character_is_whitespace(string1[i1]); @@ -69,7 +69,7 @@ extern "C" { for (; i2 < stop2; i2++) { // skip past NULL in string2. - while (i2 < stop2 && !string2[i2]) i2++; + while (i2 < stop2 && !string2[i2]) ++i2; if (i2 == stop2) break; status = f_utf_character_is_whitespace(string2[i2]); @@ -95,10 +95,10 @@ extern "C" { f_array_length_t j = 0; // determine where the last non-whitespace is in string1. - for (j = i1; j < stop1; j++) { + for (j = i1; j < stop1; ++j) { // skip past NULL in string1. - while (j < stop1 && !string1[j]) j++; + while (j < stop1 && !string1[j]) ++j; if (j == stop1) break; status = f_utf_character_is_whitespace(string1[j]); @@ -112,15 +112,15 @@ extern "C" { if (status == F_false) { last1 = j; - size1++; + ++size1; } } // for // determine where the last non-whitespace is in string2. - for (j = i2; j < stop2; j++) { + for (j = i2; j < stop2; ++j) { // skip past NULL in string2. - while (j < stop2 && !string2[j]) j++; + while (j < stop2 && !string2[j]) ++j; if (j == stop2) break; status = f_utf_character_is_whitespace(string2[j]); @@ -135,7 +135,7 @@ extern "C" { if (status == F_false) { last2 = j; - size2++; + ++size2; } } // for @@ -144,25 +144,25 @@ extern "C" { } } - for (; i1 < last1 && i2 < last2; i1++, i2++) { + for (; i1 < last1 && i2 < last2; ++i1, ++i2) { // skip past NULL in string1. - while (i1 < last1 && !string1[i1]) i1++; + while (i1 < last1 && !string1[i1]) ++i1; if (i1 == last1) break; // skip past NULL in string2. - while (i2 < last2 && !string2[i2]) i2++; + while (i2 < last2 && !string2[i2]) ++i2; if (i2 == last2) break; if (string1[i1] != string2[i2]) return F_equal_to_not; } // for // only return F_equal_to if all remaining characters are NULL. - for (; i1 < last1; i1++) { + for (; i1 < last1; ++i1) { if (string1[i1] != 0) return F_equal_to_not; } // for - for (; i2 < last2; i2++) { + for (; i2 < last2; ++i2) { if (string2[i2] != 0) return F_equal_to_not; } // for @@ -176,10 +176,10 @@ extern "C" { f_status_t status = F_none; // skip past leading whitespace. - for (; *start <= *stop; (*start)++) { + for (; *start <= *stop; ++(*start)) { // skip past NULL. - while (*start < *stop && !source[*start]) (*start)++; + while (*start < *stop && !source[*start]) ++(*start); if (*start > *stop) break; status = f_utf_character_is_whitespace(source[*start]); @@ -195,10 +195,10 @@ extern "C" { if (status == F_false) break; } // for - for (; *stop > *start; (*stop)--) { + for (; *stop > *start; --(*stop)) { // skip past NULL. - while (*stop > *start && !source[*stop]) (*stop)--; + while (*stop > *start && !source[*stop]) --(*stop); if (!source[*stop]) continue; if (*stop == *start) break; diff --git a/level_1/fl_utf/c/utf.c b/level_1/fl_utf/c/utf.c index 3d733fa..b790009 100644 --- a/level_1/fl_utf/c/utf.c +++ b/level_1/fl_utf/c/utf.c @@ -118,7 +118,7 @@ extern "C" { return F_none_eol; } - range->start++; + ++range->start; if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); @@ -168,7 +168,7 @@ extern "C" { return F_none_eol; } - range->start++; + ++range->start; if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); @@ -212,7 +212,7 @@ extern "C" { if (F_status_is_error(status)) return status; if (buffer.string[range->start] == f_utf_character_t_eol) return F_none_eol; - range->start++; + ++range->start; if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); @@ -251,7 +251,7 @@ extern "C" { while (buffer.string[range->start] != seek_to_character) { - range->start++; + ++range->start; if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) { return F_status_set_error(F_utf); @@ -336,7 +336,7 @@ extern "C" { f_utf_character_t seek_to_character = seek_to_this << 24; - for (; range->start <= range->stop; range->start++) { + for (; range->start <= range->stop; ++range->start) { if (macro_f_utf_character_t_width_is(string[range->start]) == 1) { return F_status_set_error(F_utf); @@ -381,7 +381,7 @@ extern "C" { return F_none_eol; } - range->start++; + ++range->start; if (macro_f_utf_character_t_width_is(string[range->start]) == 1) { return F_status_set_error(F_utf); @@ -426,7 +426,7 @@ extern "C" { return F_none_eol; } - range->start++; + ++range->start; if (macro_f_utf_character_t_width_is(string[range->start]) == 1) { return F_status_set_error(F_utf); @@ -465,7 +465,7 @@ extern "C" { return F_none; } - range->start++; + ++range->start; if (macro_f_utf_character_t_width_is(string[range->start]) == 1) { return F_status_set_error(F_utf); diff --git a/level_2/fll_execute/c/execute.c b/level_2/fll_execute/c/execute.c index 3181420..f62b2e6 100644 --- a/level_2/fll_execute/c/execute.c +++ b/level_2/fll_execute/c/execute.c @@ -39,7 +39,7 @@ extern "C" { f_status_t status = F_none; - for (f_array_length_t i = 0; i < size; i++) { + for (f_array_length_t i = 0; i < size; ++i) { status = private_fll_execute_arguments_add_parameter(prefix[i], prefix_length[i], name[i], name_length[i], value[i], value_length[i], arguments); if (F_status_is_error(status)) return status; @@ -57,7 +57,7 @@ extern "C" { f_status_t status = F_none; - for (f_array_length_t i = 0; i < size; i++) { + for (f_array_length_t i = 0; i < size; ++i) { status = private_fll_execute_arguments_add(source[i], length[i], arguments); if (F_status_is_error(status)) return status; @@ -101,7 +101,7 @@ extern "C" { f_status_t status = F_none; - for (f_array_length_t i = 0; i < size; i++) { + for (f_array_length_t i = 0; i < size; ++i) { status = private_fll_execute_arguments_add_parameter(prefix[i].string, prefix[i].used, name[i].string, name[i].used, value[i].string, value[i].used, arguments); if (F_status_is_error(status)) return status; @@ -119,7 +119,7 @@ extern "C" { f_status_t status = F_none; - for (f_array_length_t i = 0; i < size; i++) { + for (f_array_length_t i = 0; i < size; ++i) { status = private_fll_execute_arguments_add(source[i].string, source[i].used, arguments); if (F_status_is_error(status)) return status; diff --git a/level_2/fll_execute/c/private-execute.c b/level_2/fll_execute/c/private-execute.c index 734b01c..1ca0ce7 100644 --- a/level_2/fll_execute/c/private-execute.c +++ b/level_2/fll_execute/c/private-execute.c @@ -33,8 +33,7 @@ extern "C" { arguments->array[arguments->used].string = argument.string; arguments->array[arguments->used].used = argument.used; - arguments->array[arguments->used].size = argument.size; - arguments->used++; + arguments->array[arguments->used++].size = argument.size; return F_none; } @@ -390,7 +389,7 @@ extern "C" { if (parameter && parameter->environment) { clearenv(); - for (f_array_length_t i = 0; i < parameter->environment->used; i++) { + for (f_array_length_t i = 0; i < parameter->environment->used; ++i) { f_environment_set_dynamic(parameter->environment->array[i].name, parameter->environment->array[i].value, F_true); } // for } @@ -559,7 +558,7 @@ extern "C" { if (parameter && parameter->environment) { clearenv(); - for (f_array_length_t i = 0; i < parameter->environment->used; i++) { + for (f_array_length_t i = 0; i < parameter->environment->used; ++i) { f_environment_set_dynamic(parameter->environment->array[i].name, parameter->environment->array[i].value, F_true); } // for } diff --git a/level_2/fll_file/c/private-file.c b/level_2/fll_file/c/private-file.c index 3fc4119..820f6a6 100644 --- a/level_2/fll_file/c/private-file.c +++ b/level_2/fll_file/c/private-file.c @@ -44,9 +44,9 @@ extern "C" { uint8_t i = 0; f_array_length_t j = 0; - for (; i < 7; i++) { + for (; i < 7; ++i) { - for (j = 0; F_status_is_fine(status) && j < list[i]->used; j++) { + for (j = 0; F_status_is_fine(status) && j < list[i]->used; ++j) { const f_array_length_t length = path_length + list[i]->array[j].used + 1; @@ -67,7 +67,7 @@ extern "C" { macro_f_string_dynamics_t_delete_simple(listing.unknown); - for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; i++) { + for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; ++i) { const f_array_length_t length = path_length + listing.directory.array[i].used + 1; @@ -142,9 +142,9 @@ extern "C" { uint8_t i = 0; f_array_length_t j = 0; - for (; i < 7; i++) { + for (; i < 7; ++i) { - for (j = 0; F_status_is_fine(status) && j < list[i]->used; j++) { + for (j = 0; F_status_is_fine(status) && j < list[i]->used; ++j) { const f_array_length_t length = path_length + list[i]->array[j].used + 1; @@ -163,7 +163,7 @@ extern "C" { } // for } - for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; i++) { + for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; ++i) { const f_array_length_t length = path_length + listing.directory.array[i].used + 1; diff --git a/level_2/fll_fss/c/fss.c b/level_2/fll_fss/c/fss.c index 55a67dc..ca483e3 100644 --- a/level_2/fll_fss/c/fss.c +++ b/level_2/fll_fss/c/fss.c @@ -586,15 +586,15 @@ extern "C" { status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &map->name); if (F_status_is_error(status)) return status; - values[j]->used++; + ++values[j]->used; if (indexs) { indexs[j]->array[indexs[j]->used] = i; - indexs[j]->used++; + ++indexs[j]->used; } if (contents.array[i].used > 1) { - for (k = 1; k < contents.array[i].used; k++) { + for (k = 1; k < contents.array[i].used; ++k) { status = f_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &map->value); if (F_status_is_error(status)) return status; diff --git a/level_2/fll_fss/c/fss_basic.c b/level_2/fll_fss/c/fss_basic.c index ee9db57..abce4ed 100644 --- a/level_2/fll_fss/c/fss_basic.c +++ b/level_2/fll_fss/c/fss_basic.c @@ -45,16 +45,16 @@ extern "C" { if (range->start >= range->stop || range->start >= buffer.used) { if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) { - objects->used++; + ++objects->used; if (objects_quoted) { - objects_quoted->used++; + ++objects_quoted->used; } macro_f_fss_content_t_increase(status2, f_fss_default_allocation_step_small, contents->array[contents->used]) if (F_status_is_error(status2)) return status2; - contents->used++; + ++contents->used; return FL_fss_found_object_content_not; } @@ -94,12 +94,12 @@ extern "C" { } while (status == FL_fss_found_object_not); if (status == F_none_eos || status == F_none_stop) { - contents->array[contents->used].used++; - objects->used++; - contents->used++; + ++contents->array[contents->used].used; + ++objects->used; + ++contents->used; if (objects_quoted) { - objects_quoted->used++; + ++objects_quoted->used; } return status; @@ -125,11 +125,11 @@ extern "C" { // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop. else if (range->start >= range->stop || range->start >= buffer.used) { if (status == FL_fss_found_object || status == FL_fss_found_content || status == FL_fss_found_content_not || status == FL_fss_found_object_content_not) { - objects->used++; - contents->used++; + ++objects->used; + ++contents->used; if (objects_quoted) { - objects_quoted->used++; + ++objects_quoted->used; } } @@ -140,11 +140,11 @@ extern "C" { return F_none_stop; } - objects->used++; - contents->used++; + ++objects->used; + ++contents->used; if (objects_quoted) { - objects_quoted->used++; + ++objects_quoted->used; } } while (range->start < f_string_t_size); diff --git a/level_2/fll_fss/c/fss_basic_list.c b/level_2/fll_fss/c/fss_basic_list.c index 6b125f8..966b8fe 100644 --- a/level_2/fll_fss/c/fss_basic_list.c +++ b/level_2/fll_fss/c/fss_basic_list.c @@ -34,12 +34,12 @@ extern "C" { if (range->start >= range->stop || range->start >= buffer.used) { if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) { - objects->used++; + ++objects->used; macro_f_fss_content_t_increase(status2, f_fss_default_allocation_step_small, contents->array[contents->used]) if (F_status_is_error(status2)) return status2; - contents->used++; + ++contents->used; return FL_fss_found_object_content_not; } @@ -79,9 +79,9 @@ extern "C" { } while (status == FL_fss_found_object_not); if (status == F_none_eos || status == F_none_stop) { - contents->array[contents->used].used++; - objects->used++; - contents->used++; + ++contents->array[contents->used].used; + ++objects->used; + ++contents->used; return status; } @@ -107,8 +107,8 @@ extern "C" { // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop. if (status == FL_fss_found_object || status == FL_fss_found_content || status == FL_fss_found_content_not || status == FL_fss_found_object_content_not) { - objects->used++; - contents->used++; + ++objects->used; + ++contents->used; } if (range->start >= buffer.used) { @@ -118,8 +118,8 @@ extern "C" { return F_none_stop; } - objects->used++; - contents->used++; + ++objects->used; + ++contents->used; } while (range->start < f_string_t_size); diff --git a/level_2/fll_fss/c/fss_extended.c b/level_2/fll_fss/c/fss_extended.c index 8db3822..7909de0 100644 --- a/level_2/fll_fss/c/fss_extended.c +++ b/level_2/fll_fss/c/fss_extended.c @@ -51,22 +51,22 @@ extern "C" { if (range->start >= range->stop || range->start >= buffer.used) { if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) { - objects->used++; + ++objects->used; if (objects_quoted) { - objects_quoted->used++; + ++objects_quoted->used; } macro_f_fss_content_t_increase(status2, f_fss_default_allocation_step_small, contents->array[contents->used]) if (F_status_is_error(status2)) return status2; - contents->used++; + ++contents->used; if (contents_quoted) { macro_f_fss_quotes_t_increase(status2, f_fss_default_allocation_step_small, contents_quoted->array[contents_quoted->used]) if (F_status_is_error(status2)) return status2; - contents_quoted->used++; + ++contents_quoted->used; } return FL_fss_found_object_content_not; @@ -112,16 +112,16 @@ extern "C" { if (status == F_none_eos || status == F_none_stop) { contents->array[contents->used].used++; - objects->used++; - contents->used++; + ++objects->used; + ++contents->used; if (objects_quoted) { - objects_quoted->used++; + ++objects_quoted->used; } if (contents_quoted) { - contents_quoted->array[contents_quoted->used].used++; - contents_quoted->used++; + ++contents_quoted->array[contents_quoted->used].used; + ++contents_quoted->used; } return status; @@ -148,15 +148,15 @@ extern "C" { // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop. if (status == FL_fss_found_object || status == FL_fss_found_content || status == FL_fss_found_content_not || status == FL_fss_found_object_content_not || status == F_terminated_not_group) { - objects->used++; - contents->used++; + ++objects->used; + ++contents->used; if (objects_quoted) { - objects_quoted->used++; + ++objects_quoted->used; } if (contents_quoted) { - contents_quoted->used++; + ++contents_quoted->used; } } @@ -175,15 +175,15 @@ extern "C" { return F_none_stop; } - objects->used++; - contents->used++; + ++objects->used; + ++contents->used; if (objects_quoted) { - objects_quoted->used++; + ++objects_quoted->used; } if (contents_quoted) { - contents_quoted->used++; + ++contents_quoted->used; } } while (range->start < f_string_t_size); @@ -210,7 +210,7 @@ extern "C" { if (status == F_none || status == F_none_stop || status == F_none_eos || status == F_none_eol) { uint8_t complete = f_fss_complete_next; - for (f_array_length_t i = 0; i < contents.used; i++) { + for (f_array_length_t i = 0; i < contents.used; ++i) { if (i + 1 == contents.used) { complete = f_fss_complete_end; diff --git a/level_2/fll_fss/c/fss_extended_list.c b/level_2/fll_fss/c/fss_extended_list.c index 6f5bee3..2e0313a 100644 --- a/level_2/fll_fss/c/fss_extended_list.c +++ b/level_2/fll_fss/c/fss_extended_list.c @@ -34,12 +34,12 @@ extern "C" { if (range->start >= range->stop || range->start >= buffer.used) { if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) { - objects->used++; + ++objects->used; macro_f_fss_content_t_increase(status2, f_fss_default_allocation_step_small, contents->array[contents->used]) if (F_status_is_error(status2)) return status2; - contents->used++; + ++contents->used; return FL_fss_found_object_content_not; } @@ -79,9 +79,9 @@ extern "C" { } while (status == FL_fss_found_object_not); if (status == F_none_eos || status == F_none_stop) { - contents->array[contents->used].used++; - objects->used++; - contents->used++; + ++contents->array[contents->used].used; + ++objects->used; + ++contents->used; return status; } @@ -107,8 +107,8 @@ extern "C" { // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop. if (status == FL_fss_found_object || status == FL_fss_found_content || status == FL_fss_found_content_not || status == FL_fss_found_object_content_not) { - objects->used++; - contents->used++; + ++objects->used; + ++contents->used; } if (range->start >= buffer.used) { @@ -118,8 +118,8 @@ extern "C" { return F_none_stop; } - objects->used++; - contents->used++; + ++objects->used; + ++contents->used; } while (range->start < f_string_t_size); diff --git a/level_2/fll_iki/c/private-iki.c b/level_2/fll_iki/c/private-iki.c index 1c94356..ecd9868 100644 --- a/level_2/fll_iki/c/private-iki.c +++ b/level_2/fll_iki/c/private-iki.c @@ -19,7 +19,7 @@ extern "C" { f_array_length_t j = 0; f_array_length_t delimits = 0; - for (; i < content.used; i++) { + for (; i < content.used; ++i) { if (content.string[i] == quote) { if (escaped->used + delimits + 2 > escaped->size) { @@ -27,7 +27,7 @@ extern "C" { if (F_status_is_error(status)) return status; } - for (j = 0; j < delimits; j++) { + for (j = 0; j < delimits; ++j) { escaped->string[escaped->used++] = f_iki_syntax_slash; } // for @@ -43,7 +43,7 @@ extern "C" { } if (content.string[i] == f_iki_syntax_slash) { - delimits++; + ++delimits; } else { delimits = 0; @@ -60,7 +60,7 @@ extern "C" { if (F_status_is_error(status)) return status; } - for (j = 0; j < delimits; j++) { + for (j = 0; j < delimits; ++j) { escaped->string[escaped->used++] = f_iki_syntax_slash; } // for } @@ -85,7 +85,7 @@ extern "C" { const f_array_length_t used = unescaped->used; - for (; i < content.used; i++) { + for (; i < content.used; ++i) { if (content.string[i] == quote) { @@ -98,7 +98,7 @@ extern "C" { delimits = 1; if (i + 1 < content.used) { - for (j = i + 1; j < content.used; j++) { + for (j = i + 1; j < content.used; ++j) { if (content.string[j] == quote) { if (delimits % 2 == 0) { @@ -117,7 +117,7 @@ extern "C" { if (F_status_is_error(status)) return status; } - for (j = 0; j < delimits; j++) { + for (j = 0; j < delimits; ++j) { unescaped->string[unescaped->used++] = f_iki_syntax_slash; } // for @@ -126,7 +126,7 @@ extern "C" { break; } else if (content.string[j] == f_iki_syntax_slash) { - delimits++; + ++delimits; } else if (content.string[j]) { if (unescaped->used + (j - i) + 1 > unescaped->size) { @@ -134,12 +134,12 @@ extern "C" { if (F_status_is_error(status)) return status; } - for (; i <= j; i++) { + for (; i <= j; ++i) { unescaped->string[unescaped->used++] = content.string[i]; } // for delimits = 0; - i--; + --i; break; } } // for @@ -164,7 +164,7 @@ extern "C" { if (F_status_is_error(status)) return status; } - for (j = 0; j < delimits; j++) { + for (j = 0; j < delimits; ++j) { unescaped->string[unescaped->used++] = f_iki_syntax_slash; } // for diff --git a/level_2/fll_path/c/path.c b/level_2/fll_path/c/path.c index ed22733..56a3de5 100644 --- a/level_2/fll_path/c/path.c +++ b/level_2/fll_path/c/path.c @@ -38,7 +38,7 @@ extern "C" { status = f_string_append_assure("/", 1, canonical); if (F_status_is_error(status)) return status; - for (; path[at]; at++) { + for (; path[at]; ++at) { if (!size_chunk && path[at] == f_path_separator_current_s[0]) { if (!previous_1 || previous_1 == f_path_separator_s[0]) { @@ -71,14 +71,14 @@ extern "C" { if (previous_1 == f_path_separator_current_s[0]) { if (previous_2 == f_path_separator_current_s[0]) { if (canonical->used > 1) { - for (canonical->used--; canonical->used > 0; canonical->used--) { + for (--canonical->used; canonical->used > 0; --canonical->used) { if (canonical->string[canonical->used - 1] == f_path_separator_s[0]) break; } // for } } } else { - size_chunk++; + ++size_chunk; if (size_chunk) { status = f_string_append(path + position, size_chunk, canonical); @@ -100,7 +100,7 @@ extern "C" { size_chunk = 2; } else if (previous_1 && previous_1 != f_path_separator_s[0]) { - position--; + --position; size_chunk = 1; } } @@ -110,13 +110,13 @@ extern "C" { previous_2 = 0; } - size_chunk++; + ++size_chunk; } } // for if (previous_2 == f_path_separator_current_s[0]) { if (canonical->used > 1) { - for (canonical->used--; canonical->used > 0; canonical->used--) { + for (--canonical->used; canonical->used > 0; --canonical->used) { if (canonical->string[canonical->used - 1] == f_path_separator_s[0]) break; } // for } diff --git a/level_2/fll_program/c/program.c b/level_2/fll_program/c/program.c index c39faab..1df8eab 100644 --- a/level_2/fll_program/c/program.c +++ b/level_2/fll_program/c/program.c @@ -165,7 +165,7 @@ extern "C" { f_array_length_t length = 0; const f_array_length_t start = destination->used; - for (f_array_length_t i = 0; i < values.used; i++) { + for (f_array_length_t i = 0; i < values.used; ++i) { length = strnlen(argv[values.array[i]], f_console_parameter_size); @@ -182,8 +182,7 @@ extern "C" { macro_f_memory_structure_increment(status, (*destination), 1, f_memory_default_allocation_small, macro_f_string_dynamics_t_resize, F_array_too_large); if (F_status_is_error(status)) break; - destination->array[destination->used] = ripped; - destination->used++; + destination->array[destination->used++] = ripped; } } } // for @@ -209,7 +208,7 @@ extern "C" { f_array_length_t length = 0; const f_array_length_t start = destination->used; - for (f_array_length_t i = 0; i < values.used; i++) { + for (f_array_length_t i = 0; i < values.used; ++i) { length = strnlen(argv[values.array[i]], f_console_parameter_size); @@ -238,7 +237,7 @@ extern "C" { f_array_length_t length = 0; const f_array_length_t start = destination->used; - for (f_array_length_t i = 0; i < values.used; i++) { + for (f_array_length_t i = 0; i < values.used; ++i) { length = strnlen(argv[values.array[i]], f_console_parameter_size); @@ -255,8 +254,7 @@ extern "C" { macro_f_string_dynamics_t_increase(status, f_memory_default_allocation_small, (*destination)); if (F_status_is_error(status)) return status; - destination->array[destination->used] = ripped; - destination->used++; + destination->array[destination->used++] = ripped; } } } // for @@ -283,7 +281,7 @@ extern "C" { const f_array_length_t start = destination->used; f_string_dynamic_t ripped = f_string_dynamic_t_initialize; - for (f_array_length_t i = 0; i < values.used; i++) { + for (f_array_length_t i = 0; i < values.used; ++i) { length = strnlen(argv[values.array[i]], f_console_parameter_size); diff --git a/level_3/byte_dump/c/byte_dump.c b/level_3/byte_dump/c/byte_dump.c index cc6591d..c997760 100644 --- a/level_3/byte_dump/c/byte_dump.c +++ b/level_3/byte_dump/c/byte_dump.c @@ -374,7 +374,7 @@ extern "C" { { f_status_t missing_files = F_none; - for (f_array_length_t counter = 0; counter < main->remaining.used; counter++) { + for (f_array_length_t counter = 0; counter < main->remaining.used; ++counter) { status = f_file_exists(arguments.argv[main->remaining.array[counter]]); @@ -397,7 +397,7 @@ extern "C" { f_file_t file = f_file_t_initialize; - for (f_array_length_t counter = 0; counter < main->remaining.used; counter++) { + for (f_array_length_t counter = 0; counter < main->remaining.used; ++counter) { status = f_file_stream_open(arguments.argv[main->remaining.array[counter]], 0, &file); @@ -460,7 +460,7 @@ extern "C" { #ifndef _di_byte_dump_main_delete_ f_status_t byte_dump_main_delete(byte_dump_main_t *main) { - for (f_array_length_t i = 0; i < byte_dump_total_parameters; i++) { + for (f_array_length_t i = 0; i < byte_dump_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values); diff --git a/level_3/byte_dump/c/private-byte_dump.c b/level_3/byte_dump/c/private-byte_dump.c index ee7e116..cd8c0fe 100644 --- a/level_3/byte_dump/c/private-byte_dump.c +++ b/level_3/byte_dump/c/private-byte_dump.c @@ -609,7 +609,7 @@ extern "C" { if (previous->bytes > 0) { if (main.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { - for (; j < previous->bytes && j < main.width; j++) { + for (; j < previous->bytes && j < main.width; ++j) { if (previous->invalid) { f_color_print(main.output.stream, main.context.set.error, "%s", byte_dump_character_placeholder); @@ -623,7 +623,7 @@ extern "C" { } // for } else { - for (; j < previous->bytes && j < main.width; j++) { + for (; j < previous->bytes && j < main.width; ++j) { fprintf(main.output.stream, "%s", f_string_space_s); } // for } @@ -638,7 +638,7 @@ extern "C" { } } - for (uint8_t i = 0; i < characters.used && j < main.width; i++, j++) { + for (uint8_t i = 0; i < characters.used && j < main.width; ++i, ++j) { output = macro_f_utf_character_t_to_char_1(characters.string[i]); width_utf = macro_f_utf_byte_width_is(output); @@ -941,7 +941,7 @@ extern "C" { // Print placeholder for the remaining parts of the line. if (main.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) { - for (; j < main.width; j++) { + for (; j < main.width; ++j) { if (invalid[j]) { f_color_print(main.output.stream, main.context.set.error, "%s", byte_dump_character_placeholder); @@ -955,7 +955,7 @@ extern "C" { } // for } else { - for (; j < main.width; j++) { + for (; j < main.width; ++j) { fprintf(main.output.stream, "%s", f_string_space_s); } // for } diff --git a/level_3/control/c/control.c b/level_3/control/c/control.c index c73006f..a1adcf9 100644 --- a/level_3/control/c/control.c +++ b/level_3/control/c/control.c @@ -125,7 +125,7 @@ extern "C" { #ifndef _di_control_main_delete_ f_status_t control_main_delete(control_main_t *main) { - for (f_array_length_t i = 0; i < control_total_parameters; i++) { + for (f_array_length_t i = 0; i < control_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values); diff --git a/level_3/controller/c/private-controller.c b/level_3/controller/c/private-controller.c index 69ef095..9d4345a 100644 --- a/level_3/controller/c/private-controller.c +++ b/level_3/controller/c/private-controller.c @@ -665,7 +665,7 @@ extern "C" { at_j -= 2; cache->ats.used -= 2; - cache->ats.array[at_j]++; + ++cache->ats.array[at_j]; cache->action.line_item = entry->items.array[cache->ats.array[at_i]].line; cache->action.name_item.used = 0; @@ -1386,7 +1386,7 @@ extern "C" { at_j -= 2; cache->ats.used -= 2; - cache->ats.array[at_j]++; + ++cache->ats.array[at_j]; cache->action.line_item = entry->items.array[cache->ats.array[at_i]].line; cache->action.name_item.used = 0; diff --git a/level_3/controller/c/private-entry.c b/level_3/controller/c/private-entry.c index 4718480..827b272 100644 --- a/level_3/controller/c/private-entry.c +++ b/level_3/controller/c/private-entry.c @@ -910,7 +910,7 @@ extern "C" { break; } - cache->action.line_item++; + ++cache->action.line_item; for (j = (code & 0x1) ? 1 : 0; j < entry->items.used; ++j) { diff --git a/level_3/controller/c/private-rule.c b/level_3/controller/c/private-rule.c index 9af6a07..598a816 100644 --- a/level_3/controller/c/private-rule.c +++ b/level_3/controller/c/private-rule.c @@ -86,7 +86,7 @@ extern "C" { return status; } - parameters->used++; + ++parameters->used; } if (content && content->used) { @@ -352,8 +352,7 @@ extern "C" { status = controller_rule_parameters_read(global, cache->buffer_item, &cache->object_actions.array[i], &cache->content_actions.array[i], &actions->array[actions->used].parameters); - actions->array[actions->used].status = controller_status_simplify_error(F_status_set_fine(status)); - actions->used++; + actions->array[actions->used++].status = controller_status_simplify_error(F_status_set_fine(status)); } // for range->start = cache->content_action.array[0].start; @@ -412,8 +411,7 @@ extern "C" { controller_error_print(global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, global.thread); } else { - actions->array[actions->used].parameters.used = 1; - actions->used++; + actions->array[actions->used++].parameters.used = 1; } } } diff --git a/level_3/fake/c/fake.c b/level_3/fake/c/fake.c index dc07e9b..1180116 100644 --- a/level_3/fake/c/fake.c +++ b/level_3/fake/c/fake.c @@ -376,7 +376,7 @@ extern "C" { #ifndef _di_fake_main_delete_ f_status_t fake_main_delete(fake_main_t *main) { - for (f_array_length_t i = 0; i < fake_total_parameters; i++) { + for (f_array_length_t i = 0; i < fake_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values); diff --git a/level_3/fake/c/private-build.c b/level_3/fake/c/private-build.c index c496d6b..a746c27 100644 --- a/level_3/fake/c/private-build.c +++ b/level_3/fake/c/private-build.c @@ -1346,7 +1346,7 @@ extern "C" { if (F_status_is_error(*status)) return; // reset the environment. - for (f_array_length_t i = 0; i < environment->used; i++) { + for (f_array_length_t i = 0; i < environment->used; ++i) { environment->array[i].name.used = 0; environment->array[i].value.used = 0; } // for diff --git a/level_3/fake/c/private-make.c b/level_3/fake/c/private-make.c index 045a0cf..b1a2b5f 100644 --- a/level_3/fake/c/private-make.c +++ b/level_3/fake/c/private-make.c @@ -481,8 +481,7 @@ extern "C" { } // Ensure that the terminating NULL is after the end of the string used size. - data_make->setting_build.environment.array[data_make->setting_build.environment.used].used--; - data_make->setting_build.environment.used++; + --data_make->setting_build.environment.array[data_make->setting_build.environment.used++].used; } else if (main.error.verbosity == f_console_verbosity_verbose) { fprintf(main.output.stream, "%c", f_string_eol_s[0]); @@ -894,7 +893,7 @@ extern "C" { return; } else { - data_make->parameter.verbosity.used++; + ++data_make->parameter.verbosity.used; } } @@ -1382,7 +1381,7 @@ extern "C" { } } - arguments->used++; + ++arguments->used; unmatched = F_false; } else { @@ -1909,7 +1908,7 @@ extern "C" { status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]); if (F_status_is_error_not(status)) { - arguments->used++; + ++arguments->used; } } } @@ -3612,7 +3611,7 @@ extern "C" { if (operation == fake_make_operation_type_pop) { macro_f_string_dynamic_t_delete_simple(data_make->path.stack.array[data_make->path.stack.used - 1]); - data_make->path.stack.used--; + --data_make->path.stack.used; *status = f_path_change(data_make->path.stack.array[data_make->path.stack.used - 1].string); @@ -4741,10 +4740,10 @@ extern "C" { // fifo = 0x8 (0000 1000) invalid = 0x80 (1000 0000) uint8_t type_file = 0; - for (i = 1; i < arguments.used; i++) { + for (i = 1; i < arguments.used; ++i) { if (fl_string_dynamic_compare_string(fake_make_operation_argument_if_is_for, arguments.array[i], fake_make_operation_argument_if_is_for_length) == F_equal_to) { - i++; + ++i; break; } @@ -4794,7 +4793,7 @@ extern "C" { } if (i < arguments.used) { - for (f_status_t status_file = F_none; i < arguments.used; i++) { + for (f_status_t status_file = F_none; i < arguments.used; ++i) { status_file = fake_make_assure_inside_project(main, arguments.array[i], data_make); diff --git a/level_3/fake/c/private-skeleton.c b/level_3/fake/c/private-skeleton.c index f138f89..0e80ae9 100644 --- a/level_3/fake/c/private-skeleton.c +++ b/level_3/fake/c/private-skeleton.c @@ -48,7 +48,7 @@ extern "C" { &main.path_work_programs_static, }; - for (uint8_t i = 0; i < 20; i++) { + for (uint8_t i = 0; i < 20; ++i) { if (fake_signal_received(main)) { return F_status_set_error(F_signal); diff --git a/level_3/firewall/c/firewall.c b/level_3/firewall/c/firewall.c index 4bd28cd..dddfd40 100644 --- a/level_3/firewall/c/firewall.c +++ b/level_3/firewall/c/firewall.c @@ -208,7 +208,7 @@ extern "C" { f_array_length_t counter = 0; - for (; counter < main->remaining.used; counter++) { + for (; counter < main->remaining.used; ++counter) { if (strncmp("nat", arguments.argv[main->remaining.array[counter]], 4) != 0) { if (strncmp("mangle", arguments.argv[main->remaining.array[counter]], 7) != 0) { @@ -349,7 +349,7 @@ extern "C" { f_color_print_code(f_type_error, main->context.error); fprintf(f_type_error, "%s ", firewall_tool_iptables); - for (; i < parameters.used; i++) { + for (; i < parameters.used; ++i) { fprintf(f_type_error, "%s ", parameters.array[i].string); } // for @@ -406,13 +406,13 @@ extern "C" { { f_array_length_t i = 0; - for (; i < main->devices.used; i++) { + for (; i < main->devices.used; ++i) { if (fl_string_compare((f_string_t) firewall_device_loop, main->devices.array[i].string, firewall_device_loop_length + 1, main->devices.array[i].used) == F_equal_to) { f_string_dynamic_t swap_string = main->devices.array[i]; - main->devices.used--; + --main->devices.used; - for (; i < main->devices.used; i++) { + for (; i < main->devices.used; ++i) { main->devices.array[i] = main->devices.array[i+1]; } // for @@ -434,7 +434,7 @@ extern "C" { f_array_length_t i = 0; f_array_length_t length = 0; - for (; i < local.chain_objects.used; i++) { + for (; i < local.chain_objects.used; ++i) { length = local.chain_objects.array[i].stop - local.chain_objects.array[i].start + 1; if (!reserved.has_stop && fl_string_compare((f_string_t) firewall_group_stop, local.buffer.string + local.chain_objects.array[i].start, firewall_group_stop_length, length) == F_equal_to) { @@ -581,12 +581,12 @@ extern "C" { return status; } - i++; + ++i; } // while firewall_delete_local_data(&local); - for (i = 0; i < main->devices.used; i++) { + for (i = 0; i < main->devices.used; ++i) { local.device = i; { @@ -641,7 +641,7 @@ extern "C" { local.is_stop = F_false; local.is_lock = F_false; - for (; j < local.chain_contents.used; j++) { + for (; j < local.chain_contents.used; ++j) { input.start = local.chain_contents.array[j].array[0].start; input.stop = local.chain_contents.array[j].array[0].stop; @@ -701,7 +701,7 @@ extern "C" { return status; } - i++; + ++i; } // while } @@ -721,7 +721,7 @@ extern "C" { #ifndef _di_firewall_main_delete_ f_status_t firewall_main_delete(firewall_main_t *main) { - for (f_array_length_t i = 0; i < firewall_total_parameters; i++) { + for (f_array_length_t i = 0; i < firewall_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values); diff --git a/level_3/firewall/c/private-common.h b/level_3/firewall/c/private-common.h index a2a18af..f402c80 100644 --- a/level_3/firewall/c/private-common.h +++ b/level_3/firewall/c/private-common.h @@ -95,8 +95,7 @@ typedef struct { \ arguments.array[arguments.used].string = argument.string; \ arguments.array[arguments.used].size = argument.size; \ - arguments.array[arguments.used].used = argument.used; \ - arguments.used++; \ + arguments.array[arguments.used++].used = argument.used; \ \ macro_f_string_dynamic_t_clear(argument); diff --git a/level_3/firewall/c/private-firewall.c b/level_3/firewall/c/private-firewall.c index cdca940..56dfa48 100644 --- a/level_3/firewall/c/private-firewall.c +++ b/level_3/firewall/c/private-firewall.c @@ -60,7 +60,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi chain = firewall_chain_custom_id; } - for (; i < local.rule_objects.used; i++) { + for (; i < local.rule_objects.used; ++i) { length = macro_firewall_structure_size(local.rule_objects, i); invalid = F_false; @@ -317,7 +317,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi continue; } - for (r = repeat; r > 0; r--) { + for (r = repeat; r > 0; --r) { // first add the program name f_string_dynamics_resize(0, &arguments); @@ -510,8 +510,9 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi f_array_length_t subcounter = 0; if (is_ip_list) { + // skip past the chain - subcounter++; + ++subcounter; length = macro_firewall_structure_size(local.rule_contents.array[i], subcounter); @@ -526,12 +527,12 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi macro_firewall_concat_string(ip_list.string, local.buffer.string + local.rule_contents.array[i].array[subcounter].start, length); ip_list.used = length; - subcounter++; + ++subcounter; } } } - for (; subcounter < local.rule_contents.array[i].used; subcounter++) { + for (; subcounter < local.rule_contents.array[i].used; ++subcounter) { length = macro_firewall_structure_size(local.rule_contents.array[i], subcounter); @@ -725,7 +726,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi } // the ip_list file contains objects and no content, all objects are what matter an nothing else - for (; buffer_counter < basic_objects.used; buffer_counter++) { + for (; buffer_counter < basic_objects.used; ++buffer_counter) { ip_length = macro_firewall_structure_size(basic_objects, buffer_counter); @@ -746,7 +747,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi f_color_print_code(f_type_debug, main.context.warning); fprintf(f_type_debug, "%s ", current_tool); - for (f_array_length_t i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; ++i) { fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -768,7 +769,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi f_color_print_code(f_type_error, main.context.error); fprintf(f_type_error, "%s ", current_tool); - for (f_array_length_t i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; ++i) { fprintf(f_type_error, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -776,8 +777,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi fprintf(f_type_error, "\n"); // remove ip_argument from arguments string. - macro_f_string_dynamic_t_delete_simple(arguments.array[arguments.used]); - arguments.used--; + macro_f_string_dynamic_t_delete_simple(arguments.array[arguments.used--]); break; } @@ -785,22 +785,19 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi f_color_print(main.error.to.stream, main.context.set.error, "%sInvalid parameter when calling fll_execute_program()%c", fll_error_print_error, f_string_eol_s[0]); // remove ip_argument from arguments string. - macro_f_string_dynamic_t_delete_simple(arguments.array[arguments.used]); - arguments.used--; + macro_f_string_dynamic_t_delete_simple(arguments.array[arguments.used--]); break; } // remove ip_argument from arguments string. - macro_f_string_dynamic_t_delete_simple(arguments.array[arguments.used]); - arguments.used--; + macro_f_string_dynamic_t_delete_simple(arguments.array[arguments.used--]); } // for macro_f_string_dynamic_t_delete_simple(ip_argument); // remove ip_list_action from arguments string. - macro_f_string_dynamic_t_delete_simple(arguments.array[arguments.used]); - arguments.used--; + macro_f_string_dynamic_t_delete_simple(arguments.array[arguments.used--]); } } @@ -820,7 +817,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi f_color_print_code(f_type_debug, main.context.warning); fprintf(f_type_debug, "%s ", current_tool); - for (f_array_length_t i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; ++i) { fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -841,7 +838,7 @@ f_status_t firewall_perform_commands(const firewall_local_data_t local, const fi f_color_print_code(f_type_error, main.context.error); fprintf(f_type_error, "%s ", current_tool); - for (f_array_length_t i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; ++i) { fprintf(f_type_error, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -982,7 +979,7 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f break; } - j++; + ++j; } // while } @@ -1028,15 +1025,13 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f while (j <= local->chain_objects.array[i].stop) { if (local->buffer.string[j] == f_fss_delimit_placeholder) { - j++; + ++j; continue; } - main->chains.array[main->chains.used].string[main->chains.array[main->chains.used].used] = local->buffer.string[j]; - main->chains.array[main->chains.used].used++; - arguments.array[1].string[arguments.array[1].used] = local->buffer.string[j]; - arguments.array[1].used++; - j++; + main->chains.array[main->chains.used].string[main->chains.array[main->chains.used].used++] = local->buffer.string[j]; + arguments.array[1].string[arguments.array[1].used++] = local->buffer.string[j]; + ++j; } // while if (fl_string_compare(arguments.array[1].string, firewall_chain_forward, arguments.array[1].used, firewall_chain_forward_length) == F_equal_to) { @@ -1060,7 +1055,7 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f f_color_print_code(f_type_debug, main->context.warning); fprintf(f_type_debug, "%s ", firewall_tool_iptables); - for (f_array_length_t i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; ++i) { fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -1081,7 +1076,7 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f f_color_print_code(f_type_debug, main->context.warning); fprintf(f_type_debug, "%s ", firewall_tool_ip6tables); - for (f_array_length_t i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; ++i) { fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -1119,7 +1114,7 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f fprintf(f_type_error, "%s ", firewall_tool_ip6tables); } - for (f_array_length_t i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; ++i) { fprintf(f_type_error, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -1138,10 +1133,10 @@ f_status_t firewall_create_custom_chains(firewall_reserved_chains_t *reserved, f } } - main->chains.used++; + ++main->chains.used; } - i++; + ++i; } // while macro_f_string_dynamics_t_delete_simple(arguments); @@ -1153,7 +1148,7 @@ f_status_t firewall_delete_chains(const firewall_main_t main) { const f_string_t tools[2] = { firewall_tool_iptables, firewall_tool_ip6tables }; f_status_t status = F_none; - for (f_array_length_t i = 0; i < 2; i++) { + for (f_array_length_t i = 0; i < 2; ++i) { f_string_dynamics_t arguments = f_string_dynamics_t_initialize; f_string_dynamic_t argument[1] = f_string_dynamic_t_initialize; int return_code = 0; @@ -1170,7 +1165,7 @@ f_status_t firewall_delete_chains(const firewall_main_t main) { f_color_print_code(f_type_debug, main.context.warning); fprintf(f_type_debug, "%s ", tools[i]); - for (f_array_length_t i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; ++i) { fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -1195,7 +1190,7 @@ f_status_t firewall_delete_chains(const firewall_main_t main) { f_color_print_code(f_type_error, main.context.error); fprintf(f_type_error, "%s ", tools[i]); - for (f_array_length_t i = 0; i < arguments.used; i++) { + for (f_array_length_t i = 0; i < arguments.used; ++i) { fprintf(f_type_error, "%.*s ", arguments.array[i].used, arguments.array[i].string); } // for @@ -1213,7 +1208,7 @@ f_status_t firewall_delete_chains(const firewall_main_t main) { } } // for - for (f_array_length_t i = 0; i < 2; i++) { + for (f_array_length_t i = 0; i < 2; ++i) { f_string_dynamics_t arguments = f_string_dynamics_t_initialize; f_string_dynamic_t argument[1] = f_string_dynamic_t_initialize; int return_code = 0; @@ -1230,7 +1225,7 @@ f_status_t firewall_delete_chains(const firewall_main_t main) { f_color_print_code(f_type_debug, main.context.warning); fprintf(f_type_debug, "%s ", tools[i]); - for (f_array_length_t j = 0; j < arguments.used; j++) { + for (f_array_length_t j = 0; j < arguments.used; ++j) { fprintf(f_type_debug, "%.*s ", arguments.array[j].used, arguments.array[j].string); } // for @@ -1255,7 +1250,7 @@ f_status_t firewall_delete_chains(const firewall_main_t main) { f_color_print_code(f_type_error, main.context.error); fprintf(f_type_error, "%s ", tools[i]); - for (f_array_length_t j = 0; j < arguments.used; j++) { + for (f_array_length_t j = 0; j < arguments.used; ++j) { fprintf(f_type_error, "%.*s ", arguments.array[j].used, arguments.array[j].string); } // for @@ -1284,7 +1279,7 @@ f_status_t firewall_default_lock(const firewall_main_t main) { f_status_t status = F_none; - for (f_array_length_t i = 0; i < 3; i++) { + for (f_array_length_t i = 0; i < 3; ++i) { f_string_dynamics_t arguments = f_string_dynamics_t_initialize; f_string_dynamic_t argument[3]; @@ -1304,7 +1299,7 @@ f_status_t firewall_default_lock(const firewall_main_t main) { arguments.array[1].size = arguments.array[1].used; arguments.array[2].size = arguments.array[2].used; - for (f_array_length_t j = 0; j < 2; j++) { + for (f_array_length_t j = 0; j < 2; ++j) { int return_code = 0; // print command when debugging. diff --git a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c index 23b3f56..225bf4a 100644 --- a/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c +++ b/level_3/fss_basic_list_read/c/private-fss_basic_list_read.c @@ -135,7 +135,7 @@ extern "C" { } if (main->parameters[fss_basic_list_read_parameter_name].result == f_console_result_additional) { - for (; position_name < main->parameters[fss_basic_list_read_parameter_name].values.used; position_name++) { + for (; position_name < main->parameters[fss_basic_list_read_parameter_name].values.used; ++position_name) { if (main->parameters[fss_basic_list_read_parameter_name].values.array[position_name] < position_depth) { continue; diff --git a/level_3/fss_basic_list_write/c/fss_basic_list_write.c b/level_3/fss_basic_list_write/c/fss_basic_list_write.c index 0effbff..09b0e30 100644 --- a/level_3/fss_basic_list_write/c/fss_basic_list_write.c +++ b/level_3/fss_basic_list_write/c/fss_basic_list_write.c @@ -234,7 +234,7 @@ extern "C" { f_array_length_t location_sub_object = 0; f_array_length_t location_sub_content = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_basic_list_write_parameter_object].locations.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_basic_list_write_parameter_object].locations.used; ++i) { location_object = main->parameters[fss_basic_list_write_parameter_object].locations.array[i]; location_content = main->parameters[fss_basic_list_write_parameter_content].locations.array[i]; location_sub_object = main->parameters[fss_basic_list_write_parameter_object].locations_sub.array[i]; @@ -413,7 +413,7 @@ extern "C" { if (main->parameters[fss_basic_list_write_parameter_partial].result == f_console_result_found) { if (main->parameters[fss_basic_list_write_parameter_object].result == f_console_result_additional) { - for (f_array_length_t i = 0; i < main->parameters[fss_basic_list_write_parameter_object].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_basic_list_write_parameter_object].values.used; ++i) { object.string = arguments.argv[main->parameters[fss_basic_list_write_parameter_object].values.array[i]]; object.used = strnlen(object.string, f_console_parameter_size); @@ -424,7 +424,7 @@ extern "C" { } // for } else { - for (f_array_length_t i = 0; i < main->parameters[fss_basic_list_write_parameter_content].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_basic_list_write_parameter_content].values.used; ++i) { content.string = arguments.argv[main->parameters[fss_basic_list_write_parameter_content].values.array[i]]; content.used = strnlen(content.string, f_console_parameter_size); @@ -436,7 +436,7 @@ extern "C" { } } else { - for (f_array_length_t i = 0; i < main->parameters[fss_basic_list_write_parameter_object].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_basic_list_write_parameter_object].values.used; ++i) { object.string = arguments.argv[main->parameters[fss_basic_list_write_parameter_object].values.array[i]]; object.used = strnlen(object.string, f_console_parameter_size); @@ -501,7 +501,7 @@ extern "C" { #ifndef _di_fss_basic_list_write_main_delete_ f_status_t fss_basic_list_write_main_delete(fss_basic_list_write_main_t *main) { - for (f_array_length_t i = 0; i < fss_basic_list_write_total_parameters; i++) { + for (f_array_length_t i = 0; i < fss_basic_list_write_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values); diff --git a/level_3/fss_basic_write/c/fss_basic_write.c b/level_3/fss_basic_write/c/fss_basic_write.c index 4f1437e..38f5476 100644 --- a/level_3/fss_basic_write/c/fss_basic_write.c +++ b/level_3/fss_basic_write/c/fss_basic_write.c @@ -232,7 +232,7 @@ extern "C" { f_array_length_t location_sub_object = 0; f_array_length_t location_sub_content = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_basic_write_parameter_object].locations.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_basic_write_parameter_object].locations.used; ++i) { location_object = main->parameters[fss_basic_write_parameter_object].locations.array[i]; location_content = main->parameters[fss_basic_write_parameter_content].locations.array[i]; location_sub_object = main->parameters[fss_basic_write_parameter_object].locations_sub.array[i]; @@ -410,7 +410,7 @@ extern "C" { if (main->parameters[fss_basic_write_parameter_object].result == f_console_result_additional) { content.used = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_basic_write_parameter_object].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_basic_write_parameter_object].values.used; ++i) { object.string = arguments.argv[main->parameters[fss_basic_write_parameter_object].values.array[i]]; object.used = strnlen(object.string, f_console_parameter_size); @@ -423,7 +423,7 @@ extern "C" { else { object.used = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_basic_write_parameter_content].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_basic_write_parameter_content].values.used; ++i) { content.string = arguments.argv[main->parameters[fss_basic_write_parameter_content].values.array[i]]; content.used = strnlen(content.string, f_console_parameter_size); @@ -435,7 +435,7 @@ extern "C" { } } else { - for (f_array_length_t i = 0; i < main->parameters[fss_basic_write_parameter_object].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_basic_write_parameter_object].values.used; ++i) { object.string = arguments.argv[main->parameters[fss_basic_write_parameter_object].values.array[i]]; object.used = strnlen(object.string, f_console_parameter_size); @@ -500,7 +500,7 @@ extern "C" { #ifndef _di_fss_basic_write_main_delete_ f_status_t fss_basic_write_main_delete(fss_basic_write_main_t *main) { - for (f_array_length_t i = 0; i < fss_basic_write_total_parameters; i++) { + for (f_array_length_t i = 0; i < fss_basic_write_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values); diff --git a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c index 7211249..26f4043 100644 --- a/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c +++ b/level_3/fss_embedded_list_read/c/fss_embedded_list_read.c @@ -374,20 +374,20 @@ extern "C" { main->delimit_mode = fss_embedded_list_read_delimit_mode_depth_greater; // shorten the length to better convert the remainder to a number. - length--; + --length; } else if (arguments.argv[location][length - 1] == fss_embedded_list_read_delimit_mode_name_lesser[0]) { main->delimit_mode = fss_embedded_list_read_delimit_mode_depth_lesser; // shorten the length to better convert the remainder to a number. - length--; + --length; } f_string_range_t range = macro_f_string_range_t_initialize(length); // ignore leading plus sign. if (arguments.argv[location][0] == '+') { - range.start++; + ++range.start; } status = fl_conversion_string_to_number_unsigned(arguments.argv[location], range, &main->delimit_depth); @@ -447,7 +447,7 @@ extern "C" { } if (F_status_is_error_not(status) && main->remaining.used > 0) { - for (f_array_length_t i = 0; i < main->remaining.used; i++) { + for (f_array_length_t i = 0; i < main->remaining.used; ++i) { f_file_t file = f_file_t_initialize; status = f_file_open(arguments.argv[main->remaining.array[i]], 0, &file); @@ -524,7 +524,7 @@ extern "C" { #ifndef _di_fss_embedded_list_read_main_delete_ f_status_t fss_embedded_list_read_main_delete(fss_embedded_list_read_main_t *main) { - for (f_array_length_t i = 0; i < fss_embedded_list_read_total_parameters; i++) { + for (f_array_length_t i = 0; i < fss_embedded_list_read_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values); diff --git a/level_3/fss_embedded_list_read/c/private-common.h b/level_3/fss_embedded_list_read/c/private-common.h index abc0f88..40f6988 100644 --- a/level_3/fss_embedded_list_read/c/private-common.h +++ b/level_3/fss_embedded_list_read/c/private-common.h @@ -112,7 +112,7 @@ extern "C" { #define macro_fss_embedded_list_read_depths_t_delete_simple(depths) \ depths.used = depths.size; \ while (depths.used > 0) { \ - depths.used--; \ + --depths.used; \ macro_fss_embedded_list_read_depth_t_delete_simple(depths.array[depths.used]); \ } \ if (!depths.used) macro_f_memory_structure_delete_simple(depths, fss_embedded_list_read_depth_t) @@ -121,7 +121,7 @@ extern "C" { status = F_none; \ if (new_length < depths.size) { \ f_array_length_t i = depths.size - new_length; \ - for (; i < depths.size; i++) { \ + for (; i < depths.size; ++i) { \ macro_fss_embedded_list_read_depth_t_delete_simple(depths.array[i]); \ } \ } \ @@ -135,7 +135,7 @@ extern "C" { status = F_none; \ if (new_length < depths.size) { \ f_array_length_t i = depths.size - new_length; \ - for (; i < depths.size; i++) { \ + for (; i < depths.size; ++i) { \ macro_fss_embedded_list_read_depth_t_delete_simple(depths.array[i]); \ } \ } \ diff --git a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c index 9032d78..cec0cde 100644 --- a/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c +++ b/level_3/fss_embedded_list_read/c/private-fss_embedded_list_read.c @@ -183,9 +183,9 @@ extern "C" { depths->used++; } - for (i = 0; i < depths->used; i++) { + for (i = 0; i < depths->used; ++i) { - for (j = i + 1; j < depths->used; j++) { + for (j = i + 1; j < depths->used; ++j) { if (depths->array[i].depth == depths->array[j].depth) { fprintf(main.error.to.stream, "%c", f_string_eol_s[0]); @@ -475,10 +475,10 @@ extern "C" { if (main->parameters[fss_embedded_list_read_parameter_total].result == f_console_result_found) { f_array_length_t total = 0; - for (i = 0; i < items->used; i++) { + for (i = 0; i < items->used; ++i) { if (skip[i]) continue; - total++; + ++total; } // for fprintf(main->output.stream, "%llu%c", total, f_string_eol_s[0]); @@ -492,7 +492,7 @@ extern "C" { print_object = &fl_print_trim_except_dynamic_partial; } - for (i = 0; i < items->used; i++) { + for (i = 0; i < items->used; ++i) { if (skip[i]) continue; @@ -528,7 +528,7 @@ extern "C" { if (!items->array[i].content.used) { if (include_empty) { - total++; + ++total; } continue; @@ -539,7 +539,7 @@ extern "C" { if (!main->buffer.string[j]) continue; if (main->buffer.string[j] == f_string_eol_s[0]) { - total++; + ++total; } } // for } // for @@ -562,7 +562,7 @@ extern "C" { break; } - line_current++; + ++line_current; } continue; @@ -574,7 +574,7 @@ extern "C" { for (; j <= items->array[i].content.array[0].stop; ++j) { if (main->buffer.string[j] == f_string_eol_s[0]) { - line_current++; + ++line_current; if (line_current == line) { ++j; @@ -606,7 +606,7 @@ extern "C" { return F_none; } - for (i = 0; i < items->used; i++) { + for (i = 0; i < items->used; ++i) { if (skip[i]) continue; @@ -798,7 +798,7 @@ extern "C" { if (fss_embedded_list_read_process_delimits_within_greater(main, depth, original_delimits[j]) == F_false) { delimits->array[l] = original_delimits[j]; - delimits->used++; + ++delimits->used; } break; @@ -848,7 +848,7 @@ extern "C" { if (fss_embedded_list_read_process_delimits_within_greater(main, depth, original_delimits[j]) == F_false) { delimits->array[k] = original_delimits[j]; - delimits->used++; + ++delimits->used; } break; diff --git a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c index cd3d7d9..64adc71 100644 --- a/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/fss_embedded_list_write.c @@ -240,7 +240,7 @@ extern "C" { f_array_length_t location_sub_object = 0; f_array_length_t location_sub_content = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_embedded_list_write_parameter_object].locations.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_embedded_list_write_parameter_object].locations.used; ++i) { location_object = main->parameters[fss_embedded_list_write_parameter_object].locations.array[i]; location_content = main->parameters[fss_embedded_list_write_parameter_content].locations.array[i]; location_sub_object = main->parameters[fss_embedded_list_write_parameter_object].locations_sub.array[i]; @@ -323,7 +323,7 @@ extern "C" { main->prepend.used = length; main->prepend.size = length; - for (; range.start < length; range.start++) { + for (; range.start < length; ++range.start) { status = f_fss_is_space(main->prepend, range); if (F_status_is_error(status)) break; @@ -422,7 +422,7 @@ extern "C" { if (main->parameters[fss_embedded_list_write_parameter_partial].result == f_console_result_found) { if (main->parameters[fss_embedded_list_write_parameter_object].result == f_console_result_additional) { - for (f_array_length_t i = 0; i < main->parameters[fss_embedded_list_write_parameter_object].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_embedded_list_write_parameter_object].values.used; ++i) { object.string = arguments.argv[main->parameters[fss_embedded_list_write_parameter_object].values.array[i]]; object.used = strnlen(object.string, f_console_parameter_size); @@ -433,7 +433,7 @@ extern "C" { } // for } else { - for (f_array_length_t i = 0; i < main->parameters[fss_embedded_list_write_parameter_content].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_embedded_list_write_parameter_content].values.used; ++i) { status = fss_embedded_list_write_process_parameter_ignore(arguments, *main, main->parameters[fss_embedded_list_write_parameter_content].locations, i, &ignore); if (F_status_is_error(status)) break; @@ -448,7 +448,7 @@ extern "C" { } } else { - for (f_array_length_t i = 0; i < main->parameters[fss_embedded_list_write_parameter_object].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_embedded_list_write_parameter_object].values.used; ++i) { status = fss_embedded_list_write_process_parameter_ignore(arguments, *main, main->parameters[fss_embedded_list_write_parameter_content].locations, i, &ignore); if (F_status_is_error(status)) break; @@ -518,7 +518,7 @@ extern "C" { #ifndef _di_fss_embedded_list_write_main_delete_ f_status_t fss_embedded_list_write_main_delete(fss_embedded_list_write_main_t *main) { - for (f_array_length_t i = 0; i < fss_embedded_list_write_total_parameters; i++) { + for (f_array_length_t i = 0; i < fss_embedded_list_write_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values); diff --git a/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c b/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c index 66bbca3..0e0bc8e 100644 --- a/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c +++ b/level_3/fss_embedded_list_write/c/private-fss_embedded_list_write.c @@ -254,7 +254,7 @@ extern "C" { if (block.string[range.start] == fss_embedded_list_write_pipe_content_end) { state = 0x3; - range.start++; + ++range.start; break; } diff --git a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c index 81592ee..7d5be74 100644 --- a/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c +++ b/level_3/fss_extended_list_read/c/private-fss_extended_list_read.c @@ -135,7 +135,7 @@ extern "C" { } if (main->parameters[fss_extended_list_read_parameter_name].result == f_console_result_additional) { - for (; position_name < main->parameters[fss_extended_list_read_parameter_name].values.used; position_name++) { + for (; position_name < main->parameters[fss_extended_list_read_parameter_name].values.used; ++position_name) { if (main->parameters[fss_extended_list_read_parameter_name].values.array[position_name] < position_depth) { continue; @@ -358,11 +358,13 @@ extern "C" { fprintf(main->output.stream, "%c", fss_extended_list_read_pipe_content_end); } else { - if ((data->option & fss_extended_list_read_data_option_object) && (data->option & fss_extended_list_read_data_option_content)) { - fprintf(main->output.stream, "%c%c", f_fss_extended_list_close, f_fss_extended_list_close_end); - } - else if ((data->option & fss_extended_list_read_data_option_object) && !(data->option & fss_extended_list_read_data_option_content)) { - fprintf(main->output.stream, "%c", f_fss_eol); + if (data->option & fss_extended_list_read_data_option_object) { + if (data->option & fss_extended_list_read_data_option_content) { + fprintf(main->output.stream, "%c%c", f_fss_extended_list_close, f_fss_extended_list_close_end); + } + else if (!(data->option & fss_extended_list_read_data_option_content)) { + fprintf(main->output.stream, "%c", f_fss_eol); + } } } } diff --git a/level_3/fss_extended_list_write/c/fss_extended_list_write.c b/level_3/fss_extended_list_write/c/fss_extended_list_write.c index a34234f..2793423 100644 --- a/level_3/fss_extended_list_write/c/fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/fss_extended_list_write.c @@ -240,7 +240,7 @@ extern "C" { f_array_length_t location_sub_object = 0; f_array_length_t location_sub_content = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_extended_list_write_parameter_object].locations.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_extended_list_write_parameter_object].locations.used; ++i) { location_object = main->parameters[fss_extended_list_write_parameter_object].locations.array[i]; location_content = main->parameters[fss_extended_list_write_parameter_content].locations.array[i]; location_sub_object = main->parameters[fss_extended_list_write_parameter_object].locations_sub.array[i]; @@ -323,7 +323,7 @@ extern "C" { main->prepend.used = length; main->prepend.size = length; - for (; range.start < length; range.start++) { + for (; range.start < length; ++range.start) { status = f_fss_is_space(main->prepend, range); if (F_status_is_error(status)) break; @@ -422,7 +422,7 @@ extern "C" { if (main->parameters[fss_extended_list_write_parameter_partial].result == f_console_result_found) { if (main->parameters[fss_extended_list_write_parameter_object].result == f_console_result_additional) { - for (f_array_length_t i = 0; i < main->parameters[fss_extended_list_write_parameter_object].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_extended_list_write_parameter_object].values.used; ++i) { object.string = arguments.argv[main->parameters[fss_extended_list_write_parameter_object].values.array[i]]; object.used = strnlen(object.string, f_console_parameter_size); @@ -433,7 +433,7 @@ extern "C" { } // for } else { - for (f_array_length_t i = 0; i < main->parameters[fss_extended_list_write_parameter_content].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_extended_list_write_parameter_content].values.used; ++i) { status = fss_extended_list_write_process_parameter_ignore(arguments, *main, main->parameters[fss_extended_list_write_parameter_content].locations, i, &ignore); if (F_status_is_error(status)) break; @@ -448,7 +448,7 @@ extern "C" { } } else { - for (f_array_length_t i = 0; i < main->parameters[fss_extended_list_write_parameter_object].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_extended_list_write_parameter_object].values.used; ++i) { status = fss_extended_list_write_process_parameter_ignore(arguments, *main, main->parameters[fss_extended_list_write_parameter_content].locations, i, &ignore); if (F_status_is_error(status)) break; @@ -518,7 +518,7 @@ extern "C" { #ifndef _di_fss_extended_list_write_main_delete_ f_status_t fss_extended_list_write_main_delete(fss_extended_list_write_main_t *main) { - for (f_array_length_t i = 0; i < fss_extended_list_write_total_parameters; i++) { + for (f_array_length_t i = 0; i < fss_extended_list_write_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values); diff --git a/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c b/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c index f09688b..f99e3c7 100644 --- a/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c +++ b/level_3/fss_extended_list_write/c/private-fss_extended_list_write.c @@ -191,7 +191,7 @@ extern "C" { } } - for (; range.start <= range.stop; range.start++) { + for (; range.start <= range.stop; ++range.start) { if (block.string[range.start] == fss_extended_list_write_pipe_content_start) { state = 0x2; diff --git a/level_3/fss_extended_write/c/fss_extended_write.c b/level_3/fss_extended_write/c/fss_extended_write.c index 59681a9..43a49db 100644 --- a/level_3/fss_extended_write/c/fss_extended_write.c +++ b/level_3/fss_extended_write/c/fss_extended_write.c @@ -324,7 +324,7 @@ extern "C" { f_string_range_t range = macro_f_string_range_t_initialize(length); const f_string_static_t prepend = macro_f_string_static_t_initialize(arguments.argv[index], length); - for (; range.start < length; range.start++) { + for (; range.start < length; ++range.start) { status = f_fss_is_space(prepend, range); if (F_status_is_error(status)) break; @@ -421,7 +421,7 @@ extern "C" { if (main->parameters[fss_extended_write_parameter_object].result == f_console_result_additional) { contents.used = 0; - for (f_array_length_t i = 0; i < main->parameters[fss_extended_write_parameter_object].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[fss_extended_write_parameter_object].values.used; ++i) { object.string = arguments.argv[main->parameters[fss_extended_write_parameter_object].values.array[i]]; object.used = strnlen(object.string, f_console_parameter_size); @@ -446,18 +446,18 @@ extern "C" { else { f_array_length_t i = 0; - for (; i < main->parameters[fss_extended_write_parameter_content].values.used; i++) { + for (; i < main->parameters[fss_extended_write_parameter_content].values.used; ++i) { contents.array[contents.used].string = arguments.argv[main->parameters[fss_extended_write_parameter_content].values.array[i]]; contents.array[contents.used].used = strnlen(contents.array[contents.used].string, f_console_parameter_size); contents.array[contents.used].size = contents.array[contents.used].used; - contents.used++; + ++contents.used; } // for status = fss_extended_write_process(*main, output, quote, 0, &contents, &buffer); // clear the contents array of the static strings to avoid deallocation attempts on static variables. - for (; i < main->parameters[fss_extended_write_parameter_content].values.used; i++) { + for (; i < main->parameters[fss_extended_write_parameter_content].values.used; ++i) { contents.array[contents.used].string = 0; contents.array[contents.used].used = 0; contents.array[contents.used].size = 0; @@ -475,7 +475,7 @@ extern "C" { f_array_length_t object_next = 0; f_array_length_t content_current = 0; - for (; i < main->parameters[fss_extended_write_parameter_object].values.used; i++) { + for (; i < main->parameters[fss_extended_write_parameter_object].values.used; ++i) { object_current = main->parameters[fss_extended_write_parameter_object].locations.array[i]; @@ -489,7 +489,7 @@ extern "C" { contents.used = 0; - for (; j < main->parameters[fss_extended_write_parameter_content].values.used; j++) { + for (; j < main->parameters[fss_extended_write_parameter_content].values.used; ++j) { content_current = main->parameters[fss_extended_write_parameter_content].locations.array[j]; @@ -515,7 +515,7 @@ extern "C" { break; } - contents.used++; + ++contents.used; } // for if (F_status_is_error(status)) break; @@ -574,7 +574,7 @@ extern "C" { #ifndef _di_fss_extended_write_main_delete_ f_status_t fss_extended_write_main_delete(fss_extended_write_main_t *main) { - for (f_array_length_t i = 0; i < fss_extended_write_total_parameters; i++) { + for (f_array_length_t i = 0; i < fss_extended_write_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values); diff --git a/level_3/fss_extended_write/c/private-fss_extended_write.c b/level_3/fss_extended_write/c/private-fss_extended_write.c index 0dd2c6c..d56563a 100644 --- a/level_3/fss_extended_write/c/private-fss_extended_write.c +++ b/level_3/fss_extended_write/c/private-fss_extended_write.c @@ -97,7 +97,7 @@ extern "C" { if (contents) { if (contents->used) { - for (f_array_length_t i = 0; i < contents->used; i++) { + for (f_array_length_t i = 0; i < contents->used; ++i) { if (contents->array[i].used) { range.start = 0; @@ -210,7 +210,7 @@ extern "C" { } } - for (; range.start <= range.stop; range.start++) { + for (; range.start <= range.stop; ++range.start) { if (block.string[range.start] == fss_extended_write_pipe_content_start) { state = 0x2; diff --git a/level_3/fss_identify/c/fss_identify.c b/level_3/fss_identify/c/fss_identify.c index fbc383e..8605792 100644 --- a/level_3/fss_identify/c/fss_identify.c +++ b/level_3/fss_identify/c/fss_identify.c @@ -328,7 +328,7 @@ extern "C" { #ifndef _di_fss_identify_main_delete_ f_status_t fss_identify_main_delete(fss_identify_main_t *main) { - for (f_array_length_t i = 0; i < fss_identify_total_parameters; i++) { + for (f_array_length_t i = 0; i < fss_identify_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); diff --git a/level_3/fss_status_code/c/fss_status_code.c b/level_3/fss_status_code/c/fss_status_code.c index aa6fa35..1839088 100644 --- a/level_3/fss_status_code/c/fss_status_code.c +++ b/level_3/fss_status_code/c/fss_status_code.c @@ -155,7 +155,7 @@ extern "C" { } if (main->remaining.used > 0) { - for (f_array_length_t i = 0; i < main->remaining.used; i++) { + for (f_array_length_t i = 0; i < main->remaining.used; ++i) { status2 = fss_status_code_process_check(*main, arguments.argv[main->remaining.array[i]]); @@ -171,7 +171,7 @@ extern "C" { } if (main->remaining.used > 0) { - for (f_array_length_t i = 0; i < main->remaining.used; i++) { + for (f_array_length_t i = 0; i < main->remaining.used; ++i) { status2 = fss_status_code_process_number(*main, arguments.argv[main->remaining.array[i]]); @@ -187,7 +187,7 @@ extern "C" { } if (main->remaining.used > 0) { - for (f_array_length_t i = 0; i < main->remaining.used; i++) { + for (f_array_length_t i = 0; i < main->remaining.used; ++i) { status2 = fss_status_code_process_normal(*main, arguments.argv[main->remaining.array[i]]); if (F_status_is_error(status2) && status == F_none) { @@ -205,7 +205,7 @@ extern "C" { #ifndef _di_fss_status_code_main_delete_ f_status_t fss_status_code_main_delete(fss_status_code_main_t *main) { - for (f_array_length_t i = 0; i < fss_status_code_total_parameters; i++) { + for (f_array_length_t i = 0; i < fss_status_code_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values); diff --git a/level_3/iki_read/c/iki_read.c b/level_3/iki_read/c/iki_read.c index b7fc172..ff1891f 100644 --- a/level_3/iki_read/c/iki_read.c +++ b/level_3/iki_read/c/iki_read.c @@ -401,7 +401,7 @@ extern "C" { f_array_length_t total = 0; f_file_t file = f_file_t_initialize; - for (; i < main->remaining.used; i++) { + for (; i < main->remaining.used; ++i) { macro_f_file_t_reset(file); total = 0; @@ -468,7 +468,7 @@ extern "C" { #ifndef _di_iki_read_main_delete_ f_status_t iki_read_main_delete(iki_read_main_t *main) { - for (f_array_length_t i = 0; i < iki_read_total_parameters; i++) { + for (f_array_length_t i = 0; i < iki_read_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values); diff --git a/level_3/iki_read/c/private-iki_read.c b/level_3/iki_read/c/private-iki_read.c index 81dd11b..bf65cd1 100644 --- a/level_3/iki_read/c/private-iki_read.c +++ b/level_3/iki_read/c/private-iki_read.c @@ -17,13 +17,13 @@ extern "C" { range->start = 0; if (main->line > 0) { - for (; line < main->line && range->start < main->buffer.used; range->start++) { - if (main->buffer.string[range->start] == f_string_eol_s[0]) line++; + for (; line < main->line && range->start < main->buffer.used; ++range->start) { + if (main->buffer.string[range->start] == f_string_eol_s[0]) ++line; } // for } if (line == main->line) { - for (range->stop = range->start; range->stop < main->buffer.used; range->stop++) { + for (range->stop = range->start; range->stop < main->buffer.used; ++range->stop) { if (main->buffer.string[range->stop] == f_string_eol_s[0]) break; } // for @@ -134,7 +134,7 @@ extern "C" { if (F_status_is_error(status)) { fll_error_print(main->error, F_status_set_fine(status), "iki_read_substitutions_identify", F_true); - for (f_array_length_t i = 0; i < variable->used; i++) { + for (f_array_length_t i = 0; i < variable->used; ++i) { macro_iki_read_substitutions_t_delete_simple(substitutionss[i]); } // for @@ -150,7 +150,7 @@ extern "C" { f_array_length_t j = 0; buffer_range->start = 0; - for (; i < main->parameters[iki_read_parameter_name].values.used; i++) { + for (; i < main->parameters[iki_read_parameter_name].values.used; ++i) { index = main->parameters[iki_read_parameter_name].values.array[i]; name.used = 0; @@ -160,7 +160,7 @@ extern "C" { if (F_status_is_error(status)) { fll_error_print(main->error, F_status_set_fine(status), "f_string_append_nulless", F_true); - for (f_array_length_t i = 0; i < variable->used; i++) { + for (f_array_length_t i = 0; i < variable->used; ++i) { macro_iki_read_substitutions_t_delete_simple(substitutionss[i]); } // for @@ -170,7 +170,7 @@ extern "C" { buffer_range->stop = name.used - 1; - for (j = 0; j < vocabulary->used; j++) { + for (j = 0; j < vocabulary->used; ++j) { status = fl_string_dynamic_partial_compare(name, main->buffer, *buffer_range, vocabulary->array[j]); @@ -198,7 +198,7 @@ extern "C" { f_array_length_t i = 0; f_array_length_t j = 0; - for (; i < ranges->used; i++) { + for (; i < ranges->used; ++i) { if (substitutionss[i].used) { iki_read_substitutions_print(*main, *variable, *content, *ranges, substitutionss[i], i, content_only); @@ -216,7 +216,7 @@ extern "C" { status = F_data_not; } - for (f_array_length_t i = 0; i < variable->used; i++) { + for (f_array_length_t i = 0; i < variable->used; ++i) { macro_iki_read_substitutions_t_delete_simple(substitutionss[i]); } // for @@ -260,7 +260,7 @@ extern "C" { if (F_status_is_error(status)) { fll_error_print(main->error, F_status_set_fine(status), "iki_read_substitutions_identify", F_true); - for (f_array_length_t i = 0; i < variable->used; i++) { + for (f_array_length_t i = 0; i < variable->used; ++i) { macro_iki_read_substitutions_t_delete_simple(substitutionss[i]); } // for @@ -281,12 +281,12 @@ extern "C" { f_array_length_t j = 0; f_array_length_t length_argument = 0; - for (f_array_length_t index = 0; i < main->parameters[iki_read_parameter_name].values.used; i++) { + for (f_array_length_t index = 0; i < main->parameters[iki_read_parameter_name].values.used; ++i) { index = main->parameters[iki_read_parameter_name].values.array[i]; length_argument = strnlen(arguments.argv[index], f_console_parameter_size); - for (j = 0, name_missed = F_true; j < names.used; j++) { + for (j = 0, name_missed = F_true; j < names.used; ++j) { status = fl_string_compare(arguments.argv[index], names.array[j].string, length_argument, names.array[j].used); @@ -311,12 +311,12 @@ extern "C" { break; } - names.used++; + ++names.used; } } // for if (F_status_is_error(status)) { - for (i = 0; i < variable->used; i++) { + for (i = 0; i < variable->used; ++i) { macro_iki_read_substitutions_t_delete_simple(substitutionss[i]); } // for @@ -350,7 +350,7 @@ extern "C" { if (names.used) { name_missed = F_true; - for (k = 0; k < names.used; k++) { + for (k = 0; k < names.used; ++k) { name_range.stop = names.array[k].used - 1; status = fl_string_dynamic_partial_compare(main->buffer, names.array[k], vocabulary->array[j], name_range); @@ -388,7 +388,7 @@ extern "C" { } i = variable->array[j].stop + 1; - j++; + ++j; } // while if (i <= buffer_range.stop) { @@ -397,7 +397,7 @@ extern "C" { } } - for (f_array_length_t i = 0; i < variable->used; i++) { + for (f_array_length_t i = 0; i < variable->used; ++i) { macro_iki_read_substitutions_t_delete_simple(substitutionss[i]); } // for @@ -450,7 +450,7 @@ extern "C" { range.start = 0; - for (; i < main->parameters[iki_read_parameter_name].values.used; i++) { + for (; i < main->parameters[iki_read_parameter_name].values.used; ++i) { index = main->parameters[iki_read_parameter_name].values.array[i]; name.used = 0; @@ -466,11 +466,11 @@ extern "C" { range.stop = name.used - 1; - for (j = 0; j < vocabulary->used; j++) { + for (j = 0; j < vocabulary->used; ++j) { status = fl_string_dynamic_partial_compare(name, main->buffer, range, vocabulary->array[j]); - if (status == F_equal_to) total++; + if (status == F_equal_to) ++total; } // for } // for @@ -510,7 +510,7 @@ extern "C" { index = parameter->values.array[i]; length = strnlen(arguments.argv[index], f_console_parameter_size); - for (j = 0; j < vocabulary->used; j++) { + for (j = 0; j < vocabulary->used; ++j) { status = fl_string_compare(arguments.argv[index], main->buffer.string + vocabulary->array[j].start, length, (vocabulary->array[j].stop - vocabulary->array[j].start) + 1); @@ -529,7 +529,7 @@ extern "C" { substitutionss[j].array[index_2].with.used = strnlen(arguments.argv[index], f_console_parameter_size); substitutionss[j].array[index_2].with.size = substitutionss[j].array[index_2].with.used; - substitutionss[j].used++; + ++substitutionss[j].used; } } // for } // for @@ -547,7 +547,7 @@ extern "C" { range.start = 0; - for (; i < substitutions.used; i++) { + for (; i < substitutions.used; ++i) { range.stop = substitutions.array[i].replace.used - 1; diff --git a/level_3/iki_write/c/iki_write.c b/level_3/iki_write/c/iki_write.c index 7277608..79db81f 100644 --- a/level_3/iki_write/c/iki_write.c +++ b/level_3/iki_write/c/iki_write.c @@ -370,7 +370,7 @@ extern "C" { f_string_static_t object = f_string_static_t_initialize; f_string_static_t content = f_string_static_t_initialize; - for (f_array_length_t i = 0; i < main->parameters[iki_write_parameter_object].values.used; i++) { + for (f_array_length_t i = 0; i < main->parameters[iki_write_parameter_object].values.used; ++i) { object.string = arguments.argv[main->parameters[iki_write_parameter_object].values.array[i]]; object.used = strnlen(object.string, f_console_parameter_size); @@ -416,7 +416,7 @@ extern "C" { #ifndef _di_iki_write_main_delete_ f_status_t iki_write_main_delete(iki_write_main_t *main) { - for (f_array_length_t i = 0; i < iki_write_total_parameters; i++) { + for (f_array_length_t i = 0; i < iki_write_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values); diff --git a/level_3/status_code/c/status_code.c b/level_3/status_code/c/status_code.c index 5cd7440..fdf2d05 100644 --- a/level_3/status_code/c/status_code.c +++ b/level_3/status_code/c/status_code.c @@ -155,7 +155,7 @@ extern "C" { } if (main->remaining.used > 0) { - for (f_array_length_t i = 0; i < main->remaining.used; i++) { + for (f_array_length_t i = 0; i < main->remaining.used; ++i) { status2 = status_code_process_check(*main, arguments.argv[main->remaining.array[i]]); @@ -171,7 +171,7 @@ extern "C" { } if (main->remaining.used > 0) { - for (f_array_length_t i = 0; i < main->remaining.used; i++) { + for (f_array_length_t i = 0; i < main->remaining.used; ++i) { status2 = status_code_process_number(*main, arguments.argv[main->remaining.array[i]]); @@ -187,7 +187,7 @@ extern "C" { } if (main->remaining.used > 0) { - for (f_array_length_t i = 0; i < main->remaining.used; i++) { + for (f_array_length_t i = 0; i < main->remaining.used; ++i) { status2 = status_code_process_normal(*main, arguments.argv[main->remaining.array[i]]); @@ -206,7 +206,7 @@ extern "C" { #ifndef _di_status_code_main_delete_ f_status_t status_code_main_delete(status_code_main_t *main) { - for (f_array_length_t i = 0; i < status_code_total_parameters; i++) { + for (f_array_length_t i = 0; i < status_code_total_parameters; ++i) { macro_f_array_lengths_t_delete_simple(main->parameters[i].locations); macro_f_array_lengths_t_delete_simple(main->parameters[i].locations_sub); macro_f_array_lengths_t_delete_simple(main->parameters[i].values);