diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-08-08 05:33:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-08-08 06:38:00 +0300 |
commit | 4bf3ca20165959f98c7c830a138ba2901d3dd851 (patch) | |
tree | dd3e47024dec22fd46e240237e0328380800253d /source | |
parent | 61a045b7d30311b7524b5c40ffb33ef15a53dd0a (diff) |
Cleanup: replace elem_strcmp with elem_streq
This is used for equality and didn't have the same behavior as strcmp.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/intern/dna_genfile.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index 00ec765bfa9..8ad0271f355 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -937,13 +937,13 @@ static void cast_pointer( /** * Equality test on name and oname excluding any array-size suffix. */ -static int elem_strcmp(const char *name, const char *oname) +static bool elem_streq(const char *name, const char *oname) { int a = 0; while (1) { if (name[a] != oname[a]) { - return 1; + return false; } if (name[a] == '[' || oname[a] == '[') { break; @@ -953,7 +953,7 @@ static int elem_strcmp(const char *name, const char *oname) } a++; } - return 0; + return true; } /** @@ -984,8 +984,8 @@ static bool elem_exists_impl( otype = types[old[0]]; oname = names[old[1]]; - if (elem_strcmp(name, oname) == 0) { /* name equal */ - return STREQ(type, otype); /* type equal */ + if (elem_streq(name, oname)) { /* name equal */ + return STREQ(type, otype); /* type equal */ } } return false; @@ -1060,8 +1060,8 @@ static const char *find_elem(const SDNA *sdna, len = DNA_elem_size_nr(sdna, old[0], old[1]); - if (elem_strcmp(name, oname) == 0) { /* name equal */ - if (STREQ(type, otype)) { /* type equal */ + if (elem_streq(name, oname)) { /* name equal */ + if (STREQ(type, otype)) { /* type equal */ if (sppo) { *sppo = old; } |