]> git.seodisparate.com - SimpleArchiver/commitdiff
`clang-format`
authorStephen Seo <seo.disparate@gmail.com>
Sat, 21 Sep 2024 02:43:25 +0000 (11:43 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Sat, 21 Sep 2024 02:43:25 +0000 (11:43 +0900)
src/archiver.h
src/data_structures/linked_list.c
src/data_structures/test.c
src/test.c

index 6425bf07095a53eee6f049905e8336563e3548ca..e651b87d8f461ac5b4e5ba5b8b2395939fac8d29 100644 (file)
@@ -20,8 +20,8 @@
 #define SEODISPARATE_COM_SIMPLE_ARCHIVER_ARCHIVER_H_
 
 // Standard library includes.
-#include <stdio.h>
 #include <stdint.h>
+#include <stdio.h>
 
 // Local includes.
 #include "data_structures/hash_map.h"
index 1d3b246c59fa2816a2ca99cb90a3c1247a97e631..e3b399a48e24f6c6d562106eefdcce81a232d437 100644 (file)
@@ -19,8 +19,8 @@
 #include "linked_list.h"
 
 // Standard library includes.
-#include <stdlib.h>
 #include <stdint.h>
+#include <stdlib.h>
 
 SDArchiverLinkedList *simple_archiver_list_init(void) {
   SDArchiverLinkedList *list = malloc(sizeof(SDArchiverLinkedList));
index df82a567614d69afeb6bdf1aa76258f4faf0389c..8dfda99b095af1fb1b99715cd88b5a49bdd51364 100644 (file)
 // `data_structures/test.c` is the source for testing data structure code.
 
 // Standard library includes.
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdint.h>
 
 // Local includes.
 #include "../algorithms/linear_congruential_gen.h"
@@ -148,8 +148,8 @@ int main(void) {
         key = malloc(sizeof(int32_t));
         *value = idx;
         *key = idx;
-        simple_archiver_hash_map_insert(hash_map, value, key, sizeof(int32_t), NULL,
-                                        NULL);
+        simple_archiver_hash_map_insert(hash_map, value, key, sizeof(int32_t),
+                                        NULL, NULL);
       }
     }
 
@@ -205,16 +205,14 @@ int main(void) {
     CHECK_TRUE(simple_archiver_hash_map_iter(hash_map, hash_map_iter_check_fn,
                                              found) == 0);
 
-    for (uint32_t idx = 0; idx < SDARCHIVER_DS_TEST_HASH_MAP_ITER_SIZE;
-         ++idx) {
+    for (uint32_t idx = 0; idx < SDARCHIVER_DS_TEST_HASH_MAP_ITER_SIZE; ++idx) {
       CHECK_TRUE(found[idx] == 1);
     }
 
     CHECK_TRUE(simple_archiver_hash_map_iter(hash_map, hash_map_iter_check_fn2,
                                              found) == 2);
 
-    for (uint32_t idx = 0; idx < SDARCHIVER_DS_TEST_HASH_MAP_ITER_SIZE;
-         ++idx) {
+    for (uint32_t idx = 0; idx < SDARCHIVER_DS_TEST_HASH_MAP_ITER_SIZE; ++idx) {
       CHECK_TRUE(found[idx] == 1);
     }
 
@@ -289,7 +287,7 @@ int main(void) {
     // Deterministic randomization.
     for (uint32_t idx = max - 1; idx-- > 0;) {
       uint32_t other_idx = simple_archiver_algo_lcg_defaults(idx) %
-                               (unsigned long long)(idx + 1);
+                           (unsigned long long)(idx + 1);
       if (max - 1 != other_idx) {
         uint32_t temp = array[max - 1];
         array[max - 1] = array[other_idx];
@@ -357,7 +355,7 @@ int main(void) {
     // Deterministic randomization.
     for (uint32_t idx = max - 1; idx-- > 0;) {
       uint32_t other_idx = simple_archiver_algo_lcg_defaults(idx) %
-                               (unsigned long long)(idx + 1);
+                           (unsigned long long)(idx + 1);
       if (max - 1 != other_idx) {
         uint32_t temp = array[max - 1];
         array[max - 1] = array[other_idx];
index 2af8ade8fc1351bbe130b986ae7397f8fbcd9557..869816f826bd539d088126d78245a43d12c8ea7e 100644 (file)
 // `test.c` is the source for testing code.
 
 // Standard library includes.
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdint.h>
 
 // Local includes.
 #include "helpers.h"