|
From: Timothée L. <tim...@lp...> - 2008-09-10 16:08:54
|
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. >> 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 !! >> On a side note, I am inclined to say that it would have been better to >> fix the code that makes margins too big instead of cropping the picture >> later... >> > > Well, I'm already on record as disliking the crop option. > But if we're going to have it at all, we should at least try to make > it compile+work on all platforms. > > Agreed, of course. Best regards, Timothée |