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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-08-08 05:14:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-08-08 06:38:00 +0300
commit61a045b7d30311b7524b5c40ffb33ef15a53dd0a (patch)
treed5ca744a33988a49fa672aeb86572e7191921c2d /source
parent586a3084677b03e314a906ffdac3560a24058409 (diff)
Clenup: use STREQ macro
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/main_idmap.c2
-rw-r--r--source/blender/blenkernel/intern/object_facemap.c2
-rw-r--r--source/blender/blenkernel/intern/seqcache.c2
-rw-r--r--source/blender/blenkernel/intern/seqprefetch.c2
-rw-r--r--source/blender/blenlib/intern/fileops.c4
-rw-r--r--source/blender/blenloader/intern/versioning_280.c2
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c6
-rw-r--r--source/blender/gpu/intern/gpu_node_graph.c4
-rw-r--r--source/blender/gpu/intern/gpu_shader_interface.cc2
-rw-r--r--source/blender/imbuf/intern/jpeg.c2
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp2
-rw-r--r--source/blender/io/alembic/intern/abc_customdata.cc4
-rw-r--r--source/blender/makesdna/intern/dna_genfile.c24
-rw-r--r--source/blender/makesdna/intern/makesdna.c4
-rw-r--r--source/blender/render/intern/source/render_result.c4
15 files changed, 33 insertions, 33 deletions
diff --git a/source/blender/blenkernel/intern/main_idmap.c b/source/blender/blenkernel/intern/main_idmap.c
index 0e1f2223263..718af1f032d 100644
--- a/source/blender/blenkernel/intern/main_idmap.c
+++ b/source/blender/blenkernel/intern/main_idmap.c
@@ -166,7 +166,7 @@ static bool idkey_cmp(const void *a, const void *b)
{
const struct IDNameLib_Key *idkey_a = a;
const struct IDNameLib_Key *idkey_b = b;
- return strcmp(idkey_a->name, idkey_b->name) != 0 || (idkey_a->lib != idkey_b->lib);
+ return !STREQ(idkey_a->name, idkey_b->name) || (idkey_a->lib != idkey_b->lib);
}
ID *BKE_main_idmap_lookup_name(struct IDNameLib_Map *id_map,
diff --git a/source/blender/blenkernel/intern/object_facemap.c b/source/blender/blenkernel/intern/object_facemap.c
index 10a3e35e382..c44ec2b510e 100644
--- a/source/blender/blenkernel/intern/object_facemap.c
+++ b/source/blender/blenkernel/intern/object_facemap.c
@@ -55,7 +55,7 @@ static bool fmap_unique_check(void *arg, const char *name)
for (fmap = data->ob->fmaps.first; fmap; fmap = fmap->next) {
if (data->fm != fmap) {
- if (!strcmp(fmap->name, name)) {
+ if (STREQ(fmap->name, name)) {
return true;
}
}
diff --git a/source/blender/blenkernel/intern/seqcache.c b/source/blender/blenkernel/intern/seqcache.c
index be35c7b161b..3d1f33190dc 100644
--- a/source/blender/blenkernel/intern/seqcache.c
+++ b/source/blender/blenkernel/intern/seqcache.c
@@ -444,7 +444,7 @@ static void seq_disk_cache_delete_invalid_files(SeqDiskCache *disk_cache,
while (cache_file) {
next_file = cache_file->next;
if (cache_file->cache_type & invalidate_types) {
- if (strcmp(cache_dir, cache_file->dir) == 0) {
+ if (STREQ(cache_dir, cache_file->dir)) {
int cfra_start = seq_cache_frame_index_to_cfra(seq, cache_file->start_frame);
if (cfra_start > range_start && cfra_start <= range_end) {
seq_disk_cache_delete_file(disk_cache, cache_file);
diff --git a/source/blender/blenkernel/intern/seqprefetch.c b/source/blender/blenkernel/intern/seqprefetch.c
index ff3829bdebb..795086fffa4 100644
--- a/source/blender/blenkernel/intern/seqprefetch.c
+++ b/source/blender/blenkernel/intern/seqprefetch.c
@@ -138,7 +138,7 @@ static bool seq_prefetch_job_is_waiting(Scene *scene)
static Sequence *sequencer_prefetch_get_original_sequence(Sequence *seq, ListBase *seqbase)
{
LISTBASE_FOREACH (Sequence *, seq_orig, seqbase) {
- if (strcmp(seq->name, seq_orig->name) == 0) {
+ if (STREQ(seq->name, seq_orig->name)) {
return seq_orig;
}
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 6c7383bc297..014c5217896 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -950,8 +950,8 @@ static int delete_soft(const char *file, const char **error_message)
char *xdg_current_desktop = getenv("XDG_CURRENT_DESKTOP");
char *xdg_session_desktop = getenv("XDG_SESSION_DESKTOP");
- if ((xdg_current_desktop != NULL && strcmp(xdg_current_desktop, "KDE") == 0) ||
- (xdg_session_desktop != NULL && strcmp(xdg_session_desktop, "KDE") == 0)) {
+ if ((xdg_current_desktop != NULL && STREQ(xdg_current_desktop, "KDE")) ||
+ (xdg_session_desktop != NULL && STREQ(xdg_session_desktop, "KDE"))) {
args[0] = "kioclient5";
args[1] = "move";
args[2] = file;
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 4222df27cb7..5127bdcb77b 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1201,7 +1201,7 @@ static void do_version_fcurve_hide_viewport_fix(struct ID *UNUSED(id),
struct FCurve *fcu,
void *UNUSED(user_data))
{
- if (strcmp(fcu->rna_path, "hide") != 0) {
+ if (!STREQ(fcu->rna_path, "hide")) {
return;
}
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 08d2779043e..b051d4fe59a 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -111,11 +111,11 @@ static GPUPass *gpu_pass_cache_resolve_collision(GPUPass *pass,
BLI_spin_lock(&pass_cache_spin);
/* Collision, need to strcmp the whole shader. */
for (; pass && (pass->hash == hash); pass = pass->next) {
- if ((defs != NULL) && (strcmp(pass->defines, defs) != 0)) { /* Pass */
+ if ((defs != NULL) && (!STREQ(pass->defines, defs))) { /* Pass */
}
- else if ((geom != NULL) && (strcmp(pass->geometrycode, geom) != 0)) { /* Pass */
+ else if ((geom != NULL) && (!STREQ(pass->geometrycode, geom))) { /* Pass */
}
- else if ((strcmp(pass->fragmentcode, frag) == 0) && (strcmp(pass->vertexcode, vert) == 0)) {
+ else if ((!STREQ(pass->fragmentcode, frag) == 0) && (STREQ(pass->vertexcode, vert))) {
BLI_spin_unlock(&pass_cache_spin);
return pass;
}
diff --git a/source/blender/gpu/intern/gpu_node_graph.c b/source/blender/gpu/intern/gpu_node_graph.c
index 17d97dc05e2..81cf2d69f4d 100644
--- a/source/blender/gpu/intern/gpu_node_graph.c
+++ b/source/blender/gpu/intern/gpu_node_graph.c
@@ -457,10 +457,10 @@ GPUNodeLink *GPU_volume_grid(GPUMaterial *mat, const char *name)
/* Two special cases, where we adjust the output values of smoke grids to
* bring the into standard range without having to modify the grid values. */
- if (strcmp(name, "color") == 0) {
+ if (STREQ(name, "color")) {
GPU_link(mat, "node_attribute_volume_color", link, transform_link, &link);
}
- else if (strcmp(name, "temperature") == 0) {
+ else if (STREQ(name, "temperature")) {
GPU_link(mat, "node_attribute_volume_temperature", link, transform_link, &link);
}
else {
diff --git a/source/blender/gpu/intern/gpu_shader_interface.cc b/source/blender/gpu/intern/gpu_shader_interface.cc
index 50cc68c6be8..4511d4a199d 100644
--- a/source/blender/gpu/intern/gpu_shader_interface.cc
+++ b/source/blender/gpu/intern/gpu_shader_interface.cc
@@ -111,7 +111,7 @@ static const char *BuiltinUniformBlock_name(GPUUniformBlockBuiltin u)
GPU_INLINE bool match(const char *a, const char *b)
{
- return strcmp(a, b) == 0;
+ return STREQ(a, b);
}
GPU_INLINE uint hash_string(const char *str)
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c
index 89026c2f728..3346f1c0964 100644
--- a/source/blender/imbuf/intern/jpeg.c
+++ b/source/blender/imbuf/intern/jpeg.c
@@ -479,7 +479,7 @@ static void write_jpeg(struct jpeg_compress_struct *cinfo, struct ImBuf *ibuf)
for (prop = ibuf->metadata->data.group.first; prop; prop = prop->next) {
if (prop->type == IDP_STRING) {
int text_len;
- if (!strcmp(prop->name, "None")) {
+ if (STREQ(prop->name, "None")) {
jpeg_write_marker(cinfo, JPEG_COM, (JOCTET *)IDP_String(prop), prop->len + 1);
}
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index 77d60d37449..a4e4d41472f 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -1169,7 +1169,7 @@ void IMB_exrtile_write_channels(
/* eventually we can make the parts' channels to include
* only the current view TODO */
- if (strcmp(viewname, echan->m->view.c_str()) != 0) {
+ if (!STREQ(viewname, echan->m->view.c_str())) {
continue;
}
diff --git a/source/blender/io/alembic/intern/abc_customdata.cc b/source/blender/io/alembic/intern/abc_customdata.cc
index f3e2342e844..408894a8de2 100644
--- a/source/blender/io/alembic/intern/abc_customdata.cc
+++ b/source/blender/io/alembic/intern/abc_customdata.cc
@@ -330,7 +330,7 @@ static void read_custom_data_mcols(const std::string &iobject_full_name,
if (IC3fGeomParam::matches(prop_header)) {
IC3fGeomParam color_param(arbGeomParams, prop_header.getName());
IC3fGeomParam::Sample sample;
- BLI_assert(!strcmp("rgb", color_param.getInterpretation()));
+ BLI_assert(STREQ("rgb", color_param.getInterpretation()));
color_param.getIndexed(sample, iss);
is_facevarying = sample.getScope() == kFacevaryingScope &&
@@ -343,7 +343,7 @@ static void read_custom_data_mcols(const std::string &iobject_full_name,
else if (IC4fGeomParam::matches(prop_header)) {
IC4fGeomParam color_param(arbGeomParams, prop_header.getName());
IC4fGeomParam::Sample sample;
- BLI_assert(!strcmp("rgba", color_param.getInterpretation()));
+ BLI_assert(STREQ("rgba", color_param.getInterpretation()));
color_param.getIndexed(sample, iss);
is_facevarying = sample.getScope() == kFacevaryingScope &&
diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c
index 53ed010952e..00ec765bfa9 100644
--- a/source/blender/makesdna/intern/dna_genfile.c
+++ b/source/blender/makesdna/intern/dna_genfile.c
@@ -385,8 +385,8 @@ static bool init_structDNA(SDNA *sdna, bool do_endian_swap, const char **r_error
/* "float gravity [3]" was parsed wrong giving both "gravity" and
* "[3]" members. we rename "[3]", and later set the type of
* "gravity" to "void" so the offsets work out correct */
- if (*cp == '[' && strcmp(cp, "[3]") == 0) {
- if (nr && strcmp(sdna->names[nr - 1], "Cvi") == 0) {
+ if (*cp == '[' && STREQ(cp, "[3]")) {
+ if (nr && STREQ(sdna->names[nr - 1], "Cvi")) {
sdna->names[nr] = "gravity[3]";
gravity_fix = nr;
}
@@ -497,7 +497,7 @@ static bool init_structDNA(SDNA *sdna, bool do_endian_swap, const char **r_error
if (gravity_fix > -1) {
for (int nr = 0; nr < sdna->structs_len; nr++) {
sp = sdna->structs[nr];
- if (strcmp(sdna->types[sp[0]], "ClothSimSettings") == 0) {
+ if (STREQ(sdna->types[sp[0]], "ClothSimSettings")) {
sp[10] = SDNA_TYPE_VOID;
}
}
@@ -698,13 +698,13 @@ const char *DNA_struct_get_compareflags(const SDNA *oldsdna, const SDNA *newsdna
while (b > 0) {
str1 = newsdna->types[sp_new[0]];
str2 = oldsdna->types[sp_old[0]];
- if (strcmp(str1, str2) != 0) {
+ if (!STREQ(str1, str2)) {
break;
}
str1 = newsdna->names[sp_new[1]];
str2 = oldsdna->names[sp_old[1]];
- if (strcmp(str1, str2) != 0) {
+ if (!STREQ(str1, str2)) {
break;
}
@@ -985,7 +985,7 @@ static bool elem_exists_impl(
oname = names[old[1]];
if (elem_strcmp(name, oname) == 0) { /* name equal */
- return strcmp(type, otype) == 0; /* type equal */
+ return STREQ(type, otype); /* type equal */
}
}
return false;
@@ -1061,7 +1061,7 @@ 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 (strcmp(type, otype) == 0) { /* type equal */
+ if (STREQ(type, otype)) { /* type equal */
if (sppo) {
*sppo = old;
}
@@ -1129,7 +1129,7 @@ static void reconstruct_elem(const SDNA *newsdna,
oname = oldsdna->names[old[1]];
len = DNA_elem_size_nr(oldsdna, old[0], old[1]);
- if (strcmp(name, oname) == 0) { /* name equal */
+ if (STREQ(name, oname)) { /* name equal */
if (ispointer(name)) { /* pointer of functionpointer afhandelen */
cast_pointer(newsdna->pointer_size,
@@ -1138,7 +1138,7 @@ static void reconstruct_elem(const SDNA *newsdna,
curdata,
olddata);
}
- else if (strcmp(type, otype) == 0) { /* type equal */
+ else if (STREQ(type, otype)) { /* type equal */
memcpy(curdata, olddata, len);
}
else {
@@ -1158,7 +1158,7 @@ static void reconstruct_elem(const SDNA *newsdna,
cast_pointer(
newsdna->pointer_size, oldsdna->pointer_size, min_name_array_len, curdata, olddata);
}
- else if (strcmp(type, otype) == 0) { /* type equal */
+ else if (STREQ(type, otype)) { /* type equal */
/* size of single old array element */
mul = len / old_name_array_len;
/* smaller of sizes of old and new arrays */
@@ -1166,7 +1166,7 @@ static void reconstruct_elem(const SDNA *newsdna,
memcpy(curdata, olddata, mul);
- if (old_name_array_len > new_name_array_len && strcmp(type, "char") == 0) {
+ if (old_name_array_len > new_name_array_len && STREQ(type, "char")) {
/* string had to be truncated, ensure it's still null-terminated */
curdata[mul - 1] = '\0';
}
@@ -1365,7 +1365,7 @@ void DNA_struct_switch_endian(const SDNA *oldsdna, int oldSDNAnr, char *data)
/* exception: variable called blocktype: derived from ID_ */
bool skip = false;
if (name[0] == 'b' && name[1] == 'l') {
- if (strcmp(name, "blocktype") == 0) {
+ if (STREQ(name, "blocktype")) {
skip = true;
}
}
diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c
index af0d914391a..7aaedbff1ce 100644
--- a/source/blender/makesdna/intern/makesdna.c
+++ b/source/blender/makesdna/intern/makesdna.c
@@ -370,7 +370,7 @@ static int add_type(const char *str, int size)
/* search through type array */
for (int index = 0; index < types_len; index++) {
- if (strcmp(str, types[index]) == 0) {
+ if (STREQ(str, types[index])) {
if (size) {
types_size_native[index] = size;
types_size_32[index] = size;
@@ -523,7 +523,7 @@ static int add_name(const char *str)
/* search name array */
for (nr = 0; nr < names_len; nr++) {
- if (strcmp(name, names[nr]) == 0) {
+ if (STREQ(name, names[nr])) {
return nr;
}
}
diff --git a/source/blender/render/intern/source/render_result.c b/source/blender/render/intern/source/render_result.c
index 6299a86e25f..8b5f2778728 100644
--- a/source/blender/render/intern/source/render_result.c
+++ b/source/blender/render/intern/source/render_result.c
@@ -475,7 +475,7 @@ RenderResult *render_result_new(Render *re,
const char *view = rv->name;
if (viewname && viewname[0]) {
- if (strcmp(view, viewname) != 0) {
+ if (!STREQ(view, viewname)) {
continue;
}
}
@@ -877,7 +877,7 @@ void render_result_merge(RenderResult *rr, RenderResult *rrpart)
continue;
}
/* Renderresult have all passes, renderpart only the active view's passes. */
- if (strcmp(rpassp->fullname, rpass->fullname) != 0) {
+ if (!STREQ(rpassp->fullname, rpass->fullname)) {
continue;
}