slgtk fails to build with gtk 2.18

Jörg Sommer joerg at
Wed Feb 17 12:04:33 UTC 2010

Hi Michael,

I'm the new Debian maintainer of slgtk, because Rafael left the Debian

The current version of slgtk does not build with gtk 2.18, because the
definition of sl_gtk_widget_get_allocation gets generated and conflicts
with the definition in slgtk.c:

slgtk.c:194: error: conflicting types for 'sl_gtk_widget_get_allocation'
gtk_glue.c:41095: note: previous definition of 'sl_gtk_widget_get_allocation' was here

I've used the attatched (dirty) patch to fix it.

There's also a bug in gtkplot.c:

gtkextra/gtkplot.c: In function 'index_ticks':
gtkextra/gtkplot.c:3582: warning: value computed is not used
gtkextra/gtkplot.c:3584: warning: value computed is not used

The expression *x++ is not (*x)++, but *x; x++. The postfix operator is a
higher order operator than the dereference operator. I prefer to use the
prefix opterator, because ++*x and *++x are more clear.

diff --git a/src/gtkextra/gtkplot.c b/src/gtkextra/gtkplot.c
index 67c6183..757de91 100644
--- a/src/gtkextra/gtkplot.c
+++ b/src/gtkextra/gtkplot.c
@@ -3579,9 +3579,9 @@ static void index_ticks(double imin,   /* {{{ */
    xlo = imin < imax ? imin : imax;
    xhi = imin > imax ? imin : imax;
    *lower = nearest_int(xlo);
-   if (*lower < xlo) *lower++;
+   if (*lower < xlo) ++*lower;
    *upper = nearest_int(xhi);
-   if (*upper > xhi) *upper--;
+   if (*upper > xhi) ++*upper;
 } /* }}} */

More compiler warning:

gtkextra/gtkplot3d.c: In function 'gtk_plot3d_draw_labels':
gtkextra/gtkplot3d.c:1008: warning: 'y' may be used uninitialized in this function

gtkextra/gtkplotsurface.c: In function 'gtk_plot_surface_draw_polygons':
gtkextra/gtkplotsurface.c:847: warning: 'h' may be used uninitialized in this function
gtkextra/gtkplotsurface.c:847: note: 'h' was declared here

gtkextra/gtkplotgdk.c: In function 'gtk_plot_gdk_set_dash':
gtkextra/gtkplotgdk.c:364: warning: pointer targets in passing argument 3 of 'gdk_gc_set_dashes' differ in signedness

You may also add one or more of these gcc flags to get more warnings,
i.e. points of possible bugs:

  -Wformat=2 -Wunused -Wundef -Wextra -Wswitch-enum -Wshadow -Wpointer-arith
  -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Wbad-function-cast

Bye, Jörg.
Du hast keine Chance – also nutze sie.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <>

More information about the Pkg-jed-sl-modules mailing list