Re: [gtk-list] Re: More about types...




On Sat, 6 Mar 1999, Drazen Kacar wrote:
> 
> gsize is typedefed to guint32. And that one is "unsigned int" vulgaris
> domesticas. As far as I can tell, gsize is only used in declaration
> of g_date_strftime() and it can definitely not be used as a replacement
> for size_t.
>

Perhaps it is meant to serve a size_t-like purpose within glib rather than
replace size_t. After all the only way to actually match size_t on every
platform would be to typedef size_t gsize (or the same via configure),
and then you're back to square one. You just aren't allowed to do anything
with size_t that assumes it's one type vs. another.
 
I don't know, I'm just speculating. :-)

To printf it, come to think of it, just do this:

size_t s;
printf("%d", (int)s);

If you are overflowing int in your size_t you're doing evil things anyway.

> > Nothing special. There's gint/guint/glong/gulong but they don't offer
> > additional guarantees over int/long.
> 
> Why do they exist then? To give me a false feeling of security? Or there
> is a deeper meaning?
> 

Well, 'guint' and 'gulong' are convenient to type. Otherwise, I'm pretty
sure these particular typedefs are just there to match the others.

Havoc



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