Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2007-04-29 14:49:02 +0400
committerTon Roosendaal <ton@blender.org>2007-04-29 14:49:02 +0400
commit243d1a28c0635a85c2dca9a23e9465b170b0ba3a (patch)
tree90a6fb16f8ca90d04d70e8ff129c24c98b7f003a /source/blender
parente4d6f331eb90f7375a241a7698bd6958b6ced326 (diff)
Casting fixes for 64 bits. Incomplete commit, discussion on proper casting
has to be finished.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_customdata.h2
-rw-r--r--source/blender/blenlib/intern/fileops.c4
-rw-r--r--source/blender/blenlib/intern/util.c2
-rw-r--r--source/blender/blenloader/intern/readfile.c2
-rw-r--r--source/blender/render/intern/source/shadbuf.c4
-rw-r--r--source/blender/src/buttons_editing.c2
-rw-r--r--source/blender/src/drawmesh.c8
-rw-r--r--source/blender/src/drawobject.c12
-rw-r--r--source/blender/src/editkey.c4
-rw-r--r--source/blender/src/header_script.c6
-rw-r--r--source/blender/src/interface.c4
-rw-r--r--source/blender/src/space.c2
-rw-r--r--source/blender/src/toolbox.c16
-rwxr-xr-xsource/blender/src/transform_conversions.c10
14 files changed, 39 insertions, 39 deletions
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index ecefb6dde47..b41c06f046f 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -34,7 +34,7 @@
struct CustomData;
struct CustomDataLayer;
-typedef int CustomDataMask;
+typedef long CustomDataMask;
extern const CustomDataMask CD_MASK_BAREMESH;
extern const CustomDataMask CD_MASK_MESH;
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 232546b89ca..fcea30982bd 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -75,7 +75,7 @@ char *first_slash(char *string) {
if (!ffslash) return fbslash;
else if (!fbslash) return ffslash;
- if ((int)ffslash < (int)fbslash) return ffslash;
+ if ((long)ffslash < (long)fbslash) return ffslash;
else return fbslash;
}
@@ -88,7 +88,7 @@ char *BLI_last_slash(char *string) {
if (!lfslash) return lbslash;
else if (!lbslash) return lfslash;
- if ((int)lfslash < (int)lbslash) return lbslash;
+ if ((long)lfslash < (long)lbslash) return lbslash;
else return lfslash;
}
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c
index 83e110101dc..cfce8e3dafa 100644
--- a/source/blender/blenlib/intern/util.c
+++ b/source/blender/blenlib/intern/util.c
@@ -1540,7 +1540,7 @@ void *BLI_pointer_from_int(int val)
firsttime= 0;
free(poin);
}
- return basevalue | (((long)val)<<3);
+ return (void *)(basevalue | (((long)val)<<3));
}
#else
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index c7182c74d63..3606b1cb3c5 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2668,7 +2668,7 @@ static void lib_link_object(FileData *fd, Main *main)
ob->type= OB_EMPTY;
warn= 1;
if(ob->id.lib) printf("Can't find obdata of %s lib %s\n", ob->id.name+2, ob->id.lib->name);
- else printf("Object %s lost data. Lib:%x\n", ob->id.name+2, (unsigned int) ob->id.lib);
+ else printf("Object %s lost data.", ob->id.name+2);
if(ob->pose) {
free_pose_channels(ob->pose);
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index 4a5986591d4..5e010080ac0 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -525,8 +525,8 @@ static float readshadowbuf(ShadBuf *shb, ShadSampleBuf *shsample, int bias, int
}
else {
- /* got warning on this from DEC alpha (64 bits).... */
- /* but it's working code! (ton) */
+ /* got warning on this for 64 bits.... */
+ /* but it's working code! in this case rz is not a pointer but zvalue (ton) */
zsamp= (int) rz;
}
diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c
index 28818e66b44..b52b5ebc306 100644
--- a/source/blender/src/buttons_editing.c
+++ b/source/blender/src/buttons_editing.c
@@ -3505,7 +3505,7 @@ static void validate_posebonebutton_cb(void *bonev, void *namev)
static void armature_layer_cb(void *lay_v, void *value_v)
{
short *layer= lay_v;
- int value= (int)value_v;
+ int value= (long)value_v;
if(*layer==0 || G.qual==0) *layer= value;
allqueue(REDRAWBUTSEDIT, 0);
diff --git a/source/blender/src/drawmesh.c b/source/blender/src/drawmesh.c
index 3d574633219..cf14427e029 100644
--- a/source/blender/src/drawmesh.c
+++ b/source/blender/src/drawmesh.c
@@ -648,7 +648,7 @@ static int draw_tfaces3D__setHiddenOpts(void *userData, int index)
{
struct { Mesh *me; EdgeHash *eh; } *data = userData;
MEdge *med = &data->me->medge[index];
- unsigned int flags = (int) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
+ unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
if((G.f & G_DRAWSEAMS) && (med->flag&ME_SEAM)) {
return 0;
@@ -666,7 +666,7 @@ static int draw_tfaces3D__setSeamOpts(void *userData, int index)
{
struct { Mesh *me; EdgeHash *eh; } *data = userData;
MEdge *med = &data->me->medge[index];
- unsigned int flags = (int) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
+ unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
if (med->flag&ME_SEAM) {
if (G.f&G_HIDDENEDGES) {
@@ -682,7 +682,7 @@ static int draw_tfaces3D__setSelectOpts(void *userData, int index)
{
struct { Mesh *me; EdgeHash *eh; } *data = userData;
MEdge *med = &data->me->medge[index];
- unsigned int flags = (int) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
+ unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
return flags & eEdge_Select;
}
@@ -690,7 +690,7 @@ static int draw_tfaces3D__setActiveOpts(void *userData, int index)
{
struct { Mesh *me; EdgeHash *eh; } *data = userData;
MEdge *med = &data->me->medge[index];
- unsigned int flags = (int) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
+ unsigned long flags = (long) BLI_edgehash_lookup(data->eh, med->v1, med->v2);
if (flags & eEdge_Active) {
if (flags & eEdge_ActiveLast) {
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
index 8bb09acc462..b1b373ee47d 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -4245,7 +4245,7 @@ void draw_object_ext(Base *base)
static void bbs_mesh_verts__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
{
- int offset = (int) userData;
+ int offset = (long) userData;
EditVert *eve = EM_get_vert_for_index(index);
if (eve->h==0) {
@@ -4257,7 +4257,7 @@ static int bbs_mesh_verts(DerivedMesh *dm, int offset)
{
glPointSize( BIF_GetThemeValuef(TH_VERTEX_SIZE) );
bglBegin(GL_POINTS);
- dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, (void*) offset);
+ dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, (void*)(long) offset);
bglEnd();
glPointSize(1.0);
@@ -4266,7 +4266,7 @@ static int bbs_mesh_verts(DerivedMesh *dm, int offset)
static int bbs_mesh_wire__setDrawOptions(void *userData, int index)
{
- int offset = (int) userData;
+ int offset = (long) userData;
EditEdge *eed = EM_get_edge_for_index(index);
if (eed->h==0) {
@@ -4278,7 +4278,7 @@ static int bbs_mesh_wire__setDrawOptions(void *userData, int index)
}
static int bbs_mesh_wire(DerivedMesh *dm, int offset)
{
- dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOptions, (void*) offset);
+ dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOptions, (void*)(long) offset);
return offset + G.totedge;
}
@@ -4312,7 +4312,7 @@ static int bbs_mesh_solid_EM(DerivedMesh *dm, int facecol)
cpack(0);
if (facecol) {
- dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, (void*) 1, 0);
+ dm->drawMappedFaces(dm, bbs_mesh_solid__setSolidDrawOptions, (void*)(long) 1, 0);
if(G.scene->selectmode & SCE_SELECT_FACE) {
glPointSize(BIF_GetThemeValuef(TH_FACEDOT_SIZE));
@@ -4345,7 +4345,7 @@ static int bbs_mesh_wire__setDrawOpts(void *userData, int index)
{
struct { Mesh *me; EdgeHash *eh; int offset; } *data = userData;
MEdge *med = data->me->medge + index;
- unsigned int flags = (int)BLI_edgehash_lookup(data->eh, med->v1, med->v2);
+ unsigned long flags = (long)BLI_edgehash_lookup(data->eh, med->v1, med->v2);
if (flags & 1) {
set_framebuffer_index_color(data->offset+index);
diff --git a/source/blender/src/editkey.c b/source/blender/src/editkey.c
index e4c35254698..85dac9ee3c5 100644
--- a/source/blender/src/editkey.c
+++ b/source/blender/src/editkey.c
@@ -164,7 +164,7 @@ static void rvk_slider_func(void *voidob, void *voidkeynum)
IpoCurve *icu=NULL;
BezTriple *bezt=NULL;
float cfra, rvkval;
- int keynum = (int) voidkeynum;
+ int keynum = (long) voidkeynum;
cfra = frame_to_float(CFRA);
@@ -277,7 +277,7 @@ void make_rvk_slider(uiBlock *block, Object *ob, int keynum,
x, y , w, h,
meshslidervals+keynum, min, max, 10, 2, tip);
- uiButSetFunc(but, rvk_slider_func, ob, (void *)keynum);
+ uiButSetFunc(but, rvk_slider_func, ob, (void *)(long)keynum);
// no hilite, the winmatrix is not correct later on...
uiButSetFlag(but, UI_NO_HILITE);
diff --git a/source/blender/src/header_script.c b/source/blender/src/header_script.c
index cb1f89d465f..98f18c4e2ac 100644
--- a/source/blender/src/header_script.c
+++ b/source/blender/src/header_script.c
@@ -72,7 +72,7 @@
/* action executed after clicking in Scripts menu */
static void do_scripts_submenus(void *int_arg, int event)
{
- int menutype = (int)int_arg;
+ int menutype = (long)int_arg;
BPY_menu_do_python (menutype, event);
@@ -84,7 +84,7 @@ static uiBlock *script_scripts_submenus(void *int_menutype)
uiBlock *block;
short yco = 20, menuwidth = 120;
BPyMenu *pym;
- int i = 0, menutype = (int)int_menutype;
+ int i = 0, menutype = (long)int_menutype;
if ((menutype < 0) || (menutype > PYMENU_SCRIPTS_MENU_TOTAL))
return NULL;
@@ -135,7 +135,7 @@ static uiBlock *script_scriptsmenu(void *arg_unused)
uiBlockSetButmFunc(block, do_script_scriptsmenu, NULL);
for (i = 0; i < PYMENU_SCRIPTS_MENU_TOTAL; i++) {
- uiDefIconTextBlockBut(block, script_scripts_submenus, (void *)i, ICON_RIGHTARROW_THIN, BPyMenu_group_itoa(i), 0, yco-=20, menuwidth, 19, "");
+ uiDefIconTextBlockBut(block, script_scripts_submenus, (void *)(long)i, ICON_RIGHTARROW_THIN, BPyMenu_group_itoa(i), 0, yco-=20, menuwidth, 19, "");
}
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c
index 51191800290..60a5a59643d 100644
--- a/source/blender/src/interface.c
+++ b/source/blender/src/interface.c
@@ -5935,7 +5935,7 @@ static int findBitIndex(unsigned int x) {
/* autocomplete callback for ID buttons */
static void autocomplete_id(char *str, void *arg_v)
{
- int blocktype= (int)arg_v;
+ int blocktype= (long)arg_v;
ListBase *listb= wich_libbase(G.main, blocktype);
char truncate[32]= {0};
@@ -6285,7 +6285,7 @@ uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int
ui_check_but(but);
if(blocktype)
- uiButSetCompleteFunc(but, autocomplete_id, (void *)(int)blocktype);
+ uiButSetCompleteFunc(but, autocomplete_id, (void *)(long)blocktype);
return but;
}
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index 4cc4c016be1..3cdad990918 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -468,7 +468,7 @@ static void restore_all_scene_cfra(LinkNode *storelist) {
Scene *sc;
for (sc= G.main->scene.first; sc; sc= sc->id.next) {
- int stored_cfra= (int) sc_store->link;
+ int stored_cfra= (long) sc_store->link;
sc->r.cfra= stored_cfra;
set_scene_bg(sc);
diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c
index f4f9147b3b3..0657d89f1fc 100644
--- a/source/blender/src/toolbox.c
+++ b/source/blender/src/toolbox.c
@@ -1719,8 +1719,8 @@ static uiBlock *tb_makemenu(void *arg)
static int tb_mainx= 1234, tb_mainy= 0;
static void store_main(void *arg1, void *arg2)
{
- tb_mainx= (int)arg1;
- tb_mainy= (int)arg2;
+ tb_mainx= (long)arg1;
+ tb_mainy= (long)arg2;
}
static void do_group_addmenu(void *arg, int event)
@@ -2141,27 +2141,27 @@ void toolbox_n(void)
but=uiDefBlockBut(block, tb_makemenu, menu1, str1, mval[0]-(1.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
uiButSetFlag(but, UI_MAKE_TOP|UI_MAKE_RIGHT);
- uiButSetFunc(but, store_main, (void *)dx, (void *)-5);
+ uiButSetFunc(but, store_main, (void *)(long)dx, (void *)(long)-5);
but=uiDefBlockBut(block, tb_makemenu, menu2, str2, mval[0]-(0.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
uiButSetFlag(but, UI_MAKE_TOP);
- uiButSetFunc(but, store_main, (void *)0, (void *)-5);
+ uiButSetFunc(but, store_main, (void *)(long)0, (void *)(long)-5);
but=uiDefBlockBut(block, tb_makemenu, menu3, str3, mval[0]+(0.5*dx)+tb_mainx,mval[1]+tb_mainy, dx, 19, "");
uiButSetFlag(but, UI_MAKE_TOP|UI_MAKE_LEFT);
- uiButSetFunc(but, store_main, (void *)-dx, (void *)-5);
+ uiButSetFunc(but, store_main, (void *)(long)-dx, (void *)(long)-5);
but=uiDefBlockBut(block, tb_makemenu, menu4, str4, mval[0]-(1.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
uiButSetFlag(but, UI_MAKE_DOWN|UI_MAKE_RIGHT);
- uiButSetFunc(but, store_main, (void *)dx, (void *)5);
+ uiButSetFunc(but, store_main, (void *)(long)dx, (void *)(long)5);
but=uiDefBlockBut(block, tb_makemenu, menu5, str5, mval[0]-(0.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
uiButSetFlag(but, UI_MAKE_DOWN);
- uiButSetFunc(but, store_main, (void *)0, (void *)5);
+ uiButSetFunc(but, store_main, (void *)(long)0, (void *)(long)5);
but=uiDefBlockBut(block, tb_makemenu, menu6, str6, mval[0]+(0.5*dx)+tb_mainx,mval[1]+tb_mainy-20, dx, 19, "");
uiButSetFlag(but, UI_MAKE_DOWN|UI_MAKE_LEFT);
- uiButSetFunc(but, store_main, (void *)-dx, (void *)5);
+ uiButSetFunc(but, store_main, (void *)(long)-dx, (void *)(long)5);
} else if (tot==5 || tot==7) {
/* check if it fits, dubious */
if(mval[0]-0.25*dx+tb_mainx < 6) mval[0]= 6 + 0.25*dx -tb_mainx;
diff --git a/source/blender/src/transform_conversions.c b/source/blender/src/transform_conversions.c
index 1a670bc4e82..b4a446e773e 100755
--- a/source/blender/src/transform_conversions.c
+++ b/source/blender/src/transform_conversions.c
@@ -1566,7 +1566,7 @@ static void set_crazyspace_quats(float *mappedcos, float *quats)
EditVert *eve, *prev;
EditFace *efa;
float *v1, *v2, *v3, *v4;
- int index= 0;
+ long index= 0;
/* two abused locations in vertices */
for(eve= em->verts.first; eve; eve= eve->next, index++) {
@@ -1578,9 +1578,9 @@ static void set_crazyspace_quats(float *mappedcos, float *quats)
for(efa= em->faces.first; efa; efa= efa->next) {
/* retrieve mapped coordinates */
- v1= mappedcos + 3*( (int)(efa->v1->prev) );
- v2= mappedcos + 3*( (int)(efa->v2->prev) );
- v3= mappedcos + 3*( (int)(efa->v3->prev) );
+ v1= mappedcos + 3*( (long)(efa->v1->prev) );
+ v2= mappedcos + 3*( (long)(efa->v2->prev) );
+ v3= mappedcos + 3*( (long)(efa->v3->prev) );
if(efa->v2->tmp.fp==NULL && efa->v2->f1) {
set_crazy_vertex_quat(quats, efa->v2->co, efa->v3->co, efa->v1->co, v2, v3, v1);
@@ -1589,7 +1589,7 @@ static void set_crazyspace_quats(float *mappedcos, float *quats)
}
if(efa->v4) {
- v4= mappedcos + 3*( (int)(efa->v4->prev) );
+ v4= mappedcos + 3*( (long)(efa->v4->prev) );
if(efa->v1->tmp.fp==NULL && efa->v1->f1) {
set_crazy_vertex_quat(quats, efa->v1->co, efa->v2->co, efa->v4->co, v1, v2, v4);