diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-26 18:03:11 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-26 18:59:24 +0300 |
commit | fca515838e70f8bec7028b840bb921a1be9fabbb (patch) | |
tree | 1752923de19eca5f01ca4cfb5754fd4d1f13d934 /source/blender/blenlib/intern/listbase.c | |
parent | d44890ee75634052f325531766a661a5bcef628f (diff) |
Cleanup: strcmp/strncmp -> STREQ/STREQLEN (in boolean usage).
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)'
and 'strcmp(foo, bar) == 0' in several places...
Diffstat (limited to 'source/blender/blenlib/intern/listbase.c')
-rw-r--r-- | source/blender/blenlib/intern/listbase.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/listbase.c b/source/blender/blenlib/intern/listbase.c index bd3e1e0bbb0..d52c09790f9 100644 --- a/source/blender/blenlib/intern/listbase.c +++ b/source/blender/blenlib/intern/listbase.c @@ -474,7 +474,7 @@ void *BLI_findstring(const ListBase *listbase, const char *id, const int offset) for (link = listbase->first; link; link = link->next) { id_iter = ((const char *)link) + offset; - if (id[0] == id_iter[0] && strcmp(id, id_iter) == 0) { + if (id[0] == id_iter[0] && STREQ(id, id_iter)) { return link; } } @@ -494,7 +494,7 @@ void *BLI_rfindstring(const ListBase *listbase, const char *id, const int offset for (link = listbase->last; link; link = link->prev) { id_iter = ((const char *)link) + offset; - if (id[0] == id_iter[0] && strcmp(id, id_iter) == 0) { + if (id[0] == id_iter[0] && STREQ(id, id_iter)) { return link; } } @@ -515,7 +515,7 @@ void *BLI_findstring_ptr(const ListBase *listbase, const char *id, const int off /* exact copy of BLI_findstring(), except for this line */ id_iter = *((const char **)(((const char *)link) + offset)); - if (id[0] == id_iter[0] && strcmp(id, id_iter) == 0) { + if (id[0] == id_iter[0] && STREQ(id, id_iter)) { return link; } } @@ -536,7 +536,7 @@ void *BLI_rfindstring_ptr(const ListBase *listbase, const char *id, const int of /* exact copy of BLI_rfindstring(), except for this line */ id_iter = *((const char **)(((const char *)link) + offset)); - if (id[0] == id_iter[0] && strcmp(id, id_iter) == 0) { + if (id[0] == id_iter[0] && STREQ(id, id_iter)) { return link; } } @@ -600,7 +600,7 @@ int BLI_findstringindex(const ListBase *listbase, const char *id, const int offs while (link) { id_iter = ((const char *)link) + offset; - if (id[0] == id_iter[0] && strcmp(id, id_iter) == 0) + if (id[0] == id_iter[0] && STREQ(id, id_iter)) return i; i++; link = link->next; |