misc warnings/fixes

- WITH_OPENJPEG wasn't defined for creator.c with CMake.
- remove shadowed/redefined vars.
- remove some unused RNA report args.
- re-arrange IMB_FILE_TYPES so IRIS is not the first format tested, since its not very common test JPEG and PNG first.
This commit is contained in:
Campbell Barton 2011-02-20 15:48:01 +00:00
parent 8c4e95da48
commit 06aee2ef0e
11 changed files with 115 additions and 120 deletions

@ -737,8 +737,6 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif
/* tesselation point for curve-typed objects */
if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
/* some modifiers could work with pre-tesselated curves only */
if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) {
/* add disabled pre-tesselated button, so users could have

@ -99,7 +99,6 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
break;
case PROP_POINTER: {
PointerRNA pptr;
int icon;
pptr= RNA_property_pointer_get(ptr, prop);
if(!pptr.type)

@ -776,12 +776,12 @@ static void material_lights(GPUShadeInput *shi, GPUShadeResult *shr)
ListBase *lb = object_duplilist(shi->gpumat->scene, ob);
for(dob=lb->first; dob; dob=dob->next) {
Object *ob = dob->ob;
Object *ob_iter = dob->ob;
if(ob->type==OB_LAMP) {
copy_m4_m4(ob->obmat, dob->mat);
if(ob_iter->type==OB_LAMP) {
copy_m4_m4(ob_iter->obmat, dob->mat);
lamp = GPU_lamp_from_blender(shi->gpumat->scene, ob, base->object);
lamp = GPU_lamp_from_blender(shi->gpumat->scene, ob_iter, ob);
if(lamp)
shade_one_light(shi, shr, lamp);
}

@ -56,11 +56,11 @@ void quicktime_exit(void);
#endif
ImFileType IMB_FILE_TYPES[]= {
{NULL, NULL, imb_is_a_iris, imb_ftype_iris, imb_loadiris, imb_saveiris, NULL, 0, IMAGIC},
{NULL, NULL, imb_is_a_jpeg, imb_ftype_default, imb_load_jpeg, imb_savejpeg, NULL, 0, JPG},
{NULL, NULL, imb_is_a_png, imb_ftype_default, imb_loadpng, imb_savepng, NULL, 0, PNG},
{NULL, NULL, imb_is_a_bmp, imb_ftype_default, imb_bmp_decode, imb_savebmp, NULL, 0, BMP},
{NULL, NULL, imb_is_a_targa, imb_ftype_default, imb_loadtarga, imb_savetarga, NULL, 0, TGA},
{NULL, NULL, imb_is_a_iris, imb_ftype_iris, imb_loadiris, imb_saveiris, NULL, 0, IMAGIC},
#ifdef WITH_CINEON
{NULL, NULL, imb_is_dpx, imb_ftype_default, imb_loaddpx, imb_save_dpx, NULL, IM_FTYPE_FLOAT, DPX},
{NULL, NULL, imb_is_cineon, imb_ftype_default, imb_loadcineon, imb_savecineon, NULL, IM_FTYPE_FLOAT, CINEON},

@ -394,7 +394,7 @@ Group *rna_Main_groups_new(Main *bmain, const char *name)
{
return add_group(name);
}
void rna_Main_groups_remove(Main *bmain, ReportList *reports, Group *group)
void rna_Main_groups_remove(Main *bmain, Group *group)
{
unlink_group(group);
free_libblock(&bmain->group, group);
@ -405,7 +405,7 @@ Text *rna_Main_texts_new(Main *bmain, const char *name)
{
return add_empty_text(name);
}
void rna_Main_texts_remove(Main *bmain, ReportList *reports, Text *text)
void rna_Main_texts_remove(Main *bmain, Text *text)
{
unlink_text(bmain, text);
free_libblock(&bmain->text, text);
@ -1044,7 +1044,6 @@ void RNA_def_main_groups(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_groups_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a group from the current blendfile.");
parm= RNA_def_pointer(func, "group", "Group", "", "Group to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);
@ -1072,7 +1071,6 @@ void RNA_def_main_texts(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_function_return(func, parm);
func= RNA_def_function(srna, "remove", "rna_Main_texts_remove");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
RNA_def_function_ui_description(func, "Remove a text from the current blendfile.");
parm= RNA_def_pointer(func, "text", "Text", "", "Text to remove.");
RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL);

@ -317,10 +317,15 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo
static void rna_NlaStrip_remove(NlaTrack *track, bContext *C, ReportList *reports, NlaStrip *strip)
{
if(BLI_findindex(&track->strips, strip) == -1) {
BKE_reportf(reports, RPT_ERROR, "NLA's Strip '%s' not found in track '%s'", strip->name, track->name);
return;
}
else {
free_nlastrip(&track->strips, strip);
WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_REMOVED, NULL);
}
}
#else

@ -302,7 +302,7 @@ static void rna_Object_create_duplilist(Object *ob, ReportList *reports, Scene *
/* ob->duplilist should now be freed with Object.free_duplilist */
}
static void rna_Object_free_duplilist(Object *ob, ReportList *reports)
static void rna_Object_free_duplilist(Object *ob)
{
if (ob->duplilist) {
free_object_duplilist(ob->duplilist);
@ -451,7 +451,6 @@ void RNA_api_object(StructRNA *srna)
func= RNA_def_function(srna, "free_dupli_list", "rna_Object_free_duplilist");
RNA_def_function_ui_description(func, "Free the list of dupli objects.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* Armature */
func= RNA_def_function(srna, "find_armature", "modifiers_isDeformedByArmature");

@ -82,7 +82,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
BuildModifierData *bmd = (BuildModifierData*) md;
int i;
int numFaces, numEdges;
int maxVerts, maxEdges, maxFaces;
int *vertMap, *edgeMap, *faceMap;
float frac;
GHashIterator *hashIter;
@ -93,19 +92,15 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
GHash *edgeHash = BLI_ghash_new(BLI_ghashutil_inthash,
BLI_ghashutil_intcmp, "build ed apply gh");
maxVerts = dm->getNumVerts(dm);
vertMap = MEM_callocN(sizeof(*vertMap) * maxVerts,
"build modifier vertMap");
const int maxVerts= dm->getNumVerts(dm);
const int maxEdges= dm->getNumEdges(dm);
const int maxFaces= dm->getNumFaces(dm);
vertMap = MEM_callocN(sizeof(*vertMap) * maxVerts, "build modifier vertMap");
for(i = 0; i < maxVerts; ++i) vertMap[i] = i;
maxEdges = dm->getNumEdges(dm);
edgeMap = MEM_callocN(sizeof(*edgeMap) * maxEdges,
"build modifier edgeMap");
edgeMap = MEM_callocN(sizeof(*edgeMap) * maxEdges, "build modifier edgeMap");
for(i = 0; i < maxEdges; ++i) edgeMap[i] = i;
maxFaces = dm->getNumFaces(dm);
faceMap = MEM_callocN(sizeof(*faceMap) * maxFaces,
"build modifier faceMap");
faceMap = MEM_callocN(sizeof(*faceMap) * maxFaces, "build modifier faceMap");
for(i = 0; i < maxFaces; ++i) faceMap[i] = i;
if (ob) {
@ -121,8 +116,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* if there's at least one face, build based on faces */
if(numFaces) {
int maxEdges;
if(bmd->randomize)
BLI_array_randomize(faceMap, sizeof(*faceMap),
maxFaces, bmd->seed);
@ -151,7 +144,6 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* get the set of edges that will be in the new mesh (i.e. all edges
* that have both verts in the new mesh)
*/
maxEdges = dm->getNumEdges(dm);
for(i = 0; i < maxEdges; ++i) {
MEdge me;
dm->getEdge(dm, i, &me);
@ -213,7 +205,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* copy the vertices across */
for( hashIter = BLI_ghashIterator_new(vertHash);
!BLI_ghashIterator_isDone(hashIter);
BLI_ghashIterator_step(hashIter)) {
BLI_ghashIterator_step(hashIter)
) {
MVert source;
MVert *dest;
int oldIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(hashIter));
@ -287,19 +280,19 @@ ModifierTypeInfo modifierType_Build = {
/* flags */ eModifierTypeFlag_AcceptsMesh
| eModifierTypeFlag_AcceptsCVs,
/* copyData */ copyData,
/* deformVerts */ 0,
/* deformMatrices */ 0,
/* deformVertsEM */ 0,
/* deformMatricesEM */ 0,
/* deformVerts */ NULL,
/* deformMatrices */ NULL,
/* deformVertsEM */ NULL,
/* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier,
/* applyModifierEM */ 0,
/* applyModifierEM */ NULL,
/* initData */ initData,
/* requiredDataMask */ 0,
/* freeData */ 0,
/* isDisabled */ 0,
/* updateDepgraph */ 0,
/* requiredDataMask */ NULL,
/* freeData */ NULL,
/* isDisabled */ NULL,
/* updateDepgraph */ NULL,
/* dependsOnTime */ dependsOnTime,
/* dependsOnNormals */ 0,
/* foreachObjectLink */ 0,
/* foreachIDLink */ 0,
/* dependsOnNormals */ NULL,
/* foreachObjectLink */ NULL,
/* foreachIDLink */ NULL
};

@ -244,7 +244,6 @@ static void deformVerts(ModifierData *md, Object *ob,
}
}
else if(dvert) { /* vertex group hook */
int i;
const float fac_orig= hmd->force;
for(i = 0; i < max_dvert; i++, dvert++) {

@ -291,7 +291,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
ehi= BLI_edgehashIterator_new(edgehash);
for(; !BLI_edgehashIterator_isDone(ehi); BLI_edgehashIterator_step(ehi)) {
int eidx= GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi));
eidx= GET_INT_FROM_POINTER(BLI_edgehashIterator_getValue(ehi));
if(edge_users[eidx] >= 0) {
BLI_edgehashIterator_getKey(ehi, &v1, &v2);
orig_mvert[v1].flag |= ME_VERT_TMP_TAG;
@ -408,7 +408,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
float *vert_angles= MEM_callocN(sizeof(float) * numVerts * 2, "mod_solid_pair"); /* 2 in 1 */
float *vert_accum= vert_angles + numVerts;
float face_angles[4];
int i, j, vidx;
int j, vidx;
face_nors = CustomData_get_layer(&dm->faceData, CD_NORMAL);
if(!face_nors) {
@ -650,19 +650,19 @@ ModifierTypeInfo modifierType_Solidify = {
| eModifierTypeFlag_EnableInEditmode,
/* copyData */ copyData,
/* deformVerts */ 0,
/* deformMatrices */ 0,
/* deformVertsEM */ 0,
/* deformMatricesEM */ 0,
/* deformVerts */ NULL,
/* deformMatrices */ NULL,
/* deformVertsEM */ NULL,
/* deformMatricesEM */ NULL,
/* applyModifier */ applyModifier,
/* applyModifierEM */ applyModifierEM,
/* initData */ initData,
/* requiredDataMask */ requiredDataMask,
/* freeData */ 0,
/* isDisabled */ 0,
/* updateDepgraph */ 0,
/* dependsOnTime */ 0,
/* dependsOnNormals */ 0,
/* foreachObjectLink */ 0,
/* foreachIDLink */ 0,
/* freeData */ NULL,
/* isDisabled */ NULL,
/* updateDepgraph */ NULL,
/* dependsOnTime */ NULL,
/* dependsOnNormals */ NULL,
/* foreachObjectLink */ NULL,
/* foreachIDLink */ NULL
};

@ -51,6 +51,10 @@ if(WITH_IMAGE_OPENEXR)
add_definitions(-DWITH_OPENEXR)
endif()
if(WITH_IMAGE_OPENJPEG)
add_definitions(-DWITH_OPENJPEG)
endif()
if(WITH_IMAGE_TIFF)
add_definitions(-DWITH_TIFF)
endif()