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/editors/sculpt_paint/sculpt_undo.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/editors/sculpt_paint/sculpt_undo.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt_undo.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index 4e9d23d3d97..a4adbc6bca8 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -104,7 +104,7 @@ static int sculpt_undo_restore_coords(bContext *C, DerivedMesh *dm, SculptUndoNo if (unode->maxvert) { /* regular mesh restore */ - if (ss->kb && strcmp(ss->kb->name, unode->shapeName)) { + if (ss->kb && !STREQ(ss->kb->name, unode->shapeName)) { /* shape key has been changed before calling undo operator */ Key *key = BKE_key_from_object(ob); @@ -404,7 +404,7 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb) bool need_mask = false; for (unode = lb->first; unode; unode = unode->next) { - if (strcmp(unode->idname, ob->id.name) == 0) { + if (STREQ(unode->idname, ob->id.name)) { if (unode->type == SCULPT_UNDO_MASK) { /* is possible that we can't do the mask undo (below) * because of the vertex count */ @@ -423,7 +423,7 @@ static void sculpt_undo_restore(bContext *C, ListBase *lb) return; for (unode = lb->first; unode; unode = unode->next) { - if (!(strcmp(unode->idname, ob->id.name) == 0)) + if (!STREQ(unode->idname, ob->id.name)) continue; /* check if undo data matches current data well enough to @@ -550,7 +550,7 @@ static bool sculpt_undo_cleanup(bContext *C, ListBase *lb) unode = lb->first; - if (unode && strcmp(unode->idname, ob->id.name) != 0) { + if (unode && !STREQ(unode->idname, ob->id.name)) { if (unode->bm_entry) BM_log_cleanup_entry(unode->bm_entry); |