Sun, 09 Apr 2023 19:06:16 +0200
reformat code
src/array_list.c | file | annotate | diff | comparison | revisions | |
src/compare.c | file | annotate | diff | comparison | revisions | |
src/hash_key.c | file | annotate | diff | comparison | revisions | |
src/tree.c | file | annotate | diff | comparison | revisions |
--- a/src/array_list.c Sun Apr 09 19:03:58 2023 +0200 +++ b/src/array_list.c Sun Apr 09 19:06:16 2023 +0200 @@ -272,7 +272,7 @@ } // content destruction - cx_invoke_destructor(list, ((char*)arl->data) + index * list->item_size); + cx_invoke_destructor(list, ((char *) arl->data) + index * list->item_size); // short-circuit removal of last element if (index == list->size - 1) { @@ -510,7 +510,7 @@ if (item_size > 0) { list->base.item_size = item_size; } else { - item_size = sizeof(void*); + item_size = sizeof(void *); cxListStorePointers((CxList *) list); }
--- a/src/compare.c Sun Apr 09 19:03:58 2023 +0200 +++ b/src/compare.c Sun Apr 09 19:06:16 2023 +0200 @@ -31,8 +31,8 @@ #include <math.h> int cx_cmp_int(void const *i1, void const *i2) { - int a = *((const int*) i1); - int b = *((const int*) i2); + int a = *((const int *) i1); + int b = *((const int *) i2); if (a == b) { return 0; } else { @@ -41,8 +41,8 @@ } int cx_cmp_longint(void const *i1, void const *i2) { - long int a = *((const long int*) i1); - long int b = *((const long int*) i2); + long int a = *((const long int *) i1); + long int b = *((const long int *) i2); if (a == b) { return 0; } else { @@ -51,8 +51,8 @@ } int cx_cmp_longlong(void const *i1, void const *i2) { - long long a = *((const long long*) i1); - long long b = *((const long long*) i2); + long long a = *((const long long *) i1); + long long b = *((const long long *) i2); if (a == b) { return 0; } else { @@ -61,8 +61,8 @@ } int cx_cmp_int16(void const *i1, void const *i2) { - int16_t a = *((const int16_t*) i1); - int16_t b = *((const int16_t*) i2); + int16_t a = *((const int16_t *) i1); + int16_t b = *((const int16_t *) i2); if (a == b) { return 0; } else { @@ -71,8 +71,8 @@ } int cx_cmp_int32(void const *i1, void const *i2) { - int32_t a = *((const int32_t*) i1); - int32_t b = *((const int32_t*) i2); + int32_t a = *((const int32_t *) i1); + int32_t b = *((const int32_t *) i2); if (a == b) { return 0; } else { @@ -81,8 +81,8 @@ } int cx_cmp_int64(void const *i1, void const *i2) { - int64_t a = *((const int64_t*) i1); - int64_t b = *((const int64_t*) i2); + int64_t a = *((const int64_t *) i1); + int64_t b = *((const int64_t *) i2); if (a == b) { return 0; } else { @@ -91,8 +91,8 @@ } int cx_cmp_uint(void const *i1, void const *i2) { - unsigned int a = *((const unsigned int*) i1); - unsigned int b = *((const unsigned int*) i2); + unsigned int a = *((const unsigned int *) i1); + unsigned int b = *((const unsigned int *) i2); if (a == b) { return 0; } else { @@ -101,8 +101,8 @@ } int cx_cmp_ulongint(void const *i1, void const *i2) { - unsigned long int a = *((const unsigned long int*) i1); - unsigned long int b = *((const unsigned long int*) i2); + unsigned long int a = *((const unsigned long int *) i1); + unsigned long int b = *((const unsigned long int *) i2); if (a == b) { return 0; } else { @@ -111,8 +111,8 @@ } int cx_cmp_ulonglong(void const *i1, void const *i2) { - unsigned long long a = *((const unsigned long long*) i1); - unsigned long long b = *((const unsigned long long*) i2); + unsigned long long a = *((const unsigned long long *) i1); + unsigned long long b = *((const unsigned long long *) i2); if (a == b) { return 0; } else { @@ -121,8 +121,8 @@ } int cx_cmp_uint16(void const *i1, void const *i2) { - uint16_t a = *((const uint16_t*) i1); - uint16_t b = *((const uint16_t*) i2); + uint16_t a = *((const uint16_t *) i1); + uint16_t b = *((const uint16_t *) i2); if (a == b) { return 0; } else { @@ -131,8 +131,8 @@ } int cx_cmp_uint32(void const *i1, void const *i2) { - uint32_t a = *((const uint32_t*) i1); - uint32_t b = *((const uint32_t*) i2); + uint32_t a = *((const uint32_t *) i1); + uint32_t b = *((const uint32_t *) i2); if (a == b) { return 0; } else { @@ -141,8 +141,8 @@ } int cx_cmp_uint64(void const *i1, void const *i2) { - uint64_t a = *((const uint64_t*) i1); - uint64_t b = *((const uint64_t*) i2); + uint64_t a = *((const uint64_t *) i1); + uint64_t b = *((const uint64_t *) i2); if (a == b) { return 0; } else { @@ -151,8 +151,8 @@ } int cx_cmp_float(void const *f1, void const *f2) { - float a = *((const float*) f1); - float b = *((const float*) f2); + float a = *((const float *) f1); + float b = *((const float *) f2); if (fabsf(a - b) < 1e-6f) { return 0; } else {
--- a/src/hash_key.c Sun Apr 09 19:03:58 2023 +0200 +++ b/src/hash_key.c Sun Apr 09 19:06:16 2023 +0200 @@ -71,7 +71,7 @@ h *= m; __attribute__((__fallthrough__)); default: // do nothing - ; + ; } h ^= h >> 13;
--- a/src/tree.c Sun Apr 09 19:03:58 2023 +0200 +++ b/src/tree.c Sun Apr 09 19:06:16 2023 +0200 @@ -41,8 +41,8 @@ } void cx_tree_add_child(void **children_begin, void **children_end, - ptrdiff_t loc_prev, ptrdiff_t loc_next, void *new_node, - ptrdiff_t loc_parent, void *parent) { + ptrdiff_t loc_prev, ptrdiff_t loc_next, void *new_node, + ptrdiff_t loc_parent, void *parent) { cx_linked_list_add(children_begin, children_end, loc_prev, loc_next, new_node); // optional parent link