fix type-punning warnings

svn: r5252
This commit is contained in:
Matthew Flatt 2007-01-08 00:15:53 +00:00
parent e307901c1d
commit d48ad4fed3
6 changed files with 19 additions and 19 deletions

View File

@ -810,7 +810,7 @@ static MrEdContext *MakeContext(MrEdContext *c)
}
c->mr_hop = mr_hop;
#ifndef MZ_PRECISE_GC
scheme_weak_reference((void **)&mr_hop->context);
scheme_weak_reference((void **)(void *)&mr_hop->context);
#endif
{

View File

@ -2720,7 +2720,7 @@ void wxMediaEdit::ContinueRefresh(void)
rs = 0;
} else {
delayedscroll = -1;
delayedscrollbox = NULL;
delayedscrollbox = 0;
}
}
if (admin && !admin->standard)

View File

@ -1268,9 +1268,9 @@ void *wxStyleList::NotifyOnChange(wxStyleNotifyFunc f, void *data, int weak)
} else {
void *weak_data;
weak_data = (void *)scheme_box((Scheme_Object *)data);
GC_finalization_weak_ptr((void **)weak_data,
((void **)&SCHEME_BOX_VAL(weak_data)
- (void **)weak_data));
GC_finalization_weak_ptr((void **)(void *)weak_data,
((void **)(void *)&SCHEME_BOX_VAL(weak_data)
- (void **)(void *)weak_data));
rec->data = weak_data;
}
#else
@ -1280,7 +1280,7 @@ void *wxStyleList::NotifyOnChange(wxStyleNotifyFunc f, void *data, int weak)
rec = new WXGC_PTRS NotificationRec;
rec->data = data;
if (weak)
scheme_weak_reference((void **)&rec->data);
scheme_weak_reference((void **)(void *)&rec->data);
else
WXGC_IGNORE(rec, rec->data);
#endif

View File

@ -2123,7 +2123,7 @@ void *wxSchemeYield(void *sema)
return scheme_false;
} else if (sema) {
if (!scheme_is_evt((Scheme_Object *)sema))
scheme_wrong_type("yield", "evt or 'wait", -1, 0, (Scheme_Object **)&sema);
scheme_wrong_type("yield", "evt or 'wait", -1, 0, (Scheme_Object **)(void *)&sema);
if (is_handler)
return wxDispatchEventsUntilWaitable((wxDispatch_Check_Fun)NULL, NULL, (Scheme_Object *)sema);

View File

@ -37,28 +37,28 @@
//-----------------------------------------------------------------------------
#ifdef MZ_PRECISE_GC
# define WXGC_IGNORE(base, ptr) GC_finalization_weak_ptr((void **)base, (void **)&(ptr) - (void **)base)
# define WXGC_IGNORE(base, ptr) GC_finalization_weak_ptr((void **)(void *)base, (void **)(void *)&(ptr) - (void **)(void *)base)
# define COPYSTRING_TO_ALIGNED(s, d) copystring_to_aligned(s, d)
# define DELETE_OBJ delete_wxobject
# define DELETE_VAL delete
# define MALLOC_SAFEREF() (void *)GC_malloc_immobile_box(GC_malloc_weak_box(NULL, NULL, 0))
# define FREE_SAFEREF(x) GC_free_immobile_box((void **)x)
# define FREE_SAFEREF(x) GC_free_immobile_box((void **)(void *)x)
typedef struct {
short tag;
short filler_used_for_hashing;
void *val;
} wxWeak_Box;
# define SET_SAFEREF(x, v) (*(wxWeak_Box **)x)->val = gcOBJ_TO_PTR(v)
# define GET_SAFEREF(x) ((*(void **)x) ? gcPTR_TO_OBJ((*(wxWeak_Box **)x)->val) : NULL)
# define GET_SAFEREF(x) ((*(void **)(void *)x) ? gcPTR_TO_OBJ((*(wxWeak_Box **)(void *)x)->val) : NULL)
#else
# define WXGC_IGNORE(base, ptr) GC_general_register_disappearing_link((void **)&(ptr), NULL)
# define WXGC_IGNORE(base, ptr) GC_general_register_disappearing_link((void **)(void *)&(ptr), NULL)
# define COPYSTRING_TO_ALIGNED(s, d) (s + d)
# define DELETE_OBJ delete
# define DELETE_VAL delete
# define MALLOC_SAFEREF() malloc(sizeof(void *))
# define FREE_SAFEREF(x) free(x)
# define SET_SAFEREF(x, v) (*(void **)x) = v
# define GET_SAFEREF(x) (*(void **)x)
# define SET_SAFEREF(x, v) (*(void **)(void *)x) = v
# define GET_SAFEREF(x) (*(void **)(void *)x)
#endif
#define WXGC_NO_CLEANUP FALSE

View File

@ -348,11 +348,11 @@ void wxCanvas::SetScrollbars(int h_pixels, int v_pixels, int x_len, int y_len,
a[0].name = XtNabs_height;
a[0].value = v_pixels > 0 ? ((Dimension)v_size) : 0;
a[1].name = XtNrel_height;
*(float *)&(a[1].value) = (float)(v_pixels > 0 ? 0.0 : 1.0);
*(float *)(void *)&(a[1].value) = (float)(v_pixels > 0 ? 0.0 : 1.0);
a[2].name = XtNabs_width;
a[2].value = h_pixels > 0 ? ((Dimension)h_size) : 0;
a[3].name = XtNrel_width;
*(float *)&(a[3].value) = (float)(h_pixels > 0 ? 0.0 : 1.0);
*(float *)(void *)&(a[3].value) = (float)(h_pixels > 0 ? 0.0 : 1.0);
XtSetValues(X->handle, a, 4);
@ -372,19 +372,19 @@ void wxCanvas::SetScrollbars(int h_pixels, int v_pixels, int x_len, int y_len,
a[0].name = XtNabs_height;
a[0].value = 0;
a[1].name = XtNrel_height;
*(float *)&(a[1].value) = 1.0;
*(float *)(void *)&(a[1].value) = 1.0;
a[2].name = XtNabs_width;
a[2].value = 0;
a[3].name = XtNrel_width;
*(float *)&(a[3].value) = 1.0;
*(float *)(void *)&(a[3].value) = 1.0;
a[4].name = XtNabs_x;
a[4].value = 0;
a[5].name = XtNabs_y;
a[5].value = 0;
a[6].name = XtNrel_x;
*(float *)&(a[6].value) = 0.0;
*(float *)(void *)&(a[6].value) = 0.0;
a[7].name = XtNrel_y;
*(float *)&(a[7].value) = 0.0;
*(float *)(void *)&(a[7].value) = 0.0;
XtSetValues(X->handle, a, 8);