From: John Darrington Date: Wed, 10 Dec 2008 08:36:06 +0000 (+0900) Subject: Fix some warnings X-Git-Tag: v0.7.1~46 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a6cded0d3a48627d4209c6334191e483700f528;p=pspp-builds.git Fix some warnings --- diff --git a/lib/gtksheet/gtksheet.c b/lib/gtksheet/gtksheet.c index 7569eefe..609a81f5 100644 --- a/lib/gtksheet/gtksheet.c +++ b/lib/gtksheet/gtksheet.c @@ -1099,6 +1099,10 @@ static void redraw_range (GtkSheet *sheet, GtkSheetRange *range) { GdkRectangle rect; + + if ( ! GTK_WIDGET_REALIZED (sheet)) + return; + if ( NULL != range ) rectangle_from_range (sheet, range, &rect); else diff --git a/lib/gtksheet/psppire-axis-impl.c b/lib/gtksheet/psppire-axis-impl.c index 619e8238..1fb00d2d 100644 --- a/lib/gtksheet/psppire-axis-impl.c +++ b/lib/gtksheet/psppire-axis-impl.c @@ -331,12 +331,10 @@ psppire_axis_impl_insert (PsppireAxisImpl *a, gint posn, gint size) struct axis_node *before = NULL; struct axis_node *new_node; - g_return_if_fail ( posn < tower_height (&a->unit_tower)); g_return_if_fail ( posn >= 0); + g_return_if_fail ( posn <= tower_height (&a->unit_tower)); - new_node = pool_malloc (a->pool, sizeof (*new_node)); - - if ( posn > 0) + if ( posn < tower_height (&a->unit_tower)) { unsigned long int start = 0; struct tower_node *n; @@ -349,6 +347,8 @@ psppire_axis_impl_insert (PsppireAxisImpl *a, gint posn, gint size) before = tower_data (n, struct axis_node, unit_node); } + new_node = pool_malloc (a->pool, sizeof (*new_node)); + tower_insert (&a->unit_tower, 1, &new_node->unit_node, @@ -437,12 +437,13 @@ psppire_axis_impl_delete (PsppireAxisImpl *a, gint first, gint n_units) { gint units_to_delete = n_units; unsigned long int start; + struct tower_node *unit_node ; g_return_if_fail (first + n_units < tower_height (&a->unit_tower)); split (a, first); split (a, first + n_units); - struct tower_node *unit_node = tower_lookup (&a->unit_tower, first, &start); + unit_node = tower_lookup (&a->unit_tower, first, &start); g_assert (start == first); while (units_to_delete > 0)