Skip to content

Commit

Permalink
Run clang-format on all code
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Sep 30, 2022
1 parent 47d9c22 commit ff42640
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
15 changes: 7 additions & 8 deletions t/data_entry_list_t.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ test_map_value(MMDB_entry_data_list_s *entry_data_list) {
"==",
MMDB_DATA_TYPE_UTF8_STRING,
"found a map key in 'map'");
char *map_key_1_name =
dup_entry_string_or_bail(map_key_1->entry_data);
char *map_key_1_name = dup_entry_string_or_bail(map_key_1->entry_data);
ok(strcmp(map_key_1_name, "mapX") == 0, "key name is mapX");
free(map_key_1_name);

Expand Down Expand Up @@ -323,15 +322,15 @@ test_utf8_string_value(MMDB_entry_data_list_s *entry_data_list) {
0x65,
0x21,
0x20,
(char) 0xe2,
(char) 0x98,
(char) 0xaf,
(char)0xe2,
(char)0x98,
(char)0xaf,
0x20,
0x2d,
0x20,
(char) 0xe2,
(char) 0x99,
(char) 0xab,
(char)0xe2,
(char)0x99,
(char)0xab,
0x00};

is(utf8_string, expect, "got expected value for utf8_string key");
Expand Down
12 changes: 6 additions & 6 deletions t/data_types_t.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ void test_all_data_types(MMDB_lookup_result_s *result,
0x65,
0x21,
0x20,
(char) 0xe2,
(char) 0x98,
(char) 0xaf,
(char)0xe2,
(char)0x98,
(char)0xaf,
0x20,
0x2d,
0x20,
(char) 0xe2,
(char) 0x99,
(char) 0xab,
(char)0xe2,
(char)0x99,
(char)0xab,
0x00};
is(string, expect, "got expected utf8_string value");

Expand Down
3 changes: 1 addition & 2 deletions t/maxminddb_test_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ char *test_database_path(const char *filename) {
}

char *dup_entry_string_or_bail(MMDB_entry_data_s entry_data) {
char *string =
mmdb_strndup(entry_data.utf8_string, entry_data.data_size);
char *string = mmdb_strndup(entry_data.utf8_string, entry_data.data_size);
if (NULL == string) {
BAIL_OUT("mmdb_strndup failed");
}
Expand Down
3 changes: 2 additions & 1 deletion t/threads_t.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ void run_ipX_tests(MMDB_s *mmdb,
int pairs_rows,
const char *mode_desc) {
pthread_t *threads = malloc((unsigned long)pairs_rows * sizeof(pthread_t));
struct thread_arg *thread_args = malloc((unsigned long)pairs_rows * sizeof(struct thread_arg));
struct thread_arg *thread_args =
malloc((unsigned long)pairs_rows * sizeof(struct thread_arg));

for (int i = 0; i < pairs_rows; i += 1) {
thread_args[i].thread_id = i;
Expand Down

0 comments on commit ff42640

Please sign in to comment.