Re: Typedef inconsistency for gsize and gssize



On Wed, 2006-02-08 at 18:39 -0800, Banginwar, Rajesh wrote:
> Hello,
> 	For IA32 gsize (found in glibconfig.h) is defined as: typedef
> unsigned int gsize;
> 	For IA32-64bit extn and IA64 (Itanium) the definition is: 
> typedef unsigned long gsize;
> 
> Is this intentional? The documentation does not mention anything about
> this.. It says: unsigned int only
> 
> 
> The question is in LSB context. What is the correct way of typedefing
> this?

What we try to do is to to match the type of size_t on the system;
for 64-bit platforms, that isn't really a problem ... size_t will
be 'unsigned long', but on 32-bit platforms it could either by
'unsigned int' or 'unsigned long'.

(Matching the type prevents certain warnings when passing a size_t
to a function expecting a gsize or vice-versa.)

So, the most accurate definition you could give is
'typedef gsize size_t', except that glib.h does *not* include 
stddef.h so it's not literally that in the header files.

Regards,
					Owen





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