From: Kevin Day Date: Sat, 19 Feb 2022 21:08:49 +0000 (-0600) Subject: Refactor: Change "one", "two", and "three" into "a", "b", and "c". X-Git-Tag: 0.5.8~19 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=a577a43dfdd352d7df15ca06e066d19afbdff4ed;p=fll Refactor: Change "one", "two", and "three" into "a", "b", and "c". This makes the use of triples easier. --- diff --git a/level_0/f_string/c/private-string.c b/level_0/f_string/c/private-string.c index 50e08a8..28c4132 100644 --- a/level_0/f_string/c/private-string.c +++ b/level_0/f_string/c/private-string.c @@ -891,13 +891,13 @@ extern "C" { for (f_array_length_t i = length; i < triples->size; ++i) { - status = private_f_string_dynamic_adjust(0, &triples->array[i].one); + status = private_f_string_dynamic_adjust(0, &triples->array[i].a); if (F_status_is_error(status)) return status; - status = private_f_string_dynamic_adjust(0, &triples->array[i].two); + status = private_f_string_dynamic_adjust(0, &triples->array[i].b); if (F_status_is_error(status)) return status; - status = private_f_string_dynamic_adjust(0, &triples->array[i].three); + status = private_f_string_dynamic_adjust(0, &triples->array[i].c); if (F_status_is_error(status)) return status; } // for @@ -926,13 +926,13 @@ extern "C" { for (f_array_length_t i = length; i < triples->size; ++i) { - status = private_f_string_dynamic_resize(0, &triples->array[i].one); + status = private_f_string_dynamic_resize(0, &triples->array[i].a); if (F_status_is_error(status)) return status; - status = private_f_string_dynamic_resize(0, &triples->array[i].two); + status = private_f_string_dynamic_resize(0, &triples->array[i].b); if (F_status_is_error(status)) return status; - status = private_f_string_dynamic_resize(0, &triples->array[i].three); + status = private_f_string_dynamic_resize(0, &triples->array[i].c); if (F_status_is_error(status)) return status; } // for diff --git a/level_0/f_string/c/string/triple.c b/level_0/f_string/c/string/triple.c index 056d777..497a581 100644 --- a/level_0/f_string/c/string/triple.c +++ b/level_0/f_string/c/string/triple.c @@ -34,22 +34,22 @@ extern "C" { for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) { - destination->array[destination->used].one.used = 0; - destination->array[destination->used].two.used = 0; - destination->array[destination->used].three.used = 0; + destination->array[destination->used].a.used = 0; + destination->array[destination->used].b.used = 0; + destination->array[destination->used].c.used = 0; - if (source.array[i].one.used) { - status = private_f_string_append(source.array[i].one.string, source.array[i].one.used, &destination->array[destination->used].one); + if (source.array[i].a.used) { + status = private_f_string_append(source.array[i].a.string, source.array[i].a.used, &destination->array[destination->used].a); if (F_status_is_error(status)) return status; } - if (source.array[i].two.used) { - status = private_f_string_append(source.array[i].two.string, source.array[i].two.used, &destination->array[destination->used].two); + if (source.array[i].b.used) { + status = private_f_string_append(source.array[i].b.string, source.array[i].b.used, &destination->array[destination->used].b); if (F_status_is_error(status)) return status; } - if (source.array[i].three.used) { - status = private_f_string_append(source.array[i].three.string, source.array[i].three.used, &destination->array[destination->used].three); + if (source.array[i].c.used) { + status = private_f_string_append(source.array[i].c.string, source.array[i].c.used, &destination->array[destination->used].c); if (F_status_is_error(status)) return status; } } // for diff --git a/level_0/f_string/c/string/triple.h b/level_0/f_string/c/string/triple.h index 27a0d71..322cf29 100644 --- a/level_0/f_string/c/string/triple.h +++ b/level_0/f_string/c/string/triple.h @@ -19,39 +19,39 @@ extern "C" { /** * A string triple consisting of a set of three strings. * - * one: A string representing the first string in the triple. - * two: A string representing the second string in the triple. - * three: A string representing the third string in the triple. + * a: A string representing the first string in the triple. + * b: A string representing the second string in the triple. + * c: A string representing the third string in the triple. */ #ifndef _di_f_string_triple_t_ typedef struct { - f_string_dynamic_t one; - f_string_dynamic_t two; - f_string_dynamic_t three; + f_string_dynamic_t a; + f_string_dynamic_t b; + f_string_dynamic_t c; } f_string_triple_t; #define f_string_triple_t_initialize { f_string_dynamic_t_initialize, f_string_dynamic_t_initialize, f_string_dynamic_t_initialize } #define macro_f_string_triple_t_clear(triple) \ - triple.one.array = 0; \ - triple.one.size = 0; \ - triple.one.used = 0; \ - triple.two.array = 0; \ - triple.two.size = 0; \ - triple.two.used = 0; \ - triple.three.array = 0; \ - triple.three.size = 0; \ - triple.three.used = 0; + triple.a.array = 0; \ + triple.a.size = 0; \ + triple.a.used = 0; \ + triple.b.array = 0; \ + triple.b.size = 0; \ + triple.b.used = 0; \ + triple.c.array = 0; \ + triple.c.size = 0; \ + triple.c.used = 0; #define macro_f_string_triple_t_delete_simple(triple) \ - macro_f_string_dynamic_t_delete_simple(triple.one) \ - macro_f_string_dynamic_t_delete_simple(triple.two) \ - macro_f_string_dynamic_t_delete_simple(triple.three) + macro_f_string_dynamic_t_delete_simple(triple.a) \ + macro_f_string_dynamic_t_delete_simple(triple.b) \ + macro_f_string_dynamic_t_delete_simple(triple.c) #define macro_f_string_triple_t_destroy_simple(triple) \ - macro_f_string_dynamic_t_destroy_simple(triple.one) \ - macro_f_string_dynamic_t_destroy_simple(triple.two) \ - macro_f_string_dynamic_t_destroy_simple(triple.three) + macro_f_string_dynamic_t_destroy_simple(triple.a) \ + macro_f_string_dynamic_t_destroy_simple(triple.b) \ + macro_f_string_dynamic_t_destroy_simple(triple.c) #endif // _di_f_string_triple_t_ /** diff --git a/level_0/f_utf/c/utf.h b/level_0/f_utf/c/utf.h index 4aa57ee..3c14279 100644 --- a/level_0/f_utf/c/utf.h +++ b/level_0/f_utf/c/utf.h @@ -7,8 +7,6 @@ * * Provides UTF-8 capabilities. * - * @todo consider is_graph() functions being their own data set (review unicode to see which of checking only for graph() vs checking for all not-graph will be the smaller set). - * * Identifiers: * - UTF_8-1: 1000 0000 * - UTF_8-2: 1100 0000 diff --git a/level_0/f_utf/c/utf/private-string.c b/level_0/f_utf/c/utf/private-string.c index 7cf38a4..ca8b242 100644 --- a/level_0/f_utf/c/utf/private-string.c +++ b/level_0/f_utf/c/utf/private-string.c @@ -432,13 +432,13 @@ extern "C" { for (f_array_length_t i = length; i < triples->size; ++i) { - status = private_f_utf_string_dynamic_adjust(0, &triples->array[i].one); + status = private_f_utf_string_dynamic_adjust(0, &triples->array[i].a); if (F_status_is_error(status)) return status; - status = private_f_utf_string_dynamic_adjust(0, &triples->array[i].two); + status = private_f_utf_string_dynamic_adjust(0, &triples->array[i].b); if (F_status_is_error(status)) return status; - status = private_f_utf_string_dynamic_adjust(0, &triples->array[i].three); + status = private_f_utf_string_dynamic_adjust(0, &triples->array[i].c); if (F_status_is_error(status)) return status; } // for @@ -467,13 +467,13 @@ extern "C" { for (f_array_length_t i = length; i < triples->size; ++i) { - status = private_f_utf_string_dynamic_resize(0, &triples->array[i].one); + status = private_f_utf_string_dynamic_resize(0, &triples->array[i].a); if (F_status_is_error(status)) return status; - status = private_f_utf_string_dynamic_resize(0, &triples->array[i].two); + status = private_f_utf_string_dynamic_resize(0, &triples->array[i].b); if (F_status_is_error(status)) return status; - status = private_f_utf_string_dynamic_resize(0, &triples->array[i].three); + status = private_f_utf_string_dynamic_resize(0, &triples->array[i].c); if (F_status_is_error(status)) return status; } // for diff --git a/level_0/f_utf/c/utf/triple.c b/level_0/f_utf/c/utf/triple.c index 88fa935..0be2923 100644 --- a/level_0/f_utf/c/utf/triple.c +++ b/level_0/f_utf/c/utf/triple.c @@ -35,22 +35,22 @@ extern "C" { for (f_array_length_t i = 0; i < source.used; ++i, ++destination->used) { - destination->array[destination->used].one.used = 0; - destination->array[destination->used].two.used = 0; - destination->array[destination->used].three.used = 0; + destination->array[destination->used].a.used = 0; + destination->array[destination->used].b.used = 0; + destination->array[destination->used].c.used = 0; - if (source.array[i].one.used) { - status = private_f_utf_string_append(source.array[i].one.string, source.array[i].one.used, &destination->array[destination->used].one); + if (source.array[i].a.used) { + status = private_f_utf_string_append(source.array[i].a.string, source.array[i].a.used, &destination->array[destination->used].a); if (F_status_is_error(status)) return status; } - if (source.array[i].two.used) { - status = private_f_utf_string_append(source.array[i].two.string, source.array[i].two.used, &destination->array[destination->used].two); + if (source.array[i].b.used) { + status = private_f_utf_string_append(source.array[i].b.string, source.array[i].b.used, &destination->array[destination->used].b); if (F_status_is_error(status)) return status; } - if (source.array[i].three.used) { - status = private_f_utf_string_append(source.array[i].three.string, source.array[i].three.used, &destination->array[destination->used].three); + if (source.array[i].c.used) { + status = private_f_utf_string_append(source.array[i].c.string, source.array[i].c.used, &destination->array[destination->used].c); if (F_status_is_error(status)) return status; } } // for diff --git a/level_0/f_utf/c/utf/triple.h b/level_0/f_utf/c/utf/triple.h index 7b41d3c..77e1355 100644 --- a/level_0/f_utf/c/utf/triple.h +++ b/level_0/f_utf/c/utf/triple.h @@ -19,39 +19,39 @@ extern "C" { /** * A string triple consisting of a set of three strings. * - * one: A string representing the first string in the triple. - * two: A string representing the second string in the triple. - * three: A string representing the third string in the triple. + * a: A string representing the first string in the triple. + * b: A string representing the second string in the triple. + * c: A string representing the third string in the triple. */ #ifndef _di_f_utf_string_triple_t_ typedef struct { - f_utf_string_dynamic_t one; - f_utf_string_dynamic_t two; - f_utf_string_dynamic_t three; + f_utf_string_dynamic_t a; + f_utf_string_dynamic_t b; + f_utf_string_dynamic_t c; } f_utf_string_triple_t; #define f_utf_string_triple_t_initialize { f_utf_string_dynamic_t_initialize, f_utf_string_dynamic_t_initialize, f_utf_string_dynamic_t_initialize } #define macro_f_utf_string_triple_t_clear(triple) \ - triple.one.array = 0; \ - triple.one.size = 0; \ - triple.one.used = 0; \ - triple.two.array = 0; \ - triple.two.size = 0; \ - triple.two.used = 0; \ - triple.three.array = 0; \ - triple.three.size = 0; \ - triple.three.used = 0; + triple.a.array = 0; \ + triple.a.size = 0; \ + triple.a.used = 0; \ + triple.b.array = 0; \ + triple.b.size = 0; \ + triple.b.used = 0; \ + triple.c.array = 0; \ + triple.c.size = 0; \ + triple.c.used = 0; #define macro_f_utf_string_triple_t_delete_simple(triple) \ - macro_f_utf_string_dynamic_t_delete_simple(triple.one) \ - macro_f_utf_string_dynamic_t_delete_simple(triple.two) \ - macro_f_utf_string_dynamic_t_delete_simple(triple.three) + macro_f_utf_string_dynamic_t_delete_simple(triple.a) \ + macro_f_utf_string_dynamic_t_delete_simple(triple.b) \ + macro_f_utf_string_dynamic_t_delete_simple(triple.c) #define macro_f_utf_string_triple_t_destroy_simple(triple) \ - macro_f_utf_string_dynamic_t_destroy_simple(triple.one) \ - macro_f_utf_string_dynamic_t_destroy_simple(triple.two) \ - macro_f_utf_string_dynamic_t_destroy_simple(triple.three) + macro_f_utf_string_dynamic_t_destroy_simple(triple.a) \ + macro_f_utf_string_dynamic_t_destroy_simple(triple.b) \ + macro_f_utf_string_dynamic_t_destroy_simple(triple.c) #endif // _di_f_utf_string_triple_t_ /**