diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-26 18:03:11 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-01-26 18:59:24 +0300 |
commit | fca515838e70f8bec7028b840bb921a1be9fabbb (patch) | |
tree | 1752923de19eca5f01ca4cfb5754fd4d1f13d934 /source/blender/blenkernel/intern/customdata.c | |
parent | d44890ee75634052f325531766a661a5bcef628f (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/blenkernel/intern/customdata.c')
-rw-r--r-- | source/blender/blenkernel/intern/customdata.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 89ebed258a3..a259958dc0c 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -1553,7 +1553,7 @@ int CustomData_get_named_layer_index(const CustomData *data, int type, const cha for (i = 0; i < data->totlayer; ++i) if (data->layers[i].type == type) - if (strcmp(data->layers[i].name, name) == 0) + if (STREQ(data->layers[i].name, name)) return i; return -1; @@ -2690,7 +2690,7 @@ void CustomData_bmesh_copy_data(const CustomData *source, CustomData *dest, /* if we found a matching layer, copy the data */ if (dest->layers[dest_i].type == source->layers[src_i].type && - strcmp(dest->layers[dest_i].name, source->layers[src_i].name) == 0) + STREQ(dest->layers[dest_i].name, source->layers[src_i].name)) { const char *src_data = (char *)src_block + source->layers[src_i].offset; char *dest_data = (char *)*dest_block + dest->layers[dest_i].offset; @@ -3163,12 +3163,12 @@ static bool cd_layer_find_dupe(CustomData *data, const char *name, int type, int CustomDataLayer *layer = &data->layers[i]; if (CustomData_is_property_layer(type)) { - if (CustomData_is_property_layer(layer->type) && strcmp(layer->name, name) == 0) { + if (CustomData_is_property_layer(layer->type) && STREQ(layer->name, name)) { return true; } } else { - if (i != index && layer->type == type && strcmp(layer->name, name) == 0) { + if (i != index && layer->type == type && STREQ(layer->name, name)) { return true; } } |