- assorted warning fixes (signedness, float->double)
authorDaniel Dunbar <daniel@zuster.org>
Sat, 24 Sep 2005 16:02:56 +0000 (16:02 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 24 Sep 2005 16:02:56 +0000 (16:02 +0000)
 - added decimate,boolean modifier copydata methods

source/blender/blenkernel/depsgraph_private.h
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/modifier.c
source/blender/python/api2_2x/BezTriple.c
source/blender/src/drawdeps.c
source/blender/src/drawtext.c
source/blender/src/editface.c
source/blender/src/interface.c
source/blender/src/interface_draw.c
source/blender/src/renderwin.c

index 6b29de2d5b4715cd0c613397848bf2bdba51286d..527b78bcbe30ce70230247c40f998ec4ca6ee3d3 100644 (file)
@@ -35,8 +35,8 @@
 #include "BKE_constraint.h"
 
 
-#define DEPSX  5.0
-#define DEPSY  1.8
+#define DEPSX  5.0f
+#define DEPSY  1.8f
 
 #define DAGQUEUEALLOC 50
 
index 58d72b893945d2167fa971b2a20c3c36081fac25..f23a30fba7f0c3d041b3e134eebbf861c54fdba7 100644 (file)
@@ -670,7 +670,7 @@ void graph_bfs(void)
                                if((itA->node->color == DAG_WHITE) ) {
                                        itA->node->color = DAG_GRAY;
                                        itA->node->BFS_dist = node->BFS_dist + 1;
-                                       itA->node->k = minheight;
+                                       itA->node->k = (float) minheight;
                                        push_queue(nqueue,itA->node);
                                }
                                
@@ -683,11 +683,11 @@ void graph_bfs(void)
                        }
                        if (pos[node->BFS_dist] > node->k ) {
                                pos[node->BFS_dist] += 1;                               
-                               node->k = pos[node->BFS_dist];
+                               node->k = (float) pos[node->BFS_dist];
                        } else {
-                               pos[node->BFS_dist] = node->k +1;
+                               pos[node->BFS_dist] = (int) node->k +1;
                        }
-                       set_node_xy(node, DEPSX*2*node->BFS_dist, pos[node->BFS_dist]*DEPSY*2);
+                       set_node_xy(node, node->BFS_dist*DEPSX*2, pos[node->BFS_dist]*DEPSY*2);
                        node->color = DAG_BLACK;
                        /*
                         fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);   
@@ -820,7 +820,7 @@ DagNodeQueue * graph_dfs(void)
 
                                        time++;
                                        itA->node->DFS_dist = node->DFS_dist + 1;
-                                       itA->node->k = minheight;
+                                       itA->node->k = (float) minheight;
                                        push_stack(nqueue,itA->node);
                                        skip = 1;
                                        break;
@@ -860,11 +860,11 @@ DagNodeQueue * graph_dfs(void)
                                        maxpos = node->DFS_dist;
                                if (pos[node->DFS_dist] > node->k ) {
                                        pos[node->DFS_dist] += 1;                               
-                                       node->k = pos[node->DFS_dist];
+                                       node->k = (float) pos[node->DFS_dist];
                                } else {
-                                       pos[node->DFS_dist] = node->k +1;
+                                       pos[node->DFS_dist] = (int) node->k +1;
                                }
-                               set_node_xy(node, DEPSX*2*node->DFS_dist, pos[node->DFS_dist]*DEPSY*2);
+                               set_node_xy(node, node->DFS_dist*DEPSX*2, pos[node->DFS_dist]*DEPSY*2);
                                
                                /*
                                 fprintf(stderr,"DFS node : %20s %i %i %i %i\n",((ID *) node->ob)->name,node->BFS_dist, node->DFS_dist, node->DFS_dvtm, node->DFS_fntm );       
index f5fe534c0b33bd1a427a935836d1a1b2d546df20..f8769dd6ece2d06dc9d21e4eb465e79490bfe30c 100644 (file)
@@ -726,6 +726,14 @@ static void decimateModifier_initData(ModifierData *md)
        dmd->percent = 1.0;
 }
 
+static void decimateModifier_copyData(ModifierData *md, ModifierData *target)
+{
+       DecimateModifierData *dmd = (DecimateModifierData*) md;
+       DecimateModifierData *tdmd = (DecimateModifierData*) target;
+
+       tdmd->percent = dmd->percent;
+}
+
 static void *decimateModifier_applyModifier(ModifierData *md, Object *ob, void *derivedData, float (*vertexCos)[3], int useRenderParams, int isFinalCalc)
 {
        DecimateModifierData *dmd = (DecimateModifierData*) md;
@@ -1109,6 +1117,14 @@ static void softbodyModifier_deformVerts(ModifierData *md, Object *ob, void *der
 
 /* Boolean */
 
+static void booleanModifier_copyData(ModifierData *md, ModifierData *target)
+{
+       BooleanModifierData *bmd = (BooleanModifierData*) md;
+       BooleanModifierData *tbmd = (BooleanModifierData*) target;
+
+       tbmd->object = bmd->object;
+}
+
 static int booleanModifier_isDisabled(ModifierData *md)
 {
        BooleanModifierData *bmd = (BooleanModifierData*) md;
@@ -1223,6 +1239,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
                mti->type = eModifierTypeType_Nonconstructive;
                mti->flags = eModifierTypeFlag_AcceptsMesh;
                mti->initData = decimateModifier_initData;
+               mti->copyData = decimateModifier_copyData;
                mti->applyModifier = decimateModifier_applyModifier;
 
                mti = INIT_TYPE(Wave);
@@ -1264,6 +1281,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type)
                mti = INIT_TYPE(Boolean);
                mti->type = eModifierTypeType_Nonconstructive;
                mti->flags = eModifierTypeFlag_AcceptsMesh;
+               mti->copyData = booleanModifier_copyData;
                mti->isDisabled = booleanModifier_isDisabled;
                mti->applyModifier = booleanModifier_applyModifier;
                mti->foreachObjectLink = booleanModifier_foreachObjectLink;
index 13280c9e8c599ba94b697ef379a2f405e6d6786c..46ea67728d6260c0bc373c14f0fba14ea921e352 100644 (file)
@@ -460,7 +460,6 @@ PyObject *newBezTriple( PyObject *args)
                return  EXPP_ReturnPyObjError( PyExc_AttributeError,
                                               "wrong number of points");
        {
-               int i;
                if (length == 9)
                        status = PyArg_ParseTuple( args, "fffffffff", 
                                                   &numbuf[0], 
index 5942173bda43a29d81f40722d86ee4dd056519e7..d948f31009b2201cbdd7368563a2ce5fd8ffb318 100644 (file)
@@ -152,7 +152,7 @@ static void draw_deps(DagNode *node)
        glRectf(x1,  y1,  x2,  y2);
        
        v1[0]= x1; 
-       v1[1]= (y1+y2)/2 -0.3;
+       v1[1]= (y1+y2)/2 -0.3f;
        sprintf(str, "     %s", ((ID *) node->ob)->name+2);
        
        calc_oopstext(str, v1);
index 4de5cf5a0486a885da9a0c736063baf476bc3057..f726b87ad719358d0a08fce12732bc40914e03d9 100644 (file)
@@ -747,7 +747,7 @@ static void calc_text_rcts(SpaceText *st)
        CLAMP(st->txtbar.ymax, 2, curarea->winy-2);
 
        st->pix_per_line= (float) ltexth/curarea->winy;
-       if (st->pix_per_line<.1) st->pix_per_line=.1;
+       if (st->pix_per_line<.1) st->pix_per_line=.1f;
 
        lbarstart= MIN2(txt_get_span(st->text->lines.first, st->text->curl), 
                                txt_get_span(st->text->lines.first, st->text->sell));
index 0871505f2ea86218919f96c1cdd6b9dc43e9db0d..1a9e4b9ac21004637367f28758a371cbb98f373b 100644 (file)
@@ -955,7 +955,7 @@ int face_pick(Mesh *me, short x, short y, unsigned int *index)
        }
        /* Convert the color back to a face index */
        *index = framebuffer_to_index(col);
-       if (col==0 || (*index)<=0 || (*index)>me->totface)
+       if (col==0 || (*index)<=0 || (*index)>(unsigned) me->totface)
                return 0;
 
        (*index)--;
index 7327398c0996fe45cb46488c3a7fe2af4b3526bb..78b94c425645c2106a50256de59eb73968809ecb 100644 (file)
@@ -85,6 +85,7 @@
 #include "BIF_mywindow.h"
 #include "BIF_space.h"
 #include "BIF_glutil.h"
+#include "BIF_editfont.h"
 #include "BIF_interface.h"
 #include "BIF_butspace.h"
 
@@ -2698,9 +2699,7 @@ static int ui_do_but_CHARTAB(uiBut *but)
        float sx, sy, ex, ey;
        float width, height;
        float butw, buth;
-       int x, y;
-       unsigned long cs;
-       unsigned long che;
+       int x, y, cs, che;
 
        /* Check the position */
        uiGetMouse(mywinget(), mval);
index d4be70f87599bcf6e6281c86ff4a17e8e9be7cc3..84f200a490df18aff2c4c2edb6e39be71ece675c 100644 (file)
@@ -1713,8 +1713,7 @@ static void ui_draw_but_CHARTAB(uiBut *but)
        float sx, sy, ex, ey;
        float width, height;
        float butw, buth;
-       int x, y;
-       unsigned long cs;
+       int x, y, cs;
        wchar_t wstr[2];
        unsigned char ustr[16];
        PackedFile *pf;
index 95ff209fc903935dcf09c4ae6cc29e14267dbd29..46e59e8aacb4c9788d9b458b11a801dccf17fd50 100644 (file)
@@ -248,8 +248,8 @@ static void renderwin_reset_view(RenderWin *rw)
        /* crop option makes image smaller */
        if ((G.scene->r.mode & R_BORDER) && (G.scene->r.mode & R_MOVIECROP)) { 
                if(!(G.scene->r.scemode & R_OGL)) {
-                       rectx*= (G.scene->r.border.xmax-G.scene->r.border.xmin);
-                       recty*= (G.scene->r.border.ymax-G.scene->r.border.ymin);
+                       rectx= (int) (rectx*(G.scene->r.border.xmax-G.scene->r.border.xmin));
+                       recty= (int) (recty*(G.scene->r.border.ymax-G.scene->r.border.ymin));
                }
        }