From: Benjamin L. <lin...@gm...> - 2009-08-31 17:55:05
|
Hello list, I paid some attention to the compiler warnings emitted when building recent 4.3 and 4.4 gnuplot. I am using mingw32/gcc, but I guess it's not platform specific. First: two cases of missing declarations: in src/wxterminal/gp_cairo_helpers.c the declaration for gp_alloc() is missing and in src/internal.c the declaration of disp_value() is missing. Thr trivial fix is: diff -r 8a1e8f758422 src/wxterminal/gp_cairo_helpers.c --- a/src/wxterminal/gp_cairo_helpers.c Wed Jul 08 08:27:14 2009 +0200 +++ b/src/wxterminal/gp_cairo_helpers.c Wed Jul 08 08:27:29 2009 +0200 @@ -49,6 +49,8 @@ /* for rgb functions */ # include "getcolor.h" +/* for gp_alloc */ +#include "alloc.h" unsigned int * gp_cairo_helper_coordval_to_chars(coordval* image, int M, int N, t_imagecolor color_mode) { diff -r 6501fb450a65 src/internal.c --- a/src/internal.c Wed Jul 08 08:27:38 2009 +0200 +++ b/src/internal.c Wed Jul 08 08:27:46 2009 +0200 @@ -43,6 +43,7 @@ # include "gp_time.h" /* for str(p|f)time */ #include "command.h" /* for do_system_func */ #include "variable.h" /* For locale handling */ +#include "setshow.h" /* for disp_value */ #include <math.h> Second: when building with debugging support (i.e. with -DDEBUG), then in scr/gp_cairo.c a pritnf format specifier is not quite correct. diff -r cc501863450d src/wxterminal/gp_cairo.c --- a/src/wxterminal/gp_cairo.c Wed Jul 08 08:27:29 2009 +0200 +++ b/src/wxterminal/gp_cairo.c Wed Jul 08 08:27:33 2009 +0200 @@ -1026,7 +1026,7 @@ scale_x = (double)M/fabs( x2 - x1 ); scale_y = (double)N/fabs( y2 - y1 ); - FPRINTF((stderr,"M %d N %lf x1 %d y1 %d\n", M, N, x1, y1)); + FPRINTF((stderr,"M %d N %d x1 %d y1 %d\n", M, N, x1, y1)); cairo_save( plot->cr ); /* Set clipping boundaries for image copy. Third: when compiling src/win/wpause.c at line 94, gcc emits an "ambiguous if-else clause" and suggests braces. I am not too familiar with the code to see where the braces should be placed, but the intendation of the code would suggest a change like: diff -r cd38a24d39cf src/win/wpause.c --- a/src/win/wpause.c Wed Jul 08 08:27:33 2009 +0200 +++ b/src/win/wpause.c Wed Jul 08 08:27:38 2009 +0200 @@ -91,9 +91,10 @@ /* calculate remaining time, detect overflow */ t1 = GetTickCount(); - if (tstop > t0) + if (tstop > t0) { if ((t1 >= tstop) || (t1 < t0)) rc = WAIT_TIMEOUT; + } else if ((t1 >= tstop) && (t1 < t0)) rc = WAIT_TIMEOUT; All these are not blocking building, but for the sake of clean code I vote they should be fixed. thanks benjamin |