diff options
Diffstat (limited to 'source/blender/blenkernel/intern')
26 files changed, 79 insertions, 79 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index ea168ca6a84..8e2b3de9586 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -791,7 +791,7 @@ static void fcurves_path_rename_fix(ID *owner_id, const char *prefix, const char if (fcu->rna_path != old_path) { bActionGroup *agrp = fcu->grp; - if ((agrp) && strcmp(oldName, agrp->name) == 0) { + if ((agrp) && STREQ(oldName, agrp->name)) { BLI_strncpy(agrp->name, newName, sizeof(agrp->name)); } } @@ -828,7 +828,7 @@ static void drivers_path_rename_fix(ID *owner_id, ID *ref_id, const char *prefix /* also fix the bone-name (if applicable) */ if (strstr(prefix, "bones")) { if ( ((dtar->id) && (GS(dtar->id->name) == ID_OB) && (!ref_id || ((Object *)(dtar->id))->data == ref_id)) && - (dtar->pchan_name[0]) && (strcmp(oldName, dtar->pchan_name) == 0) ) + (dtar->pchan_name[0]) && STREQ(oldName, dtar->pchan_name) ) { BLI_strncpy(dtar->pchan_name, newName, sizeof(dtar->pchan_name)); } @@ -1281,7 +1281,7 @@ KS_Path *BKE_keyingset_find_path(KeyingSet *ks, ID *id, const char group_name[], eq_id = 0; /* path */ - if ((ksp->rna_path == NULL) || strcmp(rna_path, ksp->rna_path)) + if ((ksp->rna_path == NULL) || !STREQ(rna_path, ksp->rna_path)) eq_path = 0; /* index - need to compare whole-array setting too... */ diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c index 9f34d5b9cd9..60e81003c40 100644 --- a/source/blender/blenkernel/intern/appdir.c +++ b/source/blender/blenkernel/intern/appdir.c @@ -641,7 +641,7 @@ static void bli_where_am_i(char *fullname, const size_t maxlen, const char *name } } #if defined(DEBUG) - if (strcmp(name, fullname)) { + if (!STREQ(name, fullname)) { printf("guessing '%s' == '%s'\n", name, fullname); } #endif diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 431c24d3ed0..7d04ab7778f 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -233,7 +233,7 @@ static Bone *get_named_bone_bonechildren(Bone *bone, const char *name) { Bone *curBone, *rbone; - if (!strcmp(bone->name, name)) + if (STREQ(bone->name, name)) return bone; for (curBone = bone->childbase.first; curBone; curBone = curBone->next) { @@ -2417,7 +2417,7 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha /* validate first */ if (amod->ob && amod->ob->type == OB_CURVE && amod->channel[0]) { - if (strcmp(pchan->name, amod->channel) == 0) { + if (STREQ(pchan->name, amod->channel)) { float mat4[4][4], mat3[3][3]; curve_deform_vector(scene, amod->ob, armob, bone->arm_mat[3], pchan->pose_mat[3], mat3, amod->no_rot_axis); @@ -2430,7 +2430,7 @@ static void do_strip_modifiers(Scene *scene, Object *armob, Bone *bone, bPoseCha break; case ACTSTRIP_MOD_NOISE: { - if (strcmp(pchan->name, amod->channel) == 0) { + if (STREQ(pchan->name, amod->channel)) { float nor[3], loc[3], ofs; float eul[3], size[3], eulo[3], sizeo[3]; diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 8f6c9735aaf..7142c092583 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -454,7 +454,7 @@ static void data_dir_add(ListBase *lb, const char *member, const bool use_all) { LinkData *link; - if ((use_all == false) && strcmp(member, "scene") == 0) /* exception */ + if ((use_all == false) && STREQ(member, "scene")) /* exception */ return; if (BLI_findstring(lb, member, offsetof(LinkData, data))) @@ -546,7 +546,7 @@ ListBase CTX_data_dir_get(const bContext *C) bool CTX_data_equals(const char *member, const char *str) { - return (strcmp(member, str) == 0); + return (STREQ(member, str)); } bool CTX_data_dir(const char *member) 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; } } diff --git a/source/blender/blenkernel/intern/customdata_file.c b/source/blender/blenkernel/intern/customdata_file.c index 97972cca30c..41579aaa568 100644 --- a/source/blender/blenkernel/intern/customdata_file.c +++ b/source/blender/blenkernel/intern/customdata_file.c @@ -417,7 +417,7 @@ CDataFileLayer *cdf_layer_find(CDataFile *cdf, int type, const char *name) for (a = 0; a < cdf->totlayer; a++) { layer = &cdf->layer[a]; - if (layer->type == type && strcmp(layer->name, name) == 0) + if (layer->type == type && STREQ(layer->name, name)) return layer; } diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c index 80db62801d6..e2bb326b226 100644 --- a/source/blender/blenkernel/intern/deform.c +++ b/source/blender/blenkernel/intern/deform.c @@ -542,7 +542,7 @@ static bool defgroup_find_name_dupe(const char *name, bDeformGroup *dg, Object * for (curdef = ob->defbase.first; curdef; curdef = curdef->next) { if (dg != curdef) { - if (!strcmp(curdef->name, name)) { + if (STREQ(curdef->name, name)) { return true; } } diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 3541b3fba3f..bbc8cc314f5 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -368,7 +368,7 @@ static bool surface_duplicateNameExists(void *arg, const char *name) DynamicPaintSurface *surface = t_surface->canvas->surfaces.first; for (; surface; surface = surface->next) { - if (surface != t_surface && !strcmp(name, surface->name)) return true; + if (surface != t_surface && STREQ(name, surface->name)) return true; } return false; } diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 4648d70b62b..765917794e8 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -230,7 +230,7 @@ FCurve *list_find_fcurve(ListBase *list, const char rna_path[], const int array_ /* check paths of curves, then array indices... */ for (fcu = list->first; fcu; fcu = fcu->next) { /* simple string-compare (this assumes that they have the same root...) */ - if (fcu->rna_path && !strcmp(fcu->rna_path, rna_path)) { + if (fcu->rna_path && STREQ(fcu->rna_path, rna_path)) { /* now check indices */ if (fcu->array_index == array_index) return fcu; @@ -253,7 +253,7 @@ FCurve *iter_step_fcurve(FCurve *fcu_iter, const char rna_path[]) /* check paths of curves, then array indices... */ for (fcu = fcu_iter; fcu; fcu = fcu->next) { /* simple string-compare (this assumes that they have the same root...) */ - if (fcu->rna_path && !strcmp(fcu->rna_path, rna_path)) { + if (fcu->rna_path && STREQ(fcu->rna_path, rna_path)) { return fcu; } } @@ -290,7 +290,7 @@ int list_find_data_fcurves(ListBase *dst, ListBase *src, const char *dataPrefix, if (quotedName) { /* check if the quoted name matches the required name */ - if (strcmp(quotedName, dataName) == 0) { + if (STREQ(quotedName, dataName)) { LinkData *ld = MEM_callocN(sizeof(LinkData), __func__); ld->data = fcu; diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index 8d4bb7ec058..2adf8ebc615 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -245,7 +245,7 @@ VFont *BKE_vfont_load(Main *bmain, const char *name) } /* Do not add FO_BUILTIN_NAME to temporary listbase */ - if (strcmp(filename, FO_BUILTIN_NAME)) { + if (!STREQ(filename, FO_BUILTIN_NAME)) { vfont->temp_pf = temp_pf; } } diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 2b99b5f4620..4d83f8cf916 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -804,7 +804,7 @@ bool IDP_EqualsProperties_ex(IDProperty *prop1, IDProperty *prop2, const bool is case IDP_STRING: { return (((prop1->len == prop2->len) && - strncmp(IDP_String(prop1), IDP_String(prop2), (size_t)prop1->len) == 0)); + STREQLEN(IDP_String(prop1), IDP_String(prop2), (size_t)prop1->len))); } case IDP_ARRAY: if (prop1->len == prop2->len && prop1->subtype == prop2->subtype) { diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 27165042cb2..4404182192e 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1223,37 +1223,37 @@ char BKE_imtype_valid_depths(const char imtype) * creator.c help info */ char BKE_imtype_from_arg(const char *imtype_arg) { - if (!strcmp(imtype_arg, "TGA")) return R_IMF_IMTYPE_TARGA; - else if (!strcmp(imtype_arg, "IRIS")) return R_IMF_IMTYPE_IRIS; + if (STREQ(imtype_arg, "TGA")) return R_IMF_IMTYPE_TARGA; + else if (STREQ(imtype_arg, "IRIS")) return R_IMF_IMTYPE_IRIS; #ifdef WITH_DDS - else if (!strcmp(imtype_arg, "DDS")) return R_IMF_IMTYPE_DDS; + else if (STREQ(imtype_arg, "DDS")) return R_IMF_IMTYPE_DDS; #endif - else if (!strcmp(imtype_arg, "JPEG")) return R_IMF_IMTYPE_JPEG90; - else if (!strcmp(imtype_arg, "IRIZ")) return R_IMF_IMTYPE_IRIZ; - else if (!strcmp(imtype_arg, "RAWTGA")) return R_IMF_IMTYPE_RAWTGA; - else if (!strcmp(imtype_arg, "AVIRAW")) return R_IMF_IMTYPE_AVIRAW; - else if (!strcmp(imtype_arg, "AVIJPEG")) return R_IMF_IMTYPE_AVIJPEG; - else if (!strcmp(imtype_arg, "PNG")) return R_IMF_IMTYPE_PNG; - else if (!strcmp(imtype_arg, "QUICKTIME")) return R_IMF_IMTYPE_QUICKTIME; - else if (!strcmp(imtype_arg, "BMP")) return R_IMF_IMTYPE_BMP; + else if (STREQ(imtype_arg, "JPEG")) return R_IMF_IMTYPE_JPEG90; + else if (STREQ(imtype_arg, "IRIZ")) return R_IMF_IMTYPE_IRIZ; + else if (STREQ(imtype_arg, "RAWTGA")) return R_IMF_IMTYPE_RAWTGA; + else if (STREQ(imtype_arg, "AVIRAW")) return R_IMF_IMTYPE_AVIRAW; + else if (STREQ(imtype_arg, "AVIJPEG")) return R_IMF_IMTYPE_AVIJPEG; + else if (STREQ(imtype_arg, "PNG")) return R_IMF_IMTYPE_PNG; + else if (STREQ(imtype_arg, "QUICKTIME")) return R_IMF_IMTYPE_QUICKTIME; + else if (STREQ(imtype_arg, "BMP")) return R_IMF_IMTYPE_BMP; #ifdef WITH_HDR - else if (!strcmp(imtype_arg, "HDR")) return R_IMF_IMTYPE_RADHDR; + else if (STREQ(imtype_arg, "HDR")) return R_IMF_IMTYPE_RADHDR; #endif #ifdef WITH_TIFF - else if (!strcmp(imtype_arg, "TIFF")) return R_IMF_IMTYPE_TIFF; + else if (STREQ(imtype_arg, "TIFF")) return R_IMF_IMTYPE_TIFF; #endif #ifdef WITH_OPENEXR - else if (!strcmp(imtype_arg, "EXR")) return R_IMF_IMTYPE_OPENEXR; - else if (!strcmp(imtype_arg, "MULTILAYER")) return R_IMF_IMTYPE_MULTILAYER; + else if (STREQ(imtype_arg, "EXR")) return R_IMF_IMTYPE_OPENEXR; + else if (STREQ(imtype_arg, "MULTILAYER")) return R_IMF_IMTYPE_MULTILAYER; #endif - else if (!strcmp(imtype_arg, "MPEG")) return R_IMF_IMTYPE_FFMPEG; - else if (!strcmp(imtype_arg, "FRAMESERVER")) return R_IMF_IMTYPE_FRAMESERVER; + else if (STREQ(imtype_arg, "MPEG")) return R_IMF_IMTYPE_FFMPEG; + else if (STREQ(imtype_arg, "FRAMESERVER")) return R_IMF_IMTYPE_FRAMESERVER; #ifdef WITH_CINEON - else if (!strcmp(imtype_arg, "CINEON")) return R_IMF_IMTYPE_CINEON; - else if (!strcmp(imtype_arg, "DPX")) return R_IMF_IMTYPE_DPX; + else if (STREQ(imtype_arg, "CINEON")) return R_IMF_IMTYPE_CINEON; + else if (STREQ(imtype_arg, "DPX")) return R_IMF_IMTYPE_DPX; #endif #ifdef WITH_OPENJPEG - else if (!strcmp(imtype_arg, "JP2")) return R_IMF_IMTYPE_JP2; + else if (STREQ(imtype_arg, "JP2")) return R_IMF_IMTYPE_JP2; #endif else return R_IMF_IMTYPE_INVALID; } diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index f8c79832dfc..c748568b4c5 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -922,11 +922,11 @@ static char *get_rna_access(int blocktype, int adrcode, char actname[], char con BLI_snprintf(buf, sizeof(buf), "pose.bones[\"%s\"].constraints[\"%s\"]", actname, constname); } else if (actname && actname[0]) { - if ((blocktype == ID_OB) && strcmp(actname, "Object") == 0) { + if ((blocktype == ID_OB) && STREQ(actname, "Object")) { /* Actionified "Object" IPO's... no extra path stuff needed */ buf[0] = '\0'; /* empty string */ } - else if ((blocktype == ID_KE) && strcmp(actname, "Shape") == 0) { + else if ((blocktype == ID_KE) && STREQ(actname, "Shape")) { /* Actionified "Shape" IPO's - these are forced onto object level via the action container there... */ strcpy(buf, "data.shape_keys"); } @@ -1326,7 +1326,7 @@ static void icu_to_fcurves(ID *id, ListBase *groups, ListBase *list, IpoCurve *i * - we now need as 'frames' */ if ( (id) && (icu->blocktype == GS(id->name)) && - (fcu->rna_path && strcmp(fcu->rna_path, "eval_time") == 0) ) + (fcu->rna_path && STREQ(fcu->rna_path, "eval_time")) ) { Curve *cu = (Curve *)id; @@ -1403,9 +1403,9 @@ static void ipo_to_animato(ID *id, Ipo *ipo, char actname[], char constname[], S * F-Curves for bones). This may be added later... for now let's just dump without them... */ if (actname) { - if ((ipo->blocktype == ID_OB) && (strcmp(actname, "Object") == 0)) + if ((ipo->blocktype == ID_OB) && STREQ(actname, "Object")) actname = NULL; - else if ((ipo->blocktype == ID_OB) && (strcmp(actname, "Shape") == 0)) + else if ((ipo->blocktype == ID_OB) && STREQ(actname, "Shape")) actname = NULL; } diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 752c2961f28..4cb792da179 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1202,7 +1202,7 @@ static ID *is_dupid(ListBase *lb, ID *id, const char *name) /* do not test alphabetic! */ /* optimized */ if (idtest->name[2] == name[0]) { - if (strcmp(name, idtest->name + 2) == 0) break; + if (STREQ(name, idtest->name + 2)) break; } } } @@ -1260,7 +1260,7 @@ static bool check_for_dupid(ListBase *lb, ID *id, char *name) if ( (id != idtest) && (idtest->lib == NULL) && (*name == *(idtest->name + 2)) && - (strncmp(name, idtest->name + 2, left_len) == 0) && + STREQLEN(name, idtest->name + 2, left_len) && (BLI_split_name_num(leftest, &nrtest, idtest->name + 2, '.') == left_len) ) { diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 981064bb22a..f8f69b8901d 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1027,7 +1027,7 @@ static void do_init_render_material(Material *ma, int r_mode, float *amb) Group *group; for (group = G.main->group.first; group; group = group->id.next) { - if (!group->id.lib && strcmp(group->id.name, ma->group->id.name) == 0) { + if (!group->id.lib && STREQ(group->id.name, ma->group->id.name)) { ma->group = group; } } diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 5649164a273..ce20636233a 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -468,7 +468,7 @@ bool BKE_mball_is_basis_for(Object *ob1, Object *ob2) BLI_split_name_num(basis1name, &basis1nr, ob1->id.name + 2, '.'); BLI_split_name_num(basis2name, &basis2nr, ob2->id.name + 2, '.'); - if (!strcmp(basis1name, basis2name)) { + if (STREQ(basis1name, basis2name)) { return BKE_mball_is_basis(ob1); } else { @@ -503,7 +503,7 @@ void BKE_mball_properties_copy(Scene *scene, Object *active_object) /* Object ob has to be in same "group" ... it means, that it has to have * same base of its name */ - if (strcmp(obname, basisname) == 0) { + if (STREQ(obname, basisname)) { MetaBall *mb = ob->data; /* Copy properties from selected/edited metaball */ @@ -545,7 +545,7 @@ Object *BKE_mball_basis_find(Scene *scene, Object *basis) BLI_split_name_num(obname, &obnr, ob->id.name + 2, '.'); /* object ob has to be in same "group" ... it means, that it has to have same base of its name */ - if (strcmp(obname, basisname) == 0) { + if (STREQ(obname, basisname)) { if (obnr < basisnr) { basis = ob; basisnr = obnr; @@ -1679,7 +1679,7 @@ static float init_meta(EvaluationContext *eval_ctx, PROCESS *process, Scene *sce int nr; BLI_split_name_num(name, &nr, bob->id.name + 2, '.'); - if (strcmp(obname, name) == 0) { + if (STREQ(obname, name)) { mb = bob->data; if (mb->editelems) ml = mb->editelems->first; @@ -2243,7 +2243,7 @@ static void mball_count(EvaluationContext *eval_ctx, PROCESS *process, Scene *sc /* object ob has to be in same "group" ... it means, that it has to have * same base of its name */ - if (strcmp(obname, basisname) == 0) { + if (STREQ(obname, basisname)) { MetaBall *mb = ob->data; /* if object is in edit mode, then dynamic list of all MetaElems diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index c47d294cfb2..8ad20df18db 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -703,7 +703,7 @@ bool BKE_mesh_uv_cdlayer_rename_index(Mesh *me, const int poly_index, const int } /* Loop until we do have exactly the same name for all layers! */ - for (i = 1; (strcmp(cdlp->name, cdlu->name) != 0 || (cdlf && strcmp(cdlp->name, cdlf->name) != 0)); i++) { + for (i = 1; !STREQ(cdlp->name, cdlu->name) || (cdlf && !STREQ(cdlp->name, cdlf->name)); i++) { switch (i % step) { case 0: BLI_strncpy(cdlp->name, cdlu->name, sizeof(cdlp->name)); diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index fe38fedd7aa..491fb46bd1f 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -621,7 +621,7 @@ MovieClip *BKE_movieclip_file_add(Main *bmain, const char *name) BLI_strncpy(strtest, clip->name, sizeof(clip->name)); BLI_path_abs(strtest, G.main->name); - if (strcmp(strtest, str) == 0) { + if (STREQ(strtest, str)) { BLI_strncpy(clip->name, name, sizeof(clip->name)); /* for stringcode */ clip->id.us++; /* officially should not, it doesn't link here! */ diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 039af949d81..f30e3b699dd 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2250,7 +2250,7 @@ StructRNA *ntreeInterfaceTypeGet(bNodeTree *ntree, int create) ntree_interface_identifier_base(ntree, base); /* RNA identifier may have a number suffix, but should start with the idbase string */ - if (strncmp(RNA_struct_identifier(srna), base, sizeof(base)) != 0) { + if (!STREQLEN(RNA_struct_identifier(srna), base, sizeof(base))) { /* generate new unique RNA identifier from the ID name */ ntree_interface_identifier(ntree, base, identifier, sizeof(identifier), name, description); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 19ed49c727a..a8add058590 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -772,7 +772,7 @@ static int ptcache_smoke_read(PTCacheFile *pf, void *smoke_v) /* version header */ ptcache_file_read(pf, version, 4, sizeof(char)); - if (strncmp(version, SMOKE_CACHE_VERSION, 4)) + if (!STREQLEN(version, SMOKE_CACHE_VERSION, 4)) { /* reset file pointer */ fseek(pf->fp, -4, SEEK_CUR); @@ -954,7 +954,7 @@ static int ptcache_dynamicpaint_read(PTCacheFile *pf, void *dp_v) /* version header */ ptcache_file_read(pf, version, 1, sizeof(char) * 4); - if (strncmp(version, DPAINT_CACHE_VERSION, 4)) { + if (!STREQLEN(version, DPAINT_CACHE_VERSION, 4)) { printf("Dynamic Paint: Invalid cache version: '%c%c%c%c'!\n", UNPACK4(version)); return 0; } @@ -1716,7 +1716,7 @@ static int ptcache_file_header_begin_read(PTCacheFile *pf) if (fread(bphysics, sizeof(char), 8, pf->fp) != 8) error = 1; - if (!error && strncmp(bphysics, "BPHYSICS", 8)) + if (!error && !STREQLEN(bphysics, "BPHYSICS", 8)) error = 1; if (!error && !fread(&typeflag, sizeof(unsigned int), 1, pf->fp)) @@ -2588,7 +2588,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra) while ((de = readdir(dir)) != NULL) { if (strstr(de->d_name, ext)) { /* do we have the right extension?*/ - if (strncmp(filename, de->d_name, len ) == 0) { /* do we have the right prefix */ + if (STREQLEN(filename, de->d_name, len)) { /* do we have the right prefix */ if (mode == PTCACHE_CLEAR_ALL) { pid->cache->last_exact = MIN2(pid->cache->startframe, 0); BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name); @@ -2794,7 +2794,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra while ((de = readdir(dir)) != NULL) { if (strstr(de->d_name, ext)) { /* do we have the right extension?*/ - if (strncmp(filename, de->d_name, len ) == 0) { /* do we have the right prefix */ + if (STREQLEN(filename, de->d_name, len)) { /* do we have the right prefix */ /* read the number of the file */ unsigned int frame, len2 = (int)strlen(de->d_name); char num[7]; @@ -2975,7 +2975,7 @@ void BKE_ptcache_remove(void) return; while ((de = readdir(dir)) != NULL) { - if ( strcmp(de->d_name, ".")==0 || strcmp(de->d_name, "..")==0) { + if (STREQ(de->d_name, ".") || STREQ(de->d_name, "..")) { /* do nothing */ } else if (strstr(de->d_name, PTCACHE_EXT)) { /* do we have the right extension?*/ @@ -3532,7 +3532,7 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, const char *name_src, const c while ((de = readdir(dir)) != NULL) { if (strstr(de->d_name, ext)) { /* do we have the right extension?*/ - if (strncmp(old_filename, de->d_name, len ) == 0) { /* do we have the right prefix */ + if (STREQLEN(old_filename, de->d_name, len)) { /* do we have the right prefix */ /* read the number of the file */ int frame, len2 = (int)strlen(de->d_name); char num[7]; @@ -3587,7 +3587,7 @@ void BKE_ptcache_load_external(PTCacheID *pid) while ((de = readdir(dir)) != NULL) { if (strstr(de->d_name, ext)) { /* do we have the right extension?*/ - if (strncmp(filename, de->d_name, len ) == 0) { /* do we have the right prefix */ + if (STREQLEN(filename, de->d_name, len)) { /* do we have the right prefix */ /* read the number of the file */ int frame, len2 = (int)strlen(de->d_name); char num[7]; diff --git a/source/blender/blenkernel/intern/property.c b/source/blender/blenkernel/intern/property.c index bb04d548a44..819f4af054c 100644 --- a/source/blender/blenkernel/intern/property.c +++ b/source/blender/blenkernel/intern/property.c @@ -136,7 +136,7 @@ static bProperty *bproperty_get(bProperty *first, bProperty *self, const char *n { bProperty *p; for (p = first; p; p = p->next) { - if (p != self && (strcmp(p->name, name) == 0)) + if (p != self && STREQ(p->name, name)) return p; } return NULL; diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 577dbd6d323..8f479d4adf9 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -2003,7 +2003,7 @@ void BKE_scene_disable_color_management(Scene *scene) bool BKE_scene_check_color_management_enabled(const Scene *scene) { - return strcmp(scene->display_settings.display_device, "None") != 0; + return !STREQ(scene->display_settings.display_device, "None"); } bool BKE_scene_check_rigidbody_active(const Scene *scene) diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 3a311bfb23b..cb2819825c2 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -2740,7 +2740,7 @@ void txt_unindent(Text *text) while (true) { bool changed = false; - if (strncmp(text->curl->line, remove, indentlen) == 0) { + if (STREQLEN(text->curl->line, remove, indentlen)) { if (num == 0) unindented_first = true; text->curl->len -= indentlen; diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c index d580c184a8b..0037002f6d8 100644 --- a/source/blender/blenkernel/intern/tracking.c +++ b/source/blender/blenkernel/intern/tracking.c @@ -721,7 +721,7 @@ MovieTrackingTrack *BKE_tracking_track_get_named(MovieTracking *tracking, MovieT MovieTrackingTrack *track = tracksbase->first; while (track) { - if (!strcmp(track->name, name)) + if (STREQ(track->name, name)) return track; track = track->next; @@ -1267,7 +1267,7 @@ MovieTrackingPlaneTrack *BKE_tracking_plane_track_get_named(MovieTracking *track plane_track; plane_track = plane_track->next) { - if (!strcmp(plane_track->name, name)) { + if (STREQ(plane_track->name, name)) { return plane_track; } } @@ -1563,7 +1563,7 @@ MovieTrackingObject *BKE_tracking_object_get_named(MovieTracking *tracking, cons MovieTrackingObject *object = tracking->objects.first; while (object) { - if (!strcmp(object->name, name)) + if (STREQ(object->name, name)) return object; object = object->next; diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 9737ef429cb..128a5da9b68 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -469,8 +469,8 @@ static int ffmpeg_proprty_valid(AVCodecContext *c, const char *prop_name, IDProp { int valid = 1; - if (strcmp(prop_name, "video") == 0) { - if (strcmp(curr->name, "bf") == 0) { + if (STREQ(prop_name, "video")) { + if (STREQ(curr->name, "bf")) { /* flash codec doesn't support b frames */ valid &= c->codec_id != AV_CODEC_ID_FLV1; } @@ -624,9 +624,9 @@ static AVStream *alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex if ((of->oformat->flags & AVFMT_GLOBALHEADER) #if 0 - || !strcmp(of->oformat->name, "mp4") - || !strcmp(of->oformat->name, "mov") - || !strcmp(of->oformat->name, "3gp") + || STREQ(of->oformat->name, "mp4") + || STREQ(of->oformat->name, "mov") + || STREQ(of->oformat->name, "3gp") #endif ) { diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c index 746b99ffb52..ae6b19fb019 100644 --- a/source/blender/blenkernel/intern/writeframeserver.c +++ b/source/blender/blenkernel/intern/writeframeserver.c @@ -214,7 +214,7 @@ static int handle_request(RenderData *rd, char *req) *p = 0; - if (strcmp(path, "/index.html") == 0 || strcmp(path, "/") == 0) { + if (STREQ(path, "/index.html") || STREQ(path, "/")) { safe_puts(index_page); return -1; } @@ -226,7 +226,7 @@ static int handle_request(RenderData *rd, char *req) write_ppm = 1; return atoi(path + 12); } - if (strcmp(path, "/info.txt") == 0) { + if (STREQ(path, "/info.txt")) { char buf[4096]; sprintf(buf, @@ -250,7 +250,7 @@ static int handle_request(RenderData *rd, char *req) safe_puts(buf); return -1; } - if (strcmp(path, "/close.txt") == 0) { + if (STREQ(path, "/close.txt")) { safe_puts(good_bye); G.is_break = true; /* Abort render */ return -1; |