diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-11-04 10:06:36 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-11-04 12:59:57 -0700 |
commit | 05401f3c4e641c1e67d11187dfb943c7ec1708f4 (patch) | |
tree | 0bcdb0de1895225ee003e4a1e2a364ca92453ad5 /constlist.c | |
parent | a631117eb3d816e8b3fdb969017fc5d3c7357ba3 (diff) |
Convert to X.Org standard code style
Mostly via util/modular/x-indent-all.sh, plus some manual cleanup
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'constlist.c')
-rw-r--r-- | constlist.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/constlist.c b/constlist.c index b57fc97..bdff352 100644 --- a/constlist.c +++ b/constlist.c @@ -29,13 +29,13 @@ appendConstList(ConstListPtr first, ConstListPtr second) { ConstListPtr current; - if(second == NULL) + if (second == NULL) return first; - if(first == NULL) + if (first == NULL) return second; - for(current = first; current->next; current = current->next) + for (current = first; current->next; current = current->next) ; current->next = second; @@ -48,20 +48,20 @@ makeConstList(const char **a, int n, ConstListPtr old, int begin) ConstListPtr first, current, next; int i; - if(n == 0) + if (n == 0) return old; first = malloc(sizeof(ConstListRec)); - if(!first) + if (!first) return NULL; first->value = a[0]; first->next = NULL; current = first; - for(i = 1; i < n; i++) { + for (i = 1; i < n; i++) { next = malloc(sizeof(ConstListRec)); - if(!next) { + if (!next) { destroyConstList(first); return NULL; } @@ -71,10 +71,11 @@ makeConstList(const char **a, int n, ConstListPtr old, int begin) current->next = next; current = next; } - if(begin) { + if (begin) { current->next = old; return first; - } else { + } + else { return appendConstList(old, first); } } @@ -83,9 +84,10 @@ void destroyConstList(ConstListPtr old) { ConstListPtr next; - if(!old) + + if (!old) return; - while(old) { + while (old) { next = old->next; free(old); old = next; |