From 9ba948a4859da3308033fa6dc54f74433d7e6a21 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Mar 2019 13:16:10 +1100 Subject: Cleanup: style, use braces for blenlib --- source/blender/blenlib/intern/BLI_args.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'source/blender/blenlib/intern/BLI_args.c') diff --git a/source/blender/blenlib/intern/BLI_args.c b/source/blender/blenlib/intern/BLI_args.c index dbd609d914a..61619bc114b 100644 --- a/source/blender/blenlib/intern/BLI_args.c +++ b/source/blender/blenlib/intern/BLI_args.c @@ -71,8 +71,9 @@ static uint case_strhash(const void *ptr) uint i = 0; unsigned char c; - while ( (c = tolower(*s++)) ) + while ((c = tolower(*s++))) { i = i * 37 + c; + } return i; } @@ -150,8 +151,9 @@ static bArgDoc *internalDocs(struct bArgs *ba, const char *short_arg, const char d = MEM_callocN(sizeof(bArgDoc), "bArgDoc"); - if (doc == NULL) + if (doc == NULL) { doc = NO_DOCS; + } d->short_arg = short_arg; d->long_arg = long_arg; @@ -200,11 +202,13 @@ void BLI_argsAddCase(struct bArgs *ba, int pass, { bArgDoc *d = internalDocs(ba, short_arg, long_arg, doc); - if (short_arg) + if (short_arg) { internalAdd(ba, short_arg, pass, short_case, cb, data, d); + } - if (long_arg) + if (long_arg) { internalAdd(ba, long_arg, pass, long_case, cb, data, d); + } } void BLI_argsAdd(struct bArgs *ba, int pass, @@ -216,12 +220,15 @@ void BLI_argsAdd(struct bArgs *ba, int pass, static void internalDocPrint(bArgDoc *d) { - if (d->short_arg && d->long_arg) + if (d->short_arg && d->long_arg) { printf("%s or %s", d->short_arg, d->long_arg); - else if (d->short_arg) + } + else if (d->short_arg) { printf("%s", d->short_arg); - else if (d->long_arg) + } + else if (d->long_arg) { printf("%s", d->long_arg); + } printf(" %s\n\n", d->documentation); } @@ -284,8 +291,9 @@ void BLI_argsParse(struct bArgs *ba, int pass, BA_ArgCallback default_cb, void * } else if (retval == -1) { if (a) { - if (a->key->pass != -1) + if (a->key->pass != -1) { ba->passes[i] = pass; + } } break; } -- cgit v1.2.3