[genius] * gtkextra/*.c: fix/ignore all the compiler warnings I can find
- From: Jiri (George) Lebl <jirka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [genius] * gtkextra/*.c: fix/ignore all the compiler warnings I can find
- Date: Wed, 16 Dec 2020 19:55:49 +0000 (UTC)
commit aea22863cea864d14f3fd8a9e516fdbf02082b3d
Author: Jiri (George) Lebl <jiri lebl gmail com>
Date: Wed Dec 16 11:55:33 2020 -0800
* gtkextra/*.c: fix/ignore all the compiler warnings I can find
* src/gnome-genius.c: never do this uniquness nonsense so that
we don't get into trouble.
* configure.ac: raise version
* help/C/genius.xml: a few updates
* help/C/figures/*.png: update images
ChangeLog | 13 ++++++++
NEWS | 5 +++
configure.ac | 2 +-
gtkextra/.gitignore | 1 +
gtkextra/gtkextra.c | 2 +-
gtkextra/gtkplot.c | 16 +++++-----
gtkextra/gtkplot3d.c | 8 ++---
gtkextra/gtkplotarray.c | 16 +++++-----
gtkextra/gtkplotbar.c | 10 +++---
gtkextra/gtkplotbox.c | 10 +++---
gtkextra/gtkplotcairo.c | 16 +++++-----
gtkextra/gtkplotcandle.c | 10 +++---
gtkextra/gtkplotcanvas.c | 26 ++++++++++------
gtkextra/gtkplotcanvasellipse.c | 8 ++---
gtkextra/gtkplotcanvasline.c | 8 ++---
gtkextra/gtkplotcanvaspixmap.c | 8 ++---
gtkextra/gtkplotcanvasplot.c | 8 ++---
gtkextra/gtkplotcanvasrectangle.c | 8 ++---
gtkextra/gtkplotcanvastext.c | 8 ++---
gtkextra/gtkplotcsurface.c | 12 ++++----
gtkextra/gtkplotdata.c | 26 ++++++++--------
gtkextra/gtkplotdt.c | 45 +++++++++++++++++----------
gtkextra/gtkplotflux.c | 12 ++++----
gtkextra/gtkplotpc.c | 8 ++---
gtkextra/gtkplotpixmap.c | 12 ++++----
gtkextra/gtkplotpolar.c | 8 ++---
gtkextra/gtkplotps.c | 13 ++++----
gtkextra/gtkplotsurface.c | 12 ++++----
gtkextra/gtkpsfont.c | 8 +++++
help/C/figures/genius_window.png | Bin 6860 -> 5476 bytes
help/C/figures/line_plot.png | Bin 8596 -> 5055 bytes
help/C/figures/line_plot_graph.png | Bin 12271 -> 6853 bytes
help/C/figures/parametric.png | Bin 11075 -> 7405 bytes
help/C/figures/parametric_graph.png | Bin 11073 -> 6795 bytes
help/C/figures/surface_graph.png | Bin 30972 -> 12224 bytes
help/C/genius.xml | 60 +++++++++++++++++++-----------------
src/gnome-genius.c | 52 +++++++++++++++++++------------
ve/.gitignore | 1 +
38 files changed, 261 insertions(+), 191 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5c1b7191..65ee050f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Wed Dec 16 11:52:11 2020 Jiri (George) Lebl <jirka 5z com>
+
+ * gtkextra/*.c: fix/ignore all the compiler warnings I can find
+
+ * src/gnome-genius.c: never do this uniquness nonsense so that
+ we don't get into trouble.
+
+ * configure.ac: raise version
+
+ * help/C/genius.xml: a few updates
+
+ * help/C/figures/*.png: update images
+
Tue Dec 15 17:37:06 2020 Jiri (George) Lebl <jirka 5z com>
* src/graphing.c: move the solver bits to the expression entries
diff --git a/NEWS b/NEWS
index 093bcbf6..e858e607 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,11 @@ Changes to 1.0.26
* The range boxes in the plot dialog are now evalued rather than being
spin boxes, so that one can use arbitrary genius expressions there.
+* Always spawn a new instance, none of this uniqueness nonsense.
+* Various fixes stemming from the port to GTK3 and from various new compiler
+ warnings.
+* File chooser dialogs are now native.
+* Fix saving of settings in the presence of old style settings directories.
Changes to 1.0.25
diff --git a/configure.ac b/configure.ac
index 68e625ab..39a748d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-AC_INIT([genius], [1.0.25])
+AC_INIT([genius], [1.0.26])
#AX_IS_RELEASE([git-directory])
AX_IS_RELEASE([always])
AC_CONFIG_SRCDIR([src/calc.c])
diff --git a/gtkextra/.gitignore b/gtkextra/.gitignore
index b24de4ac..9d3253d7 100644
--- a/gtkextra/.gitignore
+++ b/gtkextra/.gitignore
@@ -1,4 +1,5 @@
.deps
+tags
Makefile
Makefile.in
*.o
diff --git a/gtkextra/gtkextra.c b/gtkextra/gtkextra.c
index 68ca8d70..6f3d6e4d 100644
--- a/gtkextra/gtkextra.c
+++ b/gtkextra/gtkextra.c
@@ -130,7 +130,7 @@ _gtkextra_signal_emit(GObject *object, guint signal_id, ...)
*result = g_value_get_boolean(&ret);
g_value_unset (&ret);
- for (i = 0; i < query.n_params; i++)
+ for (i = 0; i < (int)query.n_params; i++)
g_value_unset (instance_and_params + 1 + i);
g_value_unset (instance_and_params + 0);
diff --git a/gtkextra/gtkplot.c b/gtkextra/gtkplot.c
index 0306e46c..2820eb01 100644
--- a/gtkextra/gtkplot.c
+++ b/gtkextra/gtkplot.c
@@ -181,8 +181,8 @@ void gtk_plot_parse_label (GtkPlotAxis *axis,
gchar *label);
-static void gtk_plot_class_init (GtkPlotClass *klass);
-static void gtk_plot_init (GtkPlot *plot);
+static void gtk_plot_class_init (GtkPlotClass *klass, gpointer unused);
+static void gtk_plot_init (GtkPlot *plot, gpointer unused);
static void gtk_plot_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -191,8 +191,8 @@ static void gtk_plot_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
-static void gtk_plot_axis_class_init (GtkPlotAxisClass *klass);
-static void gtk_plot_axis_init (GtkPlotAxis *axis);
+static void gtk_plot_axis_class_init (GtkPlotAxisClass *klass, gpointer unused);
+static void gtk_plot_axis_init (GtkPlotAxis *axis, gpointer unused);
static void gtk_plot_axis_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -262,7 +262,7 @@ gtk_plot_get_type (void)
}
static void
-gtk_plot_class_init (GtkPlotClass *klass)
+gtk_plot_class_init (GtkPlotClass *klass, gpointer unused)
{
GObjectClass *object_class;
GtkWidgetClass *widget_class;
@@ -1015,7 +1015,7 @@ gtk_plot_axis_get_type (void)
static void
-gtk_plot_axis_class_init (GtkPlotAxisClass *klass)
+gtk_plot_axis_class_init (GtkPlotAxisClass *klass, gpointer unused)
{
GtkWidgetClass *object_class;
GtkPlotAxisClass *axis_class;
@@ -1593,7 +1593,7 @@ axis_changed(GtkPlotAxis *axis, GtkPlot *plot)
}
static void
-gtk_plot_init (GtkPlot *plot)
+gtk_plot_init (GtkPlot *plot, gpointer unused)
{
GdkRGBA black, white;
@@ -2043,7 +2043,7 @@ gtk_plot_real_set_pc(GtkPlot *plot, GtkPlotPC *pc)
}
static void
-gtk_plot_axis_init (GtkPlotAxis *axis)
+gtk_plot_axis_init (GtkPlotAxis *axis, gpointer unused)
{
GdkRGBA black, white;
diff --git a/gtkextra/gtkplot3d.c b/gtkextra/gtkplot3d.c
index a2e392aa..92fbaa01 100644
--- a/gtkextra/gtkplot3d.c
+++ b/gtkextra/gtkplot3d.c
@@ -104,8 +104,8 @@ enum
PROP_ZY_TITLE_VISIBLE,
};
-static void gtk_plot3d_class_init (GtkPlot3DClass *klass);
-static void gtk_plot3d_init (GtkPlot3D *plot);
+static void gtk_plot3d_class_init (GtkPlot3DClass *klass, gpointer unused);
+static void gtk_plot3d_init (GtkPlot3D *plot, gpointer unused);
static void gtk_plot3d_destroy (GtkWidget *object);
static void gtk_plot3d_set_property (GObject *object,
guint prop_id,
@@ -163,7 +163,7 @@ gtk_plot3d_get_type (void)
}
static void
-gtk_plot3d_class_init (GtkPlot3DClass *klass)
+gtk_plot3d_class_init (GtkPlot3DClass *klass, gpointer unused)
{
GtkWidgetClass *object_class;
GtkPlotClass *plot_class;
@@ -801,7 +801,7 @@ gtk_plot3d_class_init (GtkPlot3DClass *klass)
static void
-gtk_plot3d_init (GtkPlot3D *plot)
+gtk_plot3d_init (GtkPlot3D *plot, gpointer unused)
{
GdkRGBA color, black, white;
gint i;
diff --git a/gtkextra/gtkplotarray.c b/gtkextra/gtkplotarray.c
index b2d12bb5..30bad3ee 100644
--- a/gtkextra/gtkplotarray.c
+++ b/gtkextra/gtkplotarray.c
@@ -30,8 +30,8 @@
#define P_(string) string
-static void gtk_plot_array_class_init (GtkPlotArrayClass *klass);
-static void gtk_plot_array_init (GtkPlotArray *array);
+static void gtk_plot_array_class_init (GtkPlotArrayClass *klass, gpointer unused);
+static void gtk_plot_array_init (GtkPlotArray *array, gpointer unused);
static void gtk_plot_array_finalize (GObject *object);
static void gtk_plot_array_set_property (GObject *object,
guint prop_id,
@@ -41,8 +41,8 @@ static void gtk_plot_array_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
-static void gtk_plot_array_list_class_init (GtkPlotArrayListClass *klass);
-static void gtk_plot_array_list_init (GtkPlotArrayList *array_list);
+static void gtk_plot_array_list_class_init (GtkPlotArrayListClass *klass, gpointer unnused);
+static void gtk_plot_array_list_init (GtkPlotArrayList *array_list, gpointer unnused);
static void gtk_plot_array_list_finalize (GObject *object);
static GObjectClass *array_parent_class = NULL;
@@ -92,7 +92,7 @@ gtk_plot_array_get_type (void)
}
static void
-gtk_plot_array_class_init (GtkPlotArrayClass *klass)
+gtk_plot_array_class_init (GtkPlotArrayClass *klass, gpointer unused)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
@@ -273,7 +273,7 @@ gtk_plot_array_get_property (GObject *object,
}
static void
-gtk_plot_array_init (GtkPlotArray *array)
+gtk_plot_array_init (GtkPlotArray *array, gpointer unused)
{
array->name = NULL;
array->label = NULL;
@@ -543,7 +543,7 @@ gtk_plot_array_list_get_type (void)
}
static void
-gtk_plot_array_list_class_init (GtkPlotArrayListClass *klass)
+gtk_plot_array_list_class_init (GtkPlotArrayListClass *klass, gpointer unused)
{
GObjectClass *gobject_class;
@@ -556,7 +556,7 @@ gtk_plot_array_list_class_init (GtkPlotArrayListClass *klass)
static void
-gtk_plot_array_list_init (GtkPlotArrayList *array_list)
+gtk_plot_array_list_init (GtkPlotArrayList *array_list, gpointer unnused)
{
array_list->arrays = NULL;
}
diff --git a/gtkextra/gtkplotbar.c b/gtkextra/gtkplotbar.c
index 8acdac86..54012f7b 100644
--- a/gtkextra/gtkplotbar.c
+++ b/gtkextra/gtkplotbar.c
@@ -40,8 +40,8 @@
#define P_(string) string
-static void gtk_plot_bar_class_init (GtkPlotBarClass *klass);
-static void gtk_plot_bar_init (GtkPlotBar *data);
+static void gtk_plot_bar_class_init (GtkPlotBarClass *klass, gpointer unused);
+static void gtk_plot_bar_init (GtkPlotBar *data, gpointer unused);
static void gtk_plot_bar_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -93,7 +93,7 @@ gtk_plot_bar_get_type (void)
}
static void
-gtk_plot_bar_class_init (GtkPlotBarClass *klass)
+gtk_plot_bar_class_init (GtkPlotBarClass *klass, gpointer unused)
{
GtkPlotDataClass *data_class;
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
@@ -175,7 +175,7 @@ gtk_plot_bar_get_property (GObject *object,
}
static void
-gtk_plot_bar_init (GtkPlotBar *dataset)
+gtk_plot_bar_init (GtkPlotBar *dataset, gpointer unused)
{
GdkRGBA black, white;
GtkPlotArray *dim;
@@ -362,7 +362,7 @@ gtk_plot_bar_draw_legend(GtkPlotData *data, gint x, gint y)
if(data->legend)
legend.text = data->legend;
else
- legend.text = "";
+ legend.text = (char *)"";
gtk_plot_text_get_size(legend.text, legend.angle, legend.font,
roundint(legend.height * m),
diff --git a/gtkextra/gtkplotbox.c b/gtkextra/gtkplotbox.c
index 0c8e5348..6126e464 100644
--- a/gtkextra/gtkplotbox.c
+++ b/gtkextra/gtkplotbox.c
@@ -39,8 +39,8 @@
#define P_(string) string
-static void gtk_plot_box_class_init (GtkPlotBoxClass *klass);
-static void gtk_plot_box_init (GtkPlotBox *data);
+static void gtk_plot_box_class_init (GtkPlotBoxClass *klass, gpointer unused);
+static void gtk_plot_box_init (GtkPlotBox *data, gpointer unused);
static void gtk_plot_box_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -91,7 +91,7 @@ gtk_plot_box_get_type (void)
}
static void
-gtk_plot_box_class_init (GtkPlotBoxClass *klass)
+gtk_plot_box_class_init (GtkPlotBoxClass *klass, gpointer unused)
{
GtkPlotDataClass *data_class;
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
@@ -163,7 +163,7 @@ gtk_plot_box_get_property (GObject *object,
static void
-gtk_plot_box_init (GtkPlotBox *dataset)
+gtk_plot_box_init (GtkPlotBox *dataset, gpointer unused)
{
GdkRGBA black, white;
@@ -418,7 +418,7 @@ gtk_plot_box_draw_legend(GtkPlotData *data, gint x, gint y)
if(data->legend)
legend.text = data->legend;
else
- legend.text = "";
+ legend.text = (char *)"";
gtk_plot_text_get_size(legend.text, legend.angle, legend.font,
roundint(legend.height * m),
diff --git a/gtkextra/gtkplotcairo.c b/gtkextra/gtkplotcairo.c
index 4a27c2aa..24158ec3 100644
--- a/gtkextra/gtkplotcairo.c
+++ b/gtkextra/gtkplotcairo.c
@@ -41,8 +41,8 @@
#include "gtkplotcanvas.h"
#include <pango/pango.h>
-static void gtk_plot_cairo_init (GtkPlotCairo *pc);
-static void gtk_plot_cairo_class_init (GtkPlotCairoClass *klass);
+static void gtk_plot_cairo_init (GtkPlotCairo *pc, gpointer unused);
+static void gtk_plot_cairo_class_init (GtkPlotCairoClass *klass, gpointer unused);
static void gtk_plot_cairo_finalize (GObject *object);
static gboolean gtk_plot_cairo_real_init (GtkPlotPC *pc);
static void gtk_plot_cairo_set_viewport (GtkPlotPC *pc,
@@ -144,7 +144,7 @@ gtk_plot_cairo_get_type (void)
}
static void
-gtk_plot_cairo_init (GtkPlotCairo *pc)
+gtk_plot_cairo_init (GtkPlotCairo *pc, gpointer unused)
{
pc->cairo = NULL;
/*
@@ -183,7 +183,7 @@ gtk_plot_cairo_init (GtkPlotCairo *pc)
static void
-gtk_plot_cairo_class_init (GtkPlotCairoClass *klass)
+gtk_plot_cairo_class_init (GtkPlotCairoClass *klass, gpointer unused)
{
GObjectClass *gobject_class;
GtkPlotPCClass *pc_class;
@@ -410,11 +410,12 @@ gtk_plot_cairo_set_dash (GtkPlotPC *pc,
{
cairo_t *cairo = GTK_PLOT_CAIRO(pc)->cairo; /* Shortcut */
gchar list[] = {'\0','\1','\2','\3','\4','\5','\6','\7'};
- if (!cairo)
- return;
double dash[1000];
gint i;
+ if (!cairo)
+ return;
+
if(num_values == 0){
return;
}
@@ -1005,7 +1006,7 @@ gtk_plot_cairo_draw_string (GtkPlotPC *pc,
case 'b':
if (lastchar) {
const gchar *aux2 = lastchar;
- gint i = aux2 - g_utf8_prev_char(lastchar);
+ i = aux2 - g_utf8_prev_char(lastchar);
pango_layout_set_text(layout, lastchar, i);
pango_layout_get_extents(layout, NULL, &rect);
x -= sign_x*PANGO_PIXELS(rect.width);
@@ -1079,6 +1080,7 @@ gtk_plot_cairo_draw_string (GtkPlotPC *pc,
old_tx + width + border_space,
old_ty - border_space + shadow_width,
shadow_width, height + 2 * border_space);
+ /* FALLTHRU */
case GTK_PLOT_BORDER_LINE:
gtk_plot_pc_draw_rectangle(pc,
FALSE,
diff --git a/gtkextra/gtkplotcandle.c b/gtkextra/gtkplotcandle.c
index ac2c3c54..25abca97 100644
--- a/gtkextra/gtkplotcandle.c
+++ b/gtkextra/gtkplotcandle.c
@@ -28,8 +28,8 @@
#include "gtkplotcandle.h"
#include "gtkpsfont.h"
-static void gtk_plot_candle_class_init (GtkPlotCandleClass *klass);
-static void gtk_plot_candle_init (GtkPlotCandle *data);
+static void gtk_plot_candle_class_init (GtkPlotCandleClass *klass, gpointer unused);
+static void gtk_plot_candle_init (GtkPlotCandle *data, gpointer unused);
static void gtk_plot_candle_draw_legend (GtkPlotData *data,
gint x, gint y);
static void gtk_plot_candle_draw_symbol (GtkPlotData *data,
@@ -74,7 +74,7 @@ gtk_plot_candle_get_type (void)
}
static void
-gtk_plot_candle_class_init (GtkPlotCandleClass *klass)
+gtk_plot_candle_class_init (GtkPlotCandleClass *klass, gpointer unused)
{
GtkPlotDataClass *data_class;
@@ -91,7 +91,7 @@ gtk_plot_candle_class_init (GtkPlotCandleClass *klass)
static void
-gtk_plot_candle_init (GtkPlotCandle *dataset)
+gtk_plot_candle_init (GtkPlotCandle *dataset, gpointer unused)
{
GdkRGBA black, white;
GtkPlotArray *dim;
@@ -242,7 +242,7 @@ gtk_plot_candle_draw_legend(GtkPlotData *data, gint x, gint y)
if(data->legend)
legend.text = data->legend;
else
- legend.text = "";
+ legend.text = (char *)"";
gtk_plot_text_get_size(legend.text, legend.angle, legend.font,
roundint(legend.height * m),
diff --git a/gtkextra/gtkplotcanvas.c b/gtkextra/gtkplotcanvas.c
index adf7de51..3e2c713b 100644
--- a/gtkextra/gtkplotcanvas.c
+++ b/gtkextra/gtkplotcanvas.c
@@ -77,8 +77,8 @@ enum {
ARG_CHILD_SELECTION_MODE,
};
-static void gtk_plot_canvas_class_init (GtkPlotCanvasClass *klass);
-static void gtk_plot_canvas_init (GtkPlotCanvas *plot_canvas);
+static void gtk_plot_canvas_class_init (GtkPlotCanvasClass *klass, gpointer unused);
+static void gtk_plot_canvas_init (GtkPlotCanvas *plot_canvas, gpointer unused);
static void gtk_plot_canvas_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -87,8 +87,8 @@ static void gtk_plot_canvas_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
-static void gtk_plot_canvas_child_class_init (GtkPlotCanvasChildClass *klass);
-static void gtk_plot_canvas_child_init (GtkPlotCanvasChild *child);
+static void gtk_plot_canvas_child_class_init (GtkPlotCanvasChildClass *klass, gpointer unused);
+static void gtk_plot_canvas_child_init (GtkPlotCanvasChild *child, gpointer unused);
static void gtk_plot_canvas_child_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -227,7 +227,7 @@ gtk_plot_canvas_child_get_type (void)
}
static void
-gtk_plot_canvas_child_class_init (GtkPlotCanvasChildClass *klass)
+gtk_plot_canvas_child_class_init (GtkPlotCanvasChildClass *klass, gpointer unused)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
@@ -483,7 +483,7 @@ gtk_plot_canvas_child_set_property (GObject *object,
}
static void
-gtk_plot_canvas_child_init(GtkPlotCanvasChild *child)
+gtk_plot_canvas_child_init(GtkPlotCanvasChild *child, gpointer unused)
{
child->flags = GTK_PLOT_CANVAS_CAN_MOVE |
GTK_PLOT_CANVAS_CAN_RESIZE;
@@ -497,7 +497,7 @@ gtk_plot_canvas_child_init(GtkPlotCanvasChild *child)
}
static void
-gtk_plot_canvas_class_init (GtkPlotCanvasClass *klass)
+gtk_plot_canvas_class_init (GtkPlotCanvasClass *klass, gpointer unused)
{
GtkWidgetClass *object_class;
GtkWidgetClass *widget_class;
@@ -868,7 +868,7 @@ gtk_plot_canvas_set_property (GObject *object,
}
static void
-gtk_plot_canvas_init (GtkPlotCanvas *plot_canvas)
+gtk_plot_canvas_init (GtkPlotCanvas *plot_canvas, gpointer unused)
{
GtkWidget *widget;
GdkRGBA color, black, white;
@@ -1163,6 +1163,12 @@ gtk_plot_canvas_paint (GtkPlotCanvas *canvas)
gtk_plot_pc_leave(canvas->pc);
}
+static void
+queue_draw_callback(GtkWidget *widget, gpointer data)
+{
+ gtk_widget_queue_draw(widget);
+}
+
/**
* gtk_plot_canvas_refresh:
* @canvas: a #GtkPlotCanvas.
@@ -1178,7 +1184,7 @@ gtk_plot_canvas_refresh(GtkPlotCanvas *canvas)
gtk_widget_queue_draw(GTK_WIDGET(canvas));
gtk_container_foreach(GTK_CONTAINER(canvas),
- (GtkCallback) gtk_widget_queue_draw, NULL);
+ queue_draw_callback, NULL);
}
static void
@@ -1351,6 +1357,7 @@ gtk_plot_canvas_motion (GtkWidget *widget, GdkEventMotion *event)
new_x = MIN(x, pivot_x);
new_width = abs(x - pivot_x);
}
+ /* FALLTHRU */
case GTK_PLOT_CANVAS_TOP:
if(canvas->active_item && canvas->active_item->flags & GTK_PLOT_CANVAS_CAN_RESIZE){
new_y = MIN(y, pivot_y);
@@ -1368,6 +1375,7 @@ gtk_plot_canvas_motion (GtkWidget *widget, GdkEventMotion *event)
new_x = MIN(x, pivot_x);
new_width = abs(x - pivot_x);
}
+ /* FALLTHRU */
case GTK_PLOT_CANVAS_BOTTOM:
if(canvas->active_item && canvas->active_item->flags & GTK_PLOT_CANVAS_CAN_RESIZE){
new_y = MIN(y, pivot_y);
diff --git a/gtkextra/gtkplotcanvasellipse.c b/gtkextra/gtkplotcanvasellipse.c
index 50ee837f..0bb012d2 100644
--- a/gtkextra/gtkplotcanvasellipse.c
+++ b/gtkextra/gtkplotcanvasellipse.c
@@ -46,8 +46,8 @@ enum {
ARG_BG
};
-static void gtk_plot_canvas_ellipse_init (GtkPlotCanvasEllipse *ellipse);
-static void gtk_plot_canvas_ellipse_class_init (GtkPlotCanvasChildClass *klass);
+static void gtk_plot_canvas_ellipse_init (GtkPlotCanvasEllipse *ellipse, gpointer unused);
+static void gtk_plot_canvas_ellipse_class_init (GtkPlotCanvasChildClass *klass, gpointer unused);
static void gtk_plot_canvas_ellipse_draw (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *child);
static void gtk_plot_canvas_ellipse_select (cairo_t *cr,
@@ -113,7 +113,7 @@ gtk_plot_canvas_ellipse_new (GtkPlotLineStyle style,
}
static void
-gtk_plot_canvas_ellipse_init (GtkPlotCanvasEllipse *ellipse)
+gtk_plot_canvas_ellipse_init (GtkPlotCanvasEllipse *ellipse, gpointer unused)
{
gdk_rgba_parse(&ellipse->line.color, "black");
gdk_rgba_parse(&ellipse->bg, "white");
@@ -124,7 +124,7 @@ gtk_plot_canvas_ellipse_init (GtkPlotCanvasEllipse *ellipse)
}
static void
-gtk_plot_canvas_ellipse_class_init (GtkPlotCanvasChildClass *klass)
+gtk_plot_canvas_ellipse_class_init (GtkPlotCanvasChildClass *klass, gpointer unused)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
diff --git a/gtkextra/gtkplotcanvasline.c b/gtkextra/gtkplotcanvasline.c
index d216f053..0319763e 100644
--- a/gtkextra/gtkplotcanvasline.c
+++ b/gtkextra/gtkplotcanvasline.c
@@ -53,8 +53,8 @@ enum{
ARG_ARROW_STYLE
};
-static void gtk_plot_canvas_line_init (GtkPlotCanvasLine *line);
-static void gtk_plot_canvas_line_class_init (GtkPlotCanvasChildClass *klass);
+static void gtk_plot_canvas_line_init (GtkPlotCanvasLine *line, gpointer unused);
+static void gtk_plot_canvas_line_class_init (GtkPlotCanvasChildClass *klass, gpointer unused);
static void gtk_plot_canvas_line_draw_selection (cairo_t *cr,
GtkPlotCanvas *canvas,
GtkPlotCanvasChild *child,
@@ -125,7 +125,7 @@ gtk_plot_canvas_line_new (GtkPlotLineStyle style,
}
static void
-gtk_plot_canvas_line_init (GtkPlotCanvasLine *line)
+gtk_plot_canvas_line_init (GtkPlotCanvasLine *line, gpointer unused)
{
gdk_rgba_parse(&line->line.color, "black");
@@ -140,7 +140,7 @@ gtk_plot_canvas_line_init (GtkPlotCanvasLine *line)
}
static void
-gtk_plot_canvas_line_class_init (GtkPlotCanvasChildClass *klass)
+gtk_plot_canvas_line_class_init (GtkPlotCanvasChildClass *klass, gpointer unused)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
diff --git a/gtkextra/gtkplotcanvaspixmap.c b/gtkextra/gtkplotcanvaspixmap.c
index e2a10f62..ef04c96e 100644
--- a/gtkextra/gtkplotcanvaspixmap.c
+++ b/gtkextra/gtkplotcanvaspixmap.c
@@ -43,8 +43,8 @@ enum {
ARG_MASK,
};
-static void gtk_plot_canvas_pixmap_init (GtkPlotCanvasPixmap *pixmap);
-static void gtk_plot_canvas_pixmap_class_init(GtkPlotCanvasChildClass *klass);
+static void gtk_plot_canvas_pixmap_init (GtkPlotCanvasPixmap *pixmap, gpointer unused);
+static void gtk_plot_canvas_pixmap_class_init(GtkPlotCanvasChildClass *klass, gpointer unused);
static void gtk_plot_canvas_pixmap_destroy (GtkWidget *object);
static void gtk_plot_canvas_pixmap_draw (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *child);
@@ -111,7 +111,7 @@ gtk_plot_canvas_pixmap_new (cairo_surface_t *_pixmap, cairo_pattern_t *mask)
}
static void
-gtk_plot_canvas_pixmap_init (GtkPlotCanvasPixmap *pixmap)
+gtk_plot_canvas_pixmap_init (GtkPlotCanvasPixmap *pixmap, gpointer unused)
{
pixmap->pixmap = NULL;
pixmap->mask = NULL;
@@ -129,7 +129,7 @@ gtk_plot_canvas_pixmap_destroy(GtkWidget *object)
}
static void
-gtk_plot_canvas_pixmap_class_init (GtkPlotCanvasChildClass *klass)
+gtk_plot_canvas_pixmap_class_init (GtkPlotCanvasChildClass *klass, gpointer unused)
{
GtkWidgetClass *object_class = (GtkWidgetClass *)klass;
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
diff --git a/gtkextra/gtkplotcanvasplot.c b/gtkextra/gtkplotcanvasplot.c
index 70e0df1d..d3e06192 100644
--- a/gtkextra/gtkplotcanvasplot.c
+++ b/gtkextra/gtkplotcanvasplot.c
@@ -39,8 +39,8 @@
#define DEFAULT_MARKER_SIZE 6
-static void gtk_plot_canvas_plot_init (GtkPlotCanvasPlot *plot);
-static void gtk_plot_canvas_plot_class_init(GtkPlotCanvasChildClass *klass);
+static void gtk_plot_canvas_plot_init (GtkPlotCanvasPlot *plot, gpointer unused);
+static void gtk_plot_canvas_plot_class_init(GtkPlotCanvasChildClass *klass, gpointer unused);
static void gtk_plot_canvas_plot_destroy (GtkWidget *object);
static void gtk_plot_canvas_plot_draw (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *child);
@@ -111,7 +111,7 @@ gtk_plot_canvas_plot_new (GtkPlot *plot)
}
static void
-gtk_plot_canvas_plot_init (GtkPlotCanvasPlot *plot)
+gtk_plot_canvas_plot_init (GtkPlotCanvasPlot *plot, gpointer unused)
{
plot->plot = NULL;
plot->pos = GTK_PLOT_CANVAS_PLOT_IN_PLOT;
@@ -123,7 +123,7 @@ gtk_plot_canvas_plot_init (GtkPlotCanvasPlot *plot)
}
static void
-gtk_plot_canvas_plot_class_init (GtkPlotCanvasChildClass *klass)
+gtk_plot_canvas_plot_class_init (GtkPlotCanvasChildClass *klass, gpointer unused)
{
GtkWidgetClass *object_class = (GtkWidgetClass *)klass;
diff --git a/gtkextra/gtkplotcanvasrectangle.c b/gtkextra/gtkplotcanvasrectangle.c
index cfb404eb..ff928230 100644
--- a/gtkextra/gtkplotcanvasrectangle.c
+++ b/gtkextra/gtkplotcanvasrectangle.c
@@ -47,8 +47,8 @@ enum {
};
-static void gtk_plot_canvas_rectangle_init (GtkPlotCanvasRectangle *rectangle);
-static void gtk_plot_canvas_rectangle_class_init(GtkPlotCanvasChildClass *klass);
+static void gtk_plot_canvas_rectangle_init (GtkPlotCanvasRectangle *rectangle, gpointer unused);
+static void gtk_plot_canvas_rectangle_class_init(GtkPlotCanvasChildClass *klass, gpointer unused);
static void gtk_plot_canvas_rectangle_draw (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *child);
static void gtk_plot_canvas_rectangle_move (GtkPlotCanvas *canvas,
@@ -169,7 +169,7 @@ gtk_plot_canvas_rectangle_new (GtkPlotLineStyle style,
}
static void
-gtk_plot_canvas_rectangle_init (GtkPlotCanvasRectangle *rectangle)
+gtk_plot_canvas_rectangle_init (GtkPlotCanvasRectangle *rectangle, gpointer unused)
{
gdk_rgba_parse(&rectangle->line.color, "black");
gdk_rgba_parse(&rectangle->bg, "white");
@@ -182,7 +182,7 @@ gtk_plot_canvas_rectangle_init (GtkPlotCanvasRectangle *rectangle)
}
static void
-gtk_plot_canvas_rectangle_class_init (GtkPlotCanvasChildClass *klass)
+gtk_plot_canvas_rectangle_class_init (GtkPlotCanvasChildClass *klass, gpointer unused)
{
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
diff --git a/gtkextra/gtkplotcanvastext.c b/gtkextra/gtkplotcanvastext.c
index c70f79ca..4665fcbb 100644
--- a/gtkextra/gtkplotcanvastext.c
+++ b/gtkextra/gtkplotcanvastext.c
@@ -44,9 +44,9 @@ enum {
ARG_TEXT,
};
-static void gtk_plot_canvas_text_init (GtkPlotCanvasText *text);
+static void gtk_plot_canvas_text_init (GtkPlotCanvasText *text, gpointer unused);
static void gtk_plot_canvas_text_destroy (GtkWidget *object);
-static void gtk_plot_canvas_text_class_init(GtkPlotCanvasChildClass *klass);
+static void gtk_plot_canvas_text_class_init(GtkPlotCanvasChildClass *klass, gpointer unused);
static void gtk_plot_canvas_text_draw (GtkPlotCanvas *canvas,
GtkPlotCanvasChild *child);
static void gtk_plot_canvas_text_size_allocate (GtkPlotCanvas *canvas,
@@ -139,7 +139,7 @@ gtk_plot_canvas_text_new (const gchar *font, gint height, gint angle,
}
static void
-gtk_plot_canvas_text_init (GtkPlotCanvasText *text)
+gtk_plot_canvas_text_init (GtkPlotCanvasText *text, gpointer unused)
{
GtkPlotText *text_attr;
@@ -160,7 +160,7 @@ gtk_plot_canvas_text_init (GtkPlotCanvasText *text)
}
static void
-gtk_plot_canvas_text_class_init (GtkPlotCanvasChildClass *klass)
+gtk_plot_canvas_text_class_init (GtkPlotCanvasChildClass *klass, gpointer unused)
{
GtkWidgetClass *object_class = (GtkWidgetClass *)klass;
GObjectClass *gobject_class = G_OBJECT_CLASS(klass);
diff --git a/gtkextra/gtkplotcsurface.c b/gtkextra/gtkplotcsurface.c
index 22d12087..6bdcb976 100644
--- a/gtkextra/gtkplotcsurface.c
+++ b/gtkextra/gtkplotcsurface.c
@@ -64,8 +64,8 @@ typedef struct
gint type; /* one or two intersection points */
} GtkPlotContourX;
-static void gtk_plot_csurface_class_init (GtkPlotCSurfaceClass *klass);
-static void gtk_plot_csurface_init (GtkPlotCSurface *data);
+static void gtk_plot_csurface_class_init (GtkPlotCSurfaceClass *klass, gpointer unused);
+static void gtk_plot_csurface_init (GtkPlotCSurface *data, gpointer unused);
static void gtk_plot_csurface_destroy (GtkWidget *object);
static void gtk_plot_csurface_get_property (GObject *object,
guint prop_id,
@@ -143,7 +143,7 @@ gtk_plot_csurface_get_type (void)
}
static void
-gtk_plot_csurface_class_init (GtkPlotCSurfaceClass *klass)
+gtk_plot_csurface_class_init (GtkPlotCSurfaceClass *klass, gpointer unused)
{
GtkWidgetClass *object_class;
GtkPlotDataClass *data_class;
@@ -369,7 +369,7 @@ update_data (GtkPlotData *data)
}
static void
-gtk_plot_csurface_init (GtkPlotCSurface *dataset)
+gtk_plot_csurface_init (GtkPlotCSurface *dataset, gpointer unused)
{
GtkPlotArray *dim;
@@ -1623,7 +1623,7 @@ gtk_plot_csurface_get_legend_size(GtkPlotData *data, gint *width, gint *height)
if(data->legend)
legend.text = data->legend;
else
- legend.text = "X";
+ legend.text = (char *)"X";
*height = 0;
*width = roundint(12 * m);
@@ -1665,7 +1665,7 @@ gtk_plot_csurface_draw_legend(GtkPlotData *data, gint x, gint y)
if(data->legend)
legend.text = data->legend;
else
- legend.text = "X";
+ legend.text = (char *)"X";
gtk_plot_text_get_size(legend.text, legend.angle, legend.font,
roundint(legend.height * m),
diff --git a/gtkextra/gtkplotdata.c b/gtkextra/gtkplotdata.c
index aaaefa5b..be6cf5b1 100644
--- a/gtkextra/gtkplotdata.c
+++ b/gtkextra/gtkplotdata.c
@@ -42,8 +42,8 @@
static gchar DEFAULT_FONT[] = "Helvetica";
-static void gtk_plot_data_class_init (GtkPlotDataClass *klass);
-static void gtk_plot_data_init (GtkPlotData *data);
+static void gtk_plot_data_class_init (GtkPlotDataClass *klass, gpointer unused);
+static void gtk_plot_data_init (GtkPlotData *data, gpointer unused);
static void gtk_plot_data_destroy (GtkWidget *object);
static void gtk_plot_data_get_property (GObject *object,
guint prop_id,
@@ -302,7 +302,7 @@ gtk_plot_data_get_type (void)
}
static void
-gtk_plot_data_class_init (GtkPlotDataClass *klass)
+gtk_plot_data_class_init (GtkPlotDataClass *klass, gpointer unused)
{
GtkWidgetClass *object_class;
GtkPlotDataClass *data_class;
@@ -1492,7 +1492,7 @@ gtk_plot_data_class_init (GtkPlotDataClass *klass)
}
static void
-gtk_plot_data_init (GtkPlotData *dataset)
+gtk_plot_data_init (GtkPlotData *dataset, gpointer unused)
{
GdkRGBA black, white, color;
@@ -1538,7 +1538,7 @@ gtk_plot_data_init (GtkPlotData *dataset)
dataset->gradient_title_pos = GTK_PLOT_AXIS_RIGHT;
dataset->gradient_x = .6;
dataset->gradient_y = .05;
- dataset->gradient->orientation = GTK_ORIENTATION_VERTICAL;
+ dataset->gradient->orientation = GTK_PLOT_AXIS_Y;
dataset->gradient->label_mask = GTK_PLOT_LABEL_OUT;
dataset->gradient->labels_attr.fg = black;
dataset->gradient->labels_attr.bg = white;
@@ -2787,7 +2787,7 @@ gtk_plot_data_draw_legend(GtkPlotData *data, gint x, gint y)
if(data->legend)
legend.text = data->legend;
else
- legend.text = "";
+ legend.text = (char *)"";
gtk_plot_pc_gsave(plot->pc);
@@ -2859,7 +2859,7 @@ gtk_plot_data_draw_gradient(GtkPlotData *data)
gtk_plot_pc_gsave(data->plot->pc);
- if(data->gradient->orientation == GTK_ORIENTATION_VERTICAL)
+ if(data->gradient->orientation == GTK_PLOT_AXIS_Y)
draw_gradient_vertical(data, data->gradient_x, data->gradient_y);
else
draw_gradient_horizontal(data, data->gradient_x, data->gradient_y);
@@ -3388,11 +3388,12 @@ draw_gradient_horizontal(GtkPlotData *data, gdouble px, gdouble py)
}
if(!data->gradient_custom){
- gint ncolors = (nmajor-1)*line_width;
gint cx;
gdouble h;
gint l;
+ ncolors = (nmajor-1)*line_width;
+
cx = x;
gtk_plot_pc_set_lineattr(plot->pc, 0, 0, 0, 0);
for(l = ncolors; l >= 0; l--){
@@ -3570,7 +3571,7 @@ gtk_plot_data_get_legend_size(GtkPlotData *data, gint *width, gint *height)
if(data->legend)
legend.text = data->legend;
else
- legend.text = "";
+ legend.text = (char *)"";
*height = 0;
*width = roundint(12 * m);
@@ -3720,7 +3721,7 @@ gtk_plot_data_set_gradient_size(GtkPlotData *data, gint size)
&twidth, &theight,
&tascent, &tdescent);
- if(data->gradient->orientation == GTK_ORIENTATION_VERTICAL){
+ if(data->gradient->orientation == GTK_PLOT_AXIS_Y){
gradient_height = 2*roundint(data->gradient_border_offset * m);
gradient_height += lheight;
@@ -3763,7 +3764,7 @@ gtk_plot_data_set_gradient_size(GtkPlotData *data, gint size)
}
}
- if(data->gradient->orientation == GTK_ORIENTATION_VERTICAL){
+ if(data->gradient->orientation == GTK_PLOT_AXIS_Y){
data->gradient_line_height = roundint((gdouble) (size - gradient_height) / (gdouble) (nlevels - 1) / m);
} else {
data->gradient_line_width = roundint((gdouble) (size - gradient_width) / (gdouble) (nlevels - 1) / m);
@@ -3853,7 +3854,7 @@ gtk_plot_data_get_gradient_size(GtkPlotData *data, gint *width, gint *height)
if(!data->gradient->ticks.values[n].minor) nmajor++;
}
- if(data->gradient->orientation == GTK_ORIENTATION_VERTICAL){
+ if(data->gradient->orientation == GTK_PLOT_AXIS_Y){
line_height = MAX(lheight, roundint(data->gradient_line_height * m));
gradient_height = (nmajor - 1) * line_height;
gradient_height += 2*roundint(data->gradient_border_offset * m);
@@ -4076,6 +4077,7 @@ gtk_plot_data_draw_symbol_private (GtkPlotData *data,
x,
MAX(py0,y));
break;
+ default: break;
}
/*
diff --git a/gtkextra/gtkplotdt.c b/gtkextra/gtkplotdt.c
index 3a4e0e07..42889617 100644
--- a/gtkextra/gtkplotdt.c
+++ b/gtkextra/gtkplotdt.c
@@ -40,8 +40,8 @@ typedef struct {
GtkPlotDTtriangle *t;
} GtkPlotDTedge;
-static void gtk_plot_dt_class_init (GtkPlotDTClass *klass);
-static void gtk_plot_dt_init (GtkPlotDT *data);
+static void gtk_plot_dt_class_init (GtkPlotDTClass *klass, gpointer unused);
+static void gtk_plot_dt_init (GtkPlotDT *data, gpointer unused);
static void gtk_plot_dt_destroy (GtkWidget *object);
static gboolean gtk_plot_dt_real_add_node (GtkPlotDT *dt,
GtkPlotDTnode node);
@@ -75,7 +75,7 @@ gtk_plot_dt_get_type (void)
}
static void
-gtk_plot_dt_class_init (GtkPlotDTClass *klass)
+gtk_plot_dt_class_init (GtkPlotDTClass *klass, gpointer unused)
{
GtkWidgetClass *object_class;
GtkPlotDTClass *dt_class;
@@ -144,7 +144,7 @@ gtk_plot_dt_new (gint num)
}
static void
-gtk_plot_dt_init (GtkPlotDT *data)
+gtk_plot_dt_init (GtkPlotDT *data, gpointer unused)
{
data->quadrilateral= TRUE;
data->subsampling= FALSE;
@@ -571,7 +571,7 @@ edges_equal(GtkPlotDTedge *e1, GtkPlotDTedge *e2)
static void
gtk_plot_dt_triangulate_insert_node(GtkPlotDT *data, GtkPlotDTnode *node)
{
- gint j,k,l, delinquentes;
+ gint j, k, l, m, n, delinquentes;
GtkPlotDTtriangle *t = NULL;
gdouble err, min;
GList *list = NULL, *doomed = NULL, *last = NULL, *new = NULL, *aux = NULL;
@@ -675,7 +675,6 @@ gtk_plot_dt_triangulate_insert_node(GtkPlotDT *data, GtkPlotDTnode *node)
if (edges_equal(&edges[j], &edges[k])) l++;
/* only one occurence of an edge indicates outline edge! */
if (l==1){
- GtkPlotDTtriangle *t;
t = gtk_plot_dt_add_triangle(data,node->id,edges[j].a,edges[j].b);
if(t) new = g_list_append(new, t);
}
@@ -686,10 +685,10 @@ gtk_plot_dt_triangulate_insert_node(GtkPlotDT *data, GtkPlotDTnode *node)
/* Find neighbours */
list = new;
while(list){
- GtkPlotDTtriangle *t = (GtkPlotDTtriangle *)list->data;
GtkPlotDTedge t_edges[3];
- gint l, m, n;
gboolean found = FALSE;
+
+ t = (GtkPlotDTtriangle *)list->data;
t_edges[0].a = t->a;
t_edges[0].b = t->b;
t_edges[1].a = t->b;
@@ -701,6 +700,7 @@ gtk_plot_dt_triangulate_insert_node(GtkPlotDT *data, GtkPlotDTnode *node)
while(aux){
GtkPlotDTedge nn[3];
GtkPlotDTtriangle *doomed_t = (GtkPlotDTtriangle *)aux->data;
+
/* for each doomed triangles I have 3 neighbours */
for(l = 0; l < 3; l++){
GtkPlotDTtriangle *doomed_nn = doomed_t->nn[l];
@@ -771,8 +771,9 @@ gtk_plot_dt_triangulate_insert_node(GtkPlotDT *data, GtkPlotDTnode *node)
*/
if(doomed){
for (list = doomed; list; list = list->next){
- GtkPlotDTtriangle *t = (GtkPlotDTtriangle *)list->data;
gint i;
+
+ t = (GtkPlotDTtriangle *)list->data;
if(t->nn[0]){
for(i = 0; i < 3; i++)
if(t->nn[0]->nn[i] == t) t->nn[0]->nn[i] = NULL;
@@ -1174,14 +1175,24 @@ gtk_plot_dt_triangulate_tryquad(GtkPlotDT *data)
t2 = gtk_plot_dt_add_triangle(data,-1-m,x1y0->id,x1y1->id);
t3 = gtk_plot_dt_add_triangle(data,-1-m,x1y1->id,x0y1->id);
t4 = gtk_plot_dt_add_triangle(data,-1-m,x0y1->id,x0y0->id);
- t1->nn[0] = t4;
- t1->nn[1] = t2;
- t2->nn[0] = t1;
- t2->nn[1] = t3;
- t3->nn[0] = t2;
- t3->nn[1] = t4;
- t4->nn[0] = t3;
- t4->nn[1] = t1;
+
+ /* possibly never null, but avoids warnings */
+ if (t1) {
+ t1->nn[0] = t4;
+ t1->nn[1] = t2;
+ }
+ if (t2) {
+ t2->nn[0] = t1;
+ t2->nn[1] = t3;
+ }
+ if (t3) {
+ t3->nn[0] = t2;
+ t3->nn[1] = t4;
+ }
+ if (t4) {
+ t4->nn[0] = t3;
+ t4->nn[1] = t1;
+ }
find_neighbor(data, t1, x0y0->id, x1y0->id);
find_neighbor(data, t2, x1y0->id, x1y1->id);
find_neighbor(data, t3, x1y1->id, x0y1->id);
diff --git a/gtkextra/gtkplotflux.c b/gtkextra/gtkplotflux.c
index a620381d..e68b4dca 100644
--- a/gtkextra/gtkplotflux.c
+++ b/gtkextra/gtkplotflux.c
@@ -37,8 +37,8 @@
#define P_(string) string
-static void gtk_plot_flux_class_init (GtkPlotFluxClass *klass);
-static void gtk_plot_flux_init (GtkPlotFlux *data);
+static void gtk_plot_flux_class_init (GtkPlotFluxClass *klass, gpointer unused);
+static void gtk_plot_flux_init (GtkPlotFlux *data, gpointer unused);
static void gtk_plot_flux_destroy (GtkWidget *data);
static void gtk_plot_flux_get_property (GObject *object,
guint prop_id,
@@ -106,7 +106,7 @@ gtk_plot_flux_get_type (void)
}
static void
-gtk_plot_flux_class_init (GtkPlotFluxClass *klass)
+gtk_plot_flux_class_init (GtkPlotFluxClass *klass, gpointer unused)
{
GtkWidgetClass *object_class;
GtkPlotDataClass *data_class;
@@ -272,7 +272,7 @@ gtk_plot_flux_class_init (GtkPlotFluxClass *klass)
static void
-gtk_plot_flux_init (GtkPlotFlux *dataset)
+gtk_plot_flux_init (GtkPlotFlux *dataset, gpointer unused)
{
GdkRGBA black;
GtkPlotArray *dim;
@@ -546,7 +546,7 @@ gtk_plot_flux_get_legend_size(GtkPlotData *data, gint *width, gint *height)
if(data->legend)
legend.text = data->legend;
else
- legend.text = "";
+ legend.text = (char *)"";
*width = *height = 0;
if(data->show_legend)
@@ -614,7 +614,7 @@ gtk_plot_flux_draw_legend(GtkPlotData *data, gint x, gint y)
if(data->legend)
legend.text = data->legend;
else
- legend.text = "";
+ legend.text = (char *)"";
gtk_plot_text_get_size(legend.text, legend.angle, legend.font,
roundint(legend.height * m),
diff --git a/gtkextra/gtkplotpc.c b/gtkextra/gtkplotpc.c
index f76f983c..fbff5cf4 100644
--- a/gtkextra/gtkplotpc.c
+++ b/gtkextra/gtkplotpc.c
@@ -37,8 +37,8 @@
#include "gtkpsfont.h"
#include "gtkplotcanvas.h"
-static void gtk_plot_pc_class_init (GtkPlotPCClass *klass);
-static void gtk_plot_pc_real_init (GtkPlotPC *pc);
+static void gtk_plot_pc_class_init (GtkPlotPCClass *klass, gpointer unused);
+static void gtk_plot_pc_real_init (GtkPlotPC *pc, gpointer unused);
static GtkWidgetClass *parent_class = NULL;
@@ -63,13 +63,13 @@ gtk_plot_pc_get_type (void)
}
static void
-gtk_plot_pc_class_init (GtkPlotPCClass *klass)
+gtk_plot_pc_class_init (GtkPlotPCClass *klass, gpointer unused)
{
parent_class = g_type_class_ref (gtk_widget_get_type ());
}
static void
-gtk_plot_pc_real_init (GtkPlotPC *pc)
+gtk_plot_pc_real_init (GtkPlotPC *pc, gpointer unused)
{
gdk_rgba_parse(&pc->color, "black");
diff --git a/gtkextra/gtkplotpixmap.c b/gtkextra/gtkplotpixmap.c
index c84abedc..48a980f6 100644
--- a/gtkextra/gtkplotpixmap.c
+++ b/gtkextra/gtkplotpixmap.c
@@ -45,8 +45,8 @@ enum {
ARG_MASK,
};
-static void gtk_plot_pixmap_class_init (GtkPlotPixmapClass *klass);
-static void gtk_plot_pixmap_init (GtkPlotPixmap *data);
+static void gtk_plot_pixmap_class_init (GtkPlotPixmapClass *klass, gpointer unused);
+static void gtk_plot_pixmap_init (GtkPlotPixmap *data, gpointer unused);
static void gtk_plot_pixmap_destroy (GtkWidget *object);
static void gtk_plot_pixmap_draw_symbol (GtkPlotData *data,
gdouble x,
@@ -98,7 +98,7 @@ gtk_plot_pixmap_get_type (void)
}
static void
-gtk_plot_pixmap_class_init (GtkPlotPixmapClass *klass)
+gtk_plot_pixmap_class_init (GtkPlotPixmapClass *klass, gpointer unused)
{
GtkWidgetClass *object_class;
GtkPlotDataClass *data_class;
@@ -179,7 +179,7 @@ gtk_plot_pixmap_set_property (GObject *object,
}
static void
-gtk_plot_pixmap_init (GtkPlotPixmap *dataset)
+gtk_plot_pixmap_init (GtkPlotPixmap *dataset, gpointer unused)
{
dataset->pixmap = NULL;
}
@@ -331,7 +331,7 @@ gtk_plot_pixmap_draw_legend(GtkPlotData *data, gint x, gint y)
if(data->legend)
legend.text = data->legend;
else
- legend.text = "";
+ legend.text = (char *)"";
legend.x = (gdouble)(area.x + x);
legend.y = (gdouble)(area.y + y);
@@ -390,7 +390,7 @@ gtk_plot_pixmap_get_legend_size(GtkPlotData *data, gint *width, gint *height)
if(data->legend)
legend.text = data->legend;
else
- legend.text = "";
+ legend.text = (char *)"";
pwidth = cairo_image_surface_get_width(pixmap->pixmap);
pheight = cairo_image_surface_get_height(pixmap->pixmap);
diff --git a/gtkextra/gtkplotpolar.c b/gtkextra/gtkplotpolar.c
index 9b114e72..a74e625b 100644
--- a/gtkextra/gtkplotpolar.c
+++ b/gtkextra/gtkplotpolar.c
@@ -42,8 +42,8 @@
#define PI 3.14159265358979323846
#endif
-static void gtk_plot_polar_class_init (GtkPlotPolarClass *klass);
-static void gtk_plot_polar_init (GtkPlotPolar *plot);
+static void gtk_plot_polar_class_init (GtkPlotPolarClass *klass, gpointer unused);
+static void gtk_plot_polar_init (GtkPlotPolar *plot, gpointer unused);
static void gtk_plot_polar_get_property (GObject *object,
guint prop_id,
GValue *value,
@@ -101,7 +101,7 @@ gtk_plot_polar_get_type (void)
}
static void
-gtk_plot_polar_class_init (GtkPlotPolarClass *klass)
+gtk_plot_polar_class_init (GtkPlotPolarClass *klass, gpointer unused)
{
GObjectClass *gobject_class;
GtkPlotClass *plot_class;
@@ -134,7 +134,7 @@ gtk_plot_polar_class_init (GtkPlotPolarClass *klass)
static void
-gtk_plot_polar_init (GtkPlotPolar *plot)
+gtk_plot_polar_init (GtkPlotPolar *plot, gpointer unused)
{
GTK_PLOT(plot)->legends_attr.transparent = FALSE;
diff --git a/gtkextra/gtkplotps.c b/gtkextra/gtkplotps.c
index ebe66fcd..62c43709 100644
--- a/gtkextra/gtkplotps.c
+++ b/gtkextra/gtkplotps.c
@@ -49,8 +49,8 @@
#include "gtkplotps.h"
-static void gtk_plot_ps_class_init (GtkPlotPSClass *klass);
-static void gtk_plot_ps_init (GtkPlotPS *ps);
+static void gtk_plot_ps_class_init (GtkPlotPSClass *klass, gpointer unused);
+static void gtk_plot_ps_init (GtkPlotPS *ps, gpointer unused);
static void gtk_plot_ps_destroy (GtkWidget *object);
/*********************************************************************/
/* Postscript specific functions */
@@ -153,7 +153,7 @@ gtk_plot_ps_get_type (void)
}
static void
-gtk_plot_ps_init (GtkPlotPS *ps)
+gtk_plot_ps_init (GtkPlotPS *ps, gpointer unused)
{
ps->psname = NULL;
ps->gsaved = FALSE;
@@ -162,7 +162,7 @@ gtk_plot_ps_init (GtkPlotPS *ps)
static void
-gtk_plot_ps_class_init (GtkPlotPSClass *klass)
+gtk_plot_ps_class_init (GtkPlotPSClass *klass, gpointer unused)
{
GtkWidgetClass *object_class;
GtkPlotPCClass *pc_class;
@@ -433,7 +433,7 @@ static void pssetlineattr (GtkPlotPC *pc,
FILE *psout = GTK_PLOT_PS(pc)->psfile;
fprintf(psout, "%g slw\n", line_width);
- fprintf(psout, "%d slc\n", abs(cap_style - 1));
+ fprintf(psout, "%d slc\n", abs(((int)cap_style) - 1));
fprintf(psout, "%d slj\n", join_style);
if(line_style == 0)
@@ -840,7 +840,7 @@ psoutputstring (GtkPlotPC *pc,
gint code; /* 0..neither 1..latin 2..i18n */
gchar wcs[2];
while (*p) {
- code = (*p >= 0 && *p <= 0x7f) ? 1 : 2;
+ code = (*p >= 0) ? 1 : 2;
if (curcode && curcode != code)
fprintf(out, "%c %s\n", end[curcode], addstring);
if (curcode != code) {
@@ -967,6 +967,7 @@ psdrawstring (GtkPlotPC *pc,
tx + width + border_space,
ty - border_space + shadow_width,
shadow_width, height + 2 * border_space);
+ /* FALLTHRU */
case GTK_PLOT_BORDER_LINE:
psdrawrectangle(pc,
FALSE,
diff --git a/gtkextra/gtkplotsurface.c b/gtkextra/gtkplotsurface.c
index b05b50f3..7334661a 100644
--- a/gtkextra/gtkplotsurface.c
+++ b/gtkextra/gtkplotsurface.c
@@ -39,8 +39,8 @@
#define P_(string) string
-static void gtk_plot_surface_class_init (GtkPlotSurfaceClass *klass);
-static void gtk_plot_surface_init (GtkPlotSurface *data);
+static void gtk_plot_surface_class_init (GtkPlotSurfaceClass *klass, gpointer unused);
+static void gtk_plot_surface_init (GtkPlotSurface *data, gpointer unused);
static void gtk_plot_surface_destroy (GtkWidget *object);
static void gtk_plot_surface_get_property (GObject *object,
guint prop_id,
@@ -140,7 +140,7 @@ gtk_plot_surface_get_type (void)
}
static void
-gtk_plot_surface_class_init (GtkPlotSurfaceClass *klass)
+gtk_plot_surface_class_init (GtkPlotSurfaceClass *klass, gpointer unused)
{
GtkWidgetClass *object_class;
GtkPlotDataClass *data_class;
@@ -583,7 +583,7 @@ gtk_plot_surface_add_to_plot (GtkPlotData *data, GtkPlot *plot)
}
static void
-gtk_plot_surface_init (GtkPlotSurface *dataset)
+gtk_plot_surface_init (GtkPlotSurface *dataset, gpointer unused)
{
GdkRGBA color;
GtkPlotArray *dim;
@@ -940,7 +940,7 @@ gtk_plot_surface_get_legend_size(GtkPlotData *data, gint *width, gint *height)
if(data->legend && data->legend[0] != '\0')
legend.text = data->legend;
else
- legend.text = "X";
+ legend.text = (char *)"X";
*height = 0;
*width = roundint(16*m);
@@ -989,7 +989,7 @@ gtk_plot_surface_draw_legend(GtkPlotData *data, gint x, gint y)
if(data->legend && data->legend[0] != '\0')
legend.text = data->legend;
else
- legend.text = "X";
+ legend.text = (char *)"X";
gtk_plot_text_get_size(legend.text, legend.angle, legend.font,
roundint(legend.height * m),
diff --git a/gtkextra/gtkpsfont.c b/gtkextra/gtkpsfont.c
index 772e7d5a..35d431ad 100644
--- a/gtkextra/gtkpsfont.c
+++ b/gtkextra/gtkpsfont.c
@@ -45,6 +45,11 @@
#define FONTCACHE_SIZE 17
#define NUM_X11_FONTS 2
+
+#if defined __GNUC__ && 7 <= __GNUC__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
+#endif
static GtkPSFont font_data[] =
{
{ "Times-Roman",
@@ -293,6 +298,9 @@ static GtkPSFont font_data[] =
FALSE, FALSE
},
};
+#if defined __GNUC__ && 7 <= __GNUC__
+# pragma GCC diagnostic pop
+#endif
#define NUM_FONTS (sizeof(font_data)/sizeof(GtkPSFont))
diff --git a/help/C/figures/genius_window.png b/help/C/figures/genius_window.png
index b1cd161a..e5e5b347 100644
Binary files a/help/C/figures/genius_window.png and b/help/C/figures/genius_window.png differ
diff --git a/help/C/figures/line_plot.png b/help/C/figures/line_plot.png
index 94e09ae4..3571f7e6 100644
Binary files a/help/C/figures/line_plot.png and b/help/C/figures/line_plot.png differ
diff --git a/help/C/figures/line_plot_graph.png b/help/C/figures/line_plot_graph.png
index fe472a67..71e99cc4 100644
Binary files a/help/C/figures/line_plot_graph.png and b/help/C/figures/line_plot_graph.png differ
diff --git a/help/C/figures/parametric.png b/help/C/figures/parametric.png
index e6f2e673..ad931d9c 100644
Binary files a/help/C/figures/parametric.png and b/help/C/figures/parametric.png differ
diff --git a/help/C/figures/parametric_graph.png b/help/C/figures/parametric_graph.png
index 0b938519..601ced64 100644
Binary files a/help/C/figures/parametric_graph.png and b/help/C/figures/parametric_graph.png differ
diff --git a/help/C/figures/surface_graph.png b/help/C/figures/surface_graph.png
index 7f8620b2..b1a624a1 100644
Binary files a/help/C/figures/surface_graph.png and b/help/C/figures/surface_graph.png differ
diff --git a/help/C/genius.xml b/help/C/genius.xml
index dd730b56..84afcdb3 100644
--- a/help/C/genius.xml
+++ b/help/C/genius.xml
@@ -3,8 +3,8 @@
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY app "<application>Genius Mathematics Tool</application>">
<!ENTITY appname "Genius">
- <!ENTITY appversion "1.0.22">
- <!ENTITY date "September 2016">
+ <!ENTITY appversion "1.0.26">
+ <!ENTITY date "December 2020">
<!ENTITY legal SYSTEM "legal.xml">
@@ -37,7 +37,7 @@
<title>&appname; Manual</title>
<copyright>
- <year>1997-2016</year>
+ <year>1997-2020</year>
<holder>Jiří (George) Lebl</holder>
</copyright>
<copyright>
@@ -171,31 +171,34 @@
<title>Introduction</title>
<para>
The &app; application is a general calculator for use as a desktop
- calculator, an educational tool in mathematics, and is useful even for
- research. The language used in &app; is designed to be
+ calculator, an educational tool in mathematics and other STEM fields,
+ and has found use in research. The language used in &app; is designed to be
‘mathematical’ in the sense that it should be ‘what
- you mean is what you get’. Of course that is not an
+ you mean is what you get’. Of course, that is not an
entirely attainable goal. &app; features rationals, arbitrary
precision integers and multiple precision floats using the GMP library.
It handles complex numbers using cartesian notation. It has good
vector and matrix manipulation and can handle basic linear algebra.
- The programming language allows user defined functions, variables and
- modification of parameters.
+ The programming language allows user defined functions, variables, and
+ parameters.
</para>
<para>
&app; comes in two versions. One version is the graphical GNOME
version, which features an IDE style interface and the ability
- to plot functions of one or two variables.
- The command line version does not require GNOME, but of course
- does not implement any feature that requires the graphical interface.
+ to plot functions of one or two variables. Parametric plots of curves
+ are also supported. It can plot slope fields,
+ vector fields and draw their solutions. The plots can be exported
+ to several formats.
+ The command line version does not require GNOME, but
+ does not implement any feature that requires the graphical interface,
+ such as plotting
</para>
<para>
- Parts of this manual describe the graphical version of the calculator,
- but the language is of course the same. The command line only version
- lacks the graphing capabilities and all other capabilities that require
- the graphical user interface.
+ Parts of this manual describe the graphical version of the calculator.
+ The language that both versions use is the same, it is simply the
+ graphical features such as plotting that are unique to the GUI version.
</para>
<para>
@@ -531,7 +534,8 @@ See <xref linkend="lineplot-fig"/>.
parse the input it will signify this with a warning icon on the right of the text
input box where the error occurred, as well as giving you an error dialog.
You can change the ranges of the dependent and independent variables in the bottom
- part of the dialog.
+ part of the dialog. In the boxes for the ranges, simple expressions are allowed,
+ such as <userinput>2*pi</userinput> or <userinput>10^3</userinput>.
The <varname>y</varname> (dependent) range can be set automatically by turning on the <guilabel>Fit
dependent axis</guilabel>
checkbox.
The names of the variables can also be changed.
@@ -1206,13 +1210,13 @@ will be too large), while
everything modulo 6 to begin with.
</para>
<para>
-You can calculate the inverses of numbers mod some integer by just using
-rational numbers (of course the inverse has to exist).
+ The inverses of numbers mod some integer are computed by writing them as
+rational numbers (as long as the desired inverse exists, of course).
Examples:
<programlisting>10^-1 mod 101
1/10 mod 101</programlisting>
-You can also do modular evaluation with matrices including taking inverses,
-powers and dividing.
+Modular evaluation also works with matrices including taking inverses,
+powers, and dividing.
Example:
<programlisting>A = [1,2;3,4]
B = A^-1 mod 5
@@ -2390,7 +2394,7 @@ could use the following code.
you press return on the command line. Therefore think of programs
as just a sequence of lines as if they were entered on the command line.
In particular, you do not need to enter the separator at the end of the
- line (unless it is of course part of several statements inside
+ line (unless it is part of several statements inside
parentheses). When a statement does not end with a separator on the
top level, the result is printed after being executed.
</para>
@@ -2599,7 +2603,7 @@ f(r,1)
<para>
If all variables are to be created as locals you can just pass an
asterisk instead of a list of variables. In this case the variables
- will not be initialized until they are actually set of course.
+ will not be initialized until they are actually set.
So the following definition of <function>f</function>
will also work:
<programlisting>function f(g,x) = (
@@ -2905,7 +2909,7 @@ should use the
<screen><prompt>genius> </prompt><userinput>IsIn (1, [0,1,2])</userinput>
= true
</screen>
- The input <userinput>IsIn(x,X)</userinput> is of course equivalent to
+ The input <userinput>IsIn(x,X)</userinput> is equivalent to
<userinput>IsSubset([x],X)</userinput>. Note that since the empty set is a subset
of every set, <userinput>IsSubset(null,X)</userinput> is always true.
</para>
@@ -4763,7 +4767,7 @@ number is specified) of the given size returned. For example,
divides <varname>n</varname>. If <varname>d</varname>
does not divide <varname>n</varname> then this function returns
garbage. This is a lot faster for very large numbers
- than the operation <userinput>n/d</userinput>, but of course only
+ than the operation <userinput>n/d</userinput>, but it is only
useful if you know that the division is exact.
</para>
</listitem>
@@ -4796,9 +4800,9 @@ number is specified) of the given size returned. For example,
<para>
Return all factors of <varname>n</varname> in a vector. This
includes all the non-prime factors as well. It includes 1 and the
- number itself. So for example to print all the perfect numbers
+ number itself. So to print all the perfect numbers
(those that are sums of their factors) up to the number 1000 you
- could do (this is of course very inefficient)
+ could do (this is clearly very inefficient)
<programlisting>for n=1 to 1000 do (
if MatrixSum (Factors(n)) == 2*n then
print(n)
@@ -4943,7 +4947,7 @@ precalculated and returned in the second column.</para>
<synopsis>IsPerfectSquare (n)</synopsis>
<para>
Check an integer for being a perfect square of an integer. The number must
- be an integer. Negative integers are of course never perfect
+ be an integer. Negative integers are never perfect
squares of integers.
</para>
</listitem>
@@ -6723,7 +6727,7 @@ function of two arguments or it can be a matrix giving a sesquilinear form.
<para>Return the Toeplitz matrix constructed given the first column c
and (optionally) the first row r. If only the column c is given then it is
conjugated and the nonconjugated version is used for the first row to give a
-Hermitian matrix (if the first element is real of course).</para>
+Hermitian matrix (if the first element is real).</para>
<para>
See
<ulink url="https://en.wikipedia.org/wiki/Toeplitz_matrix">Wikipedia</ulink> or
diff --git a/src/gnome-genius.c b/src/gnome-genius.c
index fe6c456a..6a8d6ce1 100644
--- a/src/gnome-genius.c
+++ b/src/gnome-genius.c
@@ -200,7 +200,7 @@ static char *default_console_font = NULL;
pid_t helper_pid = -1;
static FILE *torlfp = NULL;
-static int fromrl;
+static int fromrl = -1;
static char *torlfifo = NULL;
static char *fromrlfifo = NULL;
@@ -4658,7 +4658,10 @@ get_new_line (GIOChannel *source, GIOCondition condition, gpointer data)
vte_terminal_feed (VTE_TERMINAL (term), str, -1);
g_free (str);
close (fromrl);
+ fromrl = -1;
fclose (torlfp);
+ torlfp = NULL;
+
fork_helper_setup_comm ();
start_cb_p_expression (genius_got_etree, torlfp);
return FALSE;
@@ -5387,8 +5390,12 @@ main (int argc, char *argv[])
gtk_source_init ();
#endif
+ /* I sort of doubt we can do the uniqueness thing sanely right now,
+ * there is too much global stuff happening to sanely run two
+ * windows from one process */
genius_app = gtk_application_new ("org.gnome.genius",
- G_APPLICATION_HANDLES_OPEN);
+ G_APPLICATION_HANDLES_OPEN |
+ G_APPLICATION_NON_UNIQUE);
g_signal_connect (genius_app, "startup", G_CALLBACK (startup), NULL);
g_signal_connect (genius_app, "activate", G_CALLBACK (activate), NULL);
g_signal_connect (genius_app, "open",
@@ -5403,23 +5410,30 @@ main (int argc, char *argv[])
genius_app = NULL;
g_clear_object (&info_store);
- /*
- * Save properties and plugins
- */
- set_properties ();
- gel_save_plugins ();
-
- close (fromrl);
- fclose (torlfp);
-
- unlink (fromrlfifo);
- unlink (torlfifo);
-
- /* remove old preferences to avoid confusion, by now things should be set in the new file */
- name = g_build_filename (g_get_home_dir (), ".gnome2", "genius", NULL);
- if (access (name, F_OK) == 0)
- unlink (name);
- g_free (name);
+ /* if we actually started up */
+ if (genius_datadir != NULL) {
+ /*
+ * Save properties and plugins
+ */
+ set_properties ();
+ gel_save_plugins ();
+
+ if (fromrl >= 0)
+ close (fromrl);
+ if (torlfp != NULL)
+ fclose (torlfp);
+
+ if (fromrlfifo != NULL)
+ unlink (fromrlfifo);
+ if (torlfifo != NULL)
+ unlink (torlfifo);
+
+ /* remove old preferences to avoid confusion, by now things should be set in the new file */
+ name = g_build_filename (g_get_home_dir (), ".gnome2", "genius", NULL);
+ if (access (name, F_OK) == 0)
+ unlink (name);
+ g_free (name);
+ }
return status;
}
diff --git a/ve/.gitignore b/ve/.gitignore
index 3241e0ca..0b294574 100644
--- a/ve/.gitignore
+++ b/ve/.gitignore
@@ -1,6 +1,7 @@
Makefile
Makefile.in
.deps
+tags
*.o
*.a
test-ve-config
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]