about summary refs log tree commit diff
path: root/boot/common.c
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2025-06-30 02:53:10 +0200
committerMel <mel@rnrd.eu>2025-06-30 02:53:10 +0200
commit1e2b456f08a5d00c8cbe290fb7974818e8f17b46 (patch)
tree5c267daec7df47ca790f96cb951e04dfbaeb6dc5 /boot/common.c
parentb16cf0fc98940554ef0febfe443ef690618d5083 (diff)
downloadcatskill-1e2b456f08a5d00c8cbe290fb7974818e8f17b46.tar.zst
catskill-1e2b456f08a5d00c8cbe290fb7974818e8f17b46.zip
Re-format FOR_EACH macros as control structures
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/common.c')
-rw-r--r--boot/common.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/boot/common.c b/boot/common.c
index 8291a51..318edf7 100644
--- a/boot/common.c
+++ b/boot/common.c
@@ -75,10 +75,10 @@ failure(const ascii* message)
 {
     fflush(stdout); // flush stdout to ensure any message is printed before the error.
 
-    const ascii* format =
-        ANSI_RED ANSI_BOLD ";( sorry, a failure has occurred..." ANSI_NO_BOLD "\n"
-        "-> %s!" "\n"
-        ANSI_RESET;
+    const ascii* format = ANSI_RED ANSI_BOLD
+        ";( sorry, a failure has occurred..." ANSI_NO_BOLD "\n"
+        "-> %s!"
+        "\n" ANSI_RESET;
     fprintf(stderr, format, message);
 
     exit(EXIT_FAILURE);
@@ -92,8 +92,7 @@ check(bool condition, const ascii* message)
 }
 
 // for each entry in a linked list.
-#define FOR_EACH(type, cursor, head) \
-    for (type cursor = head; cursor != nil; cursor = cursor->next)
+#define FOR_EACH(type, cursor, head) for (type cursor = head; cursor != nil; cursor = cursor->next)
 
 // the common size of region memory blocks.
 #define REGION_SIZE 65536
@@ -239,7 +238,7 @@ string_array_at(const struct String_Array* array, uint index)
 }
 
 #define STRING_ARRAY_FOR_EACH(cursor, str, array) \
-    struct String str = array.strings[0]; \
+    struct String str = array.strings[0];         \
     for (uint cursor = 0; cursor < array.count; str = array.strings[++cursor])
 
 // single iteration of the CRC32 checksum algorithm