summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@src.gnome.org>1998-12-24 17:47:02 +0000
committerJeff Garzik <jgarzik@src.gnome.org>1998-12-24 17:47:02 +0000
commit553fa4309eb849f592afa0aead4c669be21ac117 (patch)
tree9bbbce3406d299faa53aa53d5fc74789225c2c16 /gtk
parent9775547b4a062f9b73a3498a0667e12b99313a44 (diff)
downloadgdk-pixbuf-553fa4309eb849f592afa0aead4c669be21ac117.tar.gz
removed unused var 64-bit cast point to const data Made const-correct.
* 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
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkaccelgroup.c2
-rw-r--r--gtk/gtkdnd.c20
-rw-r--r--gtk/gtkdnd.h20
-rw-r--r--gtk/gtkfontsel.c3
-rw-r--r--gtk/gtkselection.c18
-rw-r--r--gtk/gtkselection.h18
-rw-r--r--gtk/testgtk.c2
7 files changed, 42 insertions, 41 deletions
diff --git a/gtk/gtkaccelgroup.c b/gtk/gtkaccelgroup.c
index f929912fb..f5570dd4f 100644
--- a/gtk/gtkaccelgroup.c
+++ b/gtk/gtkaccelgroup.c
@@ -716,7 +716,7 @@ gtk_accelerator_valid (guint keyval,
GDK_Terminate_Server, GDK_AudibleBell_Enable,
0
};
- guint *ac_val;
+ const guint *ac_val;
modifiers &= GDK_MODIFIER_MASK;
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 1aa4bbcbc..4f74cfef8 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -698,11 +698,11 @@ gtk_drag_unhighlight (GtkWidget *widget)
*************************************************************/
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 @@ gtk_drag_begin (GtkWidget *widget,
*************************************************************/
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;
diff --git a/gtk/gtkdnd.h b/gtk/gtkdnd.h
index c665a1736..90513d51a 100644
--- a/gtk/gtkdnd.h
+++ b/gtk/gtkdnd.h
@@ -58,11 +58,11 @@ GtkWidget *gtk_drag_get_source_widget (GdkDragContext *context);
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 @@ void gtk_drag_dest_unset (GtkWidget *widget);
/* 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);
diff --git a/gtk/gtkfontsel.c b/gtk/gtkfontsel.c
index a3cfc5ecb..bfe4132d7 100644
--- a/gtk/gtkfontsel.c
+++ b/gtk/gtkfontsel.c
@@ -1264,7 +1264,7 @@ gtk_font_selection_select_best_style(GtkFontSelection *fontsel,
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 @@ gtk_font_selection_select_best_style(GtkFontSelection *fontsel,
}
}
g_return_if_fail (best_style != -1);
+ g_return_if_fail (best_row != -1);
fontsel->style = best_style;
diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c
index 2aa6c8cbd..c9ed219f1 100644
--- a/gtk/gtkselection.c
+++ b/gtk/gtkselection.c
@@ -151,8 +151,8 @@ static const char *gtk_selection_handler_key = "gtk-selection-handlers";
*/
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 @@ gtk_target_list_add (GtkTargetList *list,
}
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 @@ gtk_selection_add_target (GtkWidget *widget,
}
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;
diff --git a/gtk/gtkselection.h b/gtk/gtkselection.h
index 75fcd5aeb..02fce9f7b 100644
--- a/gtk/gtkselection.h
+++ b/gtk/gtkselection.h
@@ -56,17 +56,17 @@ struct _GtkTargetPair {
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 @@ void gtk_selection_add_target (GtkWidget *widget,
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,
diff --git a/gtk/testgtk.c b/gtk/testgtk.c
index d53958a00..5d5fc5386 100644
--- a/gtk/testgtk.c
+++ b/gtk/testgtk.c
@@ -7953,7 +7953,7 @@ static void
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