diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 07:56:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-06 07:56:03 +0300 |
commit | f38ad4c66bee4fd28dbfe3fa4662fb6f8eb7d1c5 (patch) | |
tree | 519307199419c9cfe883ba8551a76196e2b918a8 /source/blender/editors | |
parent | 2d803d3f6d803ab6098410c56048f1df1ba48ee0 (diff) |
Cleanup: replace STREQLEN with STRPREFIX for constant strings
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/curve/editcurve.c | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/fsmenu.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 4b7efe0f23c..db472c9ffa7 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1029,10 +1029,10 @@ static void curve_rename_fcurves(Curve *cu, ListBase *orig_curves) * need this to make further step with copying non-cv related curves copying * not touching cv's f-curves */ LISTBASE_FOREACH_MUTABLE (FCurve *, fcu, orig_curves) { - if (STREQLEN(fcu->rna_path, "splines", 7)) { + if (STRPREFIX(fcu->rna_path, "splines")) { const char *ch = strchr(fcu->rna_path, '.'); - if (ch && (STREQLEN(ch, ".bezier_points", 14) || STREQLEN(ch, ".points", 7))) { + if (ch && (STRPREFIX(ch, ".bezier_points") || STRPREFIX(ch, ".points"))) { fcurve_remove(adt, orig_curves, fcu); } } @@ -1060,7 +1060,7 @@ static void curve_rename_fcurves(Curve *cu, ListBase *orig_curves) /* the remainders in orig_curves can be copied back (like follow path) */ /* (if it's not path to spline) */ LISTBASE_FOREACH_MUTABLE (FCurve *, fcu, orig_curves) { - if (STREQLEN(fcu->rna_path, "splines", 7)) { + if (STRPREFIX(fcu->rna_path, "splines")) { fcurve_remove(adt, orig_curves, fcu); } else { diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index a69540613fb..4c3fd57131c 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -463,7 +463,7 @@ void ui_block_bounds_calc(uiBlock *block) /* hardcoded exception... but that one is annoying with larger safety */ uiBut *bt = block->buttons.first; - int xof = (bt && STREQLEN(bt->str, "ERROR", 5)) ? 10 : 40; + int xof = (bt && STRPREFIX(bt->str, "ERROR")) ? 10 : 40; block->safety.xmin = block->rect.xmin - xof; block->safety.ymin = block->rect.ymin - xof; diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index b7d47902fe8..d8556711c55 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -579,10 +579,10 @@ void fsmenu_read_bookmarks(struct FSMenu *fsmenu, const char *filename) name[0] = '\0'; while (fgets(line, sizeof(line), fp) != NULL) { /* read a line */ - if (STREQLEN(line, "[Bookmarks]", 11)) { + if (STRPREFIX(line, "[Bookmarks]")) { category = FS_CATEGORY_BOOKMARKS; } - else if (STREQLEN(line, "[Recent]", 8)) { + else if (STRPREFIX(line, "[Recent]")) { category = FS_CATEGORY_RECENT; } else if (line[0] == '!') { |