diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-09-07 17:12:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-09-07 17:23:25 +0300 |
commit | 0b2d1badecc48b5cbff5ec088b29c6e9acc5e1d0 (patch) | |
tree | 0283a5c819d1e709edfd0de814636aa83a9b1033 /source/blender/blenlib/intern/string_utf8.c | |
parent | ab823176d31dc155645de733f1cd4fbd6ad74592 (diff) |
Cleanup: use post increment/decrement
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
Diffstat (limited to 'source/blender/blenlib/intern/string_utf8.c')
-rw-r--r-- | source/blender/blenlib/intern/string_utf8.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 22c23727d76..92c4ec73768 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -716,7 +716,7 @@ size_t BLI_str_utf8_from_unicode(uint c, char *outbuf) } if (outbuf) { - for (i = len - 1; i > 0; --i) { + for (i = len - 1; i > 0; i--) { outbuf[i] = (c & 0x3f) | 0x80; c >>= 6; } @@ -744,7 +744,7 @@ size_t BLI_str_utf8_from_unicode(uint c, char *outbuf) */ char *BLI_str_find_prev_char_utf8(const char *str, const char *p) { - for (--p; p >= str; --p) { + for (--p; p >= str; p--) { if ((*p & 0xc0) != 0x80) { return (char *)p; } @@ -771,12 +771,12 @@ char *BLI_str_find_next_char_utf8(const char *p, const char *end) { if (*p) { if (end) { - for (++p; p < end && (*p & 0xc0) == 0x80; ++p) { + for (++p; p < end && (*p & 0xc0) == 0x80; p++) { /* do nothing */ } } else { - for (++p; (*p & 0xc0) == 0x80; ++p) { + for (++p; (*p & 0xc0) == 0x80; p++) { /* do nothing */ } } @@ -852,7 +852,7 @@ size_t BLI_str_partition_ex_utf8(const char *str, break; } - for (d = delim; *d != '\0'; ++d) { + for (d = delim; *d != '\0'; d++) { if (*d == c) { /* *suf is already correct in case from_right is true. */ if (!from_right) { |