reformat code

Sun, 09 Apr 2023 19:06:16 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 09 Apr 2023 19:06:16 +0200
changeset 678
78f943d76f50
parent 677
b09aae58bba4
child 679
022fbd4bc057

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
     1.1 --- a/src/array_list.c	Sun Apr 09 19:03:58 2023 +0200
     1.2 +++ b/src/array_list.c	Sun Apr 09 19:06:16 2023 +0200
     1.3 @@ -272,7 +272,7 @@
     1.4      }
     1.5  
     1.6      // content destruction
     1.7 -    cx_invoke_destructor(list, ((char*)arl->data) + index * list->item_size);
     1.8 +    cx_invoke_destructor(list, ((char *) arl->data) + index * list->item_size);
     1.9  
    1.10      // short-circuit removal of last element
    1.11      if (index == list->size - 1) {
    1.12 @@ -510,7 +510,7 @@
    1.13      if (item_size > 0) {
    1.14          list->base.item_size = item_size;
    1.15      } else {
    1.16 -        item_size = sizeof(void*);
    1.17 +        item_size = sizeof(void *);
    1.18          cxListStorePointers((CxList *) list);
    1.19      }
    1.20  
     2.1 --- a/src/compare.c	Sun Apr 09 19:03:58 2023 +0200
     2.2 +++ b/src/compare.c	Sun Apr 09 19:06:16 2023 +0200
     2.3 @@ -31,8 +31,8 @@
     2.4  #include <math.h>
     2.5  
     2.6  int cx_cmp_int(void const *i1, void const *i2) {
     2.7 -    int a = *((const int*) i1);
     2.8 -    int b = *((const int*) i2);
     2.9 +    int a = *((const int *) i1);
    2.10 +    int b = *((const int *) i2);
    2.11      if (a == b) {
    2.12          return 0;
    2.13      } else {
    2.14 @@ -41,8 +41,8 @@
    2.15  }
    2.16  
    2.17  int cx_cmp_longint(void const *i1, void const *i2) {
    2.18 -    long int a = *((const long int*) i1);
    2.19 -    long int b = *((const long int*) i2);
    2.20 +    long int a = *((const long int *) i1);
    2.21 +    long int b = *((const long int *) i2);
    2.22      if (a == b) {
    2.23          return 0;
    2.24      } else {
    2.25 @@ -51,8 +51,8 @@
    2.26  }
    2.27  
    2.28  int cx_cmp_longlong(void const *i1, void const *i2) {
    2.29 -    long long a = *((const long long*) i1);
    2.30 -    long long b = *((const long long*) i2);
    2.31 +    long long a = *((const long long *) i1);
    2.32 +    long long b = *((const long long *) i2);
    2.33      if (a == b) {
    2.34          return 0;
    2.35      } else {
    2.36 @@ -61,8 +61,8 @@
    2.37  }
    2.38  
    2.39  int cx_cmp_int16(void const *i1, void const *i2) {
    2.40 -    int16_t a = *((const int16_t*) i1);
    2.41 -    int16_t b = *((const int16_t*) i2);
    2.42 +    int16_t a = *((const int16_t *) i1);
    2.43 +    int16_t b = *((const int16_t *) i2);
    2.44      if (a == b) {
    2.45          return 0;
    2.46      } else {
    2.47 @@ -71,8 +71,8 @@
    2.48  }
    2.49  
    2.50  int cx_cmp_int32(void const *i1, void const *i2) {
    2.51 -    int32_t a = *((const int32_t*) i1);
    2.52 -    int32_t b = *((const int32_t*) i2);
    2.53 +    int32_t a = *((const int32_t *) i1);
    2.54 +    int32_t b = *((const int32_t *) i2);
    2.55      if (a == b) {
    2.56          return 0;
    2.57      } else {
    2.58 @@ -81,8 +81,8 @@
    2.59  }
    2.60  
    2.61  int cx_cmp_int64(void const *i1, void const *i2) {
    2.62 -    int64_t a = *((const int64_t*) i1);
    2.63 -    int64_t b = *((const int64_t*) i2);
    2.64 +    int64_t a = *((const int64_t *) i1);
    2.65 +    int64_t b = *((const int64_t *) i2);
    2.66      if (a == b) {
    2.67          return 0;
    2.68      } else {
    2.69 @@ -91,8 +91,8 @@
    2.70  }
    2.71  
    2.72  int cx_cmp_uint(void const *i1, void const *i2) {
    2.73 -    unsigned int a = *((const unsigned int*) i1);
    2.74 -    unsigned int b = *((const unsigned int*) i2);
    2.75 +    unsigned int a = *((const unsigned int *) i1);
    2.76 +    unsigned int b = *((const unsigned int *) i2);
    2.77      if (a == b) {
    2.78          return 0;
    2.79      } else {
    2.80 @@ -101,8 +101,8 @@
    2.81  }
    2.82  
    2.83  int cx_cmp_ulongint(void const *i1, void const *i2) {
    2.84 -    unsigned long int a = *((const unsigned long int*) i1);
    2.85 -    unsigned long int b = *((const unsigned long int*) i2);
    2.86 +    unsigned long int a = *((const unsigned long int *) i1);
    2.87 +    unsigned long int b = *((const unsigned long int *) i2);
    2.88      if (a == b) {
    2.89          return 0;
    2.90      } else {
    2.91 @@ -111,8 +111,8 @@
    2.92  }
    2.93  
    2.94  int cx_cmp_ulonglong(void const *i1, void const *i2) {
    2.95 -    unsigned long long a = *((const unsigned long long*) i1);
    2.96 -    unsigned long long b = *((const unsigned long long*) i2);
    2.97 +    unsigned long long a = *((const unsigned long long *) i1);
    2.98 +    unsigned long long b = *((const unsigned long long *) i2);
    2.99      if (a == b) {
   2.100          return 0;
   2.101      } else {
   2.102 @@ -121,8 +121,8 @@
   2.103  }
   2.104  
   2.105  int cx_cmp_uint16(void const *i1, void const *i2) {
   2.106 -    uint16_t a = *((const uint16_t*) i1);
   2.107 -    uint16_t b = *((const uint16_t*) i2);
   2.108 +    uint16_t a = *((const uint16_t *) i1);
   2.109 +    uint16_t b = *((const uint16_t *) i2);
   2.110      if (a == b) {
   2.111          return 0;
   2.112      } else {
   2.113 @@ -131,8 +131,8 @@
   2.114  }
   2.115  
   2.116  int cx_cmp_uint32(void const *i1, void const *i2) {
   2.117 -    uint32_t a = *((const uint32_t*) i1);
   2.118 -    uint32_t b = *((const uint32_t*) i2);
   2.119 +    uint32_t a = *((const uint32_t *) i1);
   2.120 +    uint32_t b = *((const uint32_t *) i2);
   2.121      if (a == b) {
   2.122          return 0;
   2.123      } else {
   2.124 @@ -141,8 +141,8 @@
   2.125  }
   2.126  
   2.127  int cx_cmp_uint64(void const *i1, void const *i2) {
   2.128 -    uint64_t a = *((const uint64_t*) i1);
   2.129 -    uint64_t b = *((const uint64_t*) i2);
   2.130 +    uint64_t a = *((const uint64_t *) i1);
   2.131 +    uint64_t b = *((const uint64_t *) i2);
   2.132      if (a == b) {
   2.133          return 0;
   2.134      } else {
   2.135 @@ -151,8 +151,8 @@
   2.136  }
   2.137  
   2.138  int cx_cmp_float(void const *f1, void const *f2) {
   2.139 -    float a = *((const float*) f1);
   2.140 -    float b = *((const float*) f2);
   2.141 +    float a = *((const float *) f1);
   2.142 +    float b = *((const float *) f2);
   2.143      if (fabsf(a - b) < 1e-6f) {
   2.144          return 0;
   2.145      } else {
     3.1 --- a/src/hash_key.c	Sun Apr 09 19:03:58 2023 +0200
     3.2 +++ b/src/hash_key.c	Sun Apr 09 19:06:16 2023 +0200
     3.3 @@ -71,7 +71,7 @@
     3.4              h *= m;
     3.5                      __attribute__((__fallthrough__));
     3.6          default: // do nothing
     3.7 -        ;
     3.8 +            ;
     3.9      }
    3.10  
    3.11      h ^= h >> 13;
     4.1 --- a/src/tree.c	Sun Apr 09 19:03:58 2023 +0200
     4.2 +++ b/src/tree.c	Sun Apr 09 19:06:16 2023 +0200
     4.3 @@ -41,8 +41,8 @@
     4.4  }
     4.5  
     4.6  void cx_tree_add_child(void **children_begin, void **children_end,
     4.7 -                  ptrdiff_t loc_prev, ptrdiff_t loc_next, void *new_node,
     4.8 -                  ptrdiff_t loc_parent, void *parent) {
     4.9 +                       ptrdiff_t loc_prev, ptrdiff_t loc_next, void *new_node,
    4.10 +                       ptrdiff_t loc_parent, void *parent) {
    4.11      cx_linked_list_add(children_begin, children_end, loc_prev, loc_next, new_node);
    4.12  
    4.13      // optional parent link

mercurial