diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-10-17 08:06:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-10-17 08:06:45 +0300 |
commit | eb49a76dcaa18ef6bf2667b3671913ca9ccf31e7 (patch) | |
tree | 1f8c0a98d887707d679d07049b90545cece49ff2 /source/blender/blenlib/intern/path_util.c | |
parent | 3d69ef240e29194cb1be9d48591e5b411152632b (diff) |
Cleanup: warnings
- remove NULL checks for args already set as ATTR_NONNULL.
- double promotion.
Diffstat (limited to 'source/blender/blenlib/intern/path_util.c')
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index f5b3f217dee..c94ce842b8c 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -960,7 +960,7 @@ bool BLI_path_frame_range(char *path, int sta, int end, int digits) */ bool BLI_path_frame_get(char *path, int *r_frame, int *r_numdigits) { - if (path && *path) { + if (*path) { char *file = (char *)BLI_last_slash(path); char *c; int len, numdigits; @@ -1009,9 +1009,9 @@ bool BLI_path_frame_get(char *path, int *r_frame, int *r_numdigits) return false; } -void BLI_path_frame_strip(char *path, bool setsharp, char *ext) +void BLI_path_frame_strip(char *path, bool set_frame_char, char *ext) { - if (path && *path) { + if (*path) { char *file = (char *)BLI_last_slash(path); char *c, *suffix; int len; @@ -1046,15 +1046,12 @@ void BLI_path_frame_strip(char *path, bool setsharp, char *ext) if (numdigits) { /* replace the number with the suffix and terminate the string */ while (numdigits--) { - if (ext) *ext++ = *suffix; - - if (setsharp) *c++ = '#'; - else *c++ = *suffix; - + *ext++ = *suffix; + *c++ = set_frame_char ? '#' : *suffix; suffix++; } - *c = 0; - if (ext) *ext = 0; + *c = '\0'; + *ext = '\0'; } } } |