|
From: Timothée L. <tim...@lp...> - 2008-09-10 08:13:16
|
Shigeharu TAKENO a écrit : > shige 09/10 2008 > ---------------- > > | From: Ethan Merritt <merritt@u.washington.edu> > | To: gnu...@li... > | Subject: Re: Some misprints and problems > | Date: Tue, 9 Sep 2008 11:48:15 -0700 > | Cc: Shigeharu TAKENO <sh...@ie...>, > | Petr Mikulik <mi...@ph...> > ===== > | I have now fixed these in CVS by adding tests in configure.in > | Cropping will fail silently for platforms that both > | - do not use autoconf > | - have (sizeof(int) != 4) > | This can be fixed by adding an explicit definition of GP_UINT32_T > | in the appropriate platform-specific configuration file. > > Thank you for the fix. But I think there is a typo. > > ----- > diff -uN configure.in.ORG gnuplot-current/configure.in > --- configure.in.ORG Wed Sep 10 10:01:32 2008 > +++ configure.in Wed Sep 10 10:12:13 2008 > @@ -145,7 +145,7 @@ > > # Now we need to find what gp_uint32_t (sizeof == 4) will be. > if test "$ac_cv_sizeof_u_int32_t" = "4"; then > - uint32_t_def='#define GP_UINT32_T uint32_t' > + uint32_t_def='#define GP_UINT32_T u_int32_t' > AC_DEFINE(GP_UINT32_T, u_int32_t, [ some 32-bit type ]) > elif test "$ac_cv_sizeof_int" = "4"; then > uint32_t_def='#define GP_UINT32_T unsigned int' > ----- > Hi, I know it's a bit late, but I'll let you know that cairo-based terminals depend on pango, which in turns depends on GLib, which defines integer types whose sizes are guaranteed on all platforms : gint8, guint8, gint16, guint16, gint32, guint32, gint64, guint64. You can use them by including glib.h first, and then there's no more autoconf magic needed. 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. If you choose to be bullet-proof with this crop code, I guess it's worth changing the image code too ! 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... Best regards, Timothée |