[hackers] [libgrapheme] Apply clang format || Laslo Hunhold
commit c2aa140007c3fe8f6b58839668219e9c8414865b
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Fri May 26 12:19:55 2023 +0200
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Fri May 26 12:19:55 2023 +0200
Apply clang format
Signed-off-by: Laslo Hunhold <dev_AT_frign.de>
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
_AT_@ -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;
}
_AT_@ -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;
}
_AT_@ -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) {
_AT_@ -205,7 +207,6 @@ toolarge:
return 1;
}
-
static int
parse_level_list(const char *str, int_least8_t **level, size_t *levellen)
{
_AT_@ -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) {
_AT_@ -423,7 +424,7 @@ test_callback(const char *file, char **field, size_t nfields, char *comment,
}
free(current_reorder);
parse_reorder_list(tmp, ¤t_reorder,
- ¤t_reorder_len);
+ ¤t_reorder_len);
} else {
fprintf(stderr, "Unknown _AT_-input-line.\n");
exit(1);
_AT_@ -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
_AT_@ -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
_AT_@ -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;
}
Received on Fri May 26 2023 - 12:20:13 CEST
This archive was generated by hypermail 2.3.0
: Fri May 26 2023 - 12:24:39 CEST