Commit: 61a045b7d30311b7524b5c40ffb33ef15a53dd0a
Author: Campbell Barton
Date:   Sat Aug 8 12:14:52 2020 +1000
Branches: master
https://developer.blender.org/rB61a045b7d30311b7524b5c40ffb33ef15a53dd0a

Clenup: use STREQ macro

===================================================================

M       source/blender/blenkernel/intern/main_idmap.c
M       source/blender/blenkernel/intern/object_facemap.c
M       source/blender/blenkernel/intern/seqcache.c
M       source/blender/blenkernel/intern/seqprefetch.c
M       source/blender/blenlib/intern/fileops.c
M       source/blender/blenloader/intern/versioning_280.c
M       source/blender/gpu/intern/gpu_codegen.c
M       source/blender/gpu/intern/gpu_node_graph.c
M       source/blender/gpu/intern/gpu_shader_interface.cc
M       source/blender/imbuf/intern/jpeg.c
M       source/blender/imbuf/intern/openexr/openexr_api.cpp
M       source/blender/io/alembic/intern/abc_customdata.cc
M       source/blender/makesdna/intern/dna_genfile.c
M       source/blender/makesdna/intern/makesdna.c
M       source/blender/render/intern/source/render_result.c

===================================================================

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) {
             

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to