Fix format string warnings (gcc) by using string literals.

gcc 4.6 was giving warnings like this:
"warning: format not a string literal and no format arguments [-Wformat-security]"
This commit is contained in:
2012-03-19 21:38:35 +00:00
parent d91deb9e97
commit 9beef61199
6 changed files with 14 additions and 14 deletions

View File

@@ -1474,7 +1474,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
if(!modifier_isEnabled(scene, md, required_mode)) continue; if(!modifier_isEnabled(scene, md, required_mode)) continue;
if(mti->type == eModifierTypeType_OnlyDeform && !useDeform) continue; if(mti->type == eModifierTypeType_OnlyDeform && !useDeform) continue;
if((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) { if((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) {
modifier_setError(md, TIP_("Modifier requires original data, bad stack position.")); modifier_setError(md, "%s", TIP_("Modifier requires original data, bad stack position."));
continue; continue;
} }
if(sculpt_mode && (!has_multires || multires_applied)) { if(sculpt_mode && (!has_multires || multires_applied)) {
@@ -1487,7 +1487,7 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
unsupported|= multires_applied; unsupported|= multires_applied;
if(unsupported) { if(unsupported) {
modifier_setError(md, TIP_("Not supported in sculpt mode.")); modifier_setError(md, "%s", TIP_("Not supported in sculpt mode."));
continue; continue;
} }
} }
@@ -1841,7 +1841,7 @@ int editbmesh_modifier_is_enabled(Scene *scene, ModifierData *md, DerivedMesh *d
if(!modifier_isEnabled(scene, md, required_mode)) return 0; if(!modifier_isEnabled(scene, md, required_mode)) return 0;
if((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) { if((mti->flags & eModifierTypeFlag_RequiresOriginalData) && dm) {
modifier_setError(md, TIP_("Modifier requires original data, bad stack position.")); modifier_setError(md, "%s", TIP_("Modifier requires original data, bad stack position."));
return 0; return 0;
} }

View File

@@ -829,7 +829,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
clmd->clothObject->edgehash = NULL; clmd->clothObject->edgehash = NULL;
} }
else if (!clmd->clothObject) { else if (!clmd->clothObject) {
modifier_setError(&(clmd->modifier), TIP_("Out of memory on allocating clmd->clothObject.")); modifier_setError(&(clmd->modifier), "%s", TIP_("Out of memory on allocating clmd->clothObject."));
return 0; return 0;
} }
@@ -894,7 +894,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
if ( !cloth_build_springs ( clmd, dm ) ) if ( !cloth_build_springs ( clmd, dm ) )
{ {
cloth_free_modifier ( clmd ); cloth_free_modifier ( clmd );
modifier_setError(&(clmd->modifier), TIP_("Can't build springs.")); modifier_setError(&(clmd->modifier), "%s", TIP_("Can't build springs."));
printf("cloth_free_modifier cloth_build_springs\n"); printf("cloth_free_modifier cloth_build_springs\n");
return 0; return 0;
} }
@@ -940,7 +940,7 @@ static void cloth_from_mesh ( ClothModifierData *clmd, DerivedMesh *dm )
if ( clmd->clothObject->verts == NULL ) if ( clmd->clothObject->verts == NULL )
{ {
cloth_free_modifier ( clmd ); cloth_free_modifier ( clmd );
modifier_setError(&(clmd->modifier), TIP_("Out of memory on allocating clmd->clothObject->verts.")); modifier_setError(&(clmd->modifier), "%s", TIP_("Out of memory on allocating clmd->clothObject->verts."));
printf("cloth_free_modifier clmd->clothObject->verts\n"); printf("cloth_free_modifier clmd->clothObject->verts\n");
return; return;
} }
@@ -951,7 +951,7 @@ static void cloth_from_mesh ( ClothModifierData *clmd, DerivedMesh *dm )
if ( clmd->clothObject->mfaces == NULL ) if ( clmd->clothObject->mfaces == NULL )
{ {
cloth_free_modifier ( clmd ); cloth_free_modifier ( clmd );
modifier_setError(&(clmd->modifier), TIP_("Out of memory on allocating clmd->clothObject->mfaces.")); modifier_setError(&(clmd->modifier), "%s", TIP_("Out of memory on allocating clmd->clothObject->mfaces."));
printf("cloth_free_modifier clmd->clothObject->mfaces\n"); printf("cloth_free_modifier clmd->clothObject->mfaces\n");
return; return;
} }

View File

@@ -1716,7 +1716,7 @@ static void meshdeform_matrix_solve(MeshDeformModifierData *mmd, MeshDeformBind
} }
} }
else { else {
modifier_setError(&mmd->modifier, TIP_("Failed to find bind solution (increase precision?).")); modifier_setError(&mmd->modifier, "%s", TIP_("Failed to find bind solution (increase precision?)."));
error("Mesh Deform: failed to find bind solution."); error("Mesh Deform: failed to find bind solution.");
break; break;
} }

View File

@@ -156,7 +156,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
if(result) if(result)
return result; return result;
else else
modifier_setError(md, TIP_("Can't execute boolean operation.")); modifier_setError(md, "%s", TIP_("Can't execute boolean operation."));
} }
return derivedData; return derivedData;

View File

@@ -98,7 +98,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
} }
if(numTris<3) { if(numTris<3) {
modifier_setError(md, TIP_("Modifier requires more than 3 input faces (triangles).")); modifier_setError(md, "%s", TIP_("Modifier requires more than 3 input faces (triangles)."));
dm = CDDM_copy(dm); dm = CDDM_copy(dm);
return dm; return dm;
} }
@@ -173,12 +173,12 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
CDDM_calc_edges_tessface(result); CDDM_calc_edges_tessface(result);
} }
else else
modifier_setError(md, TIP_("Out of memory.")); modifier_setError(md, "%s", TIP_("Out of memory."));
LOD_FreeDecimationData(&lod); LOD_FreeDecimationData(&lod);
} }
else else
modifier_setError(md, TIP_("Non-manifold mesh as input.")); modifier_setError(md, "%s", TIP_("Non-manifold mesh as input."));
MEM_freeN(lod.vertex_buffer); MEM_freeN(lod.vertex_buffer);
MEM_freeN(lod.vertex_normal_buffer); MEM_freeN(lod.vertex_normal_buffer);

View File

@@ -218,7 +218,7 @@ static void meshdeformModifier_do(
} }
if(!cagedm) { if(!cagedm) {
modifier_setError(md, TIP_("Can't get mesh from cage object.")); modifier_setError(md, "%s", TIP_("Can't get mesh from cage object."));
return; return;
} }
@@ -255,7 +255,7 @@ static void meshdeformModifier_do(
cagedm->release(cagedm); cagedm->release(cagedm);
return; return;
} else if (mmd->bindcagecos == NULL) { } else if (mmd->bindcagecos == NULL) {
modifier_setError(md, TIP_("Bind data missing.")); modifier_setError(md, "%s", TIP_("Bind data missing."));
cagedm->release(cagedm); cagedm->release(cagedm);
return; return;
} }