diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-27 05:16:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-27 05:17:30 +0300 |
commit | 9ba948a4859da3308033fa6dc54f74433d7e6a21 (patch) | |
tree | 0bd6e95eb59d9af03aa32d925c68e1cbebecc246 /source/blender/blenlib/intern/BLI_args.c | |
parent | 337eb8c1de4c57c34520b467d79779153335eecb (diff) |
Cleanup: style, use braces for blenlib
Diffstat (limited to 'source/blender/blenlib/intern/BLI_args.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_args.c | 24 |
1 files changed, 16 insertions, 8 deletions
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; } |