Re: [gtk-list] Re: How to use a gpointer?

On Thu, 4 Mar 1999, Tim Janik wrote:

> after having seen various statements on this topic,
> i think it's time to clarify some points.
> for GLib to compile on several different platforms, certain
> assumptions can be made about its data types.
> gint8    sizeof (gint8) = 1 byte, signed
> guint8   sizeof (guint8) = 1 byte, unsigned
> gint16   sizeof (gint16) = 2 bytes, signed
> guint16  sizeof (guint16) = 2 bytes, unsigned
> gint32   sizeof (gint32) = 4 bytes, signed
> guint32  sizeof (guint32) = 4 bytes, unsigned
> gint     is merely an alias for the system's int and guarranteed
>          to be >= 4 bytes in size, signed.
> guint	 is and unsigned gint.
> glong	 is an alias for the system's long and guarranteed to be >=
>          sizeof (gint), signed.
> gulong	 is an unsigned glong.
> gpointer is essentially a void* and guarranteed to be >= sizeof (gint)
>          and <= sizeof (glong) in size.

Well spank me with a wet noodle if I'm wrong, but here is cut-and-paste
from glib.h of 1.2:

typedef int    gint;
typedef void* gpointer;

There is nothing in these typedefs that guarantees that a gint will fit
in a gpointer.

Some of the headers are generated when Glib is compiled, but not glib.h,
so I suppose that the above is the same on the Alpha.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]