Re: Moving to pointer-sized GType?
- From: Dan Winship <danw ximian com>
- To: Havoc Pennington <hp redhat com>
- Cc: Alex Larsson <alexl redhat com>, gnome-hackers gnome org, gnome-list gnome org, timj gtk org
- Subject: Re: Moving to pointer-sized GType?
- Date: 14 Sep 2001 18:14:23 -0400
> > Adding more ways for the teeming 32bit-only hordes to unwittingly break
> > things for 64bit architectures seems bad. Couldn't you just make GType
> > be a gpointer and use GPOINTER_TO_UINT or whatever in the few places
> > where you want to think of them as integers? (Which would only be inside
> > the type system itself, right?)
>
> The change we want to make is to stuff pointers in ints. i.e. GType
> would actually be a pointer, but we'd keep "typedef guint GType".
>
> This breaks on 64-bit since a pointer can't survive being assigned to
> a 32-bit guint.
Yes, I understood that. I'm just saying, why not say "typedef gpointer
GType" instead, so that any code that assumes GType == guint will break
on *all* architectures, and you can just do "switch (GPOINTER_TO_UINT
(type))" etc. rather than "switch (type)" directly.
-- Dan
_______________________________________________
gnome-hackers mailing list
gnome-hackers gnome org
http://mail.gnome.org/mailman/listinfo/gnome-hackers
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]