Clenup: use STREQ macro

This commit is contained in:
2020-08-08 12:14:52 +10:00
parent 586a308467
commit 61a045b7d3
15 changed files with 33 additions and 33 deletions

View File

@@ -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;
}

View File

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

View File

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