[genius] Tue Oct 01 18:02:13 2013 Jiri (George) Lebl <jirka 5z com>



commit 707204f8f4fe7d9408d872a3a3333c5ae0a90d21
Author: Jiri (George) Lebl <jiri lebl gmail com>
Date:   Tue Oct 1 18:03:08 2013 -0500

    Tue Oct 01 18:02:13 2013  Jiri (George) Lebl <jirka 5z com>
    
        * src/eval.c, src/mpwrap.[ch]: fix subtle copy on write error with
          nested for loops with a floating point "by"
    
        * src/eval.[ch]: fix a nasty side effect of erroneously telling gcc
          that a function is pure
    
        * gtkextra/*.c: fix some warnings

 ChangeLog                       |   10 +++
 gtkextra/Makefile.am            |    9 ++-
 gtkextra/gtkextra-marshal.c     |  132 ++++++++++++++------------------------
 gtkextra/gtkextra-marshal.h     |   18 ++----
 gtkextra/gtkextra.c             |    1 +
 gtkextra/gtkextratypebuiltins.c |    1 +
 gtkextra/gtkplot.c              |   35 +----------
 gtkextra/gtkplot3d.c            |   44 +++----------
 gtkextra/gtkplotarray.c         |    7 +--
 gtkextra/gtkplotbar.c           |   10 ---
 gtkextra/gtkplotbox.c           |   10 ---
 gtkextra/gtkplotcandle.c        |   13 ----
 gtkextra/gtkplotdata.h          |    5 ++
 gtkextra/gtkplotprint.c         |    1 +
 gtkextra/gtkplotsurface.c       |    2 +-
 gtkextra/gtkpsfont.c            |    4 +-
 gtkextra/gtkpsfont.h            |    4 +-
 src/eval.c                      |    5 +-
 src/eval.h                      |    2 +-
 src/geniustests.txt             |    1 +
 src/gnome-genius.c              |    5 +-
 src/mpwrap.c                    |   20 ++++++
 src/mpwrap.h                    |    6 ++
 23 files changed, 129 insertions(+), 216 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 80c17d5..93852cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Tue Oct 01 18:02:13 2013  Jiri (George) Lebl <jirka 5z com>
+
+       * src/eval.c, src/mpwrap.[ch]: fix subtle copy on write error with
+         nested for loops with a floating point "by"
+       
+       * src/eval.[ch]: fix a nasty side effect of erroneously telling gcc
+         that a function is pure
+
+       * gtkextra/*.c: fix some warnings
+
 Wed Jun 26 14:33:09 2013  Jiri (George) Lebl <jirka 5z com>
 
        * src/funclib.c, src/funclibhelper.cP: implement subsecond precision
diff --git a/gtkextra/Makefile.am b/gtkextra/Makefile.am
index 874ec86..ecdafdd 100644
--- a/gtkextra/Makefile.am
+++ b/gtkextra/Makefile.am
@@ -107,7 +107,8 @@ $(srcdir)/gtkextra-marshal.h: gtkextra-marshal.list
        && mv gtkextra-marshal.tmp gtkextra-marshal.h ) \
        || ( rm -f gtkextra-marshal.tmp && exit 1 )
 $(srcdir)/gtkextra-marshal.c: gtkextra-marshal.h
-       ( @GLIB_GENMARSHAL@ --prefix=gtkextra gtkextra-marshal.list --body > gtkextra-marshal.tmp \
+       ( echo '#include "gtkextra-marshal.h"' > gtkextra-marshal.tmp \
+               && @GLIB_GENMARSHAL@ --prefix=gtkextra gtkextra-marshal.list --body >> gtkextra-marshal.tmp \
        && mv gtkextra-marshal.tmp gtkextra-marshal.c ) \
        || ( rm -f gtkextra-marshal.tmp && exit 1 )
 
@@ -122,10 +123,12 @@ $(srcdir)/gtkextratypebuiltins.h: $(public_h_sources)
 
 
 $(srcdir)/gtkextratypebuiltins.c: $(public_h_sources)
-       ( cd $(srcdir) && glib-mkenums \
+       ( cd $(srcdir) \
+               && echo '#include "gtkextratypebuiltins.h"' > $(srcdir)/gtkextratypebuiltins.c \
+               && glib-mkenums \
                --fhead "#define GTKEXTRA_ENABLE_BROKEN\n#include \"gtkextra.h\"" \
                --fprod "\n/* enumerations from \"@filename \" */" \
                --vhead "GType\n enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) 
{\n    static const G Type@Value values[] = {" \
                --vprod "      { @VALUENAME@, \"@VALUENAME \", \"@valuenick \" }," \
                --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_ type@_register_static (\"@EnumName 
\", values);\n  }\n  return etype;\n}\n" \
-               $(public_h_sources) ) > $(srcdir)/gtkextratypebuiltins.c
+               $(public_h_sources) ) >> $(srcdir)/gtkextratypebuiltins.c
diff --git a/gtkextra/gtkextra-marshal.c b/gtkextra/gtkextra-marshal.c
index 31cf6e3..938c2a3 100644
--- a/gtkextra/gtkextra-marshal.c
+++ b/gtkextra/gtkextra-marshal.c
@@ -1,10 +1,11 @@
+#include "gtkextra-marshal.h"
 
 #include       <glib-object.h>
 
 
 #ifdef G_ENABLE_DEBUG
 #define g_marshal_value_peek_boolean(v)  g_value_get_boolean (v)
-#define g_marshal_value_peek_char(v)     g_value_get_char (v)
+#define g_marshal_value_peek_char(v)     g_value_get_schar (v)
 #define g_marshal_value_peek_uchar(v)    g_value_get_uchar (v)
 #define g_marshal_value_peek_int(v)      g_value_get_int (v)
 #define g_marshal_value_peek_uint(v)     g_value_get_uint (v)
@@ -21,6 +22,7 @@
 #define g_marshal_value_peek_boxed(v)    g_value_get_boxed (v)
 #define g_marshal_value_peek_pointer(v)  g_value_get_pointer (v)
 #define g_marshal_value_peek_object(v)   g_value_get_object (v)
+#define g_marshal_value_peek_variant(v)  g_value_get_variant (v)
 #else /* !G_ENABLE_DEBUG */
 /* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
  *          Do not access GValues directly in your code. Instead, use the
@@ -35,8 +37,8 @@
 #define g_marshal_value_peek_ulong(v)    (v)->data[0].v_ulong
 #define g_marshal_value_peek_int64(v)    (v)->data[0].v_int64
 #define g_marshal_value_peek_uint64(v)   (v)->data[0].v_uint64
-#define g_marshal_value_peek_enum(v)     (v)->data[0].v_int
-#define g_marshal_value_peek_flags(v)    (v)->data[0].v_uint
+#define g_marshal_value_peek_enum(v)     (v)->data[0].v_long
+#define g_marshal_value_peek_flags(v)    (v)->data[0].v_ulong
 #define g_marshal_value_peek_float(v)    (v)->data[0].v_float
 #define g_marshal_value_peek_double(v)   (v)->data[0].v_double
 #define g_marshal_value_peek_string(v)   (v)->data[0].v_pointer
@@ -44,16 +46,17 @@
 #define g_marshal_value_peek_boxed(v)    (v)->data[0].v_pointer
 #define g_marshal_value_peek_pointer(v)  (v)->data[0].v_pointer
 #define g_marshal_value_peek_object(v)   (v)->data[0].v_pointer
+#define g_marshal_value_peek_variant(v)  (v)->data[0].v_pointer
 #endif /* !G_ENABLE_DEBUG */
 
 
 /* BOOL:INT,INT,POINTER,POINTER (gtkextra-marshal.list:1) */
 void
 gtkextra_BOOLEAN__INT_INT_POINTER_POINTER (GClosure     *closure,
-                                           GValue       *return_value,
+                                           GValue       *return_value G_GNUC_UNUSED,
                                            guint         n_param_values,
                                            const GValue *param_values,
-                                           gpointer      invocation_hint,
+                                           gpointer      invocation_hint G_GNUC_UNUSED,
                                            gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__INT_INT_POINTER_POINTER) (gpointer     data1,
@@ -95,10 +98,10 @@ gtkextra_BOOLEAN__INT_INT_POINTER_POINTER (GClosure     *closure,
 /* BOOL:BOXED,POINTER (gtkextra-marshal.list:2) */
 void
 gtkextra_BOOLEAN__BOXED_POINTER (GClosure     *closure,
-                                 GValue       *return_value,
+                                 GValue       *return_value G_GNUC_UNUSED,
                                  guint         n_param_values,
                                  const GValue *param_values,
-                                 gpointer      invocation_hint,
+                                 gpointer      invocation_hint G_GNUC_UNUSED,
                                  gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_POINTER) (gpointer     data1,
@@ -136,10 +139,10 @@ gtkextra_BOOLEAN__BOXED_POINTER (GClosure     *closure,
 /* BOOL:BOXED,STRING (gtkextra-marshal.list:3) */
 void
 gtkextra_BOOLEAN__BOXED_STRING (GClosure     *closure,
-                                GValue       *return_value,
+                                GValue       *return_value G_GNUC_UNUSED,
                                 guint         n_param_values,
                                 const GValue *param_values,
-                                gpointer      invocation_hint,
+                                gpointer      invocation_hint G_GNUC_UNUSED,
                                 gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_STRING) (gpointer     data1,
@@ -177,10 +180,10 @@ gtkextra_BOOLEAN__BOXED_STRING (GClosure     *closure,
 /* BOOL:BOXED,BOXED (gtkextra-marshal.list:4) */
 void
 gtkextra_BOOLEAN__BOXED_BOXED (GClosure     *closure,
-                               GValue       *return_value,
+                               GValue       *return_value G_GNUC_UNUSED,
                                guint         n_param_values,
                                const GValue *param_values,
-                               gpointer      invocation_hint,
+                               gpointer      invocation_hint G_GNUC_UNUSED,
                                gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_BOXED) (gpointer     data1,
@@ -218,10 +221,10 @@ gtkextra_BOOLEAN__BOXED_BOXED (GClosure     *closure,
 /* BOOL:BOXED,DOUBLE,DOUBLE (gtkextra-marshal.list:5) */
 void
 gtkextra_BOOLEAN__BOXED_DOUBLE_DOUBLE (GClosure     *closure,
-                                       GValue       *return_value,
+                                       GValue       *return_value G_GNUC_UNUSED,
                                        guint         n_param_values,
                                        const GValue *param_values,
-                                       gpointer      invocation_hint,
+                                       gpointer      invocation_hint G_GNUC_UNUSED,
                                        gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_DOUBLE_DOUBLE) (gpointer     data1,
@@ -261,10 +264,10 @@ gtkextra_BOOLEAN__BOXED_DOUBLE_DOUBLE (GClosure     *closure,
 /* BOOL:POINTER,POINTER (gtkextra-marshal.list:6) */
 void
 gtkextra_BOOLEAN__POINTER_POINTER (GClosure     *closure,
-                                   GValue       *return_value,
+                                   GValue       *return_value G_GNUC_UNUSED,
                                    guint         n_param_values,
                                    const GValue *param_values,
-                                   gpointer      invocation_hint,
+                                   gpointer      invocation_hint G_GNUC_UNUSED,
                                    gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER_POINTER) (gpointer     data1,
@@ -302,10 +305,10 @@ gtkextra_BOOLEAN__POINTER_POINTER (GClosure     *closure,
 /* BOOL:POINTER,BOXED (gtkextra-marshal.list:7) */
 void
 gtkextra_BOOLEAN__POINTER_BOXED (GClosure     *closure,
-                                 GValue       *return_value,
+                                 GValue       *return_value G_GNUC_UNUSED,
                                  guint         n_param_values,
                                  const GValue *param_values,
-                                 gpointer      invocation_hint,
+                                 gpointer      invocation_hint G_GNUC_UNUSED,
                                  gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER_BOXED) (gpointer     data1,
@@ -343,10 +346,10 @@ gtkextra_BOOLEAN__POINTER_BOXED (GClosure     *closure,
 /* BOOL:POINTER,STRING (gtkextra-marshal.list:8) */
 void
 gtkextra_BOOLEAN__POINTER_STRING (GClosure     *closure,
-                                  GValue       *return_value,
+                                  GValue       *return_value G_GNUC_UNUSED,
                                   guint         n_param_values,
                                   const GValue *param_values,
-                                  gpointer      invocation_hint,
+                                  gpointer      invocation_hint G_GNUC_UNUSED,
                                   gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER_STRING) (gpointer     data1,
@@ -384,10 +387,10 @@ gtkextra_BOOLEAN__POINTER_STRING (GClosure     *closure,
 /* BOOL:POINTER (gtkextra-marshal.list:9) */
 void
 gtkextra_BOOLEAN__POINTER (GClosure     *closure,
-                           GValue       *return_value,
+                           GValue       *return_value G_GNUC_UNUSED,
                            guint         n_param_values,
                            const GValue *param_values,
-                           gpointer      invocation_hint,
+                           gpointer      invocation_hint G_GNUC_UNUSED,
                            gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER) (gpointer     data1,
@@ -423,10 +426,10 @@ gtkextra_BOOLEAN__POINTER (GClosure     *closure,
 /* BOOL:BOXED (gtkextra-marshal.list:10) */
 void
 gtkextra_BOOLEAN__BOXED (GClosure     *closure,
-                         GValue       *return_value,
+                         GValue       *return_value G_GNUC_UNUSED,
                          guint         n_param_values,
                          const GValue *param_values,
-                         gpointer      invocation_hint,
+                         gpointer      invocation_hint G_GNUC_UNUSED,
                          gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED) (gpointer     data1,
@@ -462,10 +465,10 @@ gtkextra_BOOLEAN__BOXED (GClosure     *closure,
 /* BOOL:INT,INT (gtkextra-marshal.list:11) */
 void
 gtkextra_BOOLEAN__INT_INT (GClosure     *closure,
-                           GValue       *return_value,
+                           GValue       *return_value G_GNUC_UNUSED,
                            guint         n_param_values,
                            const GValue *param_values,
-                           gpointer      invocation_hint,
+                           gpointer      invocation_hint G_GNUC_UNUSED,
                            gpointer      marshal_data)
 {
   typedef gboolean (*GMarshalFunc_BOOLEAN__INT_INT) (gpointer     data1,
@@ -505,10 +508,10 @@ gtkextra_BOOLEAN__INT_INT (GClosure     *closure,
 /* VOID:INT,STRING (gtkextra-marshal.list:13) */
 void
 gtkextra_VOID__INT_STRING (GClosure     *closure,
-                           GValue       *return_value,
+                           GValue       *return_value G_GNUC_UNUSED,
                            guint         n_param_values,
                            const GValue *param_values,
-                           gpointer      invocation_hint,
+                           gpointer      invocation_hint G_GNUC_UNUSED,
                            gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__INT_STRING) (gpointer     data1,
@@ -550,10 +553,10 @@ gtkextra_VOID__INT_STRING (GClosure     *closure,
 /* VOID:INT,INT (gtkextra-marshal.list:18) */
 void
 gtkextra_VOID__INT_INT (GClosure     *closure,
-                        GValue       *return_value,
+                        GValue       *return_value G_GNUC_UNUSED,
                         guint         n_param_values,
                         const GValue *param_values,
-                        gpointer      invocation_hint,
+                        gpointer      invocation_hint G_GNUC_UNUSED,
                         gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer     data1,
@@ -587,10 +590,10 @@ gtkextra_VOID__INT_INT (GClosure     *closure,
 /* VOID:INT,POINTER (gtkextra-marshal.list:19) */
 void
 gtkextra_VOID__INT_POINTER (GClosure     *closure,
-                            GValue       *return_value,
+                            GValue       *return_value G_GNUC_UNUSED,
                             guint         n_param_values,
                             const GValue *param_values,
-                            gpointer      invocation_hint,
+                            gpointer      invocation_hint G_GNUC_UNUSED,
                             gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__INT_POINTER) (gpointer     data1,
@@ -621,50 +624,13 @@ gtkextra_VOID__INT_POINTER (GClosure     *closure,
             data2);
 }
 
-/* VOID:INT,BOXED (gtkextra-marshal.list:20) */
-void
-gtkextra_VOID__INT_BOXED (GClosure     *closure,
-                          GValue       *return_value,
-                          guint         n_param_values,
-                          const GValue *param_values,
-                          gpointer      invocation_hint,
-                          gpointer      marshal_data)
-{
-  typedef void (*GMarshalFunc_VOID__INT_BOXED) (gpointer     data1,
-                                                gint         arg_1,
-                                                gpointer     arg_2,
-                                                gpointer     data2);
-  register GMarshalFunc_VOID__INT_BOXED callback;
-  register GCClosure *cc = (GCClosure*) closure;
-  register gpointer data1, data2;
-
-  g_return_if_fail (n_param_values == 3);
-
-  if (G_CCLOSURE_SWAP_DATA (closure))
-    {
-      data1 = closure->data;
-      data2 = g_value_peek_pointer (param_values + 0);
-    }
-  else
-    {
-      data1 = g_value_peek_pointer (param_values + 0);
-      data2 = closure->data;
-    }
-  callback = (GMarshalFunc_VOID__INT_BOXED) (marshal_data ? marshal_data : cc->callback);
-
-  callback (data1,
-            g_marshal_value_peek_int (param_values + 1),
-            g_marshal_value_peek_boxed (param_values + 2),
-            data2);
-}
-
-/* VOID:POINTER,POINTER (gtkextra-marshal.list:21) */
+/* VOID:POINTER,POINTER (gtkextra-marshal.list:20) */
 void
 gtkextra_VOID__POINTER_POINTER (GClosure     *closure,
-                                GValue       *return_value,
+                                GValue       *return_value G_GNUC_UNUSED,
                                 guint         n_param_values,
                                 const GValue *param_values,
-                                gpointer      invocation_hint,
+                                gpointer      invocation_hint G_GNUC_UNUSED,
                                 gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__POINTER_POINTER) (gpointer     data1,
@@ -695,13 +661,13 @@ gtkextra_VOID__POINTER_POINTER (GClosure     *closure,
             data2);
 }
 
-/* VOID:BOXED,POINTER (gtkextra-marshal.list:22) */
+/* VOID:BOXED,POINTER (gtkextra-marshal.list:21) */
 void
 gtkextra_VOID__BOXED_POINTER (GClosure     *closure,
-                              GValue       *return_value,
+                              GValue       *return_value G_GNUC_UNUSED,
                               guint         n_param_values,
                               const GValue *param_values,
-                              gpointer      invocation_hint,
+                              gpointer      invocation_hint G_GNUC_UNUSED,
                               gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__BOXED_POINTER) (gpointer     data1,
@@ -732,13 +698,13 @@ gtkextra_VOID__BOXED_POINTER (GClosure     *closure,
             data2);
 }
 
-/* VOID:BOXED,BOXED (gtkextra-marshal.list:23) */
+/* VOID:BOXED,BOXED (gtkextra-marshal.list:22) */
 void
 gtkextra_VOID__BOXED_BOXED (GClosure     *closure,
-                            GValue       *return_value,
+                            GValue       *return_value G_GNUC_UNUSED,
                             guint         n_param_values,
                             const GValue *param_values,
-                            gpointer      invocation_hint,
+                            gpointer      invocation_hint G_GNUC_UNUSED,
                             gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__BOXED_BOXED) (gpointer     data1,
@@ -769,13 +735,13 @@ gtkextra_VOID__BOXED_BOXED (GClosure     *closure,
             data2);
 }
 
-/* VOID:OBJECT,OBJECT (gtkextra-marshal.list:24) */
+/* VOID:OBJECT,OBJECT (gtkextra-marshal.list:23) */
 void
 gtkextra_VOID__OBJECT_OBJECT (GClosure     *closure,
-                              GValue       *return_value,
+                              GValue       *return_value G_GNUC_UNUSED,
                               guint         n_param_values,
                               const GValue *param_values,
-                              gpointer      invocation_hint,
+                              gpointer      invocation_hint G_GNUC_UNUSED,
                               gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__OBJECT_OBJECT) (gpointer     data1,
@@ -806,13 +772,13 @@ gtkextra_VOID__OBJECT_OBJECT (GClosure     *closure,
             data2);
 }
 
-/* VOID:DOUBLE,DOUBLE,DOUBLE,DOUBLE (gtkextra-marshal.list:25) */
+/* VOID:DOUBLE,DOUBLE,DOUBLE,DOUBLE (gtkextra-marshal.list:24) */
 void
 gtkextra_VOID__DOUBLE_DOUBLE_DOUBLE_DOUBLE (GClosure     *closure,
-                                            GValue       *return_value,
+                                            GValue       *return_value G_GNUC_UNUSED,
                                             guint         n_param_values,
                                             const GValue *param_values,
-                                            gpointer      invocation_hint,
+                                            gpointer      invocation_hint G_GNUC_UNUSED,
                                             gpointer      marshal_data)
 {
   typedef void (*GMarshalFunc_VOID__DOUBLE_DOUBLE_DOUBLE_DOUBLE) (gpointer     data1,
diff --git a/gtkextra/gtkextra-marshal.h b/gtkextra/gtkextra-marshal.h
index 82dfe5c..802b942 100644
--- a/gtkextra/gtkextra-marshal.h
+++ b/gtkextra/gtkextra-marshal.h
@@ -145,15 +145,7 @@ extern void gtkextra_VOID__INT_POINTER (GClosure     *closure,
                                         gpointer      invocation_hint,
                                         gpointer      marshal_data);
 
-/* VOID:INT,BOXED (gtkextra-marshal.list:20) */
-extern void gtkextra_VOID__INT_BOXED (GClosure     *closure,
-                                      GValue       *return_value,
-                                      guint         n_param_values,
-                                      const GValue *param_values,
-                                      gpointer      invocation_hint,
-                                      gpointer      marshal_data);
-
-/* VOID:POINTER,POINTER (gtkextra-marshal.list:21) */
+/* VOID:POINTER,POINTER (gtkextra-marshal.list:20) */
 extern void gtkextra_VOID__POINTER_POINTER (GClosure     *closure,
                                             GValue       *return_value,
                                             guint         n_param_values,
@@ -161,7 +153,7 @@ extern void gtkextra_VOID__POINTER_POINTER (GClosure     *closure,
                                             gpointer      invocation_hint,
                                             gpointer      marshal_data);
 
-/* VOID:BOXED,POINTER (gtkextra-marshal.list:22) */
+/* VOID:BOXED,POINTER (gtkextra-marshal.list:21) */
 extern void gtkextra_VOID__BOXED_POINTER (GClosure     *closure,
                                           GValue       *return_value,
                                           guint         n_param_values,
@@ -169,7 +161,7 @@ extern void gtkextra_VOID__BOXED_POINTER (GClosure     *closure,
                                           gpointer      invocation_hint,
                                           gpointer      marshal_data);
 
-/* VOID:BOXED,BOXED (gtkextra-marshal.list:23) */
+/* VOID:BOXED,BOXED (gtkextra-marshal.list:22) */
 extern void gtkextra_VOID__BOXED_BOXED (GClosure     *closure,
                                         GValue       *return_value,
                                         guint         n_param_values,
@@ -177,7 +169,7 @@ extern void gtkextra_VOID__BOXED_BOXED (GClosure     *closure,
                                         gpointer      invocation_hint,
                                         gpointer      marshal_data);
 
-/* VOID:OBJECT,OBJECT (gtkextra-marshal.list:24) */
+/* VOID:OBJECT,OBJECT (gtkextra-marshal.list:23) */
 extern void gtkextra_VOID__OBJECT_OBJECT (GClosure     *closure,
                                           GValue       *return_value,
                                           guint         n_param_values,
@@ -185,7 +177,7 @@ extern void gtkextra_VOID__OBJECT_OBJECT (GClosure     *closure,
                                           gpointer      invocation_hint,
                                           gpointer      marshal_data);
 
-/* VOID:DOUBLE,DOUBLE,DOUBLE,DOUBLE (gtkextra-marshal.list:25) */
+/* VOID:DOUBLE,DOUBLE,DOUBLE,DOUBLE (gtkextra-marshal.list:24) */
 extern void gtkextra_VOID__DOUBLE_DOUBLE_DOUBLE_DOUBLE (GClosure     *closure,
                                                         GValue       *return_value,
                                                         guint         n_param_values,
diff --git a/gtkextra/gtkextra.c b/gtkextra/gtkextra.c
index 96af92c..eb06d80 100644
--- a/gtkextra/gtkextra.c
+++ b/gtkextra/gtkextra.c
@@ -79,6 +79,7 @@ _gtkextra_signal_test(GtkObject *object, guint signal_id, gint arg1, gint arg2,
 }
 */
 
+void _gtkextra_signal_emit(GtkObject *object, guint signal_id, ...);
 void
 _gtkextra_signal_emit(GtkObject *object, guint signal_id, ...)
 {
diff --git a/gtkextra/gtkextratypebuiltins.c b/gtkextra/gtkextratypebuiltins.c
index 2709c1e..04ee499 100644
--- a/gtkextra/gtkextratypebuiltins.c
+++ b/gtkextra/gtkextratypebuiltins.c
@@ -1,3 +1,4 @@
+#include "gtkextratypebuiltins.h"
 
 
 
diff --git a/gtkextra/gtkplot.c b/gtkextra/gtkplot.c
index 6c776c5..7e10505 100644
--- a/gtkextra/gtkplot.c
+++ b/gtkextra/gtkplot.c
@@ -2555,8 +2555,6 @@ gtk_plot_real_paint (GtkWidget *widget)
 {
   GtkPlot *plot;
   GtkPlotText *child_text;
-  GtkStyle *style;
-  GdkPixmap *pixmap;
   GList *dataset;
   GList *text;
   gint width, height;
@@ -2569,10 +2567,6 @@ gtk_plot_real_paint (GtkWidget *widget)
   width = plot->internal_allocation.width;
   height = plot->internal_allocation.height;
 
-  style = gtk_widget_get_style(widget);
-
-  pixmap = plot->drawable;
-
   gtk_plot_pc_gsave(plot->pc);
   gtk_plot_pc_set_color(plot->pc, &plot->background);
 
@@ -2762,10 +2756,6 @@ gtk_plot_refresh (GtkPlot *plot, GdkRectangle *drawing_area)
 static void
 gtk_plot_size_request (GtkWidget *widget, GtkRequisition *requisition)
 {
-  GtkPlot *plot;
-
-  plot = GTK_PLOT(widget);
-
   requisition->width =  DEFAULT_WIDTH;
   requisition->height =  DEFAULT_HEIGHT;
 }
@@ -3044,7 +3034,6 @@ gtk_plot_is_transparent (GtkPlot *plot)
 static void
 gtk_plot_draw_grids(GtkPlot *plot)
 {
-  GtkWidget *widget;
   GdkRectangle clip_area;
   gdouble width, height;
   gdouble xp, yp;
@@ -3053,8 +3042,6 @@ gtk_plot_draw_grids(GtkPlot *plot)
   gdouble x_tick;
   gint ntick;
 
-  widget = GTK_WIDGET(plot);
-
   xp = plot->internal_allocation.x;
   yp = plot->internal_allocation.y;
   width = plot->internal_allocation.width;
@@ -3169,7 +3156,6 @@ gtk_plot_draw_axis(GtkPlot *plot, GtkPlotAxis *axis, GtkPlotVector tick_directio
 {
   GtkWidget *widget;
   gdouble x_tick;
-  gdouble xp, yp, width, height;
   gint ntick;
   gdouble m = plot->magnification;
   gdouble x1, y1, x2, y2;
@@ -3177,10 +3163,6 @@ gtk_plot_draw_axis(GtkPlot *plot, GtkPlotAxis *axis, GtkPlotVector tick_directio
   gdouble xx, yy;
 
   widget = GTK_WIDGET(plot); 
-  xp = plot->internal_allocation.x;
-  yp = plot->internal_allocation.y;
-  width = plot->internal_allocation.width;
-  height = plot->internal_allocation.height;
 
   gtk_plot_get_pixel(plot, axis->origin.x, axis->origin.y, &x1, &y1);
 
@@ -3272,7 +3254,6 @@ gtk_plot_draw_labels(GtkPlot *plot,
   gdouble x_tick;
   gdouble xx, yy;
   gint text_height;
-  gdouble xp, yp, width, height;
   gint ntick;
   gdouble m = plot->magnification;
   gboolean veto = FALSE;
@@ -3282,10 +3263,6 @@ gtk_plot_draw_labels(GtkPlot *plot,
   GtkAllocation  allocation;
 
   widget = GTK_WIDGET(plot); 
-  xp = plot->internal_allocation.x;
-  yp = plot->internal_allocation.y;
-  width = plot->internal_allocation.width;
-  height = plot->internal_allocation.height;
 
   gtk_plot_pc_set_color (plot->pc, &axis->labels_attr.fg);
 
@@ -3902,7 +3879,6 @@ gtk_plot_text_get_size(const gchar *text, gint angle,
   gint x, y, y0;
   GList *family;
   gint numf;
-  gchar insert_char;
   gchar num[4];
   const gchar *aux = text;
   const gchar *lastchar = text;
@@ -4107,7 +4083,7 @@ gtk_plot_text_get_size(const gchar *text, gint angle,
               break;
            }
            num[3] = '\0';
-           insert_char = (gchar)atoi(num);
+           /* insert_char = (gchar)atoi(num); */
            /* \xNNN is always outputted with latin fonts. */
            pango_layout_set_font_description(layout, font);
            pango_layout_set_text(layout, aux, 1);
@@ -4426,10 +4402,8 @@ gtk_plot_resize (GtkPlot *plot, gdouble width, gdouble height)
 void
 gtk_plot_set_magnification (GtkPlot *plot, gdouble magnification)
 {
-  GtkWidget *widget;
   GtkAllocation allocation;
  
-  widget = GTK_WIDGET(plot); 
   plot->magnification = magnification;
   gtk_widget_get_allocation(GTK_WIDGET(plot), &allocation);
 
@@ -4534,7 +4508,6 @@ gtk_plot_real_get_point(GtkWidget *widget,
     GtkPlot *plot;
     gdouble xx, yy;
     gdouble xp, yp, width, height;
-    gdouble rx, ry;
     GtkAllocation allocation;
 
 
@@ -4555,9 +4528,6 @@ gtk_plot_real_get_point(GtkWidget *widget,
     else
       yy = y - allocation.y - yp;
 
-    rx = plot->bottom->ticks.max - plot->bottom->ticks.min;
-    ry = plot->left->ticks.max - plot->left->ticks.min;
-
     *px = gtk_plot_axis_ticks_inverse(plot->bottom, xx / width);
     *py = gtk_plot_axis_ticks_inverse(plot->left, yy / height);
 }
@@ -4988,7 +4958,6 @@ gtk_plot_put_text (GtkPlot *plot, gdouble x, gdouble y,
 {
   GtkWidget *widget;
   GtkPlotText *text_attr;
-  GdkRectangle area;
   GtkAllocation allocation;
 
 
@@ -4997,8 +4966,6 @@ gtk_plot_put_text (GtkPlot *plot, gdouble x, gdouble y,
   text_attr = g_new0(GtkPlotText, 1);
 
   gtk_widget_get_allocation(widget, &allocation);
-  area.x = allocation.x;
-  area.y = allocation.y;
 
   text_attr->x = x;
   text_attr->y = y;
diff --git a/gtkextra/gtkplot3d.c b/gtkextra/gtkplot3d.c
index 7f6438c..3291781 100644
--- a/gtkextra/gtkplot3d.c
+++ b/gtkextra/gtkplot3d.c
@@ -166,7 +166,6 @@ static void
 gtk_plot3d_class_init (GtkPlot3DClass *klass)
 {
   GtkObjectClass *object_class;
-  GtkWidgetClass *widget_class;
   GtkPlotClass *plot_class;
   GtkPlot3DClass *plot3d_class;
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
@@ -174,7 +173,6 @@ gtk_plot3d_class_init (GtkPlot3DClass *klass)
   parent_class = g_type_class_ref (gtk_plot_get_type ());
 
   object_class = (GtkObjectClass *) klass;
-  widget_class = (GtkWidgetClass *) klass;
   plot_class = (GtkPlotClass *) klass;
   plot3d_class = (GtkPlot3DClass *) klass;
 
@@ -1433,12 +1431,11 @@ gtk_plot3d_real_paint (GtkWidget *widget)
 {
   GtkPlot3D *plot;
   GtkPlotText *child_text;
-  GdkPixmap *pixmap;
   GtkPlotPC *pc;
   GList *datasets;
   GList *text;
-  gint width, height, size;
-  gint xoffset, yoffset, xp, yp;
+  gint width, height;
+  gint xoffset, yoffset;
   gint origin;
   gdouble pz;
   GtkPlotVector e[8], o, v[8];
@@ -1454,7 +1451,7 @@ gtk_plot3d_real_paint (GtkWidget *widget)
   width = GTK_PLOT(plot)->internal_allocation.width;
   height = GTK_PLOT(plot)->internal_allocation.height;
 
-  pixmap = GTK_PLOT(plot)->drawable;
+  /* pixmap = GTK_PLOT(plot)->drawable; */
   pc = GTK_PLOT(plot)->pc;
 
   gtk_plot_pc_gsave(pc);
@@ -1474,11 +1471,6 @@ gtk_plot3d_real_paint (GtkWidget *widget)
 
   /* find origin */
 
-  xp = GTK_PLOT(plot)->internal_allocation.x;
-  yp = GTK_PLOT(plot)->internal_allocation.y;
-
-  size = MIN(width, height) / SQRT2;
-
   /* 8 vertices of the cube */
 
   e[0].x = 0;
@@ -1839,7 +1831,6 @@ gtk_plot3d_draw_plane(GtkPlot3D *plot,
                       GdkColor background)
 {
   GtkWidget *widget;
-  GdkPixmap *pixmap;
   GtkPlotPC *pc;
   GtkPlotVector v[4];
   GtkPlotPoint p[4];
@@ -1849,7 +1840,6 @@ gtk_plot3d_draw_plane(GtkPlot3D *plot,
   widget = GTK_WIDGET(plot);
   if(!gtk_widget_get_visible(widget)) return;
 
-  pixmap = GTK_PLOT(plot)->drawable;
   pc = GTK_PLOT(plot)->pc;
 
   gtk_plot_pc_set_color(pc, &background);
@@ -1880,26 +1870,19 @@ gtk_plot3d_draw_plane(GtkPlot3D *plot,
 static void
 gtk_plot3d_draw_grids(GtkPlot3D *plot, GtkPlotAxis *axis, GtkPlotVector delta)
 {
-  GtkWidget *widget;
   gdouble xx;
   GtkPlotLine major_grid, minor_grid;
   gdouble x1, x2, y1, y2;
-  gint size, width, height;
-  gdouble xp, yp, oz;
+  gint width, height;
+  gdouble oz;
   gint ntick;
 
-  widget = GTK_WIDGET(plot);
-
   /* no values! */
   if (axis->ticks.values == NULL) return;
 
-  xp = GTK_PLOT(plot)->internal_allocation.x;
-  yp = GTK_PLOT(plot)->internal_allocation.y;
   width = GTK_PLOT(plot)->internal_allocation.width;
   height = GTK_PLOT(plot)->internal_allocation.height;
 
-  size = MIN(width, height) / SQRT2;
-
   major_grid = GTK_PLOT(plot)->left->major_grid;
   minor_grid = GTK_PLOT(plot)->left->minor_grid;
   switch(axis->orientation){
@@ -1972,31 +1955,25 @@ gtk_plot3d_draw_axis(GtkPlot3D *plot,
                      GtkPlotVector tick,
                      GtkPlotVector delta)
 {
-  GtkWidget *widget;
   GtkPlotPC *pc;
   gdouble xx;
   gint line_width;
-  gint xp, yp, width, height;
+  gint width, height;
   gint ntick;
   gdouble m;
   gdouble oz;
   gdouble x1, x2, y1, y2;
-  gint size;
   gint ticks_length;
 
   if (axis->ticks.values == NULL)
     return;
 
-  widget = GTK_WIDGET(plot); 
   pc = GTK_PLOT(plot)->pc;
 
-  xp = GTK_PLOT(plot)->internal_allocation.x;
-  yp = GTK_PLOT(plot)->internal_allocation.y;
   width = GTK_PLOT(plot)->internal_allocation.width;
   height = GTK_PLOT(plot)->internal_allocation.height;
 
   m = GTK_PLOT(plot)->magnification;
-  size = MIN(width, height) / SQRT2;
 
   line_width = plot->frame.line_width;
   gtk_plot_pc_set_color(pc, &plot->frame.color);
@@ -2063,10 +2040,10 @@ gtk_plot3d_draw_labels(GtkPlot3D *plot,
   gdouble tick_value;
   gdouble xx;
   gint text_height, text_width, ascent, descent;
-  gint xp, yp, width, height;
+  gint width, height;
   gint ntick;
   gdouble m;
-  gdouble size, ox, oy, oz;
+  gdouble ox, oy, oz;
   gdouble sx, sy, sz;
   gdouble y = 0;
   GtkPlotVector ticks_direction, center;
@@ -2076,12 +2053,9 @@ gtk_plot3d_draw_labels(GtkPlot3D *plot,
   widget = GTK_WIDGET(plot); 
   pc = GTK_PLOT(plot)->pc;
 
-  xp = GTK_PLOT(plot)->internal_allocation.x;
-  yp = GTK_PLOT(plot)->internal_allocation.y;
   width = GTK_PLOT(plot)->internal_allocation.width;
   height = GTK_PLOT(plot)->internal_allocation.height;
 
-  size = MIN(width, height) / SQRT2;
   m = GTK_PLOT(plot)->magnification;
 
   gtk_plot_pc_set_color (pc, &axis->labels_attr.fg);
@@ -2179,6 +2153,7 @@ gtk_plot3d_draw_labels(GtkPlot3D *plot,
        }
 }
 
+/*
 gdouble 
 get_clean_tick_size(gdouble delta) 
 {
@@ -2188,6 +2163,7 @@ get_clean_tick_size(gdouble delta)
   magnitude= (gint)(floor(log10(delta)));
   return ceil(delta/pow(10,magnitude))*pow(10,magnitude);
 }
+*/
 
 
 /******************************************
diff --git a/gtkextra/gtkplotarray.c b/gtkextra/gtkplotarray.c
index a3db67b..5bc1174 100644
--- a/gtkextra/gtkplotarray.c
+++ b/gtkextra/gtkplotarray.c
@@ -94,13 +94,10 @@ gtk_plot_array_get_type (void)
 static void
 gtk_plot_array_class_init (GtkPlotArrayClass *klass)
 {
-  GtkPlotArrayClass *array_class;
   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
 
   array_parent_class = g_type_class_peek_parent (klass);
 
-  array_class = (GtkPlotArrayClass *) klass;
-
   gobject_class->finalize = gtk_plot_array_finalize;
   gobject_class->set_property = gtk_plot_array_set_property;
   gobject_class->get_property = gtk_plot_array_get_property;
@@ -547,12 +544,10 @@ static void
 gtk_plot_array_list_class_init (GtkPlotArrayListClass *klass)
 {
   GObjectClass *gobject_class;
-  GtkPlotArrayListClass *array_list_class;
 
   array_list_parent_class = g_type_class_peek_parent (klass);
 
   gobject_class = (GObjectClass *) klass;
-  array_list_class = (GtkPlotArrayListClass *) klass;
 
   gobject_class->finalize = gtk_plot_array_list_finalize;
 }
@@ -582,7 +577,7 @@ gtk_plot_array_list_finalize(GObject *object)
   gtk_plot_array_list_clear(array_list);
 }
 
-GList *
+static GList *
 find_array(GtkPlotArrayList *array_list, const gchar *name)
 {
   GList *list;
diff --git a/gtkextra/gtkplotbar.c b/gtkextra/gtkplotbar.c
index b04fb89..be11db4 100644
--- a/gtkextra/gtkplotbar.c
+++ b/gtkextra/gtkplotbar.c
@@ -95,15 +95,11 @@ gtk_plot_bar_get_type (void)
 static void
 gtk_plot_bar_class_init (GtkPlotBarClass *klass)
 {
-  GtkObjectClass *object_class;
-  GtkWidgetClass *widget_class;
   GtkPlotDataClass *data_class;
   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
 
   parent_class = g_type_class_ref (gtk_plot_data_get_type ());
 
-  object_class = (GtkObjectClass *) klass;
-  widget_class = (GtkWidgetClass *) klass;
   data_class = (GtkPlotDataClass *) klass;
 
   gobject_class->set_property = gtk_plot_bar_set_property;
@@ -179,13 +175,10 @@ gtk_plot_bar_get_property (GObject      *object,
 static void
 gtk_plot_bar_init (GtkPlotBar *dataset)
 {
-  GtkWidget *widget;
   GdkColor black, white;
   GdkColormap *colormap;
   GtkPlotArray *dim;
 
-  widget = GTK_WIDGET(dataset);
-
   colormap = gdk_colormap_get_system();
 
   gdk_color_black(colormap, &black);
@@ -343,7 +336,6 @@ gtk_plot_bar_draw_symbol(GtkPlotData *dataset,
 static void
 gtk_plot_bar_draw_legend(GtkPlotData *data, gint x, gint y)
 {
-  GtkPlotBar *bar;
   GtkPlot *plot = NULL;
   GtkPlotText legend;
   GdkRectangle area;
@@ -351,8 +343,6 @@ gtk_plot_bar_draw_legend(GtkPlotData *data, gint x, gint y)
   gdouble m;
   GtkAllocation allocation;
 
-  bar = GTK_PLOT_BAR(data);
-
   g_return_if_fail(data->plot != NULL);
   g_return_if_fail(GTK_IS_PLOT(data->plot));
   g_return_if_fail(gtk_widget_get_visible(GTK_WIDGET(data)));
diff --git a/gtkextra/gtkplotbox.c b/gtkextra/gtkplotbox.c
index c6ee1bd..97a2a24 100644
--- a/gtkextra/gtkplotbox.c
+++ b/gtkextra/gtkplotbox.c
@@ -93,15 +93,11 @@ gtk_plot_box_get_type (void)
 static void
 gtk_plot_box_class_init (GtkPlotBoxClass *klass)
 {
-  GtkObjectClass *object_class;
-  GtkWidgetClass *widget_class;
   GtkPlotDataClass *data_class;
   GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
 
   parent_class = g_type_class_ref (gtk_plot_data_get_type ());
 
-  object_class = (GtkObjectClass *) klass;
-  widget_class = (GtkWidgetClass *) klass;
   data_class = (GtkPlotDataClass *) klass;
 
   gobject_class->set_property = gtk_plot_box_set_property;
@@ -167,12 +163,9 @@ gtk_plot_box_get_property (GObject      *object,
 static void
 gtk_plot_box_init (GtkPlotBox *dataset)
 {
-  GtkWidget *widget;
   GdkColor black, white;
   GdkColormap *colormap;
 
-  widget = GTK_WIDGET(dataset);
-
   colormap = gdk_colormap_get_system();
 
   gdk_color_black(colormap, &black);
@@ -395,7 +388,6 @@ gtk_plot_box_draw_symbol(GtkPlotData *dataset,
 static void
 gtk_plot_box_draw_legend(GtkPlotData *data, gint x, gint y)
 {
-  GtkPlotBox *box;
   GtkPlot *plot = NULL;
   GtkPlotText legend;
   GdkRectangle area;
@@ -403,8 +395,6 @@ gtk_plot_box_draw_legend(GtkPlotData *data, gint x, gint y)
   gdouble m;
   GtkAllocation allocation;
 
-  box = GTK_PLOT_BOX(data);
-
   g_return_if_fail(data->plot != NULL);
   g_return_if_fail(GTK_IS_PLOT(data->plot));
   //g_return_if_fail(gtk_widget_get_realized(data->plot));  // is this required?? RRR
diff --git a/gtkextra/gtkplotcandle.c b/gtkextra/gtkplotcandle.c
index a79513d..7fc0a3f 100644
--- a/gtkextra/gtkplotcandle.c
+++ b/gtkextra/gtkplotcandle.c
@@ -74,14 +74,10 @@ gtk_plot_candle_get_type (void)
 static void
 gtk_plot_candle_class_init (GtkPlotCandleClass *klass)
 {
-  GtkObjectClass *object_class;
-  GtkWidgetClass *widget_class;
   GtkPlotDataClass *data_class;
 
   parent_class = gtk_type_class (gtk_plot_data_get_type ());
 
-  object_class = (GtkObjectClass *) klass;
-  widget_class = (GtkWidgetClass *) klass;
   data_class = (GtkPlotDataClass *) klass;
 
   data_class->draw_legend = gtk_plot_candle_draw_legend;
@@ -95,13 +91,10 @@ gtk_plot_candle_class_init (GtkPlotCandleClass *klass)
 static void
 gtk_plot_candle_init (GtkPlotCandle *dataset)
 {
-  GtkWidget *widget;
   GdkColor black, white;
   GdkColormap *colormap;
   GtkPlotArray *dim;
 
-  widget = GTK_WIDGET(dataset);
-
   colormap = gdk_colormap_get_system();
 
   gdk_color_black(colormap, &black);
@@ -146,7 +139,6 @@ gtk_plot_candle_draw_symbol(GtkPlotData *dataset,
                          gdouble dx, gdouble dy, gdouble dz, gdouble da)
 {
   GtkPlot *plot;
-  GtkPlotCandle *box = NULL;
   gdouble px, py, pz, ex, ey, ez;
   gdouble x1 = 0.0, y1 = 0.0, width = 0.0, height = 0.0;
   gdouble m;
@@ -156,8 +148,6 @@ gtk_plot_candle_draw_symbol(GtkPlotData *dataset,
 
   g_return_if_fail(GTK_IS_PLOT_CANDLE(dataset));
 
-  box = GTK_PLOT_CANDLE(dataset);
-
   g_return_if_fail(dataset->plot != NULL);
 
   plot = dataset->plot;
@@ -229,15 +219,12 @@ gtk_plot_candle_draw_symbol(GtkPlotData *dataset,
 static void
 gtk_plot_candle_draw_legend(GtkPlotData *data, gint x, gint y)
 {
-  GtkPlotCandle *box;
   GtkPlot *plot = NULL;
   GtkPlotText legend;
   GdkRectangle area;
   gint lascent, ldescent, lheight, lwidth;
   gdouble m;
 
-  box = GTK_PLOT_CANDLE(data);
-
   g_return_if_fail(data->plot != NULL);
   g_return_if_fail(GTK_IS_PLOT(data->plot));
   if(!GTK_WIDGET_REALIZED(data->plot)) return;
diff --git a/gtkextra/gtkplotdata.h b/gtkextra/gtkplotdata.h
index ab778f2..231def9 100644
--- a/gtkextra/gtkplotdata.h
+++ b/gtkextra/gtkplotdata.h
@@ -277,6 +277,11 @@ void               gtk_plot_data_set_link                  (GtkPlotData *dataset,
 gpointer       gtk_plot_data_get_link                  (GtkPlotData *dataset);
 void           gtk_plot_data_remove_link               (GtkPlotData *dataset);
 
+
+void           gtk_plot_data_set_gradient_show_lt_gt   (GtkPlotData *data,
+                                                        gboolean show);
+gboolean       gtk_plot_data_gradient_show_lt_gt       (GtkPlotData *data);
+
 /* Markers */
 
 GtkPlotMarker *        gtk_plot_data_add_marker                (GtkPlotData *data,
diff --git a/gtkextra/gtkplotprint.c b/gtkextra/gtkplotprint.c
index 66e689b..ae1ed90 100644
--- a/gtkextra/gtkplotprint.c
+++ b/gtkextra/gtkplotprint.c
@@ -43,6 +43,7 @@
 #include "gtkplotsurface.h"
 #include "gtkplotcairo.h"
 #include "gtkplotcanvas.h"
+#include "gtkplotprint.h"
 
 static void recalc_pixels(GtkPlot *plot);
 
diff --git a/gtkextra/gtkplotsurface.c b/gtkextra/gtkplotsurface.c
index b5889b2..efb0126 100644
--- a/gtkextra/gtkplotsurface.c
+++ b/gtkextra/gtkplotsurface.c
@@ -107,7 +107,7 @@ enum {
 static GtkPlotDataClass *parent_class = NULL;
 
 /* "stolen" from 3dgpl */
-inline gulong _sqrt(register gulong arg)
+static inline gulong _sqrt(register gulong arg)
 { 
    register gint i;
    register gulong nprd,msk=0x8000L,val=0,prd=0;
diff --git a/gtkextra/gtkpsfont.c b/gtkextra/gtkpsfont.c
index 2c59fa0..69ffa2e 100644
--- a/gtkextra/gtkpsfont.c
+++ b/gtkextra/gtkpsfont.c
@@ -312,7 +312,7 @@ static const char *default_font = "fixed";
 static GtkPSFont *find_psfont          (const gchar *name);
 
 gint
-gtk_psfont_init()
+gtk_psfont_init(void)
 {
   GtkPSFont *data = NULL;
   GList *fonts;
@@ -368,7 +368,7 @@ gtk_psfont_init()
  * Unref ps fonts.
  */
 void
-gtk_psfont_unref()
+gtk_psfont_unref(void)
 {
   GList *list;
 
diff --git a/gtkextra/gtkpsfont.h b/gtkextra/gtkpsfont.h
index ee5931a..e00fb40 100644
--- a/gtkextra/gtkpsfont.h
+++ b/gtkextra/gtkpsfont.h
@@ -92,8 +92,8 @@ struct _GtkPSFont {
   gboolean vertical;
 };
 
-gint           gtk_psfont_init                 ();
-void           gtk_psfont_unref                ();
+gint           gtk_psfont_init                 (void);
+void           gtk_psfont_unref                (void);
 GtkPSFont*     gtk_psfont_get_by_name          (const gchar *name);
 GtkPSFont*     gtk_psfont_get_by_family        (const gchar *family_name, 
                                                  gboolean italic, 
diff --git a/src/eval.c b/src/eval.c
index 81384ec..d9e2ef3 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2473,7 +2473,7 @@ gel_mod_node (GelCtx *ctx, GelETree *n)
 
 /*return TRUE if node is true (a number node !=0), false otherwise*/
 gboolean
-gel_isnodetrue (GelETree *n, gboolean *bad_node) /*PURE!*/
+gel_isnodetrue (GelETree *n, gboolean *bad_node)
 {
        switch (n->type) {
        case GEL_NULL_NODE:
@@ -4106,7 +4106,6 @@ iter_pop_stack(GelCtx *ctx)
                                        mpw_add_ui (evf->x, evf->x, 1);
                                /* we know we aren't dealing with complexes */
                                if (mpw_is_real_part_float (evf->x)) {
-                                       int thecmp = mpw_cmp (evf->x, evf->to);
                                        if (mpw_cmp (evf->x, evf->to) == -evf->init_cmp) {
                                                /* maybe we just missed it, let's look back within 2^-20 of 
the by and see */
                                                mpw_t tmp;
@@ -4114,6 +4113,7 @@ iter_pop_stack(GelCtx *ctx)
                                                        mpfr_ptr f;
                                                        /* by is definitely mpfr */
                                                        mpw_init_set (tmp, evf->by);
+                                                       mpw_make_copy_real (tmp);
                                                        f = mpw_peek_real_mpf (tmp);
                                                        mpfr_mul_2si (f, f, -20, GMP_RNDN);
                                                } else {
@@ -5214,6 +5214,7 @@ iter_ifop(GelCtx *ctx, GelETree *n, gboolean has_else, gboolean *repushed)
        } else {
                GEL_GET_LR(n,l,r);
        }
+
        
        ret = gel_isnodetrue(l,&bad_node);
        if G_UNLIKELY (bad_node || gel_error_num) {
diff --git a/src/eval.h b/src/eval.h
index ea16529..17506bc 100644
--- a/src/eval.h
+++ b/src/eval.h
@@ -101,7 +101,7 @@ GelETree * gel_eval_etree(GelCtx *ctx, GelETree *etree);
 
 /*return TRUE if node is true (a number node !=0, or nonempty string),
   false otherwise*/
-int gel_isnodetrue(GelETree *n, int *bad_node) G_GNUC_PURE;
+int gel_isnodetrue(GelETree *n, int *bad_node);
 
 /*call a function (arguments should have already been evaluated)*/
 GelETree * gel_funccall(GelCtx *ctx, GelEFunc *func, GelETree **args, int nargs);
diff --git a/src/geniustests.txt b/src/geniustests.txt
index 3415276..0885970 100644
--- a/src/geniustests.txt
+++ b/src/geniustests.txt
@@ -1129,6 +1129,7 @@ FindRootBisection (`(x)=x^2-1,0.5,1.6,10^-20,10000000)            [true,1.0,67]
 FindRootBisection (`(x)=x^2-1,-1,0.9,10^-20,10000000)          [true,-1.0,68]
 FindRootBisection (`(x)=x^2-1,0,10^2000,10^-20,1000)@(1)       false
 FindRootBisection (`(x)=x^2+1,-1,1,0.01,100)                   
FindRootBisection((`(x)=((x^2)+1)),-1,1,0.01,100)
+c=0;for x = 0 to 0.3 by 0.1 do ( for y=0.0 to 0.3 by 0.1 do (c=c+1); c)                16
 load "nullspacetest.gel"                                       true
 load "longtest.gel"                                            true
 load "testprec.gel"                                            true
diff --git a/src/gnome-genius.c b/src/gnome-genius.c
index 999dd1e..401d593 100644
--- a/src/gnome-genius.c
+++ b/src/gnome-genius.c
@@ -3349,7 +3349,7 @@ move_cursor (GtkTextBuffer *buffer,
 #ifdef HAVE_GTKSOURCEVIEW
 #ifdef HAVE_GTKSOURCEVIEW2
 static GtkSourceLanguageManager*
-get_source_language_manager ()
+get_source_language_manager (void)
 {
        static GtkSourceLanguageManager *lm = NULL;
        gchar **lang_dirs;
@@ -4186,7 +4186,8 @@ run_program (GtkWidget *menu_item, gpointer data)
                        if (write (p[1], prog, len) < len) {
                                status = 1;
                        } else if (prog[len-1] != '\n') {
-                               write (p[1], "\n", 1);
+                               while (write (p[1], "\n", 1) == 0)
+                                       ;
                        }
                        close (p[1]);
                        _exit (status);
diff --git a/src/mpwrap.c b/src/mpwrap.c
index 58a091a..213eaed 100644
--- a/src/mpwrap.c
+++ b/src/mpwrap.c
@@ -3401,6 +3401,26 @@ mpw_set_mpf_use (mpw_ptr rop, mpfr_ptr op)
        memcpy (rop->r->data.fval, op, sizeof (__mpfr_struct));
 }
 
+void
+mpw_make_copy (mpw_ptr op)
+{
+       MAKE_COPY (op->r);
+       MAKE_COPY (op->i);
+}
+
+void
+mpw_make_copy_real (mpw_ptr op)
+{
+       MAKE_COPY (op->r);
+}
+
+void
+mpw_make_copy_imag (mpw_ptr op)
+{
+       MAKE_COPY (op->r);
+       MAKE_COPY (op->i);
+}
+
 mpz_ptr
 mpw_peek_real_mpz (mpw_ptr op)
 {
diff --git a/src/mpwrap.h b/src/mpwrap.h
index 7afb57b..5194884 100644
--- a/src/mpwrap.h
+++ b/src/mpwrap.h
@@ -126,6 +126,12 @@ void mpw_set_mpz_use (mpw_ptr rop, mpz_ptr op);
 void mpw_set_mpq_use (mpw_ptr rop, mpq_ptr op);
 void mpw_set_mpf_use (mpw_ptr rop, mpfr_ptr op);
 
+/* Always use make_copy if peeking and then modifying the
+ * peeked value!  Otherwise copy on write will bite us */
+void mpw_make_copy (mpw_ptr op);
+void mpw_make_copy_real (mpw_ptr op);
+void mpw_make_copy_imag (mpw_ptr op);
+
 mpz_ptr mpw_peek_real_mpz (mpw_ptr op);
 mpq_ptr mpw_peek_real_mpq (mpw_ptr op);
 mpfr_ptr mpw_peek_real_mpf (mpw_ptr op);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]