const fixes seek commit approval
- From: Havoc Pennington <rhpennin midway uchicago edu>
- To: gtk-devel-list redhat com
- Subject: const fixes seek commit approval
- Date: Tue, 20 Oct 1998 17:19:13 -0500 (CDT)
Can I commit this patch?
Havoc
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.685
diff -u -r1.685 ChangeLog
--- ChangeLog 1998/10/20 18:43:49 1.685
+++ ChangeLog 1998/10/20 22:10:25
@@ -1,3 +1,141 @@
+1998-10-20 Havoc Pennington <hp@pobox.com>
+
+ * gtkclist.h (struct _GtkCListClass): const gchar* fix for
+ insert_row signature
+ (gtk_clist_construct): const gchar* fix
+ (gtk_clist_new_with_titles): const gchar* fix
+ (gtk_clist_get_text): returned strings are const
+ (gtk_clist_get_pixtext): returned strings are const
+ (gtk_clist_prepend): const gchar* fix
+ (gtk_clist_insert): const gchar* fix
+
+ * gtkctree.h (gtk_ctree_construct): const gchar* fix
+ (gtk_ctree_new_with_titles): const gchar* on the titles
+ (gtk_ctree_insert_node): const gchar* on text
+ (gtk_ctree_get_text): returned text is const
+ (gtk_ctree_get_node_info): returned text is const
+
+ * gtkentry.h (gtk_entry_get_text): returns const text
+
+ * gtkfilesel.h (struct _GtkFileSelection): fileop_file
+ member is const
+
+ * gtkfontsel.h (gtk_font_selection_get_preview_text):
+ returns const gchar*
+ (gtk_font_selection_dialog_get_preview_text): returns
+ const
+
+ * gtklabel.h (gtk_label_get): returns const string
+
+ * gtkprogress.h (gtk_progress_set_format_string): format
+ is const
+
+ * gtktreeitem.h (gtk_tree_item_new_with_label): const arg
+
+ * gtktypeutils.h (gtk_type_name): returns const
+
+ * gtkwidget.h (gtk_widget_get_name): returns const
+
+ * gtkbindings.c (binding_match_activate): path arg
+ is const
+ (gtk_bindings_activate): local gchar*'s are const
+
+ * gtkcalendar.c (gtk_calendar_signals): -ansi whined about
+ these being gint and not guint
+ (gtk_calendar_get_type): reserved_1 and reserved_2 aren't function
+ pointers anymore, remove casts
+
+ * gtkclist.c (real_insert_row): text arg is const
+ (gtk_clist_construct) (gtk_clist_new_with_titles)
+ (gtk_clist_get_text) (gtk_clist_get_pixtext)
+ (gtk_clist_prepend) (gtk_clist_append) (gtk_clist_insert):
+ Fixes to match const gchar* in header file
+
+ * gtkcombo.c (gtk_combo_func): returns const, local ltext is const
+ (gtk_combo_find): locals text and ltext are const
+ (gtk_combo_update_entry): local text is const
+
+ * gtkctree.c (real_insert_row): text arg is const
+ (gtk_ctree_construct) (gtk_ctree_new_with_titles)
+ (gtk_ctree_insert_node) (gtk_ctree_node_get_text)
+ (gtk_ctree_get_node_info): const changes as in header.
+
+ * gtkentry.c (gtk_entry_get_text): returns const
+
+ * gtkfilesel.c (cmpl_completion_filename): first arg
+ is const
+ (open_user_dir): first arg const
+ (gtk_file_selection_init): locals dir_title and file_title are
+ const char* []
+ (gtk_file_selection_get_filename): local text is const
+ (gtk_file_selection_create_dir_confirmed): locals dirname const
+ (gtk_file_selection_delete_file): local filename is const
+ (gtk_file_selection_rename_file_confirmed): local file is const
+ (gtk_file_selection_key_press): local text is const
+ (gtk_file_selection_file_button): local temp is const
+ (gtk_file_selection_populate): local text is const
+
+ * gtkfontsel.c (gtk_font_selection_expand_slant_code): const arg
+ and return.
+ (gtk_font_selection_expand_spacing_code): const arg and return
+ (gtk_font_selection_init): locals titles, size, row_text,
+ property, and text are const
+ (gtk_font_selection_insert_fonts): font_item is const
+ (gtk_font_selection_show_available_styles): charset and new_item
+ are const
+ (gtk_font_selection_show_available_sizes): size is const
+ (gtk_font_selection_size_key_press): text is const
+ (gtk_font_selection_select_best_size): text is const
+ (gtk_font_selection_select_size): text is const
+ (gtk_font_selection_load_font): label_text is const
+ (gtk_font_selection_update_preview): text is const
+ (gtk_font_selection_show_font_info): field is const
+ (gtk_font_selection_apply_filter): font_item is const
+ (gtk_font_selection_get_preview_text)
+ (gtk_font_selection_dialog_get_preview_text): return const as in header
+
+ * gtkgamma.c (gamma_ok_callback): local start is const
+
+ * gtklabel.c (gtk_label_get): return is const, matching header
+
+ * gtkmenu.c (gtk_menu_set_tearoff_state): local storing text from
+ a label must be const
+
+ * gtkprogress.c (gtk_progress_set_format_string): format string is
+ const
+
+ * gtkrc.c (gtk_rc_styles_match): two string args are const
+ (gtk_rc_get_style): couple of locals are const since they come
+ from gtk_type_name
+
+ * gtktext.c (find_cursor_at_line): remove unused variable
+
+ * gtktreeitem.c (gtk_tree_item_new_with_label): const arg
+
+ * gtktypeutils.c (gtk_type_name): returns const
+ (gtk_type_descriptive_name): returns const, has a const
+ local 'name'
+
+ * gtkwidget.c (gtk_widget_get_name): returns const, some locals
+ const
+
+ * testdnd.c (popup_cb): use g_snprintf instead of sprintf to
+ squelch undeclared warning
+
+ * testgtk.c (add1000_clist): stuff to go in the list is const
+ (add10000_clist): ditto
+ (select_clist): local text is const
+ (unselect_clist): local text is const
+ (insert_row_clist): local text is const
+ (create_clist): titles and texts are const
+ (after_move): const locals
+ (export_ctree): title is const
+ (build_recursive): text is const
+ (rebuild_tree): text is const
+ (create_ctree): title is const
+
+ * testselection.c (paste): local 'name' is const
+
Tue Oct 20 14:53:28 1998 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c: Always send "drag_leave" to dests
Index: gtk/gtkclist.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkclist.h,v
retrieving revision 1.32
diff -u -r1.32 gtkclist.h
--- gtkclist.h 1998/10/19 22:46:36 1.32
+++ gtkclist.h 1998/10/20 22:10:25
@@ -239,7 +239,7 @@
void (*sort_list) (GtkCList *clist);
gint (*insert_row) (GtkCList *clist,
gint row,
- gchar *text[]);
+ const gchar *text[]);
void (*remove_row) (GtkCList *clist,
gint row);
void (*set_cell_contents) (GtkCList *clist,
@@ -381,12 +381,12 @@
/* constructers useful for gtk-- wrappers */
void gtk_clist_construct (GtkCList *clist,
gint columns,
- gchar *titles[]);
+ const gchar *titles[]);
/* create a new GtkCList */
GtkWidget *gtk_clist_new (gint columns);
GtkWidget *gtk_clist_new_with_titles (gint columns,
- gchar *titles[]);
+ const gchar *titles[]);
/* deprecated function, use gtk_clist_set_shadow_type instead. */
void gtk_clist_set_border (GtkCList *clist,
@@ -518,7 +518,7 @@
gint gtk_clist_get_text (GtkCList *clist,
gint row,
gint column,
- gchar **text);
+ const gchar **text);
/* sets a given cell's pixmap, replacing it's current contents */
void gtk_clist_set_pixmap (GtkCList *clist,
@@ -545,7 +545,7 @@
gint gtk_clist_get_pixtext (GtkCList *clist,
gint row,
gint column,
- gchar **text,
+ const gchar **text,
guint8 *spacing,
GdkPixmap **pixmap,
GdkBitmap **mask);
@@ -602,16 +602,16 @@
* making it easier to append and modify a row
*/
gint gtk_clist_prepend (GtkCList *clist,
- gchar *text[]);
+ const gchar *text[]);
gint gtk_clist_append (GtkCList *clist,
- gchar *text[]);
+ const gchar *text[]);
/* inserts a row at index row and returns the row where it was
* actually inserted (may be different from "row" in auto_sort mode)
*/
gint gtk_clist_insert (GtkCList *clist,
gint row,
- gchar *text[]);
+ const gchar *text[]);
/* removes row at index row */
void gtk_clist_remove (GtkCList *clist,
Index: gtk/gtkctree.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkctree.h,v
retrieving revision 1.21
diff -u -r1.21 gtkctree.h
--- gtkctree.h 1998/10/16 15:00:03 1.21
+++ gtkctree.h 1998/10/20 22:10:25
@@ -177,16 +177,16 @@
void gtk_ctree_construct (GtkCTree *ctree,
gint columns,
gint tree_column,
- gchar *titles[]);
+ const gchar *titles[]);
GtkWidget * gtk_ctree_new_with_titles (gint columns,
gint tree_column,
- gchar *titles[]);
+ const gchar *titles[]);
GtkWidget * gtk_ctree_new (gint columns,
gint tree_column);
GtkCTreeNode * gtk_ctree_insert_node (GtkCTree *ctree,
GtkCTreeNode *parent,
GtkCTreeNode *sibling,
- gchar *text[],
+ const gchar *text[],
guint8 spacing,
GdkPixmap *pixmap_closed,
GdkBitmap *mask_closed,
@@ -348,7 +348,7 @@
gint gtk_ctree_node_get_text (GtkCTree *ctree,
GtkCTreeNode *node,
gint column,
- gchar **text);
+ const gchar **text);
gint gtk_ctree_node_get_pixmap (GtkCTree *ctree,
GtkCTreeNode *node,
gint column,
@@ -363,7 +363,7 @@
GdkBitmap **mask);
gint gtk_ctree_get_node_info (GtkCTree *ctree,
GtkCTreeNode *node,
- gchar **text,
+ const gchar **text,
guint8 *spacing,
GdkPixmap **pixmap_closed,
GdkBitmap **mask_closed,
Index: gtk/gtkentry.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkentry.h,v
retrieving revision 1.22
diff -u -r1.22 gtkentry.h
--- gtkentry.h 1998/10/07 04:20:27 1.22
+++ gtkentry.h 1998/10/20 22:10:26
@@ -84,7 +84,7 @@
const gchar *text);
void gtk_entry_set_position (GtkEntry *entry,
gint position);
-gchar* gtk_entry_get_text (GtkEntry *entry);
+const gchar* gtk_entry_get_text (GtkEntry *entry);
void gtk_entry_select_region (GtkEntry *entry,
gint start,
gint end);
Index: gtk/gtkfilesel.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkfilesel.h,v
retrieving revision 1.4
diff -u -r1.4 gtkfilesel.h
--- gtkfilesel.h 1998/04/13 02:00:05 1.4
+++ gtkfilesel.h 1998/10/20 22:10:26
@@ -54,7 +54,7 @@
GList *history_list;
GtkWidget *fileop_dialog;
GtkWidget *fileop_entry;
- gchar *fileop_file;
+ const gchar *fileop_file;
gpointer cmpl_state;
GtkWidget *fileop_c_dir;
Index: gtk/gtkfontsel.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkfontsel.h,v
retrieving revision 1.5
diff -u -r1.5 gtkfontsel.h
--- gtkfontsel.h 1998/10/07 04:20:32 1.5
+++ gtkfontsel.h 1998/10/20 22:10:26
@@ -190,7 +190,7 @@
/* This returns the text in the preview entry. You should copy the returned
text if you need it. */
-gchar* gtk_font_selection_get_preview_text (GtkFontSelection *fontsel);
+const gchar* gtk_font_selection_get_preview_text (GtkFontSelection *fontsel);
/* 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. */
@@ -209,7 +209,7 @@
GdkFont* gtk_font_selection_dialog_get_font (GtkFontSelectionDialog *fsd);
gboolean gtk_font_selection_dialog_set_font_name (GtkFontSelectionDialog *fsd,
const gchar *fontname);
-gchar* gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd);
+const gchar* gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd);
void gtk_font_selection_dialog_set_preview_text (GtkFontSelectionDialog *fsd,
const gchar *text);
Index: gtk/gtklabel.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtklabel.h,v
retrieving revision 1.6
diff -u -r1.6 gtklabel.h
--- gtklabel.h 1998/10/07 04:20:39 1.6
+++ gtklabel.h 1998/10/20 22:10:26
@@ -66,7 +66,7 @@
void gtk_label_set_justify (GtkLabel *label,
GtkJustification jtype);
void gtk_label_get (GtkLabel *label,
- gchar **string);
+ const gchar **string);
/* Convenience function to set the name and pattern by parsing
Index: gtk/gtkprogress.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkprogress.h,v
retrieving revision 1.1
diff -u -r1.1 gtkprogress.h
--- gtkprogress.h 1998/07/19 10:35:36 1.1
+++ gtkprogress.h 1998/10/20 22:10:28
@@ -71,7 +71,7 @@
gfloat x_align,
gfloat y_align);
void gtk_progress_set_format_string (GtkProgress *progress,
- gchar *format);
+ const gchar *format);
void gtk_progress_set_adjustment (GtkProgress *progress,
GtkAdjustment *adjustment);
void gtk_progress_reconfigure (GtkProgress *progress,
Index: gtk/gtktreeitem.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeitem.h,v
retrieving revision 1.7
diff -u -r1.7 gtktreeitem.h
--- gtktreeitem.h 1998/10/07 04:21:13 1.7
+++ gtktreeitem.h 1998/10/20 22:10:28
@@ -65,7 +65,7 @@
GtkType gtk_tree_item_get_type (void);
GtkWidget* gtk_tree_item_new (void);
-GtkWidget* gtk_tree_item_new_with_label (gchar *label);
+GtkWidget* gtk_tree_item_new_with_label (const gchar *label);
void gtk_tree_item_set_subtree (GtkTreeItem *tree_item,
GtkWidget *subtree);
void gtk_tree_item_remove_subtree (GtkTreeItem *tree_item);
Index: gtk/gtktypeutils.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktypeutils.h,v
retrieving revision 1.35
diff -u -r1.35 gtktypeutils.h
--- gtktypeutils.h 1998/10/07 04:21:14 1.35
+++ gtktypeutils.h 1998/10/20 22:10:28
@@ -313,7 +313,7 @@
GtkTypeInfo *type_info);
void gtk_type_set_chunk_alloc (GtkType type,
guint n_chunks);
-gchar* gtk_type_name (guint type);
+const gchar* gtk_type_name (guint type);
GtkType gtk_type_from_name (const gchar *name);
GtkType gtk_type_parent (GtkType type);
gpointer gtk_type_class (GtkType type);
Index: gtk/gtkwidget.h
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwidget.h,v
retrieving revision 1.46
diff -u -r1.46 gtkwidget.h
--- gtkwidget.h 1998/10/20 18:43:54 1.46
+++ gtkwidget.h 1998/10/20 22:10:28
@@ -468,7 +468,7 @@
void gtk_widget_set_name (GtkWidget *widget,
const gchar *name);
-gchar* gtk_widget_get_name (GtkWidget *widget);
+const gchar*gtk_widget_get_name (GtkWidget *widget);
void gtk_widget_set_state (GtkWidget *widget,
GtkStateType state);
void gtk_widget_set_sensitive (GtkWidget *widget,
Index: gtk/gtkbindings.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkbindings.c,v
retrieving revision 1.14
diff -u -r1.14 gtkbindings.c
--- gtkbindings.c 1998/07/27 01:50:06 1.14
+++ gtkbindings.c 1998/10/20 22:10:28
@@ -772,7 +772,7 @@
binding_match_activate (GSList *pspec_list,
GtkObject *object,
guint path_length,
- gchar *path,
+ const gchar *path,
gchar *path_reversed)
{
GSList *slist;
@@ -917,7 +917,8 @@
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: gtk/gtkcalendar.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcalendar.c,v
retrieving revision 1.5
diff -u -r1.5 gtkcalendar.c
--- gtkcalendar.c 1998/10/05 03:52:47 1.5
+++ gtkcalendar.c 1998/10/20 22:10:28
@@ -203,7 +203,7 @@
LAST_SIGNAL
};
-static gint gtk_calendar_signals[LAST_SIGNAL] = { 0 };
+static guint gtk_calendar_signals[LAST_SIGNAL] = { 0 };
static GtkWidgetClass *parent_class = NULL;
@@ -317,8 +317,8 @@
sizeof (GtkCalendarClass),
(GtkClassInitFunc) gtk_calendar_class_init,
(GtkObjectInitFunc) gtk_calendar_init,
- (GtkArgSetFunc) NULL,
- (GtkArgGetFunc) NULL,
+ NULL,
+ NULL,
};
calendar_type = gtk_type_unique (GTK_TYPE_WIDGET, &calendar_info);
Index: gtk/gtkclist.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkclist.c,v
retrieving revision 1.101
diff -u -r1.101 gtkclist.c
--- gtkclist.c 1998/10/19 22:46:34 1.101
+++ gtkclist.c 1998/10/20 22:10:31
@@ -340,7 +340,7 @@
GdkBitmap *mask);
static gint real_insert_row (GtkCList *clist,
gint row,
- gchar *text[]);
+ const gchar *text[]);
static void real_remove_row (GtkCList *clist,
gint row);
static void real_clear (GtkCList *clist);
@@ -840,7 +840,7 @@
void
gtk_clist_construct (GtkCList *clist,
gint columns,
- gchar *titles[])
+ const gchar *titles[])
{
int i;
@@ -916,7 +916,7 @@
GtkWidget *
gtk_clist_new_with_titles (gint columns,
- gchar *titles[])
+ const gchar *titles[])
{
GtkWidget *widget;
@@ -1913,7 +1913,7 @@
gtk_clist_get_text (GtkCList *clist,
gint row,
gint column,
- gchar **text)
+ const gchar **text)
{
GtkCListRow *clist_row;
@@ -2040,7 +2040,7 @@
gtk_clist_get_pixtext (GtkCList *clist,
gint row,
gint column,
- gchar **text,
+ const gchar **text,
guint8 *spacing,
GdkPixmap **pixmap,
GdkBitmap **mask)
@@ -2256,7 +2256,7 @@
*/
gint
gtk_clist_prepend (GtkCList *clist,
- gchar *text[])
+ const gchar *text[])
{
g_return_val_if_fail (clist != NULL, -1);
g_return_val_if_fail (GTK_IS_CLIST (clist), -1);
@@ -2267,7 +2267,7 @@
gint
gtk_clist_append (GtkCList *clist,
- gchar *text[])
+ const gchar *text[])
{
g_return_val_if_fail (clist != NULL, -1);
g_return_val_if_fail (GTK_IS_CLIST (clist), -1);
@@ -2279,7 +2279,7 @@
gint
gtk_clist_insert (GtkCList *clist,
gint row,
- gchar *text[])
+ const gchar*text[])
{
g_return_val_if_fail (clist != NULL, -1);
g_return_val_if_fail (GTK_IS_CLIST (clist), -1);
@@ -2316,7 +2316,7 @@
static gint
real_insert_row (GtkCList *clist,
gint row,
- gchar *text[])
+ const gchar *text[])
{
gint i;
GtkCListRow *clist_row;
Index: gtk/gtkcombo.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcombo.c,v
retrieving revision 1.27
diff -u -r1.27 gtkcombo.c
--- gtkcombo.c 1998/10/14 09:07:18 1.27
+++ gtkcombo.c 1998/10/20 22:10:32
@@ -43,7 +43,7 @@
static void gtk_combo_init (GtkCombo *combo);
static void gtk_combo_destroy (GtkObject *combo);
static GtkListItem *gtk_combo_find (GtkCombo *combo);
-static gchar * gtk_combo_func (GtkListItem *li);
+static const gchar *gtk_combo_func (GtkListItem *li);
static gint gtk_combo_focus_idle (GtkCombo *combo);
static gint gtk_combo_entry_focus_out (GtkEntry *entry,
GdkEventFocus *event,
@@ -188,8 +188,8 @@
static GtkListItem *
gtk_combo_find (GtkCombo * combo)
{
- gchar *text;
- gchar *ltext;
+ const gchar *text;
+ const gchar *ltext;
GList *clist;
int (*string_compare) (const char *, const char *);
@@ -214,11 +214,11 @@
return NULL;
}
-static gchar *
+static const gchar *
gtk_combo_func (GtkListItem * li)
{
GtkWidget *label;
- gchar *ltext = NULL;
+ const gchar *ltext = NULL;
ltext = (gchar *) gtk_object_get_data (GTK_OBJECT (li), gtk_combo_string_key);
if (!ltext)
@@ -429,7 +429,7 @@
static void
gtk_combo_update_entry (GtkList * list, GtkCombo * combo)
{
- char *text;
+ const gchar *text;
gtk_grab_remove (GTK_WIDGET (combo));
gtk_signal_handler_block (GTK_OBJECT (list), combo->list_change_id);
Index: gtk/gtkctree.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkctree.c,v
retrieving revision 1.35
diff -u -r1.35 gtkctree.c
--- gtkctree.c 1998/10/19 22:46:37 1.35
+++ gtkctree.c 1998/10/20 22:10:34
@@ -214,7 +214,7 @@
gpointer data);
static gint real_insert_row (GtkCList *clist,
gint row,
- gchar *text[]);
+ const gchar *text[]);
static void real_remove_row (GtkCList *clist,
gint row);
static void real_sort_list (GtkCList *clist);
@@ -3764,7 +3764,7 @@
gtk_ctree_construct (GtkCTree *ctree,
gint columns,
gint tree_column,
- gchar *titles[])
+ const gchar *titles[])
{
GtkCList *clist;
@@ -3794,7 +3794,7 @@
GtkWidget *
gtk_ctree_new_with_titles (gint columns,
gint tree_column,
- gchar *titles[])
+ const gchar *titles[])
{
GtkWidget *widget;
@@ -3816,7 +3816,7 @@
static gint
real_insert_row (GtkCList *clist,
gint row,
- gchar *text[])
+ const gchar *text[])
{
GtkCTreeNode *parent = NULL;
GtkCTreeNode *sibling;
@@ -3842,7 +3842,7 @@
gtk_ctree_insert_node (GtkCTree *ctree,
GtkCTreeNode *parent,
GtkCTreeNode *sibling,
- gchar *text[],
+ const gchar *text[],
guint8 spacing,
GdkPixmap *pixmap_closed,
GdkBitmap *mask_closed,
@@ -5103,7 +5103,7 @@
gtk_ctree_node_get_text (GtkCTree *ctree,
GtkCTreeNode *node,
gint column,
- gchar **text)
+ const gchar **text)
{
g_return_val_if_fail (ctree != NULL, 0);
g_return_val_if_fail (GTK_IS_CTREE (ctree), 0);
@@ -5182,7 +5182,7 @@
gint
gtk_ctree_get_node_info (GtkCTree *ctree,
GtkCTreeNode *node,
- gchar **text,
+ const gchar **text,
guint8 *spacing,
GdkPixmap **pixmap_closed,
GdkBitmap **mask_closed,
Index: gtk/gtkentry.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkentry.c,v
retrieving revision 1.58
diff -u -r1.58 gtkentry.c
--- gtkentry.c 1998/09/20 14:58:06 1.58
+++ gtkentry.c 1998/10/20 22:10:35
@@ -476,7 +476,7 @@
gtk_editable_set_editable (GTK_EDITABLE (entry), editable);
}
-gchar*
+const gchar*
gtk_entry_get_text (GtkEntry *entry)
{
static char empty_str[2] = "";
Index: gtk/gtkfilesel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkfilesel.c,v
retrieving revision 1.34
diff -u -r1.34 gtkfilesel.c
--- gtkfilesel.c 1998/09/12 14:41:04 1.34
+++ gtkfilesel.c 1998/10/20 22:10:36
@@ -238,7 +238,7 @@
/* 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. */
@@ -250,7 +250,7 @@
gboolean *stat_subdirs);
static CompletionDir* open_dir (gchar* dir_name,
CompletionState* cmpl_state);
-static CompletionDir* open_user_dir (gchar* text_to_complete,
+static CompletionDir* open_user_dir (const gchar* text_to_complete,
CompletionState *cmpl_state);
static CompletionDir* open_relative_dir (gchar* dir_name, CompletionDir* dir,
CompletionState *cmpl_state);
@@ -367,8 +367,8 @@
GtkWidget *list_hbox;
GtkWidget *confirm_area;
GtkWidget *pulldown_hbox;
- char *dir_title [] = { "Directories", };
- char *file_title [] = { "Files", };
+ const char *dir_title [] = { "Directories", };
+ const char *file_title [] = { "Files", };
filesel->cmpl_state = cmpl_init_state ();
@@ -611,7 +611,7 @@
gtk_file_selection_get_filename (GtkFileSelection *filesel)
{
static char nothing[2] = "";
- char *text;
+ const char *text;
char *filename;
g_return_val_if_fail (filesel != NULL, nothing);
@@ -729,7 +729,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 *buf;
@@ -860,7 +860,7 @@
GtkWidget *vbox;
GtkWidget *button;
GtkWidget *dialog;
- gchar *filename;
+ const gchar *filename;
gchar *buf;
g_return_if_fail (fs != NULL);
@@ -930,7 +930,7 @@
{
GtkFileSelection *fs = data;
gchar *buf;
- gchar *file;
+ const gchar *file;
gchar *path;
gchar *new_filename;
gchar *old_filename;
@@ -1046,7 +1046,8 @@
gpointer user_data)
{
GtkFileSelection *fs;
- char *text;
+ const char *text;
+ char* textcopy;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (event != NULL, FALSE);
@@ -1060,11 +1061,11 @@
intercept = text && *text;
- text = g_strdup (text);
+ textcopy = g_strdup (text);
- gtk_file_selection_populate (fs, text, TRUE);
+ gtk_file_selection_populate (fs, textcopy, TRUE);
- g_free (text);
+ g_free (textcopy);
if (intercept)
gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event");
@@ -1184,7 +1185,8 @@
gpointer user_data)
{
GtkFileSelection *fs = NULL;
- gchar *filename, *temp = NULL;
+ gchar *filename = NULL;
+ const gchar*temp = NULL;
g_return_if_fail (GTK_IS_CLIST (widget));
@@ -1223,7 +1225,8 @@
gpointer user_data)
{
GtkFileSelection *fs = NULL;
- gchar *filename, *temp = NULL;
+ gchar *filename = NULL;
+ const gchar *temp = NULL;
g_return_if_fail (GTK_IS_CLIST (widget));
@@ -1265,7 +1268,7 @@
gint row;
gchar* rem_path = rel_path;
gchar* sel_text;
- gchar* text[2];
+ const gchar* text[2];
gint did_recurse = FALSE;
gint possible_count = 0;
gint selection_index = -1;
@@ -1466,7 +1469,7 @@
}
static gchar*
-cmpl_completion_fullname (gchar* text, CompletionState* cmpl_state)
+cmpl_completion_fullname (const gchar* text, CompletionState* cmpl_state)
{
static char nothing[2] = "";
@@ -1822,7 +1825,7 @@
/* 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)
{
gchar *first_slash;
Index: gtk/gtkfontsel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkfontsel.c,v
retrieving revision 1.9
diff -u -r1.9 gtkfontsel.c
--- gtkfontsel.c 1998/08/18 03:59:31 1.9
+++ gtkfontsel.c 1998/10/20 22:10:39
@@ -355,8 +355,8 @@
gint ntable,
gchar *field);
-static gchar* gtk_font_selection_expand_slant_code (gchar *slant);
-static gchar* gtk_font_selection_expand_spacing_code(gchar *spacing);
+static const gchar* gtk_font_selection_expand_slant_code (const gchar *slant);
+static const gchar* gtk_font_selection_expand_spacing_code(const gchar *spacing);
/* Functions for handling X Logical Font Description fontnames. */
static gboolean gtk_font_selection_is_xlfd_font_name (const gchar *fontname);
@@ -432,12 +432,12 @@
GtkWidget *text_box;
GtkWidget *table, *label, *hbox, *hbox2, *clist, *button, *vbox, *alignment;
gint i, prop, row;
- gchar *titles[] = { "Font Property", "Requested Value", "Actual Value" };
+ const gchar *titles[] = { "Font Property", "Requested Value", "Actual Value" };
gchar buffer[128];
- gchar *size;
+ const gchar *size;
gint size_to_match;
- gchar *row_text[3];
- gchar *property, *text;
+ const gchar *row_text[3];
+ const gchar *property, *text;
gboolean inserted;
/* Initialize the GtkFontSelection struct. We do this here in case any
@@ -883,7 +883,7 @@
{
FontInfo *font_info, *font;
gchar font_buffer[XLFD_MAX_FIELD_LEN * 2 + 4];
- gchar *font_item;
+ const gchar *font_item;
gint nfonts, i, row;
font_info = fontsel_info->font_info;
@@ -1058,8 +1058,8 @@
gint weight_index, slant_index, set_width_index, spacing_index;
gint charset_index;
gchar *weight, *slant, *set_width, *spacing;
- gchar *charset = NULL;
- gchar *new_item;
+ const gchar *charset = NULL;
+ const gchar *new_item;
gchar buffer[XLFD_MAX_FIELD_LEN * 6 + 2];
GdkColor *inactive_fg, *inactive_bg;
gboolean show_charset;
@@ -1250,7 +1250,7 @@
FontInfo *font;
FontStyle *styles;
gint style, prop;
- gchar *text;
+ const gchar *text;
#ifdef FONTSEL_DEBUG
g_message("In select_style\n");
@@ -1316,7 +1316,8 @@
FontStyle *styles, *style;
guint16 *standard_sizes, *bitmapped_sizes, bitmap_size;
gint nstandard_sizes, nbitmapped_sizes;
- gchar buffer[16], *size;
+ gchar buffer[16];
+ const gchar *size;
gfloat bitmap_size_float;
gboolean can_match;
@@ -1417,7 +1418,7 @@
GtkFontSelection *fontsel;
gint new_size;
gfloat new_size_float;
- gchar *text;
+ const gchar *text;
#ifdef FONTSEL_DEBUG
g_message("In size_key_press\n");
@@ -1465,7 +1466,7 @@
{
FontInfo *font;
FontStyle *styles, *style;
- gchar *text;
+ const gchar *text;
gint row, best_row = 0, size, size_fraction, best_size = 0, nmatched;
gboolean found = FALSE;
gchar buffer[32];
@@ -1554,7 +1555,7 @@
{
GtkFontSelection *fontsel;
gint new_size;
- gchar *text;
+ const gchar *text;
gchar buffer[16];
gint i;
@@ -1651,7 +1652,8 @@
gtk_font_selection_load_font (GtkFontSelection *fontsel)
{
GdkFont *font;
- gchar *fontname, *label_text;
+ gchar *fontname;
+ const gchar*label_text;
if (fontsel->font)
gdk_font_unref (fontsel->font);
@@ -1709,7 +1711,7 @@
GtkWidget *preview_entry;
GtkStyle *style;
gint text_height, new_height;
- gchar *text;
+ const gchar *text;
XFontStruct *xfs;
#ifdef FONTSEL_DEBUG
@@ -1780,7 +1782,7 @@
char *name;
gchar *fontname;
gchar field_buffer[XLFD_MAX_FIELD_LEN];
- gchar *field;
+ const gchar *field;
gint i;
gboolean shown_actual_fields = FALSE;
@@ -1848,8 +1850,8 @@
}
-static gchar*
-gtk_font_selection_expand_slant_code(gchar *slant)
+static const gchar*
+gtk_font_selection_expand_slant_code(const gchar *slant)
{
if (!g_strcasecmp(slant, "r")) return("roman");
else if (!g_strcasecmp(slant, "i")) return("italic");
@@ -1860,8 +1862,8 @@
return slant;
}
-static gchar*
-gtk_font_selection_expand_spacing_code(gchar *spacing)
+static const gchar*
+gtk_font_selection_expand_spacing_code(const gchar *spacing)
{
if (!g_strcasecmp(spacing, "p")) return("proportional");
else if (!g_strcasecmp(spacing, "m")) return("monospaced");
@@ -2001,7 +2003,7 @@
GList *selection;
gint nfonts, prop, nselected, i, j, row, style, index;
gchar font_buffer[XLFD_MAX_FIELD_LEN * 2 + 4];
- gchar *font_item;
+ const gchar *font_item;
gboolean matched, matched_style;
#ifdef FONTSEL_DEBUG
@@ -2923,7 +2925,7 @@
/* This returns the text in the preview entry. You should copy the returned
text if you need it. */
-gchar*
+const gchar*
gtk_font_selection_get_preview_text (GtkFontSelection *fontsel)
{
return gtk_entry_get_text(GTK_ENTRY(fontsel->preview_entry));
@@ -3189,7 +3191,7 @@
}
-gchar*
+const gchar*
gtk_font_selection_dialog_get_preview_text (GtkFontSelectionDialog *fsd)
{
return gtk_font_selection_get_preview_text(GTK_FONT_SELECTION(fsd->fontsel));
Index: gtk/gtkgamma.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkgamma.c,v
retrieving revision 1.11
diff -u -r1.11 gtkgamma.c
--- gtkgamma.c 1998/07/04 15:30:32 1.11
+++ gtkgamma.c 1998/10/20 22:10:39
@@ -352,7 +352,8 @@
gamma_ok_callback (GtkWidget *w, gpointer data)
{
GtkGammaCurve *c = data;
- gchar *start, *end;
+ const gchar *start;
+ gchar *end;
gfloat v;
start = gtk_entry_get_text (GTK_ENTRY (c->gamma_text));
Index: gtk/gtklabel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtklabel.c,v
retrieving revision 1.27
diff -u -r1.27 gtklabel.c
--- gtklabel.c 1998/08/29 22:27:46 1.27
+++ gtklabel.c 1998/10/20 22:10:39
@@ -294,7 +294,7 @@
void
gtk_label_get (GtkLabel *label,
- gchar **str)
+ const gchar**str)
{
g_return_if_fail (label != NULL);
g_return_if_fail (GTK_IS_LABEL (label));
Index: gtk/gtkmenu.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmenu.c,v
retrieving revision 1.30
diff -u -r1.30 gtkmenu.c
--- gtkmenu.c 1998/09/03 02:38:36 1.30
+++ gtkmenu.c 1998/10/20 22:10:39
@@ -611,7 +611,7 @@
GtkWidget *child = GTK_BIN (attach_widget)->child;
if (GTK_IS_LABEL (child))
{
- gchar *ret;
+ const gchar *ret;
gtk_label_get (GTK_LABEL (child), &ret);
gdk_window_set_title (menu->tearoff_window->window, ret);
}
Index: gtk/gtkprogress.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkprogress.c,v
retrieving revision 1.2
diff -u -r1.2 gtkprogress.c
--- gtkprogress.c 1998/09/01 18:41:26 1.2
+++ gtkprogress.c 1998/10/20 22:10:40
@@ -484,7 +484,7 @@
void
gtk_progress_set_format_string (GtkProgress *progress,
- gchar *format)
+ const gchar *format)
{
g_return_if_fail (progress != NULL);
g_return_if_fail (GTK_IS_PROGRESS (progress));
Index: gtk/gtkrc.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkrc.c,v
retrieving revision 1.21
diff -u -r1.21 gtkrc.c
--- gtkrc.c 1998/08/18 16:58:05 1.21
+++ gtkrc.c 1998/10/20 22:10:44
@@ -68,8 +68,8 @@
static GtkRcStyle* gtk_rc_style_find (const char *name);
static GtkRcStyle* gtk_rc_styles_match (GSList *sets,
guint path_length,
- gchar *path,
- gchar *path_reversed);
+ const gchar *path,
+ const gchar *path_reversed);
static GtkStyle* gtk_rc_style_init (GtkRcStyle *rc_style,
GdkColormap *cmap);
static void gtk_rc_parse_file (const gchar *filename,
@@ -406,8 +406,8 @@
static GtkRcStyle*
gtk_rc_styles_match (GSList *sets,
guint path_length,
- gchar *path,
- gchar *path_reversed)
+ const gchar *path,
+ const gchar *path_reversed)
{
GtkRcSet *rc_set;
@@ -463,7 +463,8 @@
type = GTK_OBJECT_TYPE (widget);
while (type)
{
- gchar *path, *path_reversed;
+ const gchar *path;
+ gchar *path_reversed;
guint path_length;
path = gtk_type_name (type);
Index: gtk/gtktext.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktext.c,v
retrieving revision 1.59
diff -u -r1.59 gtktext.c
--- gtktext.c 1998/10/18 13:10:07 1.59
+++ gtktext.c 1998/10/20 22:10:48
@@ -3492,7 +3492,6 @@
find_cursor_at_line (GtkText* text, const LineParams* start_line, gint pixel_height)
{
gchar ch;
- GtkEditable *editable = (GtkEditable *)text;
GtkPropertyMark mark = start_line->start;
TabStopMark tab_mark = start_line->tab_cont.tab_start;
Index: gtk/gtktreeitem.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktreeitem.c,v
retrieving revision 1.27
diff -u -r1.27 gtktreeitem.c
--- gtktreeitem.c 1998/09/03 02:38:50 1.27
+++ gtktreeitem.c 1998/10/20 22:10:49
@@ -273,7 +273,7 @@
}
GtkWidget*
-gtk_tree_item_new_with_label (gchar *label)
+gtk_tree_item_new_with_label (const gchar *label)
{
GtkWidget *tree_item;
GtkWidget *label_widget;
Index: gtk/gtktypeutils.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktypeutils.c,v
retrieving revision 1.40
diff -u -r1.40 gtktypeutils.c
--- gtktypeutils.c 1998/10/08 19:43:47 1.40
+++ gtktypeutils.c 1998/10/20 22:10:50
@@ -239,7 +239,7 @@
return new_type;
}
-gchar*
+const gchar*
gtk_type_name (GtkType type)
{
GtkTypeNode *node;
@@ -566,10 +566,10 @@
}
}
-static inline gchar*
+static inline const gchar*
gtk_type_descriptive_name (GtkType type)
{
- gchar *name;
+ const gchar *name;
name = gtk_type_name (type);
if (!name)
Index: gtk/gtkwidget.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwidget.c,v
retrieving revision 1.112
diff -u -r1.112 gtkwidget.c
--- gtkwidget.c 1998/10/19 00:51:21 1.112
+++ gtkwidget.c 1998/10/20 22:10:51
@@ -2458,7 +2458,7 @@
* results:
*****************************************/
-gchar*
+const gchar*
gtk_widget_get_name (GtkWidget *widget)
{
g_return_val_if_fail (widget != NULL, NULL);
@@ -4047,8 +4047,9 @@
len = 0;
do
{
- gchar *string;
- gchar *d, *s;
+ const gchar *string;
+ gchar *d;
+ const gchar *s;
guint l;
string = gtk_widget_get_name (widget);
@@ -4100,8 +4101,9 @@
len = 0;
do
{
- gchar *string;
- gchar *d, *s;
+ const gchar *string;
+ const gchar *s;
+ gchar *d;
guint l;
string = gtk_type_name (GTK_WIDGET_TYPE (widget));
Index: gtk/testdnd.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/testdnd.c,v
retrieving revision 1.1
diff -u -r1.1 testdnd.c
--- testdnd.c 1998/10/18 23:28:36 1.1
+++ testdnd.c 1998/10/20 22:10:52
@@ -446,7 +446,7 @@
for (j=0; j<3; j++)
{
char buffer[128];
- sprintf(buffer, "%d,%d", i, j);
+ g_snprintf(buffer, 127, "%d,%d", i, j);
button = gtk_button_new_with_label (buffer);
gtk_table_attach (GTK_TABLE (table), button, i, i+1, j, j+1,
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL,
Index: gtk/testgtk.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/testgtk.c,v
retrieving revision 1.132
diff -u -r1.132 testgtk.c
--- testgtk.c 1998/10/19 22:46:38 1.132
+++ testgtk.c 1998/10/20 22:10:55
@@ -3517,7 +3517,7 @@
{
gint i, row;
char text[TESTGTK_CLIST_COLUMNS][50];
- char *texts[TESTGTK_CLIST_COLUMNS];
+ const char *texts[TESTGTK_CLIST_COLUMNS];
GdkBitmap *mask;
GdkPixmap *pixmap;
GtkCList *clist;
@@ -3558,7 +3558,7 @@
{
gint i;
char text[TESTGTK_CLIST_COLUMNS][50];
- char *texts[TESTGTK_CLIST_COLUMNS];
+ const char *texts[TESTGTK_CLIST_COLUMNS];
for (i = 0; i < TESTGTK_CLIST_COLUMNS; i++)
{
@@ -3613,7 +3613,7 @@
{
gint i;
guint8 spacing;
- gchar *text;
+ const gchar *text;
GdkPixmap *pixmap;
GdkBitmap *mask;
GList *list;
@@ -3673,7 +3673,7 @@
{
gint i;
guint8 spacing;
- gchar *text;
+ const gchar *text;
GdkPixmap *pixmap;
GdkBitmap *mask;
GList *list;
@@ -3727,7 +3727,7 @@
static void
insert_row_clist (GtkWidget *widget, gpointer data)
{
- static char *text[] =
+ static const char *text[] =
{
"This", "is", "a", "inserted", "row.",
"This", "is", "a", "inserted", "row.",
@@ -3851,7 +3851,7 @@
gint i;
static GtkWidget *window = NULL;
- static char *titles[] =
+ static const char *titles[] =
{
"auto resize", "not resizeable", "max width 100", "min width 50",
"hide column", "Title 5", "Title 6", "Title 7",
@@ -3869,7 +3869,7 @@
};
char text[TESTGTK_CLIST_COLUMNS][50];
- char *texts[TESTGTK_CLIST_COLUMNS];
+ const char *texts[TESTGTK_CLIST_COLUMNS];
GtkWidget *box1;
GtkWidget *box2;
@@ -4138,9 +4138,9 @@
void after_move (GtkCTree *ctree, GtkCTreeNode *child, GtkCTreeNode *parent,
GtkCTreeNode *sibling, gpointer data)
{
- char *source;
- char *target1;
- char *target2;
+ const char *source;
+ const char *target1;
+ const char *target2;
gtk_ctree_get_node_info (ctree, child, &source,
NULL, NULL, NULL, NULL, NULL, NULL, NULL);
@@ -4423,7 +4423,7 @@
void export_ctree (GtkWidget *widget, GtkCTree *ctree)
{
- char *title[] = { "Tree" , "Info" };
+ const char *title[] = { "Tree" , "Info" };
static GtkWidget *export_window = NULL;
static GtkCTree *export_ctree;
GtkWidget *vbox;
@@ -4591,7 +4591,7 @@
void build_recursive (GtkCTree *ctree, gint cur_depth, gint depth,
gint num_books, gint num_pages, GtkCTreeNode *parent)
{
- gchar *text[2];
+ const gchar *text[2];
gchar buf1[60];
gchar buf2[60];
GtkCTreeNode *sibling;
@@ -4661,7 +4661,7 @@
void rebuild_tree (GtkWidget *widget, GtkCTree *ctree)
{
- gchar *text [2];
+ const gchar *text [2];
gchar label1[] = "Root";
gchar label2[] = "";
GtkCTreeNode *parent;
@@ -4745,7 +4745,7 @@
GtkWidget *spinner;
GdkColor transparent;
- char *title[] = { "Tree" , "Info" };
+ const char *title[] = { "Tree" , "Info" };
char buf[80];
static OptionMenuItem items1[] =
Index: gtk/testselection.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/testselection.c,v
retrieving revision 1.10
diff -u -r1.10 testselection.c
--- testselection.c 1998/10/18 22:51:24 1.10
+++ testselection.c 1998/10/20 22:10:55
@@ -349,7 +349,7 @@
void
paste (GtkWidget *widget, GtkWidget *entry)
{
- char *name;
+ const char *name;
GdkAtom atom;
name = gtk_entry_get_text (GTK_ENTRY(entry));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]