]> Kevux Git Server - fll/commitdiff
Cleanup: Use macro_f_string_static_t_initialize2() with macro_f_string_static_t_initi...
authorKevin Day <thekevinday@gmail.com>
Mon, 23 May 2022 01:51:29 +0000 (20:51 -0500)
committerKevin Day <thekevinday@gmail.com>
Mon, 23 May 2022 01:51:29 +0000 (20:51 -0500)
Using macro_f_string_static_t_initialize2() was the old way and is now deemed incorrect.
The macro_f_string_static_t_initialize2() applies the length parameter to both the used and size.
For static strings the size is always 0 because nothing is dynamically allocated.
Therefore, using macro_f_string_static_t_initialize2() for static string initialization is incorrect.

level_1/fl_directory/c/directory.c
level_3/controller/c/entry/private-entry.c
level_3/fake/c/private-make-operate.c

index 217629232a4b4674108ab014298f6b1a4fedc157..f1646a25c3e07776b83b93429c8fe43e50b02c28 100644 (file)
@@ -145,8 +145,8 @@ extern "C" {
     if (F_status_is_error(status)) return status;
     if (status == F_false) return F_status_set_error(F_directory_not);
 
-    f_string_static_t static_source = macro_f_string_static_t_initialize2(source.string, source.used);
-    f_string_static_t static_destination = macro_f_string_static_t_initialize2(destination.string, destination.used);
+    f_string_static_t static_source = macro_f_string_static_t_initialize(source.string, 0, source.used);
+    f_string_static_t static_destination = macro_f_string_static_t_initialize(destination.string, 0, destination.used);
 
     // Do not allow null termination or trailing path separators in the string's length calculation.
     {
@@ -213,8 +213,8 @@ extern "C" {
       if (F_status_is_error(status)) return status;
     }
 
-    f_string_static_t static_source = macro_f_string_static_t_initialize2(source.string, source.used);
-    f_string_static_t static_destination = macro_f_string_static_t_initialize2(destination.string, destination.used);
+    f_string_static_t static_source = macro_f_string_static_t_initialize(source.string, 0, source.used);
+    f_string_static_t static_destination = macro_f_string_static_t_initialize(destination.string, 0, destination.used);
 
     // Do not allow null termination or trailing path separators in the string's length calculation.
     {
@@ -267,8 +267,8 @@ extern "C" {
     if (F_status_is_error(status)) return status;
     if (status == F_false) return F_status_set_error(F_directory_not);
 
-    f_string_static_t static_source = macro_f_string_static_t_initialize2(source.string, source.used);
-    f_string_static_t static_destination = macro_f_string_static_t_initialize2(destination.string, destination.used);
+    f_string_static_t static_source = macro_f_string_static_t_initialize(source.string, 0, source.used);
+    f_string_static_t static_destination = macro_f_string_static_t_initialize(destination.string, 0, destination.used);
 
     // Do not allow null termination or trailing path separators in the string's length calculation.
     {
index a1960433e61707aacdaa6618aa34ef2aafa2e986..a50fc05aa15c9ecdd63387d18a99ecc0af39df11 100644 (file)
@@ -1119,7 +1119,7 @@ extern "C" {
 
           const f_array_length_t id_rule_length = entry_action->parameters.array[0].used + entry_action->parameters.array[1].used + 1;
           f_char_t id_rule_name[id_rule_length + 1];
-          const f_string_static_t alias_rule = macro_f_string_static_t_initialize2(id_rule_name, id_rule_length);
+          const f_string_static_t alias_rule = macro_f_string_static_t_initialize(id_rule_name, 0, id_rule_length);
 
           memcpy(id_rule_name, entry_action->parameters.array[0].string, sizeof(f_char_t) * entry_action->parameters.array[0].used);
           memcpy(id_rule_name + entry_action->parameters.array[0].used + 1, entry_action->parameters.array[1].string, sizeof(f_char_t) * entry_action->parameters.array[1].used);
index cd76300cf9bc752fb5982bfaa13183a56179a281..674f72d85bdc960e4b2a2af468afdc6d714153a9 100644 (file)
@@ -161,9 +161,9 @@ extern "C" {
       return;
     }
 
-    const f_string_static_t vocabulary_context = macro_f_string_static_t_initialize2(F_iki_vocabulary_0002_context_s, F_iki_vocabulary_0002_context_s_length);
-    const f_string_static_t vocabulary_define = macro_f_string_static_t_initialize2(F_iki_vocabulary_0002_define_s, F_iki_vocabulary_0002_define_s_length);
-    const f_string_static_t vocabulary_parameter = macro_f_string_static_t_initialize2(F_iki_vocabulary_0002_parameter_s, F_iki_vocabulary_0002_parameter_s_length);
+    const f_string_static_t vocabulary_context = macro_f_string_static_t_initialize(F_iki_vocabulary_0002_context_s, 0, F_iki_vocabulary_0002_context_s_length);
+    const f_string_static_t vocabulary_define = macro_f_string_static_t_initialize(F_iki_vocabulary_0002_define_s, 0, F_iki_vocabulary_0002_define_s_length);
+    const f_string_static_t vocabulary_parameter = macro_f_string_static_t_initialize(F_iki_vocabulary_0002_parameter_s, 0, F_iki_vocabulary_0002_parameter_s_length);
 
     f_iki_data_t iki_data = f_iki_data_t_initialize;