Remove G_DISABLE_CONST_RETURNS.

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.
This commit is contained in:
Owen Taylor 2001-10-23 16:02:23 +00:00 committed by Owen Taylor
parent 0d5635b366
commit 4e32ede287
24 changed files with 292 additions and 74 deletions

View 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
@ -58,12 +87,13 @@
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>

View 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
@ -58,12 +87,13 @@
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>

View 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
@ -58,12 +87,13 @@
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>

View 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
@ -58,12 +87,13 @@
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>

View 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
@ -58,12 +87,13 @@
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>

View 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
@ -58,12 +87,13 @@
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>

View 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
@ -58,12 +87,13 @@
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>

View File

@ -205,7 +205,7 @@ static PangoDirection
get_direction (void)
{
XkbDescRec *xkb = get_xkb ();
char *name;
const char *name;
XkbStateRec state_rec;
PangoDirection result;

View 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 \

View 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);

View 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));

View 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 *);

View 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)

View 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));

View 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. */

View 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 ();

View 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);

View 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;

View 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)

View 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)

View 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);

View 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;

View 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);

View 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);
}
}