misc warnings/fixes
authorCampbell Barton <ideasman42@gmail.com>
Sun, 20 Feb 2011 15:48:01 +0000 (15:48 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 20 Feb 2011 15:48:01 +0000 (15:48 +0000)
- 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.

source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_utils.c
source/blender/gpu/intern/gpu_material.c
source/blender/imbuf/intern/filetype.c
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_nla.c
source/blender/makesrna/intern/rna_object_api.c
source/blender/modifiers/intern/MOD_build.c
source/blender/modifiers/intern/MOD_hook.c
source/blender/modifiers/intern/MOD_solidify.c
source/creator/CMakeLists.txt

index 5be5c6fa0c4b8b252a77ffb41ab9e5f24e7f7ad0..429f1e802312f757354651ace0db8b7abbb93239 100644 (file)
@@ -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
index 842dc40a39f217ef8aacc4d2a2f8ffa4f00cdc8c..c80a4010d881d729027aec853e64eb57deab918d 100644 (file)
@@ -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)
index c283e2fd9071785612642bddf33f67dad3837422..3dd4ccc2a2f046e1b96bff29eab05c4af74dcdba 100644 (file)
@@ -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;
-                               
-                               if(ob->type==OB_LAMP) {
-                                       copy_m4_m4(ob->obmat, dob->mat);
+                               Object *ob_iter = dob->ob;
+
+                               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);
                                }
index 0702fbe3907f23d925d5b2489003409afd25d79f..4e96fd945558fbb940faa1aef0af5d8d7160a99b 100644 (file)
@@ -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},
index 56c2f44ed7304e0b02d487ed2be1c802c3f0debb..ce9785819ca3121c493beaed03587cbf3e3748b1 100644 (file)
@@ -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);
index f28fec75fe2e0d5890e7026b3e555a4f38750f69..c2d38aaf0389161f954f3c985b6f85870d78d9f1 100644 (file)
@@ -317,9 +317,14 @@ static NlaStrip *rna_NlaStrip_new(NlaTrack *track, bContext *C, ReportList *repo
 
 static void rna_NlaStrip_remove(NlaTrack *track, bContext *C, ReportList *reports, NlaStrip *strip)
 {
-       free_nlastrip(&track->strips, strip);
-
-       WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_REMOVED, NULL);
+       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
index 9f1ef7396c0833d26e17f4a8fe0e5f55b4628dea..43113fed2c4371719fd84100d291a53f9c3186b9 100644 (file)
@@ -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");
index 3bf1fa401f9d963ba34cc92c5b306c75cc81f366..bc59c2cba0bc112c5254ec343e42d7a501ca4208 100644 (file)
@@ -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");
-       for(i = 0; i < maxVerts; ++i) vertMap[i] = i;
+       const int maxVerts= dm->getNumVerts(dm);
+       const int maxEdges= dm->getNumEdges(dm);
+       const int maxFaces= dm->getNumFaces(dm);
 
-       maxEdges = dm->getNumEdges(dm);
-       edgeMap = MEM_callocN(sizeof(*edgeMap) * maxEdges,
-                                 "build modifier edgeMap");
+       vertMap = MEM_callocN(sizeof(*vertMap) * maxVerts, "build modifier vertMap");
+       for(i = 0; i < maxVerts; ++i) vertMap[i] = i;
+       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);
@@ -211,71 +203,72 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
                                        BLI_ghash_size(edgeHash), numFaces);
 
        /* copy the vertices across */
-       for(hashIter = BLI_ghashIterator_new(vertHash);
-                  !BLI_ghashIterator_isDone(hashIter);
-                  BLI_ghashIterator_step(hashIter)) {
-                          MVert source;
-                          MVert *dest;
-                          int oldIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(hashIter));
-                          int newIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(hashIter));
-
-                          dm->getVert(dm, oldIndex, &source);
-                          dest = CDDM_get_vert(result, newIndex);
-
-                          DM_copy_vert_data(dm, result, oldIndex, newIndex, 1);
-                          *dest = source;
-                  }
-                  BLI_ghashIterator_free(hashIter);
-
-                  /* copy the edges across, remapping indices */
-                  for(i = 0; i < BLI_ghash_size(edgeHash); ++i) {
-                          MEdge source;
-                          MEdge *dest;
-                          int oldIndex = GET_INT_FROM_POINTER(BLI_ghash_lookup(edgeHash, SET_INT_IN_POINTER(i)));
-
-                          dm->getEdge(dm, oldIndex, &source);
-                          dest = CDDM_get_edge(result, i);
-
-                          source.v1 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v1)));
-                          source.v2 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v2)));
-
-                          DM_copy_edge_data(dm, result, oldIndex, i, 1);
-                          *dest = source;
-                  }
-
-                  /* copy the faces across, remapping indices */
-                  for(i = 0; i < numFaces; ++i) {
-                          MFace source;
-                          MFace *dest;
-                          int orig_v4;
-
-                          dm->getFace(dm, faceMap[i], &source);
-                          dest = CDDM_get_face(result, i);
-
-                          orig_v4 = source.v4;
-
-                          source.v1 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v1)));
-                          source.v2 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v2)));
-                          source.v3 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v3)));
-                          if(source.v4)
-                                  source.v4 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v4)));
-
-                          DM_copy_face_data(dm, result, faceMap[i], i, 1);
-                          *dest = source;
-
-                          test_index_face(dest, &result->faceData, i, (orig_v4 ? 4 : 3));
-                  }
-
-                  CDDM_calc_normals(result);
-
-                  BLI_ghash_free(vertHash, NULL, NULL);
-                  BLI_ghash_free(edgeHash, NULL, NULL);
+       for(    hashIter = BLI_ghashIterator_new(vertHash);
+                       !BLI_ghashIterator_isDone(hashIter);
+                       BLI_ghashIterator_step(hashIter)
+       ) {
+          MVert source;
+          MVert *dest;
+          int oldIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(hashIter));
+          int newIndex = GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(hashIter));
+
+          dm->getVert(dm, oldIndex, &source);
+          dest = CDDM_get_vert(result, newIndex);
+
+          DM_copy_vert_data(dm, result, oldIndex, newIndex, 1);
+          *dest = source;
+   }
+       BLI_ghashIterator_free(hashIter);
+       
+       /* copy the edges across, remapping indices */
+       for(i = 0; i < BLI_ghash_size(edgeHash); ++i) {
+               MEdge source;
+               MEdge *dest;
+               int oldIndex = GET_INT_FROM_POINTER(BLI_ghash_lookup(edgeHash, SET_INT_IN_POINTER(i)));
+               
+               dm->getEdge(dm, oldIndex, &source);
+               dest = CDDM_get_edge(result, i);
+               
+               source.v1 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v1)));
+               source.v2 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v2)));
+               
+               DM_copy_edge_data(dm, result, oldIndex, i, 1);
+               *dest = source;
+       }
 
-                  MEM_freeN(vertMap);
-                  MEM_freeN(edgeMap);
-                  MEM_freeN(faceMap);
+       /* copy the faces across, remapping indices */
+       for(i = 0; i < numFaces; ++i) {
+               MFace source;
+               MFace *dest;
+               int orig_v4;
+               
+               dm->getFace(dm, faceMap[i], &source);
+               dest = CDDM_get_face(result, i);
+               
+               orig_v4 = source.v4;
+               
+               source.v1 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v1)));
+               source.v2 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v2)));
+               source.v3 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v3)));
+               if(source.v4)
+                       source.v4 = GET_INT_FROM_POINTER(BLI_ghash_lookup(vertHash, SET_INT_IN_POINTER(source.v4)));
+               
+               DM_copy_face_data(dm, result, faceMap[i], i, 1);
+               *dest = source;
+               
+               test_index_face(dest, &result->faceData, i, (orig_v4 ? 4 : 3));
+       }
 
-                  return result;
+       CDDM_calc_normals(result);
+       
+       BLI_ghash_free(vertHash, NULL, NULL);
+       BLI_ghash_free(edgeHash, NULL, NULL);
+       
+       MEM_freeN(vertMap);
+       MEM_freeN(edgeMap);
+       MEM_freeN(faceMap);
+       
+       return result;
 }
 
 
@@ -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
 };
index cbd88f32409488c0ed8ed72cf77b695e85b84a5f..59c45eb2eecd3b979b468edbb992eccda29fe10c 100644 (file)
@@ -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++) {
index 4faf955b953f38dc2f61f32bbe0f107aeb9e1ee1..edf149c1580029fcdc26395a2d6b35c045bb17ba 100644 (file)
@@ -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
 };
index 41e90ecdc63e476ee03d25ebef57110fce4308cb..9e52f1881953292f02427ac5c934e11814c2a35c 100644 (file)
@@ -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()