From 20a870a6e068c852ce37c3bb072ee6e3ef11527a Mon Sep 17 00:00:00 2001 From: Darin Adler Date: Sat, 15 Dec 2001 17:17:56 +0000 Subject: [PATCH] Fix some warnings. * gdk/x11/gdkproperty-x11.c: (gdk_property_get): Fix wrong type in g_new -- bug if sizeof (GtkAtom) != sizeof (GtkAtom *). * gdk/x11/gdkwindow-x11.c: (create_moveresize_window): FALSE -> NULL * gtk/gtkaccellabel.c: (gtk_accel_label_refetch): Remove unused local. * gtk/gtklistitem.c: (gtk_list_item_expose): Remove unused local. * gtk/gtktextiter.c: (_gtk_text_iter_backward_indexable_segment): Restructure loop to get rid of uninitialized variable warning. Also gives a tiny efficiency gain. --- ChangeLog | 13 +++++++++++++ ChangeLog.pre-2-0 | 13 +++++++++++++ ChangeLog.pre-2-10 | 13 +++++++++++++ ChangeLog.pre-2-2 | 13 +++++++++++++ ChangeLog.pre-2-4 | 13 +++++++++++++ ChangeLog.pre-2-6 | 13 +++++++++++++ ChangeLog.pre-2-8 | 13 +++++++++++++ gdk/x11/gdkproperty-x11.c | 2 +- gdk/x11/gdkwindow-x11.c | 2 +- gtk/gtkaccellabel.c | 1 - gtk/gtklistitem.c | 1 - gtk/gtktextiter.c | 3 ++- 12 files changed, 95 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb168ecd2e..72748c64e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2001-12-15 Darin Adler + + Fix some warnings. + + * gdk/x11/gdkproperty-x11.c: (gdk_property_get): Fix wrong type in + g_new -- bug if sizeof (GtkAtom) != sizeof (GtkAtom *). + * gdk/x11/gdkwindow-x11.c: (create_moveresize_window): FALSE -> NULL + * gtk/gtkaccellabel.c: (gtk_accel_label_refetch): Remove unused local. + * gtk/gtklistitem.c: (gtk_list_item_expose): Remove unused local. + * gtk/gtktextiter.c: (_gtk_text_iter_backward_indexable_segment): + Restructure loop to get rid of uninitialized variable warning. Also + gives a tiny efficiency gain. + 2001-12-15 Murray Cumming * Fixed first arg type of GtkScale's "format_value" signal's diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index bb168ecd2e..72748c64e4 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,16 @@ +2001-12-15 Darin Adler + + Fix some warnings. + + * gdk/x11/gdkproperty-x11.c: (gdk_property_get): Fix wrong type in + g_new -- bug if sizeof (GtkAtom) != sizeof (GtkAtom *). + * gdk/x11/gdkwindow-x11.c: (create_moveresize_window): FALSE -> NULL + * gtk/gtkaccellabel.c: (gtk_accel_label_refetch): Remove unused local. + * gtk/gtklistitem.c: (gtk_list_item_expose): Remove unused local. + * gtk/gtktextiter.c: (_gtk_text_iter_backward_indexable_segment): + Restructure loop to get rid of uninitialized variable warning. Also + gives a tiny efficiency gain. + 2001-12-15 Murray Cumming * Fixed first arg type of GtkScale's "format_value" signal's diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index bb168ecd2e..72748c64e4 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +2001-12-15 Darin Adler + + Fix some warnings. + + * gdk/x11/gdkproperty-x11.c: (gdk_property_get): Fix wrong type in + g_new -- bug if sizeof (GtkAtom) != sizeof (GtkAtom *). + * gdk/x11/gdkwindow-x11.c: (create_moveresize_window): FALSE -> NULL + * gtk/gtkaccellabel.c: (gtk_accel_label_refetch): Remove unused local. + * gtk/gtklistitem.c: (gtk_list_item_expose): Remove unused local. + * gtk/gtktextiter.c: (_gtk_text_iter_backward_indexable_segment): + Restructure loop to get rid of uninitialized variable warning. Also + gives a tiny efficiency gain. + 2001-12-15 Murray Cumming * Fixed first arg type of GtkScale's "format_value" signal's diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index bb168ecd2e..72748c64e4 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,16 @@ +2001-12-15 Darin Adler + + Fix some warnings. + + * gdk/x11/gdkproperty-x11.c: (gdk_property_get): Fix wrong type in + g_new -- bug if sizeof (GtkAtom) != sizeof (GtkAtom *). + * gdk/x11/gdkwindow-x11.c: (create_moveresize_window): FALSE -> NULL + * gtk/gtkaccellabel.c: (gtk_accel_label_refetch): Remove unused local. + * gtk/gtklistitem.c: (gtk_list_item_expose): Remove unused local. + * gtk/gtktextiter.c: (_gtk_text_iter_backward_indexable_segment): + Restructure loop to get rid of uninitialized variable warning. Also + gives a tiny efficiency gain. + 2001-12-15 Murray Cumming * Fixed first arg type of GtkScale's "format_value" signal's diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index bb168ecd2e..72748c64e4 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +2001-12-15 Darin Adler + + Fix some warnings. + + * gdk/x11/gdkproperty-x11.c: (gdk_property_get): Fix wrong type in + g_new -- bug if sizeof (GtkAtom) != sizeof (GtkAtom *). + * gdk/x11/gdkwindow-x11.c: (create_moveresize_window): FALSE -> NULL + * gtk/gtkaccellabel.c: (gtk_accel_label_refetch): Remove unused local. + * gtk/gtklistitem.c: (gtk_list_item_expose): Remove unused local. + * gtk/gtktextiter.c: (_gtk_text_iter_backward_indexable_segment): + Restructure loop to get rid of uninitialized variable warning. Also + gives a tiny efficiency gain. + 2001-12-15 Murray Cumming * Fixed first arg type of GtkScale's "format_value" signal's diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index bb168ecd2e..72748c64e4 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +2001-12-15 Darin Adler + + Fix some warnings. + + * gdk/x11/gdkproperty-x11.c: (gdk_property_get): Fix wrong type in + g_new -- bug if sizeof (GtkAtom) != sizeof (GtkAtom *). + * gdk/x11/gdkwindow-x11.c: (create_moveresize_window): FALSE -> NULL + * gtk/gtkaccellabel.c: (gtk_accel_label_refetch): Remove unused local. + * gtk/gtklistitem.c: (gtk_list_item_expose): Remove unused local. + * gtk/gtktextiter.c: (_gtk_text_iter_backward_indexable_segment): + Restructure loop to get rid of uninitialized variable warning. Also + gives a tiny efficiency gain. + 2001-12-15 Murray Cumming * Fixed first arg type of GtkScale's "format_value" signal's diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index bb168ecd2e..72748c64e4 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +2001-12-15 Darin Adler + + Fix some warnings. + + * gdk/x11/gdkproperty-x11.c: (gdk_property_get): Fix wrong type in + g_new -- bug if sizeof (GtkAtom) != sizeof (GtkAtom *). + * gdk/x11/gdkwindow-x11.c: (create_moveresize_window): FALSE -> NULL + * gtk/gtkaccellabel.c: (gtk_accel_label_refetch): Remove unused local. + * gtk/gtklistitem.c: (gtk_list_item_expose): Remove unused local. + * gtk/gtktextiter.c: (_gtk_text_iter_backward_indexable_segment): + Restructure loop to get rid of uninitialized variable warning. Also + gives a tiny efficiency gain. + 2001-12-15 Murray Cumming * Fixed first arg type of GtkScale's "format_value" signal's diff --git a/gdk/x11/gdkproperty-x11.c b/gdk/x11/gdkproperty-x11.c index 8eab3f4153..9a0f8e7c5c 100644 --- a/gdk/x11/gdkproperty-x11.c +++ b/gdk/x11/gdkproperty-x11.c @@ -388,7 +388,7 @@ gdk_property_get (GdkWindow *window, * to an array of GDK Atoms */ gint i; - GdkAtom *ret_atoms = g_new (GdkAtom *, ret_nitems); + GdkAtom *ret_atoms = g_new (GdkAtom, ret_nitems); Atom *xatoms = (Atom *)ret_data; data = (guchar *)ret_atoms; diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index 1c8c19bac7..3c5d2ee408 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -4397,7 +4397,7 @@ create_moveresize_window (guint32 timestamp) FALSE, GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK, - FALSE, + NULL, NULL, timestamp); diff --git a/gtk/gtkaccellabel.c b/gtk/gtkaccellabel.c index 3c25864404..745ceca639 100644 --- a/gtk/gtkaccellabel.c +++ b/gtk/gtkaccellabel.c @@ -484,7 +484,6 @@ gboolean gtk_accel_label_refetch (GtkAccelLabel *accel_label) { GtkAccelLabelClass *class; - gchar *utf8; g_return_val_if_fail (GTK_IS_ACCEL_LABEL (accel_label), FALSE); diff --git a/gtk/gtklistitem.c b/gtk/gtklistitem.c index 952649f9fe..b919361173 100644 --- a/gtk/gtklistitem.c +++ b/gtk/gtklistitem.c @@ -539,7 +539,6 @@ gtk_list_item_expose (GtkWidget *widget, GdkEventExpose *event) { GtkBin *bin; - gint focus_width; g_return_val_if_fail (widget != NULL, FALSE); diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c index a7e685fbc5..7ad71577a8 100644 --- a/gtk/gtktextiter.c +++ b/gtk/gtktextiter.c @@ -2109,7 +2109,7 @@ _gtk_text_iter_backward_indexable_segment (GtkTextIter *iter) * segment just before our current segment. */ g_assert (seg != real->segment); - while (seg != real->segment) + do { prev_seg = seg; prev_any_seg = any_seg; @@ -2119,6 +2119,7 @@ _gtk_text_iter_backward_indexable_segment (GtkTextIter *iter) while (seg->char_count == 0) seg = seg->next; } + while (seg != real->segment); g_assert (prev_seg != NULL); g_assert (prev_any_seg != NULL);