Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-05-27 01:04:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-27 01:04:01 +0400
commit78b8e4a437b34a3956283dae08a6718a01b00e63 (patch)
tree56cfe521361250f19e4a9a0ba71ade8bbaf97c53
parent06fea1a0ff01590e88ef210edd2314615e077400 (diff)
remove BLI_streq() since it was hardly used, also replace string search with BLI_findstring().
-rw-r--r--source/blender/blenlib/BLI_string.h7
-rw-r--r--source/blender/blenlib/intern/string.c5
-rw-r--r--source/blender/blenloader/intern/readfile.c4
-rw-r--r--source/blender/editors/armature/editarmature_sketch.c6
-rw-r--r--source/blender/editors/interface/interface.c15
5 files changed, 10 insertions, 27 deletions
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
@@ -123,13 +123,6 @@ __attribute__ ((format (printf, 1, 2)))
;
/**
- * 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.
*
* @retval True if the strings are equal, false otherwise.
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= &region->uiblocks;
uiBlock *oldblock= NULL;
- lb= &region->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)