Revision: 21462
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21462
Author:   ton
Date:     2009-07-09 17:40:04 +0200 (Thu, 09 Jul 2009)

Log Message:
-----------
2.5

Monthly cleaning round to make it compile warning free.
Mostly it was const stuff (strings, Context), but also
a couple useful fixes, like wrong use of temp pointers.

Only Mathutils callback struct I left alone... design issue.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/blenkernel/intern/cloth.c
    branches/blender2.5/blender/source/blender/blenkernel/intern/packedFile.c
    branches/blender2.5/blender/source/blender/blenkernel/intern/particle.c
    
branches/blender2.5/blender/source/blender/blenkernel/intern/particle_system.c
    branches/blender2.5/blender/source/blender/blenkernel/intern/pointcache.c
    branches/blender2.5/blender/source/blender/blenlib/intern/storage.c
    branches/blender2.5/blender/source/blender/blenlib/intern/util.c
    branches/blender2.5/blender/source/blender/editors/armature/BIF_retarget.h
    
branches/blender2.5/blender/source/blender/editors/armature/editarmature_retarget.c
    
branches/blender2.5/blender/source/blender/editors/armature/editarmature_sketch.c
    branches/blender2.5/blender/source/blender/editors/include/ED_armature.h
    branches/blender2.5/blender/source/blender/editors/object/object_edit.c
    branches/blender2.5/blender/source/blender/editors/physics/ed_pointcache.c
    branches/blender2.5/blender/source/blender/editors/space_file/file_ops.c
    branches/blender2.5/blender/source/blender/editors/space_file/file_panels.c
    branches/blender2.5/blender/source/blender/editors/space_file/filelist.c
    branches/blender2.5/blender/source/blender/editors/space_file/filelist.h
    
branches/blender2.5/blender/source/blender/editors/transform/transform_manipulator.c
    
branches/blender2.5/blender/source/blender/editors/transform/transform_ndofinput.c
    branches/blender2.5/blender/source/blender/python/BPY_extern.h
    branches/blender2.5/blender/source/blender/python/generic/euler.c
    branches/blender2.5/blender/source/blender/python/generic/quat.c
    branches/blender2.5/blender/source/blender/python/generic/vector.c
    branches/blender2.5/blender/source/blender/python/intern/bpy_interface.c
    branches/blender2.5/blender/source/blender/render/intern/source/zbuf.c

Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/cloth.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/cloth.c        
2009-07-09 14:35:40 UTC (rev 21461)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/cloth.c        
2009-07-09 15:40:04 UTC (rev 21462)
@@ -341,24 +341,27 @@
 }
 
 int modifiers_indexInObject(Object *ob, ModifierData *md_seek);
-static void cloth_write_state(int index, Cloth *cloth, float *data)
+static void cloth_write_state(int index, void *cloth_v, float *data)
 {
+       Cloth *cloth= cloth_v;
        ClothVertex *vert = cloth->verts + index;
 
        memcpy(data, vert->x, 3 * sizeof(float));
        memcpy(data + 3, vert->xconst, 3 * sizeof(float));
        memcpy(data + 6, vert->v, 3 * sizeof(float));
 }
-static void cloth_read_state(int index, Cloth *cloth, float *data)
+static void cloth_read_state(int index, void *cloth_v, float *data)
 {
+       Cloth *cloth= cloth_v;
        ClothVertex *vert = cloth->verts + index;
        
        memcpy(vert->x, data, 3 * sizeof(float));
        memcpy(vert->xconst, data + 3, 3 * sizeof(float));
        memcpy(vert->v, data + 6, 3 * sizeof(float));
 }
-static void cloth_cache_interpolate(int index, Cloth *cloth, float frs_sec, 
float cfra, float cfra1, float cfra2, float *data1, float *data2)
+static void cloth_cache_interpolate(int index, void *cloth_v, float frs_sec, 
float cfra, float cfra1, float cfra2, float *data1, float *data2)
 {
+       Cloth *cloth= cloth_v;
        ClothVertex *vert = cloth->verts + index;
        ParticleKey keys[4];
        float dfra;

Modified: 
branches/blender2.5/blender/source/blender/blenkernel/intern/packedFile.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/packedFile.c   
2009-07-09 14:35:40 UTC (rev 21461)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/packedFile.c   
2009-07-09 15:40:04 UTC (rev 21462)
@@ -377,8 +377,6 @@
 
 char *unpackFile(ReportList *reports, char *abs_name, char *local_name, 
PackedFile *pf, int how)
 {
-       char menu[6 *(FILE_MAXDIR + FILE_MAXFILE + 100)];
-       char line[FILE_MAXDIR + FILE_MAXFILE + 100];
        char *newname = NULL, *temp = NULL;
        
        // char newabs[FILE_MAXDIR + FILE_MAXFILE];

Modified: 
branches/blender2.5/blender/source/blender/blenkernel/intern/particle.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/particle.c     
2009-07-09 14:35:40 UTC (rev 21461)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/particle.c     
2009-07-09 15:40:04 UTC (rev 21462)
@@ -2008,10 +2008,10 @@
        ParticleTexture ptex;
        float *cpa_fuv=0, *par_rot=0;
        float co[3], orco[3], ornor[3], t, cpa_1st[3], dvec[3];
-       float branch_begin, branch_end, branch_prob, branchfac, rough_rand;
+       float branch_begin, branch_end, branch_prob, rough_rand;
        float length, max_length = 1.0f, cur_length = 0.0f;
        float eff_length, eff_vec[3];
-       int k, cpa_num, guided = 0;
+       int k, cpa_num;
        short cpa_from;
 
        if(part->flag & PART_BRANCHING) {
@@ -2417,7 +2417,7 @@
        float nosel_col[3];
        float length, vec[3];
        float *vg_effector= NULL, effector=0.0f;
-       float *vg_length= NULL, pa_length=1.0f, max_length=1.0f, 
cur_length=0.0f;
+       float *vg_length= NULL, pa_length=1.0f;
        int keyed, baked;
 
        /* we don't have anything valid to create paths from so let's quit here 
*/
@@ -3553,7 +3553,6 @@
        float t, real_t, dfra, keytime, frs_sec = scene->r.frs_sec;
        float co[3], orco[3];
        float hairmat[4][4];
-       float pa_clump = 0.0, pa_kink = 0.0;
        int totparent = 0;
        int totpart = psys->totpart;
        int totchild = psys->totchild;
@@ -3800,7 +3799,6 @@
                                Normalize(state->vel);
                        }
                        else{
-                               float length = VecLength(state->vel);
                                tstate.time=t+0.001f;
                                psys_get_particle_on_path(scene, 
ob,psys,p,&tstate,0);
                                VECSUB(state->vel,tstate.co,state->co);

Modified: 
branches/blender2.5/blender/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/blenkernel/intern/particle_system.c  
    2009-07-09 14:35:40 UTC (rev 21461)
+++ 
branches/blender2.5/blender/source/blender/blenkernel/intern/particle_system.c  
    2009-07-09 15:40:04 UTC (rev 21462)
@@ -2205,8 +2205,10 @@
        *sfra = MAX2(1, (int)part->sta);
        *efra = MIN2((int)(part->end + part->lifetime + 1.0), scene->r.efra);
 }
-static void particle_write_state(int index, ParticleSystem *psys, float *data)
+static void particle_write_state(int index, void *psys_ptr, float *data)
 {
+       ParticleSystem *psys= psys_ptr;
+       
        memcpy(data, (float *)(&(psys->particles+index)->state), 
sizeof(ParticleKey));
 }
 static void particle_read_state(int index, void *psys_ptr, float *data)
@@ -2225,7 +2227,7 @@
        ParticleSystem *psys= psys_ptr;
        ParticleData *pa = psys->particles + index;
        ParticleKey keys[4];
-       float dfra, cfra1f = (float)cfra1, cfra2f(float);
+       float dfra;
 
        cfra = MIN2(cfra, pa->dietime);
        cfra1 = MIN2(cfra1, pa->dietime);

Modified: 
branches/blender2.5/blender/source/blender/blenkernel/intern/pointcache.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/pointcache.c   
2009-07-09 14:35:40 UTC (rev 21461)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/pointcache.c   
2009-07-09 15:40:04 UTC (rev 21462)
@@ -643,8 +643,8 @@
                                return 0;
 
                        for(i=0; i<writer->totelem; i++) {
-                               writer->set_elem(i, writer->calldata, &temp);
-                               BKE_ptcache_file_write_floats(pf, &temp, incr);
+                               writer->set_elem(i, writer->calldata, temp);
+                               BKE_ptcache_file_write_floats(pf, temp, incr);
                        }
                }
        }
@@ -677,8 +677,8 @@
                        pmdata = pm->data;
 
                        for(i=0; i<writer->totelem; i++, pmdata+=incr) {
-                               writer->set_elem(i, writer->calldata, &temp);
-                               memcpy(pmdata, &temp, elemsize);
+                               writer->set_elem(i, writer->calldata, temp);
+                               memcpy(pmdata, temp, elemsize);
                        }
 
                        pm->frame = writer->cfra;
@@ -689,8 +689,8 @@
                        pmdata = pm->data;
 
                        for(i=0; i<writer->totelem; i++, pmdata+=incr) {
-                               writer->set_elem(i, writer->calldata, &temp);
-                               memcpy(pmdata, &temp, elemsize);
+                               writer->set_elem(i, writer->calldata, temp);
+                               memcpy(pmdata, temp, elemsize);
                        }
 
                        pm->frame = writer->cfra;

Modified: branches/blender2.5/blender/source/blender/blenlib/intern/storage.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenlib/intern/storage.c 
2009-07-09 14:35:40 UTC (rev 21461)
+++ branches/blender2.5/blender/source/blender/blenlib/intern/storage.c 
2009-07-09 15:40:04 UTC (rev 21462)
@@ -218,7 +218,7 @@
 {
        struct dirent *fname;
        struct dirlink *dlink;
-       int rellen, newnum = 0, ignore;
+       int rellen, newnum = 0;
        char buf[256];
        DIR *dir;
 

Modified: branches/blender2.5/blender/source/blender/blenlib/intern/util.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenlib/intern/util.c    
2009-07-09 14:35:40 UTC (rev 21461)
+++ branches/blender2.5/blender/source/blender/blenlib/intern/util.c    
2009-07-09 15:40:04 UTC (rev 21462)
@@ -738,9 +738,9 @@
 
 void BLI_getlastdir(const char* dir, char *last, int maxlen)
 {
-       char *s = dir;
-       char *lslash = NULL;
-       char *prevslash = NULL;
+       const char *s = dir;
+       const char *lslash = NULL;
+       const char *prevslash = NULL;
        while (*s) {
                if ((*s == '\\') || (*s == '/')) {
                        prevslash = lslash;

Modified: 
branches/blender2.5/blender/source/blender/editors/armature/BIF_retarget.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/armature/BIF_retarget.h  
2009-07-09 14:35:40 UTC (rev 21461)
+++ branches/blender2.5/blender/source/blender/editors/armature/BIF_retarget.h  
2009-07-09 15:40:04 UTC (rev 21462)
@@ -152,7 +152,7 @@
 } RigControl;
 
 void BIF_retargetArc(struct bContext *C, ReebArc *earc, RigGraph 
*template_rigg);
-RigGraph *RIG_graphFromArmature(struct bContext *C, struct Object *ob, struct 
bArmature *arm);
+RigGraph *RIG_graphFromArmature(const struct bContext *C, struct Object *ob, 
struct bArmature *arm);
 int RIG_nbJoints(RigGraph *rg);
 char *RIG_nameBone(RigGraph *rg, int arc_index, int bone_index);
 void RIG_freeRigGraph(BGraph *rg);

Modified: 
branches/blender2.5/blender/source/blender/editors/armature/editarmature_retarget.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/armature/editarmature_retarget.c
 2009-07-09 14:35:40 UTC (rev 21461)
+++ 
branches/blender2.5/blender/source/blender/editors/armature/editarmature_retarget.c
 2009-07-09 15:40:04 UTC (rev 21462)
@@ -1538,7 +1538,7 @@
 
 
/*******************************************************************************************************/
 
-RigGraph *RIG_graphFromArmature(bContext *C, Object *ob, bArmature *arm)
+RigGraph *RIG_graphFromArmature(const bContext *C, Object *ob, bArmature *arm)
 {
        Object *obedit = CTX_data_edit_object(C);
        Scene *scene = CTX_data_scene(C);

Modified: 
branches/blender2.5/blender/source/blender/editors/armature/editarmature_sketch.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/armature/editarmature_sketch.c
   2009-07-09 14:35:40 UTC (rev 21461)
+++ 
branches/blender2.5/blender/source/blender/editors/armature/editarmature_sketch.c
   2009-07-09 15:40:04 UTC (rev 21462)
@@ -242,7 +242,7 @@
 GHash *TEMPLATES_HASH = NULL;
 RigGraph *TEMPLATE_RIGG = NULL;
 
-void BIF_makeListTemplates(bContext *C)
+void BIF_makeListTemplates(const bContext *C)
 {
        Object *obedit = CTX_data_edit_object(C);
        Scene *scene = CTX_data_scene(C);
@@ -275,7 +275,7 @@
        }
 }
 
-char *BIF_listTemplates(bContext *C)
+char *BIF_listTemplates(const bContext *C)
 {
        GHashIterator ghi;
        char menu_header[] = "Template%t|None%x0|";
@@ -307,7 +307,7 @@
        return TEMPLATES_MENU;
 }
 
-int   BIF_currentTemplate(bContext *C)
+int   BIF_currentTemplate(const bContext *C)
 {
        ToolSettings *ts = CTX_data_tool_settings(C);
 
@@ -334,7 +334,7 @@
        return TEMPLATES_CURRENT;
 }
 
-RigGraph* sk_makeTemplateGraph(bContext *C, Object *ob)
+RigGraph* sk_makeTemplateGraph(const bContext *C, Object *ob)
 {
        Object *obedit = CTX_data_edit_object(C);
        if (ob == obedit)
@@ -363,7 +363,7 @@
        return TEMPLATE_RIGG;
 }
 

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to