More changes to GET_INT_FROM_POINTER and SET_INT_IN_POINTER to get rid of

other warnings that only occurred with 64bit systems.  Wish I'd known about
these macros earlier!
This commit is contained in:
Ken Hughes
2008-04-18 00:21:40 +00:00
parent be0b8ccfaa
commit 60de9d9b2f
6 changed files with 17 additions and 15 deletions

View File

@@ -396,10 +396,10 @@ static DerivedMesh *ConvertCSGDescriptorsToDerivedMesh(
if (!BLI_ghash_haskey(material_hash, orig_mat)) {
mat[*totmat] = orig_mat;
mat_nr = mface->mat_nr = (*totmat)++;
BLI_ghash_insert(material_hash, orig_mat, (void*)mat_nr);
BLI_ghash_insert(material_hash, orig_mat, SET_INT_IN_POINTER(mat_nr));
}
else
mface->mat_nr = (int)BLI_ghash_lookup(material_hash, orig_mat);
mface->mat_nr = GET_INT_FROM_POINTER(BLI_ghash_lookup(material_hash, orig_mat));
}
else
mface->mat_nr = 0;

View File

@@ -4161,13 +4161,13 @@ static void editing_panel_armature_type(Object *ob, bArmature *arm)
for(a=0; a<8; a++) {
short dx= 18;
but= uiDefButBitS(block, BUT_TOGDUAL, 1<<a, REDRAWVIEW3D, "", 10+a*dx, 115, dx, 15, &arm->layer, 0, 0, 0, 0, "Armature layer (Hold Ctrl for locking in a proxy instance)");
uiButSetFunc(but, armature_layer_cb, &arm->layer, (void *)(1<<a));
uiButSetFunc(but, armature_layer_cb, &arm->layer, SET_INT_IN_POINTER(1<<a));
}
uiBlockBeginAlign(block);
for(a=8; a<16; a++) {
short dx= 18;
but= uiDefButBitS(block, BUT_TOGDUAL, 1<<a, REDRAWVIEW3D, "", 18+a*dx, 115, dx, 15, &arm->layer, 0, 0, 0, 0, "Armature layer (Hold Ctrl for locking in a proxy instance)");
uiButSetFunc(but, armature_layer_cb, &arm->layer, (void *)(1<<a));
uiButSetFunc(but, armature_layer_cb, &arm->layer, SET_INT_IN_POINTER(1<<a));
}
/* quite bad here, but I don't know a better place for copy... */
if(ob->pose)
@@ -4367,13 +4367,13 @@ static void editing_panel_armature_bones(Object *ob, bArmature *arm)
for(a=0; a<8; a++) {
short dx= 21;
but= uiDefButBitS(block, TOG, 1<<a, REDRAWVIEW3D, "", -10+a*dx, by-57, dx, 15, &curBone->layer, 0, 0, 0, 0, "Armature layer that bone exists on");
uiButSetFunc(but, armature_layer_cb, &curBone->layer, (void *)(1<<a));
uiButSetFunc(but, armature_layer_cb, &curBone->layer, SET_INT_IN_POINTER(1<<a));
}
uiBlockBeginAlign(block);
for(a=8; a<16; a++) {
short dx= 21;
but= uiDefButBitS(block, TOG, 1<<a, REDRAWVIEW3D, "", -6+a*dx, by-57, dx, 15, &curBone->layer, 0, 0, 0, 0, "Armature layer that bone exists on");
uiButSetFunc(but, armature_layer_cb, &curBone->layer, (void *)(1<<a));
uiButSetFunc(but, armature_layer_cb, &curBone->layer, SET_INT_IN_POINTER(1<<a));
}
uiBlockEndAlign(block);
@@ -4470,13 +4470,13 @@ static void editing_panel_pose_bones(Object *ob, bArmature *arm)
for(a=0; a<8; a++) {
short dx= 21;
but= uiDefButBitS(block, TOG, 1<<a, REDRAWVIEW3D, "", -10+a*dx, by-57, dx, 15, &curBone->layer, 0, 0, 0, 0, "Armature layer that bone exists on");
uiButSetFunc(but, armature_layer_cb, &curBone->layer, (void *)(1<<a));
uiButSetFunc(but, armature_layer_cb, &curBone->layer, SET_INT_IN_POINTER(1<<a));
}
uiBlockBeginAlign(block);
for(a=8; a<16; a++) {
short dx= 21;
but= uiDefButBitS(block, TOG, 1<<a, REDRAWVIEW3D, "", -6+a*dx, by-57, dx, 15, &curBone->layer, 0, 0, 0, 0, "Armature layer that bone exists on");
uiButSetFunc(but, armature_layer_cb, &curBone->layer, (void *)(1<<a));
uiButSetFunc(but, armature_layer_cb, &curBone->layer, SET_INT_IN_POINTER(1<<a));
}
uiBlockEndAlign(block);
@@ -4994,7 +4994,7 @@ static void editing_panel_mesh_skgen(Object *ob, Mesh *me)
int y = 90 - 20 * i;
but = uiDefIconBut(block, BUT, B_MODIFIER_RECALC, VICON_MOVE_DOWN, 1025, y, 16, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Change the order the subdivisions algorithm are applied");
uiButSetFunc(but, skgen_reorder, (void *)i, NULL);
uiButSetFunc(but, skgen_reorder, SET_INT_IN_POINTER(i), NULL);
switch(G.scene->toolsettings->skgen_subdivisions[i])
{

View File

@@ -64,6 +64,8 @@
#include "BKE_main.h"
#include "BKE_sca.h"
#include "BKE_property.h"
#include "BKE_property.h"
#include "BKE_utildefines.h"
#include "BIF_gl.h"
#include "BIF_resources.h"
@@ -215,7 +217,7 @@ void make_unique_prop_names(char *str)
static void make_unique_prop_names_cb(void *strv, void *redraw_view3d_flagv)
{
char *str= strv;
int redraw_view3d_flag= (int) redraw_view3d_flagv;
int redraw_view3d_flag= GET_INT_FROM_POINTER(redraw_view3d_flagv);
make_unique_prop_names(str);
if (redraw_view3d_flag) allqueue(REDRAWVIEW3D, 0);

View File

@@ -2711,7 +2711,7 @@ static void render_panel_yafrayGlobal()
static void layer_copy_func(void *lay_v, void *lay_p)
{
unsigned int *lay= lay_p;
int laybit= (int)lay_v;
int laybit= GET_INT_FROM_POINTER(lay_v);
if(G.qual & (LR_SHIFTKEY|LR_CTRLKEY)) {
if(*lay==0) *lay= 1<<laybit;

View File

@@ -897,7 +897,7 @@ void draw_uvs_sima(void)
glLineWidth(1);
col2[0] = col2[1] = col2[2] = 128; col2[3] = 255;
glColor4ubv(col2);
glColor4ubv((unsigned char *)col2);
if (G.f & G_DRAWEDGES) {
glShadeModel(GL_SMOOTH);

View File

@@ -908,7 +908,7 @@ static void seam_add_adjacent(Mesh *me, Heap *heap, int mednum, int vertnum, int
if (cost[adjnum] > newcost) {
cost[adjnum] = newcost;
prevedge[adjnum] = mednum;
BLI_heap_insert(heap, newcost, (void*)adjnum);
BLI_heap_insert(heap, newcost, SET_INT_IN_POINTER(adjnum));
}
}
}
@@ -973,11 +973,11 @@ static int seam_shortest_path(Mesh *me, int source, int target)
/* regular dijkstra shortest path, but over edges instead of vertices */
heap = BLI_heap_new();
BLI_heap_insert(heap, 0.0f, (void*)source);
BLI_heap_insert(heap, 0.0f, SET_INT_IN_POINTER(source));
cost[source] = 0.0f;
while (!BLI_heap_empty(heap)) {
mednum = (int)BLI_heap_popmin(heap);
mednum = GET_INT_FROM_POINTER(BLI_heap_popmin(heap));
med = me->medge + mednum;
if (mednum == target)