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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-01-26 18:03:11 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-01-26 18:59:24 +0300
commitfca515838e70f8bec7028b840bb921a1be9fabbb (patch)
tree1752923de19eca5f01ca4cfb5754fd4d1f13d934 /source/blender/editors/space_file/filelist.c
parentd44890ee75634052f325531766a661a5bcef628f (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/editors/space_file/filelist.c')
-rw-r--r--source/blender/editors/space_file/filelist.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index bcef0817ffe..bf9c6626706 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -304,10 +304,10 @@ static int compare_direntry_generic(const struct direntry *entry1, const struct
if ((entry1->type & S_IFMT) > (entry2->type & S_IFMT)) return (1);
/* make sure "." and ".." are always first */
- if (strcmp(entry1->relname, ".") == 0) return (-1);
- if (strcmp(entry2->relname, ".") == 0) return (1);
- if (strcmp(entry1->relname, "..") == 0) return (-1);
- if (strcmp(entry2->relname, "..") == 0) return (1);
+ if (STREQ(entry1->relname, ".")) return (-1);
+ if (STREQ(entry2->relname, ".")) return (1);
+ if (STREQ(entry1->relname, "..")) return (-1);
+ if (STREQ(entry2->relname, "..")) return (1);
return 0;
}
@@ -634,10 +634,10 @@ ImBuf *filelist_geticon(struct FileList *filelist, const int index)
fidx = filelist->fidx[index];
file = &filelist->filelist[fidx];
if (file->type & S_IFDIR) {
- if (strcmp(filelist->filelist[fidx].relname, "..") == 0) {
+ if (STREQ(filelist->filelist[fidx].relname, "..")) {
ibuf = gSpecialFileImages[SPECIAL_IMG_PARENT];
}
- else if (strcmp(filelist->filelist[fidx].relname, ".") == 0) {
+ else if (STREQ(filelist->filelist[fidx].relname, ".")) {
ibuf = gSpecialFileImages[SPECIAL_IMG_REFRESH];
}
else {
@@ -773,7 +773,8 @@ int filelist_find(struct FileList *filelist, const char *filename)
for (i = 0; i < filelist->numfiles; ++i) {
- if (strcmp(filelist->filelist[i].relname, filename) == 0) { /* not dealing with user input so don't need BLI_path_cmp */
+ /* not dealing with user input so don't need BLI_path_cmp */
+ if (STREQ(filelist->filelist[i].relname, filename)) {
index = i;
break;
}