Casting fixes for 64 bits. Incomplete commit, discussion on proper casting
has to be finished.
This commit is contained in:
		@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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, "");
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user