commit c2aa140007c3fe8f6b58839668219e9c8414865b
Author:     Laslo Hunhold <[email protected]>
AuthorDate: Fri May 26 12:19:55 2023 +0200
Commit:     Laslo Hunhold <[email protected]>
CommitDate: Fri May 26 12:19:55 2023 +0200

    Apply clang format
    
    Signed-off-by: Laslo Hunhold <[email protected]>

diff --git a/gen/bidirectional-test.c b/gen/bidirectional-test.c
index 4ea77e0..778ebe2 100644
--- a/gen/bidirectional-test.c
+++ b/gen/bidirectional-test.c
@@ -130,7 +130,8 @@ strtolevel(const char *str, size_t len, int_least8_t *level)
        /* check if the string is completely numerical */
        for (i = 0; i < len; i++) {
                if (str[i] < '0' && str[i] > '9') {
-                       fprintf(stderr, "strtolevel: '%.*s' is not an 
integer.\n",
+                       fprintf(stderr,
+                               "strtolevel: '%.*s' is not an integer.\n",
                                (int)len, str);
                        return 1;
                }
@@ -182,7 +183,8 @@ strtoreorder(const char *str, size_t len, int_least16_t 
*reorder)
        /* check if the string is completely numerical */
        for (i = 0; i < len; i++) {
                if (str[i] < '0' && str[i] > '9') {
-                       fprintf(stderr, "strtoreorder: '%.*s' is not an 
integer.\n",
+                       fprintf(stderr,
+                               "strtoreorder: '%.*s' is not an integer.\n",
                                (int)len, str);
                        return 1;
                }
@@ -190,7 +192,7 @@ strtoreorder(const char *str, size_t len, int_least16_t 
*reorder)
 
        if (len == 3) {
                *reorder = (str[0] - '0') * 100 + (str[1] - '0') * 10 +
-                        (str[2] - '0');
+                          (str[2] - '0');
        } else if (len == 2) {
                *reorder = (str[0] - '0') * 10 + (str[1] - '0');
        } else if (len == 1) {
@@ -205,7 +207,6 @@ toolarge:
        return 1;
 }
 
-
 static int
 parse_level_list(const char *str, int_least8_t **level, size_t *levellen)
 {
@@ -274,8 +275,8 @@ parse_reorder_list(const char *str, int_least16_t 
**reorder, size_t *reorderlen)
        for (i = 0, tmp1 = tmp2 = str; tmp2 != NULL; i++) {
                tmp2 = strchr(tmp1, ' ');
                if (strtoreorder(tmp1,
-                              tmp2 ? (size_t)(tmp2 - tmp1) : strlen(tmp1),
-                              &((*reorder)[i]))) {
+                                tmp2 ? (size_t)(tmp2 - tmp1) : strlen(tmp1),
+                                &((*reorder)[i]))) {
                        return 1;
                }
                if (tmp2 != NULL) {
@@ -423,7 +424,7 @@ test_callback(const char *file, char **field, size_t 
nfields, char *comment,
                        }
                        free(current_reorder);
                        parse_reorder_list(tmp, &current_reorder,
-                                        &current_reorder_len);
+                                          &current_reorder_len);
                } else {
                        fprintf(stderr, "Unknown @-input-line.\n");
                        exit(1);
@@ -549,7 +550,7 @@ character_test_callback(const char *file, char **field, 
size_t nfields,
                      &(test[testlen - 1].cplen));
        parse_level_list(field[3], &(test[testlen - 1].level), &tmp);
        parse_reorder_list(field[4], &(test[testlen - 1].reorder),
-                        &(test[testlen - 1].reorderlen));
+                          &(test[testlen - 1].reorderlen));
 
        /* parse paragraph-level-mode */
        if (strlen(field[1]) != 1) {
diff --git a/src/bidirectional.c b/src/bidirectional.c
index 6062ed6..9f1812c 100644
--- a/src/bidirectional.c
+++ b/src/bidirectional.c
@@ -1400,8 +1400,8 @@ preprocess(HERODOTUS_READER *r, enum 
grapheme_bidirectional_direction override,
                /* store resolved paragraph level in output variable */
                /* TODO use enum-type */
                *resolved = (paragraph_level == 0) ?
-                       GRAPHEME_BIDIRECTIONAL_DIRECTION_LTR :
-                       GRAPHEME_BIDIRECTIONAL_DIRECTION_RTL;
+                                   GRAPHEME_BIDIRECTIONAL_DIRECTION_LTR :
+                                   GRAPHEME_BIDIRECTIONAL_DIRECTION_RTL;
        }
 
        if (buf == NULL) {
diff --git a/test/bidirectional.c b/test/bidirectional.c
index 8ba0ac8..f2ba339 100644
--- a/test/bidirectional.c
+++ b/test/bidirectional.c
@@ -43,8 +43,10 @@ main(int argc, char *argv[])
                                goto err;
                        }
 
-                       /* resolved paragraph level (if specified in the test) 
*/
-                       if (bidirectional_test[i].resolved != 
GRAPHEME_BIDIRECTIONAL_DIRECTION_NEUTRAL &&
+                       /* resolved paragraph level (if specified in the test)
+                        */
+                       if (bidirectional_test[i].resolved !=
+                                   GRAPHEME_BIDIRECTIONAL_DIRECTION_NEUTRAL &&
                            resolved != bidirectional_test[i].resolved) {
                                goto err;
                        }

Reply via email to