]> Pileus Git - ~andy/gtk/commitdiff
Remove G_DISABLE_CONST_RETURNS.
authorOwen Taylor <otaylor@redhat.com>
Tue, 23 Oct 2001 16:02:23 +0000 (16:02 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Tue, 23 Oct 2001 16:02:23 +0000 (16:02 +0000)
Tue Oct 23 11:53:00 2001  Owen Taylor  <otaylor@redhat.com>

* gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.

* gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
G_CONST_RETURN. (Murray Cumming)

* gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
Make G_CONST_RETURN.

* gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
results of g_get_home_dir().

* gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated
copy. Storing the return from gtk_entry_get_text() is evil.

* gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c
gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c
gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
gtk/gtksignal.c: Add const.

* gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.

* gtk/gtktreeview.c: Namespace object data keys to be safe, even
if we are setting them on private widgets.

* gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search):
Duplicate entry->text before setting it as object data.

24 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/x11/gdkkeys-x11.c
gtk/Makefile.am
gtk/gtkbindings.c
gtk/gtkcellrenderertext.c
gtk/gtkcombo.c
gtk/gtkfilesel.c
gtk/gtkfontsel.c
gtk/gtkfontsel.h
gtk/gtkimmodule.c
gtk/gtkmain.c
gtk/gtkobject.c
gtk/gtkoldeditable.c
gtk/gtkrc.c
gtk/gtkscale.c
gtk/gtksignal.c
gtk/gtktreedatalist.c
gtk/gtktreeview.c

index 541a77a292b4a9c5ae0ddf195b034a115cf552ab..11af575157263461830b16f090771362b24629d7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,32 @@
+Tue Oct 23 11:53:00 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+       * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+       G_CONST_RETURN. (Murray Cumming)        
+
+       * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+       Make G_CONST_RETURN.
+
+       * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+       results of g_get_home_dir().
+
+       * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated 
+       copy. Storing the return from gtk_entry_get_text() is evil.
+
+       * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c 
+       gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c 
+       gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+       gtk/gtksignal.c: Add const.
+
+       * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+       * gtk/gtktreeview.c: Namespace object data keys to be safe, even 
+       if we are setting them on private widgets.
+
+       * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search): 
+       Duplicate entry->text before setting it as object data.
+
 2001-10-22  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
 Mon Oct 22 11:47:47 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c: Add cursor-position, selection-bound 
-       properties. (#62148, Reported by Padraig O'briain)
+       properties. (#62148, reported by Padraig O'Briain)
 
        * gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
        to cursor_position. (1.3.x addition, text_position is an awful
        name.) Make cursor_position read-only to avoid sticky questions
-       of interaction with selection_bound.
+       of interaction with selection_bound. (#62636, reported by
+       Padraig O'Briain)
 
 Mon Oct 22 16:25:12 2001  Owen Taylor  <otaylor@redhat.com>
 
index 541a77a292b4a9c5ae0ddf195b034a115cf552ab..11af575157263461830b16f090771362b24629d7 100644 (file)
@@ -1,3 +1,32 @@
+Tue Oct 23 11:53:00 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+       * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+       G_CONST_RETURN. (Murray Cumming)        
+
+       * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+       Make G_CONST_RETURN.
+
+       * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+       results of g_get_home_dir().
+
+       * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated 
+       copy. Storing the return from gtk_entry_get_text() is evil.
+
+       * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c 
+       gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c 
+       gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+       gtk/gtksignal.c: Add const.
+
+       * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+       * gtk/gtktreeview.c: Namespace object data keys to be safe, even 
+       if we are setting them on private widgets.
+
+       * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search): 
+       Duplicate entry->text before setting it as object data.
+
 2001-10-22  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
 Mon Oct 22 11:47:47 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c: Add cursor-position, selection-bound 
-       properties. (#62148, Reported by Padraig O'briain)
+       properties. (#62148, reported by Padraig O'Briain)
 
        * gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
        to cursor_position. (1.3.x addition, text_position is an awful
        name.) Make cursor_position read-only to avoid sticky questions
-       of interaction with selection_bound.
+       of interaction with selection_bound. (#62636, reported by
+       Padraig O'Briain)
 
 Mon Oct 22 16:25:12 2001  Owen Taylor  <otaylor@redhat.com>
 
index 541a77a292b4a9c5ae0ddf195b034a115cf552ab..11af575157263461830b16f090771362b24629d7 100644 (file)
@@ -1,3 +1,32 @@
+Tue Oct 23 11:53:00 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+       * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+       G_CONST_RETURN. (Murray Cumming)        
+
+       * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+       Make G_CONST_RETURN.
+
+       * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+       results of g_get_home_dir().
+
+       * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated 
+       copy. Storing the return from gtk_entry_get_text() is evil.
+
+       * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c 
+       gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c 
+       gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+       gtk/gtksignal.c: Add const.
+
+       * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+       * gtk/gtktreeview.c: Namespace object data keys to be safe, even 
+       if we are setting them on private widgets.
+
+       * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search): 
+       Duplicate entry->text before setting it as object data.
+
 2001-10-22  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
 Mon Oct 22 11:47:47 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c: Add cursor-position, selection-bound 
-       properties. (#62148, Reported by Padraig O'briain)
+       properties. (#62148, reported by Padraig O'Briain)
 
        * gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
        to cursor_position. (1.3.x addition, text_position is an awful
        name.) Make cursor_position read-only to avoid sticky questions
-       of interaction with selection_bound.
+       of interaction with selection_bound. (#62636, reported by
+       Padraig O'Briain)
 
 Mon Oct 22 16:25:12 2001  Owen Taylor  <otaylor@redhat.com>
 
index 541a77a292b4a9c5ae0ddf195b034a115cf552ab..11af575157263461830b16f090771362b24629d7 100644 (file)
@@ -1,3 +1,32 @@
+Tue Oct 23 11:53:00 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+       * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+       G_CONST_RETURN. (Murray Cumming)        
+
+       * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+       Make G_CONST_RETURN.
+
+       * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+       results of g_get_home_dir().
+
+       * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated 
+       copy. Storing the return from gtk_entry_get_text() is evil.
+
+       * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c 
+       gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c 
+       gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+       gtk/gtksignal.c: Add const.
+
+       * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+       * gtk/gtktreeview.c: Namespace object data keys to be safe, even 
+       if we are setting them on private widgets.
+
+       * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search): 
+       Duplicate entry->text before setting it as object data.
+
 2001-10-22  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
 Mon Oct 22 11:47:47 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c: Add cursor-position, selection-bound 
-       properties. (#62148, Reported by Padraig O'briain)
+       properties. (#62148, reported by Padraig O'Briain)
 
        * gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
        to cursor_position. (1.3.x addition, text_position is an awful
        name.) Make cursor_position read-only to avoid sticky questions
-       of interaction with selection_bound.
+       of interaction with selection_bound. (#62636, reported by
+       Padraig O'Briain)
 
 Mon Oct 22 16:25:12 2001  Owen Taylor  <otaylor@redhat.com>
 
index 541a77a292b4a9c5ae0ddf195b034a115cf552ab..11af575157263461830b16f090771362b24629d7 100644 (file)
@@ -1,3 +1,32 @@
+Tue Oct 23 11:53:00 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+       * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+       G_CONST_RETURN. (Murray Cumming)        
+
+       * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+       Make G_CONST_RETURN.
+
+       * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+       results of g_get_home_dir().
+
+       * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated 
+       copy. Storing the return from gtk_entry_get_text() is evil.
+
+       * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c 
+       gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c 
+       gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+       gtk/gtksignal.c: Add const.
+
+       * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+       * gtk/gtktreeview.c: Namespace object data keys to be safe, even 
+       if we are setting them on private widgets.
+
+       * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search): 
+       Duplicate entry->text before setting it as object data.
+
 2001-10-22  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
 Mon Oct 22 11:47:47 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c: Add cursor-position, selection-bound 
-       properties. (#62148, Reported by Padraig O'briain)
+       properties. (#62148, reported by Padraig O'Briain)
 
        * gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
        to cursor_position. (1.3.x addition, text_position is an awful
        name.) Make cursor_position read-only to avoid sticky questions
-       of interaction with selection_bound.
+       of interaction with selection_bound. (#62636, reported by
+       Padraig O'Briain)
 
 Mon Oct 22 16:25:12 2001  Owen Taylor  <otaylor@redhat.com>
 
index 541a77a292b4a9c5ae0ddf195b034a115cf552ab..11af575157263461830b16f090771362b24629d7 100644 (file)
@@ -1,3 +1,32 @@
+Tue Oct 23 11:53:00 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+       * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+       G_CONST_RETURN. (Murray Cumming)        
+
+       * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+       Make G_CONST_RETURN.
+
+       * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+       results of g_get_home_dir().
+
+       * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated 
+       copy. Storing the return from gtk_entry_get_text() is evil.
+
+       * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c 
+       gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c 
+       gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+       gtk/gtksignal.c: Add const.
+
+       * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+       * gtk/gtktreeview.c: Namespace object data keys to be safe, even 
+       if we are setting them on private widgets.
+
+       * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search): 
+       Duplicate entry->text before setting it as object data.
+
 2001-10-22  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
 Mon Oct 22 11:47:47 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c: Add cursor-position, selection-bound 
-       properties. (#62148, Reported by Padraig O'briain)
+       properties. (#62148, reported by Padraig O'Briain)
 
        * gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
        to cursor_position. (1.3.x addition, text_position is an awful
        name.) Make cursor_position read-only to avoid sticky questions
-       of interaction with selection_bound.
+       of interaction with selection_bound. (#62636, reported by
+       Padraig O'Briain)
 
 Mon Oct 22 16:25:12 2001  Owen Taylor  <otaylor@redhat.com>
 
index 541a77a292b4a9c5ae0ddf195b034a115cf552ab..11af575157263461830b16f090771362b24629d7 100644 (file)
@@ -1,3 +1,32 @@
+Tue Oct 23 11:53:00 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/Makefile.am (INCLUDES): Remove G_DISABLE_CONST_RETURNS.
+
+       * gtk/gtkfontsel.[ch]: Make gtk_font_selection_get_font()
+       G_CONST_RETURN. (Murray Cumming)        
+
+       * gtk/gtkfontsel.c (gtk_font_selection_dialog_get_preview_text):
+       Make G_CONST_RETURN.
+
+       * gtk/gtkfilesel.c (open_user_dir): Fix bug with freeing
+       results of g_get_home_dir().
+
+       * gtk/gtkfilesel.c: Make filesel->fileop_file a duplicated 
+       copy. Storing the return from gtk_entry_get_text() is evil.
+
+       * gtk/gtkcombo.c gtk/gtkcellrenderertext.c gtk/gtkbindings.c 
+       gtk/gtkfilesel.c gtk/gtkfontsel.c gtk/gtkimmodule.c 
+       gtk/gtkobject.c gtk/gtkoldeditable.c gtk/gtktreedatalist.c
+       gtk/gtksignal.c: Add const.
+
+       * gdk/x11/gdkkeys-x11.c (get_direction): Add missing const.
+
+       * gtk/gtktreeview.c: Namespace object data keys to be safe, even 
+       if we are setting them on private widgets.
+
+       * gtk/gtktreeview.c (gtk_tree_view_real_start_interactive_search): 
+       Duplicate entry->text before setting it as object data.
+
 2001-10-22  Havoc Pennington  <hp@redhat.com>
 
        * gtk/gtktextbuffer.c (gtk_text_buffer_place_cursor): don't back
 Mon Oct 22 11:47:47 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtklabel.c: Add cursor-position, selection-bound 
-       properties. (#62148, Reported by Padraig O'briain)
+       properties. (#62148, reported by Padraig O'Briain)
 
        * gtk/gtkentry.c (gtk_entry_class_init): Rename text_position
        to cursor_position. (1.3.x addition, text_position is an awful
        name.) Make cursor_position read-only to avoid sticky questions
-       of interaction with selection_bound.
+       of interaction with selection_bound. (#62636, reported by
+       Padraig O'Briain)
 
 Mon Oct 22 16:25:12 2001  Owen Taylor  <otaylor@redhat.com>
 
index 27524b09d65a28312e6e91d63bb8fc3e18a4921b..db587736cf3f054afbee404fb53cef3eded14b72 100644 (file)
@@ -205,7 +205,7 @@ static PangoDirection
 get_direction (void)
 {
   XkbDescRec *xkb = get_xkb ();
-  char *name;
+  const char *name;
   XkbStateRec state_rec;
   PangoDirection result;
 
index 294ff9910a46eebf359d9d50acf9a754b0deae7a..242fc689af3aa6cc67c6b38ec380a492b9aa76d2 100644 (file)
@@ -11,7 +11,6 @@ INCLUDES = @STRIP_BEGIN@ \
        -DGTK_VERSION=\"@GTK_VERSION@\"                 \
        -DGTK_BINARY_VERSION=\"@GTK_BINARY_VERSION@\"   \
        -DTESTGTK_RCFILE=\"`pwd`/$(srcdir)/testgtkrc\"  \
-       -DG_DISABLE_CONST_RETURNS                       \
        -I$(top_builddir)/gtk                           \
        -I$(top_srcdir) -I../gdk                        \
        -I$(top_srcdir)/gdk                             \
index 66ae70f6568e30d3ddc4c14987bb1f9ea6f28b7e..902410e11989a805fe9d0a973ef7ae981096f8c6 100644 (file)
@@ -793,8 +793,8 @@ static inline gboolean
 binding_match_activate (GSList          *pspec_list,
                        GtkObject       *object,
                        guint            path_length,
-                       gchar           *path,
-                       gchar           *path_reversed)
+                       const gchar     *path,
+                       const gchar     *path_reversed)
 {
   GSList *slist;
 
@@ -938,7 +938,8 @@ gtk_bindings_activate (GtkObject      *object,
       while (class_type && !handled)
        {
          guint path_length;
-         gchar *path, *path_reversed;
+         const gchar *path;
+         gchar *path_reversed;
          
          path = gtk_type_name (class_type);
          path_reversed = g_strdup (path);
index 353e4e02e099b8d63e3e52b1269c12924951890d..2bf054b5030b56aacf43322a0e57deb6cf7e9142 100644 (file)
@@ -1317,7 +1317,7 @@ gtk_cell_renderer_text_editing_done (GtkCellEditable *entry,
                                     gpointer         data)
 {
   gchar *path;
-  gchar *new_text;
+  const gchar *new_text;
 
   path = g_object_get_data (G_OBJECT (entry), GTK_CELL_RENDERER_TEXT_PATH);
   new_text = gtk_entry_get_text (GTK_ENTRY (entry));
index 8a52efc436e4f25d86bd2465e2724a2549a2ed6c..edbed499cb837a3be24ff0cf6ca12c295d793b26 100644 (file)
@@ -304,7 +304,7 @@ gtk_combo_window_key_press (GtkWidget   *window,
 static GtkListItem *
 gtk_combo_find (GtkCombo * combo)
 {
-  gchar *text;
+  const gchar *text;
   gchar *ltext;
   GList *clist;
   int (*string_compare) (const char *, const char *);
index 4326af41d3e42a21fc1b27f04d2ba085688cea4f..fa330d0cc0fe0e3e0a9d1ecc205053d6ab069632 100644 (file)
@@ -240,7 +240,7 @@ enum {
 static CompletionState*    cmpl_init_state        (void);
 static void                cmpl_free_state        (CompletionState *cmpl_state);
 static gint                cmpl_state_okay        (CompletionState* cmpl_state);
-static gchar*              cmpl_strerror          (gint);
+static const gchar*        cmpl_strerror          (gint);
 
 static PossibleCompletion* cmpl_completion_matches(gchar           *text_to_complete,
                                                   gchar          **remaining_text,
@@ -293,7 +293,7 @@ static gint                cmpl_last_valid_char    (CompletionState* cmpl_state)
 /* When the user selects a non-directory, call cmpl_completion_fullname
  * to get the full name of the selected file.
  */
-static gchar*              cmpl_completion_fullname (gchar*, CompletionState* cmpl_state);
+static gchar*              cmpl_completion_fullname (const gchar*, CompletionState* cmpl_state);
 
 
 /* Directory operations. */
@@ -308,7 +308,7 @@ static gboolean       check_dir            (gchar *dir_name,
 static CompletionDir* open_dir             (gchar* dir_name,
                                            CompletionState* cmpl_state);
 #ifdef HAVE_PWD_H
-static CompletionDir* open_user_dir        (gchar* text_to_complete,
+static CompletionDir* open_user_dir        (const gchar* text_to_complete,
                                            CompletionState *cmpl_state);
 #endif
 static CompletionDir* open_relative_dir    (gchar* dir_name, CompletionDir* dir,
@@ -355,6 +355,7 @@ static void gtk_file_selection_get_property  (GObject         *object,
                                              GValue          *value,
                                              GParamSpec      *pspec);
 static void gtk_file_selection_init          (GtkFileSelection      *filesel);
+static void gtk_file_selection_finalize      (GObject               *object);
 static void gtk_file_selection_destroy       (GtkObject             *object);
 static gint gtk_file_selection_key_press     (GtkWidget             *widget,
                                              GdkEventKey           *event,
@@ -495,6 +496,7 @@ gtk_file_selection_class_init (GtkFileSelectionClass *class)
 
   parent_class = gtk_type_class (GTK_TYPE_DIALOG);
 
+  gobject_class->finalize = gtk_file_selection_finalize;
   gobject_class->set_property = gtk_file_selection_set_property;
   gobject_class->get_property = gtk_file_selection_get_property;
    
@@ -878,7 +880,7 @@ filenames_drag_get (GtkWidget        *widget,
                    guint             time,
                    GtkFileSelection *filesel)
 {
-  gchar *file;
+  const gchar *file;
   gchar *uri_list;
   char hostname[256];
   int res;
@@ -1085,7 +1087,7 @@ gtk_file_selection_get_filename (GtkFileSelection *filesel)
   static gchar nothing[2] = "";
   static gchar something[MAXPATHLEN*2];
   char *sys_filename;
-  char *text;
+  const char *text;
 
   g_return_val_if_fail (GTK_IS_FILE_SELECTION (filesel), nothing);
 
@@ -1158,6 +1160,14 @@ gtk_file_selection_destroy (GtkObject *object)
   GTK_OBJECT_CLASS (parent_class)->destroy (object);
 }
 
+static void
+gtk_file_selection_finalize (GObject *object)
+{
+  GtkFileSelection *filesel = GTK_FILE_SELECTION (object);
+
+  g_free (filesel->fileop_file);
+}
+
 /* Begin file operations callbacks */
 
 static void
@@ -1204,7 +1214,7 @@ gtk_file_selection_create_dir_confirmed (GtkWidget *widget,
                                         gpointer   data)
 {
   GtkFileSelection *fs = data;
-  gchar *dirname;
+  const gchar *dirname;
   gchar *path;
   gchar *full_path;
   gchar *sys_full_path;
@@ -1376,7 +1386,7 @@ gtk_file_selection_delete_file (GtkWidget *widget,
   GtkWidget *vbox;
   GtkWidget *button;
   GtkWidget *dialog;
-  gchar *filename;
+  const gchar *filename;
   gchar *buf;
   
   g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
@@ -1392,7 +1402,8 @@ gtk_file_selection_delete_file (GtkWidget *widget,
   if (strlen (filename) < 1)
     return;
 
-  fs->fileop_file = filename;
+  g_free (fs->fileop_file);
+  fs->fileop_file = g_strdup (filename);
   
   /* main dialog */
   fs->fileop_dialog = dialog = gtk_dialog_new ();
@@ -1450,7 +1461,7 @@ gtk_file_selection_rename_file_confirmed (GtkWidget *widget,
 {
   GtkFileSelection *fs = data;
   gchar *buf;
-  gchar *file;
+  const gchar *file;
   gchar *path;
   gchar *new_filename;
   gchar *old_filename;
@@ -1532,7 +1543,8 @@ gtk_file_selection_rename_file (GtkWidget *widget,
   if (fs->fileop_dialog)
          return;
 
-  fs->fileop_file = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
+  g_free (fs->fileop_file);
+  fs->fileop_file = g_strdup (gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)));
   if (strlen (fs->fileop_file) < 1)
     return;
   
@@ -1638,9 +1650,7 @@ gtk_file_selection_key_press (GtkWidget   *widget,
 #ifdef G_WITH_CYGWIN
       translate_win32_path (fs);
 #endif
-      text = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
-
-      text = g_strdup (text);
+      text = g_strdup (gtk_entry_get_text (GTK_ENTRY (fs->selection_entry)));
 
       gtk_file_selection_populate (fs, text, TRUE);
 
@@ -2078,7 +2088,7 @@ cmpl_last_valid_char (CompletionState *cmpl_state)
 }
 
 static gchar*
-cmpl_completion_fullname (gchar           *text,
+cmpl_completion_fullname (const gchar     *text,
                          CompletionState *cmpl_state)
 {
   static char nothing[2] = "";
@@ -2489,7 +2499,7 @@ open_ref_dir (gchar           *text_to_complete,
 
 /* open a directory by user name */
 static CompletionDir*
-open_user_dir (gchar           *text_to_complete,
+open_user_dir (const gchar     *text_to_complete,
               CompletionState *cmpl_state)
 {
   CompletionDir *result;
@@ -2508,11 +2518,9 @@ open_user_dir (gchar           *text_to_complete,
   if (!cmp_len)
     {
       /* ~/ */
-      gchar *homedir = g_get_home_dir ();
+      const gchar *homedir = g_get_home_dir ();
       gchar *utf8_homedir = g_filename_to_utf8 (homedir, -1, NULL, NULL, NULL);
 
-      g_free (homedir);
-
       if (utf8_homedir)
        result = open_dir (utf8_homedir, cmpl_state);
       else
@@ -3494,7 +3502,7 @@ cmpl_state_okay (CompletionState* cmpl_state)
   return  cmpl_state && cmpl_state->reference_dir;
 }
 
-static gchar*
+static const gchar*
 cmpl_strerror (gint err)
 {
   if (err == CMPL_ERRNO_TOO_LONG)
index d7196fea47f17a3df358f5f546595261d5d4d335..95c43472f71310ac6b234172245dadaf731cfc03 100644 (file)
@@ -504,7 +504,7 @@ gtk_font_selection_select_font (GtkWidget      *w,
                                gpointer        data)
 {
   GtkFontSelection *fontsel;
-  gchar *family_name;
+  const gchar *family_name;
   gint index;
   
   fontsel = GTK_FONT_SELECTION (data);
@@ -762,7 +762,7 @@ gtk_font_selection_size_activate (GtkWidget   *w,
 {
   GtkFontSelection *fontsel;
   gint new_size;
-  gchar *text;
+  const gchar *text;
   
   fontsel = GTK_FONT_SELECTION (data);
 
@@ -836,7 +836,7 @@ gtk_font_selection_update_preview (GtkFontSelection *fontsel)
   gint new_height;
   GtkRequisition old_requisition;
   GtkWidget *preview_entry = fontsel->preview_entry;
-  gchar *text;
+  const gchar *text;
 
   gtk_widget_get_child_requisition (preview_entry, &old_requisition);
   
@@ -957,7 +957,7 @@ gtk_font_selection_set_font_name (GtkFontSelection *fontsel,
 
 /* This returns the text in the preview entry. You should copy the returned
    text if you need it. */
-gchar*
+G_CONST_RETURN gchar*
 gtk_font_selection_get_preview_text  (GtkFontSelection *fontsel)
 {
   return gtk_entry_get_text (GTK_ENTRY (fontsel->preview_entry));
@@ -1093,7 +1093,7 @@ gtk_font_selection_dialog_set_font_name (GtkFontSelectionDialog *fsd,
   return gtk_font_selection_set_font_name (GTK_FONT_SELECTION (fsd->fontsel), fontname);
 }
 
-gchar*
+G_CONST_RETURN gchar*
 gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd)
 {
   return gtk_font_selection_get_preview_text (GTK_FONT_SELECTION (fsd->fontsel));
index 5d8eb82142e46cfb81dae18a842b3b96ab9dd0ac..e6a20cfe0faeb9026dcfb599679121328b1cc458 100644 (file)
@@ -135,13 +135,11 @@ gchar*       gtk_font_selection_get_font_name     (GtkFontSelection *fontsel);
 GdkFont*   gtk_font_selection_get_font         (GtkFontSelection *fontsel);
 #endif /* GTK_DISABLE_DEPRECATED */
 
-gboolean   gtk_font_selection_set_font_name    (GtkFontSelection *fontsel,
-                                                const gchar      *fontname);
-gchar*    gtk_font_selection_get_preview_text  (GtkFontSelection *fontsel);
-void      gtk_font_selection_set_preview_text  (GtkFontSelection *fontsel,
-                                                const gchar      *text);
-
-
+gboolean              gtk_font_selection_set_font_name    (GtkFontSelection *fontsel,
+                                                          const gchar      *fontname);
+G_CONST_RETURN gchar* gtk_font_selection_get_preview_text (GtkFontSelection *fontsel);
+void                  gtk_font_selection_set_preview_text (GtkFontSelection *fontsel,
+                                                          const gchar      *text);
 
 /*****************************************************************************
  * GtkFontSelectionDialog functions.
@@ -175,7 +173,7 @@ gboolean gtk_font_selection_dialog_set_font_name    (GtkFontSelectionDialog *fsd
 
 /* This returns the text in the preview entry. You should copy the returned
    text if you need it. */
-gchar*  gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd);
+G_CONST_RETURN gchar* gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd);
 
 /* This sets the text in the preview entry. It will be copied by the entry,
    so there's no need to g_strdup() it first. */
index 1086d9fc6d42666d4bea01573c99fe86c36444ad..ea40819e376edeca6ed6968429f0d36012999c02 100644 (file)
@@ -482,7 +482,7 @@ _gtk_im_module_get_default_context_id (const gchar *locale)
   gint best_goodness = 0;
   gint i;
   gchar *tmp_locale, *tmp;
-  gchar *envvar;
+  const gchar *envvar;
       
   if (!contexts_hash)
     gtk_im_module_init ();
index 378b28705bafb6dc4146c42a48b0be51960b1f80..450f3741a7c93e1358c947fe2f9073a3b010146b 100644 (file)
@@ -227,9 +227,10 @@ check_setugid (void)
 static gchar **
 get_module_path (void)
 {
-  gchar *module_path = g_getenv ("GTK_MODULE_PATH");
-  gchar *exe_prefix = g_getenv("GTK_EXE_PREFIX");
+  const gchar *module_path_env = g_getenv ("GTK_MODULE_PATH");
+  const gchar *exe_prefix = g_getenv("GTK_EXE_PREFIX");
   gchar **result;
+  gchar *module_path;
   gchar *default_dir;
 
   if (exe_prefix)
@@ -242,8 +243,8 @@ get_module_path (void)
       default_dir = g_build_filename (get_gtk_win32_directory (""), "modules", NULL);
 #endif
     }
-  module_path = g_strconcat (module_path ? module_path : "",
-                            module_path ? G_SEARCHPATH_SEPARATOR_S : "",
+  module_path = g_strconcat (module_path_env ? module_path_env : "",
+                            module_path_env ? G_SEARCHPATH_SEPARATOR_S : "",
                             default_dir, NULL);
 
   result = pango_split_file_list (module_path);
index 6dc3fff7997a5ae24370390fa1b24dfb8a65df99..1f45383bee23677add482d52ad17612fb72f1f61 100644 (file)
@@ -134,7 +134,7 @@ gtk_arg_set_from_value (GtkArg       *arg,
     case G_TYPE_STRING:         if (copy_string)
       GTK_VALUE_STRING (*arg) = g_value_dup_string (value);
     else
-      GTK_VALUE_STRING (*arg) = g_value_get_string (value);
+      GTK_VALUE_STRING (*arg) = (char *) g_value_get_string (value);
     break;
     default:
       return FALSE;
index 5182c1e1f91b9f8048ec4164eef4630024582a40..f67952807e5e6ff1be66d1d6539b22702ff8e844 100644 (file)
@@ -476,7 +476,7 @@ gtk_old_editable_get_public_chars (GtkOldEditable   *old_editable,
                                   gint              end)
 {
   gchar *str = NULL;
-  gchar *charset;
+  const gchar *charset;
   gboolean need_conversion = !g_get_charset (&charset);
 
   if (old_editable->visible)
@@ -595,7 +595,7 @@ gtk_old_editable_paste_received (GtkOldEditable *old_editable,
                                 gboolean        is_clipboard)
 {
   const gchar *str = NULL;
-  gchar *charset;
+  const gchar *charset;
   gboolean need_conversion = FALSE;
 
   if (text)
index 2975c3855bdf3a073550b318dc09f4813577a239..b8d27f29f574314832bd04a571e0055eae6c3289 100644 (file)
@@ -659,7 +659,7 @@ gtk_rc_parse_named (GtkRcContext *context,
                    const gchar  *type)
 {
   gchar *path = NULL;
-  gchar *home_dir;
+  const gchar *home_dir;
   gchar *subpath;
 
   if (type)
index 10cf85ea6b3b9604a7a460b0159e988b908f8ce3..4920c4ea95eb5c1e60b4a2b0b3fc3d5282cf8539 100644 (file)
@@ -94,7 +94,7 @@ single_string_accumulator (GSignalInvocationHint *ihint,
                            gpointer               dummy)
 {
   gboolean continue_emission;
-  gchar *str;
+  const gchar *str;
   
   str = g_value_get_string (handler_return);
   g_value_set_string (return_accu, str);
index 1d98d92230e35d4cbcba8f37d484a72e58bce5a8..b24741dd8feca95fd098820eda04ca1d9add2210 100644 (file)
@@ -106,7 +106,7 @@ gtk_signal_connect_object_while_alive (GtkObject    *object,
   
   g_signal_connect_closure_by_id (object,
                                  g_signal_lookup (signal, G_OBJECT_TYPE (object)), 0,
-                                 g_cclosure_new_object_swap (func, alive_object),
+                                 g_cclosure_new_object_swap (func, G_OBJECT (alive_object)),
                                  FALSE);
 }
 
@@ -254,7 +254,7 @@ gtk_arg_set_from_value (GtkArg  *arg,
     case G_TYPE_STRING:                if (copy_string)
       GTK_VALUE_STRING (*arg) = g_value_dup_string (value);
     else
-      GTK_VALUE_STRING (*arg) = g_value_get_string (value);
+      GTK_VALUE_STRING (*arg) = (char *) g_value_get_string (value);
     break;
     default:
       return FALSE;
@@ -286,7 +286,7 @@ gtk_argloc_set_from_value (GtkArg  *arg,
     case G_TYPE_STRING:                if (copy_string)
       *GTK_RETLOC_STRING (*arg) = g_value_dup_string (value);
     else
-      *GTK_RETLOC_STRING (*arg) = g_value_get_string (value);
+      *GTK_RETLOC_STRING (*arg) = (char *) g_value_get_string (value);
     break;
     default:
       return FALSE;
index 81d6332e6f3c029d367f69772b18d8ae03920334..82cbdf480058dd468ab1ae14087620abb2da635c 100644 (file)
@@ -265,7 +265,7 @@ gtk_tree_data_list_compare_func (GtkTreeModel *model,
   GValue a_value = {0, };
   GValue b_value = {0, };
   gint retval;
-  gchar *stra, *strb;
+  const gchar *stra, *strb;
 
   gtk_tree_model_get_value (model, a, column, &a_value);
   gtk_tree_model_get_value (model, b, column, &b_value);
index c562625110131142dfdf2f934a879542f6262c24..f4d5be21c10705274a23d36cecd54ca49db18fed 100644 (file)
@@ -6184,8 +6184,9 @@ gtk_tree_view_real_start_interactive_search (GtkTreeView *tree_view)
 
   /* position window */
 
-  gtk_object_set_data (GTK_OBJECT (window), "text",
-                       gtk_entry_get_text (GTK_ENTRY (entry)));
+  gtk_object_set_data_full (GTK_OBJECT (window), "gtk-tree-view-text",
+                           g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))),
+                           (GDestroyNotify) g_free);
   gtk_object_set_data (GTK_OBJECT (tree_view),
                       GTK_TREE_VIEW_SEARCH_DIALOG_KEY, window);
 
@@ -8979,8 +8980,8 @@ gtk_tree_view_search_move (GtkWidget   *window,
   GtkTreeModel *model;
   GtkTreeSelection *selection;
 
-  text = gtk_object_get_data (GTK_OBJECT (window), "text");
-  selected_iter = gtk_object_get_data (GTK_OBJECT (window), "selected-iter");
+  text = gtk_object_get_data (GTK_OBJECT (window), "gtk-tree-view-text");
+  selected_iter = gtk_object_get_data (GTK_OBJECT (window), "gtk-tree-view-selected-iter");
 
   g_return_if_fail (text != NULL);
 
@@ -9191,10 +9192,10 @@ gtk_tree_view_search_init (GtkWidget   *entry,
 
   /* search */
   gtk_tree_selection_unselect_all (selection);
-  selected_iter = gtk_object_get_data (GTK_OBJECT (window), "selected-iter");
+  selected_iter = gtk_object_get_data (GTK_OBJECT (window), "gtk-tree-view-selected-iter");
   if (selected_iter)
     g_free (selected_iter);
-  gtk_object_remove_data (GTK_OBJECT (window), "selected-iter");
+  gtk_object_remove_data (GTK_OBJECT (window), "gtk-tree-view-selected-iter");
 
   if (len < 1)
     return;
@@ -9209,7 +9210,7 @@ gtk_tree_view_search_init (GtkWidget   *entry,
     {
       selected_iter = g_malloc (sizeof (int));
       *selected_iter = 1;
-      gtk_object_set_data (GTK_OBJECT (window), "selected-iter",
+      gtk_object_set_data (GTK_OBJECT (window), "gtk-tree-view-selected-iter",
                            selected_iter);
     }
 }