diff --git a/source/blender/blenlib/BLI_string.h b/source/blender/blenlib/BLI_string.h index 69702f72026..408809661cf 100644 --- a/source/blender/blenlib/BLI_string.h +++ b/source/blender/blenlib/BLI_string.h @@ -122,13 +122,6 @@ __attribute__ ((format (printf, 1, 2))) #endif ; - /** - * Compare two strings - * - * @retval True if the strings are equal, false otherwise. - */ -int BLI_streq(const char *a, const char *b); - /** * Compare two strings without regard to case. * diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index 11de8a3d45c..8e0314ec17f 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -212,11 +212,6 @@ char *BLI_replacestr(char *str, const char *oldText, const char *newText) } } -int BLI_streq(const char *a, const char *b) -{ - return (strcmp(a, b)==0); -} - int BLI_strcaseeq(const char *a, const char *b) { return (BLI_strcasecmp(a, b)==0); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 03cd6e188c4..5f984a9268d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1082,7 +1082,7 @@ int BLO_is_a_library(const char *path, char *dir, char *group) /* now we know that we are in a blend file and it is safe to assume that gp actually points to a group */ - if (BLI_streq("Screen", gp)==0) + if (strcmp("Screen", gp)!=0) BLI_strncpy(group, gp, GROUP_MAX); } return 1; @@ -12902,7 +12902,7 @@ static void append_id_part(FileData *fd, Main *mainvar, ID *id, ID **id_r) for (bhead= blo_firstbhead(fd); bhead; bhead= blo_nextbhead(fd, bhead)) { if (bhead->code == GS(id->name)) { - if (BLI_streq(id->name, bhead_id_name(fd, bhead))) { + if (strcmp(id->name, bhead_id_name(fd, bhead))==0) { id->flag &= ~LIB_READ; id->flag |= LIB_TEST; // printf("read lib block %s\n", id->name); diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index ccb9a45af37..97f85b92b32 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -374,16 +374,16 @@ static void sk_autoname(bContext *C, ReebArc *arc) int valid = 0; int caps = 0; - if (BLI_streq(side, "")) + if (side[0] == '\0') { valid = 1; } - else if (BLI_streq(side, "R") || BLI_streq(side, "L")) + else if (strcmp(side, "R")==0 || strcmp(side, "L")==0) { valid = 1; caps = 1; } - else if (BLI_streq(side, "r") || BLI_streq(side, "l")) + else if (strcmp(side, "r")==0 || strcmp(side, "l")==0) { valid = 1; caps = 0; diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index e70b793cfb0..da479fe7ca3 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1848,29 +1848,24 @@ void uiFreeInactiveBlocks(const bContext *C, ListBase *lb) void uiBlockSetRegion(uiBlock *block, ARegion *region) { - ListBase *lb; + ListBase *lb= ®ion->uiblocks; uiBlock *oldblock= NULL; - lb= ®ion->uiblocks; - /* each listbase only has one block with this name, free block * if is already there so it can be rebuilt from scratch */ if(lb) { - for (oldblock= lb->first; oldblock; oldblock= oldblock->next) - if (BLI_streq(oldblock->name, block->name)) - break; + oldblock= BLI_findstring(lb, block->name, offsetof(uiBlock, name)); if (oldblock) { oldblock->active= 0; oldblock->panel= NULL; } + + /* at the beginning of the list! for dynamical menus/blocks */ + BLI_addhead(lb, block); } block->oldblock= oldblock; - - /* at the beginning of the list! for dynamical menus/blocks */ - if(lb) - BLI_addhead(lb, block); } uiBlock *uiBeginBlock(const bContext *C, ARegion *region, const char *name, short dt)