[PATCH] Gtk+ warnings cleanup
- From: Jeff Garzik <jgarzik pobox com>
- To: gtk-devel-list redhat com
- Subject: [PATCH] Gtk+ warnings cleanup
- Date: Wed, 23 Dec 1998 21:11:26 -0500 (EST)
Below are several small changes that are [IMHO] correct fixes for
several warnings that crop up during compilation. Please point out
any problems you see. I will commit without objections.
Particularly look at my change to the logic in gtkfontsel.c
(gtk_font_selection_select_best_style), and make sure the best_row logic
is correct -- both my change, and in general.
Thanks,
Jeff
ChangeLog entry:
Wed Dec 23 20:44:41 1998 Jeff Garzik <jgarzik@pobox.com>
* docs/Makefile.am: removed stray backslash
* gdk/gdkfont.c: removed unused var
* gdk/gdkim.c: 64-bit cast
* gtk/gtkaccelgroup.c: point to const data
* gtk/gtkdnd.[ch]: (gtk_drag_dest_set, gtk_drag_source_set):
Made const-correct.
* gtk/gtkfontsel.c: kill uninitialized var warning
* gtk/gtkselection.[ch]: (gtk_target_list_new,
gtk_target_list_add_table, gtk_selection_add_targets):
Made const-correct.
* gtk/testgtk.c: 64-bit cast
Index: docs/Makefile.am
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/docs/Makefile.am,v
retrieving revision 1.12
diff -u -r1.12 Makefile.am
--- Makefile.am 1998/12/23 16:24:03 1.12
+++ Makefile.am 1998/12/24 01:41:49
@@ -99,7 +99,7 @@
html/gtkfaq-5.html \
html/gtkfaq-6.html \
html/gtkfaq-7.html \
- text/gtkfaq.txt \
+ text/gtkfaq.txt
EXTRA_DIST = \
texinfo.tex \
Index: gdk/gdkfont.c
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gdk/gdkfont.c,v
retrieving revision 1.12
diff -u -r1.12 gdkfont.c
--- gdkfont.c 1998/12/15 20:30:48 1.12
+++ gdkfont.c 1998/12/24 01:41:57
@@ -521,7 +521,6 @@
int direction;
int font_ascent;
int font_descent;
- gint i;
g_return_if_fail (font != NULL);
g_return_if_fail (text != NULL);
Index: gdk/gdkim.c
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gdk/gdkim.c,v
retrieving revision 1.6
diff -u -r1.6 gdkim.c
--- gdkim.c 1998/12/17 16:13:20 1.6
+++ gdkim.c 1998/12/24 01:42:02
@@ -731,7 +731,7 @@
if (mask & GDK_IC_LINE_SPACING)
{
arg->name = XNLineSpace;
- arg->value = (gpointer) attr->line_spacing;
+ arg->value = GINT_TO_POINTER( attr->line_spacing );
if (XSetICValues (xic, XNPreeditAttributes, arg, NULL))
error |= GDK_IC_LINE_SPACING;
Index: gtk/gtkaccelgroup.c
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkaccelgroup.c,v
retrieving revision 1.12
diff -u -r1.12 gtkaccelgroup.c
--- gtkaccelgroup.c 1998/11/30 19:05:09 1.12
+++ gtkaccelgroup.c 1998/12/24 01:42:06
@@ -716,7 +716,7 @@
GDK_Terminate_Server, GDK_AudibleBell_Enable,
0
};
- guint *ac_val;
+ const guint *ac_val;
modifiers &= GDK_MODIFIER_MASK;
Index: gtk/gtkdnd.c
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkdnd.c,v
retrieving revision 1.20
diff -u -r1.20 gtkdnd.c
--- gtkdnd.c 1998/12/22 22:00:43 1.20
+++ gtkdnd.c 1998/12/24 01:42:17
@@ -698,11 +698,11 @@
*************************************************************/
void
-gtk_drag_dest_set (GtkWidget *widget,
- GtkDestDefaults flags,
- GtkTargetEntry *targets,
- gint n_targets,
- GdkDragAction actions)
+gtk_drag_dest_set (GtkWidget *widget,
+ GtkDestDefaults flags,
+ const GtkTargetEntry *targets,
+ gint n_targets,
+ GdkDragAction actions)
{
GtkDragDestSite *site;
@@ -1571,11 +1571,11 @@
*************************************************************/
void
-gtk_drag_source_set (GtkWidget *widget,
- GdkModifierType start_button_mask,
- GtkTargetEntry *targets,
- gint n_targets,
- GdkDragAction actions)
+gtk_drag_source_set (GtkWidget *widget,
+ GdkModifierType start_button_mask,
+ const GtkTargetEntry *targets,
+ gint n_targets,
+ GdkDragAction actions)
{
GtkDragSourceSite *site;
Index: gtk/gtkdnd.h
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkdnd.h,v
retrieving revision 1.5
diff -u -r1.5 gtkdnd.h
--- gtkdnd.h 1998/12/11 02:48:40 1.5
+++ gtkdnd.h 1998/12/24 01:42:18
@@ -58,11 +58,11 @@
void gtk_drag_highlight (GtkWidget *widget);
void gtk_drag_unhighlight (GtkWidget *widget);
-void gtk_drag_dest_set (GtkWidget *widget,
- GtkDestDefaults flags,
- GtkTargetEntry *targets,
- gint n_targets,
- GdkDragAction actions);
+void gtk_drag_dest_set (GtkWidget *widget,
+ GtkDestDefaults flags,
+ const GtkTargetEntry *targets,
+ gint n_targets,
+ GdkDragAction actions);
void gtk_drag_dest_set_proxy (GtkWidget *widget,
GdkWindow *proxy_window,
@@ -77,11 +77,11 @@
/* Source side */
-void gtk_drag_source_set (GtkWidget *widget,
- GdkModifierType start_button_mask,
- GtkTargetEntry *targets,
- gint n_targets,
- GdkDragAction actions);
+void gtk_drag_source_set (GtkWidget *widget,
+ GdkModifierType start_button_mask,
+ const GtkTargetEntry *targets,
+ gint n_targets,
+ GdkDragAction actions);
void gtk_drag_source_unset (GtkWidget *widget);
Index: gtk/gtkfontsel.c
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkfontsel.c,v
retrieving revision 1.17
diff -u -r1.17 gtkfontsel.c
--- gtkfontsel.c 1998/12/18 01:32:19 1.17
+++ gtkfontsel.c 1998/12/24 01:42:41
@@ -1264,7 +1264,7 @@
FontInfo *font;
FontStyle *styles;
gint row, prop, style, matched;
- gint best_matched = -1, best_style = -1, best_row;
+ gint best_matched = -1, best_style = -1, best_row = -1;
#ifdef FONTSEL_DEBUG
g_message("In select_best_style\n");
@@ -1301,6 +1301,7 @@
}
}
g_return_if_fail (best_style != -1);
+ g_return_if_fail (best_row != -1);
fontsel->style = best_style;
Index: gtk/gtkselection.c
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkselection.c,v
retrieving revision 1.19
diff -u -r1.19 gtkselection.c
--- gtkselection.c 1998/12/16 20:09:20 1.19
+++ gtkselection.c 1998/12/24 01:42:47
@@ -151,8 +151,8 @@
*/
GtkTargetList *
-gtk_target_list_new (GtkTargetEntry *targets,
- guint ntargets)
+gtk_target_list_new (const GtkTargetEntry *targets,
+ guint ntargets)
{
GtkTargetList *result = g_new (GtkTargetList, 1);
result->list = NULL;
@@ -206,9 +206,9 @@
}
void
-gtk_target_list_add_table (GtkTargetList *list,
- GtkTargetEntry *targets,
- guint ntargets)
+gtk_target_list_add_table (GtkTargetList *list,
+ const GtkTargetEntry *targets,
+ guint ntargets)
{
gint i;
@@ -461,10 +461,10 @@
}
void
-gtk_selection_add_targets (GtkWidget *widget,
- GdkAtom selection,
- GtkTargetEntry *targets,
- guint ntargets)
+gtk_selection_add_targets (GtkWidget *widget,
+ GdkAtom selection,
+ const GtkTargetEntry *targets,
+ guint ntargets)
{
GtkTargetList *list;
Index: gtk/gtkselection.h
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/gtkselection.h,v
retrieving revision 1.6
diff -u -r1.6 gtkselection.h
--- gtkselection.h 1998/10/18 22:51:17 1.6
+++ gtkselection.h 1998/12/24 01:42:47
@@ -56,17 +56,17 @@
guint info;
};
-GtkTargetList *gtk_target_list_new (GtkTargetEntry *targets,
- guint ntargets);
+GtkTargetList *gtk_target_list_new (const GtkTargetEntry *targets,
+ guint ntargets);
void gtk_target_list_ref (GtkTargetList *list);
void gtk_target_list_unref (GtkTargetList *list);
void gtk_target_list_add (GtkTargetList *list,
GdkAtom target,
guint flags,
guint info);
-void gtk_target_list_add_table (GtkTargetList *list,
- GtkTargetEntry *targets,
- guint ntargets);
+void gtk_target_list_add_table (GtkTargetList *list,
+ const GtkTargetEntry *targets,
+ guint ntargets);
void gtk_target_list_remove (GtkTargetList *list,
GdkAtom target);
gboolean gtk_target_list_find (GtkTargetList *list,
@@ -82,10 +82,10 @@
GdkAtom selection,
GdkAtom target,
guint info);
-void gtk_selection_add_targets (GtkWidget *widget,
- GdkAtom selection,
- GtkTargetEntry *targets,
- guint ntargets);
+void gtk_selection_add_targets (GtkWidget *widget,
+ GdkAtom selection,
+ const GtkTargetEntry *targets,
+ guint ntargets);
gint gtk_selection_convert (GtkWidget *widget,
GdkAtom selection,
GdkAtom target,
Index: gtk/testgtk.c
===================================================================
RCS file: /debian/home/gnomecvs/gtk+/gtk/testgtk.c,v
retrieving revision 1.155
diff -u -r1.155 testgtk.c
--- testgtk.c 1998/12/16 02:37:41 1.155
+++ testgtk.c 1998/12/24 01:43:29
@@ -7953,7 +7953,7 @@
toggle_idle_container (GtkObject *button,
GtkContainer *container)
{
- gtk_container_set_resize_mode (container, (guint) gtk_object_get_user_data (button));
+ gtk_container_set_resize_mode (container, GPOINTER_TO_INT (gtk_object_get_user_data (button)));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]