|
From: Ethan A M. <merritt@u.washington.edu> - 2008-09-10 16:36:59
|
On Wednesday 10 September 2008, Timothée Lecomte wrote: > Ethan A Merritt a écrit : > > > > uint32_t is defined in the C99 standard, but not for C++. > > The u_int32_t type is used by BSD and is defined in various compatibility > > headers. But neither of these is guaranteed to be on all platforms. > > We explicitly try not to depend on C99 compliance, and > > also I do not think we can depend on GLib being present. > > > My point was that cairo-based terminals do already depend on GLib, so > for them we can directly use this library. OK. I fully agree with that. > >> Besides, I've been using the same kind of byte-wise and 32-bits > >> manipulation with a simple "unsigned int" in > >> gp_cairo.c:gp_cairo_draw_image(), where "unsigned int" is implicitly 32 > >> bits. > >> > > > > I think that is not safe. > > Has the code been tested on native 64-bit machines? > > That is, machines where sizeof(int)==8 ? > > I don't currently have such a machine in the lab, but they are not so > > very rare. I used to have several. > > > > > My personal machine is an Intel Core2 running a 64-bits distribution, > but that's most likely not a guarantee. Instead, wikipedia says that > sizeof(int)==4 on 64 bits machines with compilers from Solaris, AIX, HP, > Linux, Mac OS X, FreeBSD, IBM z/OS and Microsoft's VC++. I'm not sure I > can find a machine with sizeof(int)==8 !! DEC Alpha, for one. (Wikipedia is wrong if it implies that *all* compilers from the listed vendors use the LP64 model for data types). -- Ethan A Merritt |