I submitted this patch twice to gtk-devel-list, and received no comments,

I submitted this patch twice to gtk-devel-list, and received no comments, so
am committing it.  Although not exhaustively tested, I have been using this
gtk+ for a week w/o problems, and I did read the code to ensure that nothing
ever writes to these data structures. If by chance people encounter SEGV's in
gtk+ code that is setting values in global data structures, this patch could
be a possible culprit.

1998-11-30  Elliot Lee  <sopwith@cuc.ml.org>

	* {gdk,gtk}/*.c: Make read-only data structures "static const" to
	allow them to be shared, mainly including (but not limited to) the
	GtkTypeInfo structures for each class.

	* gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
This commit is contained in:
Elliot Lee 1998-11-30 19:07:15 +00:00 committed by Elliot Lee
parent 58ca2448eb
commit 060978e069
116 changed files with 217 additions and 160 deletions

View File

@ -1,3 +1,11 @@
1998-11-30 Elliot Lee <sopwith@cuc.ml.org>
* {gdk,gtk}/*.c: Make read-only data structures "static const" to
allow them to be shared, mainly including (but not limited to) the
GtkTypeInfo structures for each class.
* gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
Mon Nov 30 12:17:10 1998 Jeff Garzik <jgarzik@pobox.com>
* gtk/gtknotebook.c (gtk_notebook_reorder_child):

View File

@ -1,3 +1,11 @@
1998-11-30 Elliot Lee <sopwith@cuc.ml.org>
* {gdk,gtk}/*.c: Make read-only data structures "static const" to
allow them to be shared, mainly including (but not limited to) the
GtkTypeInfo structures for each class.
* gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
Mon Nov 30 12:17:10 1998 Jeff Garzik <jgarzik@pobox.com>
* gtk/gtknotebook.c (gtk_notebook_reorder_child):

View File

@ -1,3 +1,11 @@
1998-11-30 Elliot Lee <sopwith@cuc.ml.org>
* {gdk,gtk}/*.c: Make read-only data structures "static const" to
allow them to be shared, mainly including (but not limited to) the
GtkTypeInfo structures for each class.
* gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
Mon Nov 30 12:17:10 1998 Jeff Garzik <jgarzik@pobox.com>
* gtk/gtknotebook.c (gtk_notebook_reorder_child):

View File

@ -1,3 +1,11 @@
1998-11-30 Elliot Lee <sopwith@cuc.ml.org>
* {gdk,gtk}/*.c: Make read-only data structures "static const" to
allow them to be shared, mainly including (but not limited to) the
GtkTypeInfo structures for each class.
* gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
Mon Nov 30 12:17:10 1998 Jeff Garzik <jgarzik@pobox.com>
* gtk/gtknotebook.c (gtk_notebook_reorder_child):

View File

@ -1,3 +1,11 @@
1998-11-30 Elliot Lee <sopwith@cuc.ml.org>
* {gdk,gtk}/*.c: Make read-only data structures "static const" to
allow them to be shared, mainly including (but not limited to) the
GtkTypeInfo structures for each class.
* gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
Mon Nov 30 12:17:10 1998 Jeff Garzik <jgarzik@pobox.com>
* gtk/gtknotebook.c (gtk_notebook_reorder_child):

View File

@ -1,3 +1,11 @@
1998-11-30 Elliot Lee <sopwith@cuc.ml.org>
* {gdk,gtk}/*.c: Make read-only data structures "static const" to
allow them to be shared, mainly including (but not limited to) the
GtkTypeInfo structures for each class.
* gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
Mon Nov 30 12:17:10 1998 Jeff Garzik <jgarzik@pobox.com>
* gtk/gtknotebook.c (gtk_notebook_reorder_child):

View File

@ -1,3 +1,11 @@
1998-11-30 Elliot Lee <sopwith@cuc.ml.org>
* {gdk,gtk}/*.c: Make read-only data structures "static const" to
allow them to be shared, mainly including (but not limited to) the
GtkTypeInfo structures for each class.
* gtk/gtkfilesel.c: Add /net to the "leave me alone" directory listing.
Mon Nov 30 12:17:10 1998 Jeff Garzik <jgarzik@pobox.com>
* gtk/gtknotebook.c (gtk_notebook_reorder_child):

View File

@ -229,7 +229,7 @@ static gulong base_id;
static gint autorepeat;
#ifdef G_ENABLE_DEBUG
static GDebugKey gdk_debug_keys[] = {
static const GDebugKey gdk_debug_keys[] = {
{"events", GDK_DEBUG_EVENTS},
{"misc", GDK_DEBUG_MISC},
{"dnd", GDK_DEBUG_DND},
@ -1504,8 +1504,8 @@ gdk_pointer_grab (GdkWindow * window,
guint32 time)
{
/* From gdkwindow.c */
extern int nevent_masks;
extern int event_mask_table[];
extern const int nevent_masks;
extern const int event_mask_table[];
gint return_val;
GdkWindowPrivate *window_private;

View File

@ -38,9 +38,9 @@ static GdkDevicePrivate *gdk_input_find_device (guint32 id);
/* Incorporate the specific routines depending on compilation options */
static GdkAxisUse gdk_input_core_axes[] = { GDK_AXIS_X, GDK_AXIS_Y };
static const GdkAxisUse gdk_input_core_axes[] = { GDK_AXIS_X, GDK_AXIS_Y };
static GdkDeviceInfo gdk_input_core_info =
static const GdkDeviceInfo gdk_input_core_info =
{
GDK_CORE_POINTER,
"Core Pointer",

View File

@ -304,7 +304,7 @@ gdk_rgb_try_colormap (gint nr, gint ng, gint nb)
static gboolean
gdk_rgb_do_colormaps (void)
{
const gint sizes[][3] = {
static const gint sizes[][3] = {
/* { 6, 7, 6 }, */
{ 6, 6, 6 },
{ 6, 6, 5 },
@ -316,7 +316,7 @@ gdk_rgb_do_colormaps (void)
{ 3, 3, 3 },
{ 2, 2, 2 }
};
const gint n_sizes = sizeof(sizes) / (3 * sizeof(gint));
static const gint n_sizes = sizeof(sizes) / (3 * sizeof(gint));
gint i;
for (i = 0; i < n_sizes; i++)
@ -387,7 +387,7 @@ static guint32
gdk_rgb_score_visual (GdkVisual *visual)
{
guint32 quality, speed, sys, pseudo;
gchar* visual_names[] =
static const gchar* visual_names[] =
{
"static gray",
"grayscale",
@ -535,7 +535,7 @@ void
gdk_rgb_init (void)
{
gint i;
gint byte_order[1] = { 1 };
static const gint byte_order[1] = { 1 };
/* check endian sanity */
#if G_BYTE_ORDER == G_BIG_ENDIAN
@ -982,7 +982,7 @@ static const guchar DM[128][128] =
#define DM_WIDTH 8
#define DM_WIDTH_SHIFT 3
#define DM_HEIGHT 8
static guchar DM[8][8] =
static const guchar DM[8][8] =
{
{ 0, 32, 8, 40, 2, 34, 10, 42 },
{ 48, 16, 56, 24, 50, 18, 58, 26 },

View File

@ -44,7 +44,7 @@ static gint navailable_types;
#ifdef G_ENABLE_DEBUG
static gchar* visual_names[] =
static const gchar* visual_names[] =
{
"static gray",
"grayscale",
@ -61,8 +61,8 @@ static GHashTable *visual_hash = NULL;
void
gdk_visual_init (void)
{
static gint possible_depths[7] = { 32, 24, 16, 15, 8, 4, 1 };
static GdkVisualType possible_types[6] =
static const gint possible_depths[7] = { 32, 24, 16, 15, 8, 4, 1 };
static const GdkVisualType possible_types[6] =
{
GDK_VISUAL_DIRECT_COLOR,
GDK_VISUAL_TRUE_COLOR,
@ -72,8 +72,8 @@ gdk_visual_init (void)
GDK_VISUAL_STATIC_GRAY
};
static gint npossible_depths = 7;
static gint npossible_types = 6;
static const gint npossible_depths = sizeof(possible_depths)/sizeof(gint);
static const gint npossible_types = sizeof(possible_types)/sizeof(GdkVisualType);
XVisualInfo *visual_list;
XVisualInfo visual_template;

View File

@ -33,8 +33,7 @@
#include <X11/extensions/shape.h>
#endif
int nevent_masks = 20;
int event_mask_table[20] =
const int event_mask_table[20] =
{
ExposureMask,
PointerMotionMask,
@ -57,6 +56,7 @@ int event_mask_table[20] =
0, /* PROXIMTY_OUT */
SubstructureNotifyMask
};
const int nevent_masks = sizeof(event_mask_table)/sizeof(int);
static gboolean gdk_window_have_shape_ext (void);

View File

@ -38,9 +38,9 @@ static GdkDevicePrivate *gdk_input_find_device (guint32 id);
/* Incorporate the specific routines depending on compilation options */
static GdkAxisUse gdk_input_core_axes[] = { GDK_AXIS_X, GDK_AXIS_Y };
static const GdkAxisUse gdk_input_core_axes[] = { GDK_AXIS_X, GDK_AXIS_Y };
static GdkDeviceInfo gdk_input_core_info =
static const GdkDeviceInfo gdk_input_core_info =
{
GDK_CORE_POINTER,
"Core Pointer",

View File

@ -229,7 +229,7 @@ static gulong base_id;
static gint autorepeat;
#ifdef G_ENABLE_DEBUG
static GDebugKey gdk_debug_keys[] = {
static const GDebugKey gdk_debug_keys[] = {
{"events", GDK_DEBUG_EVENTS},
{"misc", GDK_DEBUG_MISC},
{"dnd", GDK_DEBUG_DND},
@ -1504,8 +1504,8 @@ gdk_pointer_grab (GdkWindow * window,
guint32 time)
{
/* From gdkwindow.c */
extern int nevent_masks;
extern int event_mask_table[];
extern const int nevent_masks;
extern const int event_mask_table[];
gint return_val;
GdkWindowPrivate *window_private;

View File

@ -44,7 +44,7 @@ static gint navailable_types;
#ifdef G_ENABLE_DEBUG
static gchar* visual_names[] =
static const gchar* visual_names[] =
{
"static gray",
"grayscale",
@ -61,8 +61,8 @@ static GHashTable *visual_hash = NULL;
void
gdk_visual_init (void)
{
static gint possible_depths[7] = { 32, 24, 16, 15, 8, 4, 1 };
static GdkVisualType possible_types[6] =
static const gint possible_depths[7] = { 32, 24, 16, 15, 8, 4, 1 };
static const GdkVisualType possible_types[6] =
{
GDK_VISUAL_DIRECT_COLOR,
GDK_VISUAL_TRUE_COLOR,
@ -72,8 +72,8 @@ gdk_visual_init (void)
GDK_VISUAL_STATIC_GRAY
};
static gint npossible_depths = 7;
static gint npossible_types = 6;
static const gint npossible_depths = sizeof(possible_depths)/sizeof(gint);
static const gint npossible_types = sizeof(possible_types)/sizeof(GdkVisualType);
XVisualInfo *visual_list;
XVisualInfo visual_template;

View File

@ -33,8 +33,7 @@
#include <X11/extensions/shape.h>
#endif
int nevent_masks = 20;
int event_mask_table[20] =
const int event_mask_table[20] =
{
ExposureMask,
PointerMotionMask,
@ -57,6 +56,7 @@ int event_mask_table[20] =
0, /* PROXIMTY_OUT */
SubstructureNotifyMask
};
const int nevent_masks = sizeof(event_mask_table)/sizeof(int);
static gboolean gdk_window_have_shape_ext (void);

View File

@ -702,7 +702,7 @@ gboolean
gtk_accelerator_valid (guint keyval,
GdkModifierType modifiers)
{
guint invalid_accelerator_vals[] = {
static const guint invalid_accelerator_vals[] = {
GDK_BackSpace, GDK_Delete, GDK_KP_Delete,
GDK_Shift_L, GDK_Shift_R, GDK_Shift_Lock, GDK_Caps_Lock, GDK_ISO_Lock,
GDK_Control_L, GDK_Control_R, GDK_Meta_L, GDK_Meta_R,
@ -880,7 +880,7 @@ gtk_accelerator_parse (const gchar *accelerator,
}
else if (len >= 6 && is_modx (accelerator))
{
guint mod_vals[] = {
static const guint mod_vals[] = {
GDK_MOD1_MASK, GDK_MOD2_MASK, GDK_MOD3_MASK,
GDK_MOD4_MASK, GDK_MOD5_MASK
};

View File

@ -57,7 +57,7 @@ gtk_accel_label_get_type (void)
if (!accel_label_type)
{
GtkTypeInfo accel_label_info =
static const GtkTypeInfo accel_label_info =
{
"GtkAccelLabel",
sizeof (GtkAccelLabel),

View File

@ -41,7 +41,7 @@ gtk_adjustment_get_type (void)
if (!adjustment_type)
{
GtkTypeInfo adjustment_info =
static const GtkTypeInfo adjustment_info =
{
"GtkAdjustment",
sizeof (GtkAdjustment),

View File

@ -50,7 +50,7 @@ gtk_alignment_get_type (void)
if (!alignment_type)
{
GtkTypeInfo alignment_info =
static const GtkTypeInfo alignment_info =
{
"GtkAlignment",
sizeof (GtkAlignment),

View File

@ -47,7 +47,7 @@ gtk_arrow_get_type (void)
if (!arrow_type)
{
GtkTypeInfo arrow_info =
static const GtkTypeInfo arrow_info =
{
"GtkArrow",
sizeof (GtkArrow),

View File

@ -44,7 +44,7 @@ gtk_aspect_frame_get_type (void)
if (!aspect_frame_type)
{
GtkTypeInfo aspect_frame_info =
static const GtkTypeInfo aspect_frame_info =
{
"GtkAspectFrame",
sizeof (GtkAspectFrame),

View File

@ -36,7 +36,7 @@ gtk_button_box_get_type (void)
if (!button_box_type)
{
GtkTypeInfo button_box_info =
static const GtkTypeInfo button_box_info =
{
"GtkButtonBox",
sizeof (GtkButtonBox),

View File

@ -48,7 +48,7 @@ gtk_bin_get_type (void)
if (!bin_type)
{
GtkTypeInfo bin_info =
static const GtkTypeInfo bin_info =
{
"GtkBin",
sizeof (GtkBin),

View File

@ -76,7 +76,7 @@ gtk_box_get_type (void)
if (!box_type)
{
GtkTypeInfo box_info =
static const GtkTypeInfo box_info =
{
"GtkBox",
sizeof (GtkBox),

View File

@ -100,7 +100,7 @@ gtk_button_get_type (void)
if (!button_type)
{
GtkTypeInfo button_info =
static const GtkTypeInfo button_info =
{
"GtkButton",
sizeof (GtkButton),

View File

@ -43,13 +43,13 @@ typedef enum { false = FALSE , true = TRUE } boolean;
#define and && /* logical (boolean) operators: lower case */
#define or ||
static N_int month_length[2][13] =
static const N_int month_length[2][13] =
{
{ 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
{ 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
};
static N_int days_in_months[2][14] =
static const N_int days_in_months[2][14] =
{
{ 0, 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 },
{ 0, 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
@ -313,7 +313,7 @@ gtk_calendar_get_type (void)
if (!calendar_type)
{
GtkTypeInfo calendar_info =
static const GtkTypeInfo calendar_info =
{
"GtkCalendar",
sizeof (GtkCalendar),

View File

@ -52,7 +52,7 @@ gtk_check_button_get_type (void)
if (!check_button_type)
{
GtkTypeInfo check_button_info =
static const GtkTypeInfo check_button_info =
{
"GtkCheckButton",
sizeof (GtkCheckButton),

View File

@ -54,7 +54,7 @@ gtk_check_menu_item_get_type (void)
if (!check_menu_item_type)
{
GtkTypeInfo check_menu_item_info =
static const GtkTypeInfo check_menu_item_info =
{
"GtkCheckMenuItem",
sizeof (GtkCheckMenuItem),

View File

@ -396,7 +396,7 @@ gtk_clist_get_type (void)
if (!clist_type)
{
GtkTypeInfo clist_info =
static const GtkTypeInfo clist_info =
{
"GtkCList",
sizeof (GtkCList),

View File

@ -196,7 +196,7 @@ static const gchar *value_index_key = "gtk-value-index";
#define SF GtkSignalFunc
scale_val_type scale_vals[NUM_CHANNELS] =
static const scale_val_type scale_vals[NUM_CHANNELS] =
{
{"Hue:", 0.0, 360.0, 1.00, 10.00, (SF) gtk_color_selection_hsv_updater},
{"Saturation:", 0.0, 1.0, 0.01, 0.01, (SF) gtk_color_selection_hsv_updater},
@ -214,7 +214,7 @@ gtk_color_selection_get_type (void)
if (!color_selection_type)
{
GtkTypeInfo colorsel_info =
static const GtkTypeInfo colorsel_info =
{
"GtkColorSelection",
sizeof (GtkColorSelection),
@ -517,7 +517,7 @@ gtk_color_selection_realize (GtkWidget *widget)
{
GtkColorSelection *colorsel;
GtkTargetEntry targets[] = {
static const GtkTargetEntry targets[] = {
{ "application/x-color", 0 }
};

View File

@ -725,7 +725,7 @@ gtk_combo_get_type (void)
if (!combo_type)
{
GtkTypeInfo combo_info =
static const GtkTypeInfo combo_info =
{
"GtkCombo",
sizeof (GtkCombo),

View File

@ -112,7 +112,7 @@ gtk_container_get_type (void)
if (!container_type)
{
GtkTypeInfo container_info =
static const GtkTypeInfo container_info =
{
"GtkContainer",
sizeof (GtkContainer),

View File

@ -298,7 +298,7 @@ gtk_ctree_get_type (void)
if (!ctree_type)
{
GtkTypeInfo ctree_info =
static const GtkTypeInfo ctree_info =
{
"GtkCTree",
sizeof (GtkCTree),

View File

@ -58,7 +58,7 @@ gtk_curve_get_type (void)
if (!curve_type)
{
GtkTypeInfo curve_info =
static const GtkTypeInfo curve_info =
{
"GtkCurve",
sizeof (GtkCurve),

View File

@ -39,7 +39,7 @@ gtk_data_get_type (void)
if (!data_type)
{
GtkTypeInfo data_info =
static const GtkTypeInfo data_info =
{
"GtkData",
sizeof (GtkData),

View File

@ -34,7 +34,7 @@ gtk_dialog_get_type (void)
if (!dialog_type)
{
GtkTypeInfo dialog_info =
static const GtkTypeInfo dialog_info =
{
"GtkDialog",
sizeof (GtkDialog),

View File

@ -302,10 +302,10 @@ static struct {
{ 0 , action_none_bits, action_none_mask_bits, NULL },
};
static gint n_drag_cursors = sizeof(drag_cursors) / sizeof(drag_cursors[0]);
static const gint n_drag_cursors = sizeof(drag_cursors) / sizeof(drag_cursors[0]);
/* XPM */
static char * drag_default_xpm[] = {
static const char * drag_default_xpm[] = {
"32 32 3 1",
" c None",
". c #000000",

View File

@ -34,7 +34,7 @@ gtk_drawing_area_get_type (void)
if (!drawing_area_type)
{
GtkTypeInfo drawing_area_info =
static const GtkTypeInfo drawing_area_info =
{
"GtkDrawingArea",
sizeof (GtkDrawingArea),

View File

@ -33,7 +33,7 @@ gtk_draw_window_get_type (void)
if (!draw_window_type)
{
GtkTypeInfo draw_window_info =
static const GtkTypeInfo draw_window_info =
{
"GtkDrawWindow",
sizeof (GtkDrawWindow),

View File

@ -109,7 +109,7 @@ gtk_editable_get_type (void)
if (!editable_type)
{
GtkTypeInfo editable_info =
static const GtkTypeInfo editable_info =
{
"GtkEditable",
sizeof (GtkEditable),
@ -371,12 +371,12 @@ gtk_editable_get_arg (GtkObject *object,
static void
gtk_editable_init (GtkEditable *editable)
{
static GtkTargetEntry targets[] = {
static const GtkTargetEntry targets[] = {
{ "STRING", TARGET_STRING },
{ "TEXT", TARGET_TEXT },
{ "COMPOUND_TEXT", TARGET_COMPOUND_TEXT }
};
static gint n_targets = sizeof(targets) / sizeof(targets[0]);
static const gint n_targets = sizeof(targets) / sizeof(targets[0]);
GTK_WIDGET_SET_FLAGS (editable, GTK_CAN_FOCUS);

View File

@ -153,7 +153,7 @@ static void gtk_entry_set_position_from_editable (GtkEditable *editable,
static GtkWidgetClass *parent_class = NULL;
static GdkAtom ctext_atom = GDK_NONE;
static GtkTextFunction control_keys[26] =
static const GtkTextFunction control_keys[26] =
{
(GtkTextFunction)gtk_move_beginning_of_line, /* a */
(GtkTextFunction)gtk_move_backward_character, /* b */
@ -183,7 +183,7 @@ static GtkTextFunction control_keys[26] =
NULL, /* z */
};
static GtkTextFunction alt_keys[26] =
static const GtkTextFunction alt_keys[26] =
{
NULL, /* a */
(GtkTextFunction)gtk_move_backward_word, /* b */
@ -221,7 +221,7 @@ gtk_entry_get_type (void)
if (!entry_type)
{
GtkTypeInfo entry_info =
static const GtkTypeInfo entry_info =
{
"GtkEntry",
sizeof (GtkEntry),

View File

@ -40,7 +40,7 @@ gtk_event_box_get_type (void)
if (!event_box_type)
{
GtkTypeInfo event_box_info =
static const GtkTypeInfo event_box_info =
{
"GtkEventBox",
sizeof (GtkEventBox),

View File

@ -329,7 +329,7 @@ gtk_file_selection_get_type (void)
if (!file_selection_type)
{
GtkTypeInfo filesel_info =
static const GtkTypeInfo filesel_info =
{
"GtkFileSelection",
sizeof (GtkFileSelection),
@ -369,8 +369,8 @@ gtk_file_selection_init (GtkFileSelection *filesel)
GtkWidget *pulldown_hbox;
GtkWidget *scrolled_win;
char *dir_title [] = { "Directories", };
char *file_title [] = { "Files", };
static const char *dir_title [] = { "Directories", NULL };
static const char *file_title [] = { "Files", NULL };
filesel->cmpl_state = cmpl_init_state ();
@ -2026,15 +2026,16 @@ check_dir(gchar *dir_name, struct stat *result, gboolean *stat_subdirs)
* expensive.
*/
static struct {
static const struct {
gchar *name;
gboolean present;
struct stat statbuf;
} no_stat_dirs[] = {
{ "/afs", FALSE, { 0 } },
{ "/net", FALSE, { 0 } }
};
static gint n_no_stat_dirs = sizeof(no_stat_dirs) / sizeof(no_stat_dirs[0]);
static const gint n_no_stat_dirs = sizeof(no_stat_dirs) / sizeof(no_stat_dirs[0]);
static gboolean initialized = FALSE;
gint i;

View File

@ -54,7 +54,7 @@ gtk_fixed_get_type (void)
if (!fixed_type)
{
GtkTypeInfo fixed_info =
static const GtkTypeInfo fixed_info =
{
"GtkFixed",
sizeof (GtkFixed),

View File

@ -93,7 +93,7 @@
/* These are what we use as the standard font sizes, for the size clist.
Note that when using points we still show these integer point values but
we work internally in decipoints (and decipoint values can be typed in). */
static guint16 font_sizes[] = {
static const guint16 font_sizes[] = {
8, 9, 10, 11, 12, 13, 14, 16, 18, 20, 22, 24, 26, 28,
32, 36, 40, 48, 56, 64, 72
};
@ -198,7 +198,7 @@ typedef enum
} FontField;
/* These are the names of the fields, used on the info & filter page. */
static gchar* xlfd_field_names[GTK_XLFD_NUM_FIELDS] = {
static const gchar* xlfd_field_names[GTK_XLFD_NUM_FIELDS] = {
"Foundry:",
"Family:",
"Weight:",
@ -228,7 +228,7 @@ typedef enum
/* This is used to look up a field in a fontname given one of the above
property indices. */
static FontField xlfd_index[GTK_NUM_FONT_PROPERTIES] = {
static const FontField xlfd_index[GTK_NUM_FONT_PROPERTIES] = {
XLFD_WEIGHT,
XLFD_SLANT,
XLFD_SET_WIDTH,
@ -238,10 +238,10 @@ static FontField xlfd_index[GTK_NUM_FONT_PROPERTIES] = {
};
/* These are the positions of the properties in the filter table - x, y. */
static gint filter_positions[GTK_NUM_FONT_PROPERTIES][2] = {
static const gint filter_positions[GTK_NUM_FONT_PROPERTIES][2] = {
{ 1, 0 }, { 0, 2 }, { 1, 2 }, { 2, 2 }, { 2, 0 }, { 0, 0 }
};
static gint filter_heights[GTK_NUM_FONT_PROPERTIES] = {
static const gint filter_heights[GTK_NUM_FONT_PROPERTIES] = {
100, 70, 70, 40, 100, 100
};
@ -396,7 +396,7 @@ gtk_font_selection_get_type()
if(!font_selection_type)
{
GtkTypeInfo fontsel_type_info =
static const GtkTypeInfo fontsel_type_info =
{
"GtkFontSelection",
sizeof (GtkFontSelection),

View File

@ -61,7 +61,7 @@ gtk_frame_get_type (void)
if (!frame_type)
{
GtkTypeInfo frame_info =
static const GtkTypeInfo frame_info =
{
"GtkFrame",
sizeof (GtkFrame),

View File

@ -58,7 +58,7 @@ enum
NUM_XPMS
};
static char *xpm[][27] =
static const char *xpm[][27] =
{
/* spline: */
{
@ -209,7 +209,7 @@ gtk_gamma_curve_get_type (void)
if (!gamma_curve_type)
{
GtkTypeInfo gamma_curve_info =
static const GtkTypeInfo gamma_curve_info =
{
"GtkGammaCurve",
sizeof (GtkGammaCurve),

View File

@ -92,7 +92,7 @@ gtk_handle_box_get_type (void)
if (!handle_box_type)
{
GtkTypeInfo handle_box_info =
static const GtkTypeInfo handle_box_info =
{
"GtkHandleBox",
sizeof (GtkHandleBox),

View File

@ -37,7 +37,7 @@ gtk_hbutton_box_get_type (void)
if (!hbutton_box_type)
{
GtkTypeInfo hbutton_box_info =
static const GtkTypeInfo hbutton_box_info =
{
"GtkHButtonBox",
sizeof (GtkHButtonBox),

View File

@ -34,7 +34,7 @@ gtk_hbox_get_type (void)
if (!hbox_type)
{
GtkTypeInfo hbox_info =
static const GtkTypeInfo hbox_info =
{
"GtkHBox",
sizeof (GtkHBox),

View File

@ -43,7 +43,7 @@ gtk_hpaned_get_type (void)
if (!hpaned_type)
{
GtkTypeInfo hpaned_info =
static const GtkTypeInfo hpaned_info =
{
"GtkHPaned",
sizeof (GtkHPaned),

View File

@ -45,7 +45,7 @@ gtk_hruler_get_type (void)
if (!hruler_type)
{
GtkTypeInfo hruler_info =
static const GtkTypeInfo hruler_info =
{
"GtkHRuler",
sizeof (GtkHRuler),

View File

@ -70,7 +70,7 @@ gtk_hscale_get_type (void)
if (!hscale_type)
{
GtkTypeInfo hscale_info =
static const GtkTypeInfo hscale_info =
{
"GtkHScale",
sizeof (GtkHScale),

View File

@ -58,7 +58,7 @@ gtk_hscrollbar_get_type (void)
if (!hscrollbar_type)
{
GtkTypeInfo hscrollbar_info =
static const GtkTypeInfo hscrollbar_info =
{
"GtkHScrollbar",
sizeof (GtkHScrollbar),

View File

@ -32,7 +32,7 @@ gtk_hseparator_get_type (void)
if (!hseparator_type)
{
GtkTypeInfo hseparator_info =
static const GtkTypeInfo hseparator_info =
{
"GtkHSeparator",
sizeof (GtkHSeparator),

View File

@ -33,7 +33,7 @@ gtk_image_get_type (void)
if (!image_type)
{
GtkTypeInfo image_info =
static const GtkTypeInfo image_info =
{
"GtkImage",
sizeof (GtkImage),

View File

@ -114,7 +114,7 @@ gtk_input_dialog_get_type (void)
if (!input_dialog_type)
{
GtkTypeInfo input_dialog_info =
static const GtkTypeInfo input_dialog_info =
{
"GtkInputDialog",
sizeof (GtkInputDialog),
@ -484,7 +484,7 @@ gtk_input_dialog_set_axis(GtkWidget *widget, gpointer data)
static void
gtk_input_dialog_fill_axes(GtkInputDialog *inputd, GdkDeviceInfo *info)
{
static char *axis_use_strings[GDK_AXIS_LAST] =
static const char *axis_use_strings[GDK_AXIS_LAST] =
{
"",
"X",

View File

@ -33,7 +33,7 @@ gtk_invisible_get_type (void)
if (!invisible_type)
{
GtkTypeInfo invisible_info =
static const GtkTypeInfo invisible_info =
{
"GtkInvisible",
sizeof (GtkInvisible),

View File

@ -49,7 +49,7 @@ gtk_item_get_type (void)
if (!item_type)
{
GtkTypeInfo item_info =
static const GtkTypeInfo item_info =
{
"GtkItem",
sizeof (GtkItem),

View File

@ -158,7 +158,7 @@ gtk_item_factory_get_type (void)
if (!item_factory_type)
{
GtkTypeInfo item_factory_info =
static const GtkTypeInfo item_factory_info =
{
"GtkItemFactory",
sizeof (GtkItemFactory),

View File

@ -64,7 +64,7 @@ gtk_label_get_type (void)
if (!label_type)
{
GtkTypeInfo label_info =
static const GtkTypeInfo label_info =
{
"GtkLabel",
sizeof (GtkLabel),

View File

@ -305,7 +305,7 @@ gtk_layout_get_type (void)
if (!layout_type)
{
GtkTypeInfo layout_info =
static const GtkTypeInfo layout_info =
{
"GtkLayout",
sizeof (GtkLayout),

View File

@ -154,7 +154,7 @@ gtk_list_get_type (void)
if (!list_type)
{
GtkTypeInfo list_info =
static const GtkTypeInfo list_info =
{
"GtkList",
sizeof (GtkList),

View File

@ -74,7 +74,7 @@ gtk_list_item_get_type (void)
if (!list_item_type)
{
GtkTypeInfo list_item_info =
static const GtkTypeInfo list_item_info =
{
"GtkListItem",
sizeof (GtkListItem),

View File

@ -216,7 +216,7 @@ static GdkColormap *gtk_colormap; /* The colormap to be used in creating new
guint gtk_debug_flags = 0; /* Global GTK debug flag */
#ifdef G_ENABLE_DEBUG
static GDebugKey gtk_debug_keys[] = {
static const GDebugKey gtk_debug_keys[] = {
{"objects", GTK_DEBUG_OBJECTS},
{"misc", GTK_DEBUG_MISC},
{"signals", GTK_DEBUG_SIGNALS},

View File

@ -75,7 +75,7 @@ gtk_menu_get_type (void)
if (!menu_type)
{
GtkTypeInfo menu_info =
static const GtkTypeInfo menu_info =
{
"GtkMenu",
sizeof (GtkMenu),

View File

@ -59,7 +59,7 @@ gtk_menu_bar_get_type (void)
if (!menu_bar_type)
{
GtkTypeInfo menu_bar_info =
static const GtkTypeInfo menu_bar_info =
{
"GtkMenuBar",
sizeof (GtkMenuBar),

View File

@ -77,7 +77,7 @@ gtk_menu_item_get_type (void)
if (!menu_item_type)
{
GtkTypeInfo menu_item_info =
static const GtkTypeInfo menu_item_info =
{
"GtkMenuItem",
sizeof (GtkMenuItem),

View File

@ -147,7 +147,7 @@ gtk_menu_shell_get_type (void)
if (!menu_shell_type)
{
GtkTypeInfo menu_shell_info =
static const GtkTypeInfo menu_shell_info =
{
"GtkMenuShell",
sizeof (GtkMenuShell),

View File

@ -46,7 +46,7 @@ gtk_misc_get_type (void)
if (!misc_type)
{
GtkTypeInfo misc_info =
static const GtkTypeInfo misc_info =
{
"GtkMisc",
sizeof (GtkMisc),

View File

@ -210,7 +210,7 @@ gtk_notebook_get_type (void)
if (!notebook_type)
{
GtkTypeInfo notebook_info =
static const GtkTypeInfo notebook_info =
{
"GtkNotebook",
sizeof (GtkNotebook),

View File

@ -96,8 +96,8 @@ gtk_object_debug (void)
void
gtk_object_init_type (void)
{
GtkType object_type = 0;
GtkTypeInfo object_info =
static GtkType object_type = 0;
static const GtkTypeInfo object_info =
{
"GtkObject",
sizeof (GtkObject),

View File

@ -74,7 +74,7 @@ gtk_option_menu_get_type (void)
if (!option_menu_type)
{
GtkTypeInfo option_menu_info =
static const GtkTypeInfo option_menu_info =
{
"GtkOptionMenu",
sizeof (GtkOptionMenu),

View File

@ -161,7 +161,7 @@ gtk_packer_get_type (void)
if (!packer_type)
{
GtkTypeInfo packer_info =
static const GtkTypeInfo packer_info =
{
"GtkPacker",
sizeof (GtkPacker),

View File

@ -48,7 +48,7 @@ gtk_paned_get_type (void)
if (!paned_type)
{
GtkTypeInfo paned_info =
static const GtkTypeInfo paned_info =
{
"GtkPaned",
sizeof (GtkPaned),

View File

@ -39,7 +39,7 @@ gtk_pixmap_get_type (void)
if (!pixmap_type)
{
GtkTypeInfo pixmap_info =
static const GtkTypeInfo pixmap_info =
{
"GtkPixmap",
sizeof (GtkPixmap),

View File

@ -44,7 +44,7 @@ gtk_plug_get_type ()
if (!plug_type)
{
GtkTypeInfo plug_info =
static const GtkTypeInfo plug_info =
{
"GtkPlug",
sizeof (GtkPlug),

View File

@ -51,7 +51,7 @@ gtk_preview_get_type (void)
if (!preview_type)
{
GtkTypeInfo preview_info =
static const GtkTypeInfo preview_info =
{
"GtkPreview",
sizeof (GtkPreview),

View File

@ -62,7 +62,7 @@ gtk_progress_get_type (void)
if (!progress_type)
{
GtkTypeInfo progress_info =
static const GtkTypeInfo progress_info =
{
"GtkProgress",
sizeof (GtkProgress),

View File

@ -61,7 +61,7 @@ gtk_progress_bar_get_type (void)
if (!progress_bar_type)
{
GtkTypeInfo progress_bar_info =
static const GtkTypeInfo progress_bar_info =
{
"GtkProgressBar",
sizeof (GtkProgressBar),

View File

@ -53,7 +53,7 @@ gtk_radio_button_get_type (void)
if (!radio_button_type)
{
GtkTypeInfo radio_button_info =
static const GtkTypeInfo radio_button_info =
{
"GtkRadioButton",
sizeof (GtkRadioButton),

View File

@ -34,7 +34,7 @@ gtk_radio_menu_item_get_type (void)
if (!radio_menu_item_type)
{
GtkTypeInfo radio_menu_item_info =
static const GtkTypeInfo radio_menu_item_info =
{
"GtkRadioMenuItem",
sizeof (GtkRadioMenuItem),

View File

@ -99,7 +99,7 @@ gtk_range_get_type (void)
if (!range_type)
{
GtkTypeInfo range_info =
static const GtkTypeInfo range_info =
{
"GtkRange",
sizeof (GtkRange),

View File

@ -97,7 +97,7 @@ static void gtk_rc_append_default_module_path (void);
static void gtk_rc_append_pixmap_path (gchar *dir);
static GScannerConfig gtk_rc_scanner_config =
static const GScannerConfig gtk_rc_scanner_config =
{
(
" \t\n"
@ -138,7 +138,7 @@ static GScannerConfig gtk_rc_scanner_config =
FALSE /* scope_0_fallback */,
};
static struct
static const struct
{
gchar *name;
guint token;
@ -172,7 +172,7 @@ static struct
{ "module_path", GTK_RC_TOKEN_MODULE_PATH },
};
static guint n_symbols = sizeof (symbols) / sizeof (symbols[0]);
static const guint n_symbols = sizeof (symbols) / sizeof (symbols[0]);
static GHashTable *rc_style_ht = NULL;
static GHashTable *realized_style_ht = NULL;

View File

@ -32,7 +32,7 @@ static void gtk_ruler_make_pixmap (GtkRuler *ruler);
static GtkWidgetClass *parent_class;
static GtkRulerMetric ruler_metrics[] =
static const GtkRulerMetric ruler_metrics[] =
{
{"Pixels", "Pi", 1.0, { 1, 2, 5, 10, 25, 50, 100, 250, 500, 1000 }, { 1, 5, 10, 50, 100 }},
{"Inches", "In", 72.0, { 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 }, { 1, 2, 4, 8, 16 }},
@ -47,7 +47,7 @@ gtk_ruler_get_type (void)
if (!ruler_type)
{
GtkTypeInfo ruler_info =
static const GtkTypeInfo ruler_info =
{
"GtkRuler",
sizeof (GtkRuler),

View File

@ -42,7 +42,7 @@ gtk_scale_get_type (void)
if (!scale_type)
{
GtkTypeInfo scale_info =
static const GtkTypeInfo scale_info =
{
"GtkScale",
sizeof (GtkScale),

View File

@ -28,7 +28,7 @@ gtk_scrollbar_get_type (void)
if (!scrollbar_type)
{
GtkTypeInfo scrollbar_info =
static const GtkTypeInfo scrollbar_info =
{
"GtkScrollbar",
sizeof (GtkScrollbar),

View File

@ -74,7 +74,7 @@ gtk_scrolled_window_get_type (void)
if (!scrolled_window_type)
{
GtkTypeInfo scrolled_window_info =
static const GtkTypeInfo scrolled_window_info =
{
"GtkScrolledWindow",
sizeof (GtkScrolledWindow),

View File

@ -30,7 +30,7 @@ gtk_separator_get_type (void)
if (!separator_type)
{
GtkTypeInfo separator_info =
static const GtkTypeInfo separator_info =
{
"GtkSeparator",
sizeof (GtkSeparator),

View File

@ -67,7 +67,7 @@ gtk_socket_get_type ()
if (!socket_type)
{
GtkTypeInfo socket_info =
static const GtkTypeInfo socket_info =
{
"GtkSocket",
sizeof (GtkSocket),

View File

@ -119,7 +119,7 @@ gtk_spin_button_get_type (void)
if (!spin_button_type)
{
GtkTypeInfo spin_button_info =
static const GtkTypeInfo spin_button_info =
{
"GtkSpinButton",
sizeof (GtkSpinButton),

View File

@ -49,7 +49,7 @@ gtk_statusbar_get_type (void)
if (!statusbar_type)
{
GtkTypeInfo statusbar_info =
static const GtkTypeInfo statusbar_info =
{
"GtkStatusbar",
sizeof (GtkStatusbar),

View File

@ -287,7 +287,7 @@ static void rgb_to_hls (gdouble *r, gdouble *g, gdouble *b);
static void hls_to_rgb (gdouble *h, gdouble *l, gdouble *s);
GtkStyleClass default_class =
static const GtkStyleClass default_class =
{
2,
2,

View File

@ -100,7 +100,7 @@ gtk_table_get_type (void)
if (!table_type)
{
GtkTypeInfo table_info =
static const GtkTypeInfo table_info =
{
"GtkTable",
sizeof (GtkTable),

View File

@ -43,7 +43,7 @@ gtk_tearoff_menu_item_get_type (void)
if (!tearoff_menu_item_type)
{
GtkTypeInfo tearoff_menu_item_info =
static const GtkTypeInfo tearoff_menu_item_info =
{
"GtkTearoffMenuItem",
sizeof (GtkTearoffMenuItem),

View File

@ -432,7 +432,7 @@ static GMemChunk *text_property_chunk = NULL;
static GtkWidgetClass *parent_class = NULL;
static GtkTextFunction control_keys[26] =
static const GtkTextFunction control_keys[26] =
{
(GtkTextFunction)gtk_text_move_beginning_of_line, /* a */
(GtkTextFunction)gtk_text_move_backward_character, /* b */
@ -462,7 +462,7 @@ static GtkTextFunction control_keys[26] =
NULL, /* z */
};
static GtkTextFunction alt_keys[26] =
static const GtkTextFunction alt_keys[26] =
{
NULL, /* a */
(GtkTextFunction)gtk_text_move_backward_word, /* b */
@ -504,7 +504,7 @@ gtk_text_get_type (void)
if (!text_type)
{
GtkTypeInfo text_info =
static const GtkTypeInfo text_info =
{
"GtkText",
sizeof (GtkText),

View File

@ -79,7 +79,7 @@ gtk_tips_query_get_type (void)
if (!tips_query_type)
{
GtkTypeInfo tips_query_info =
static const GtkTypeInfo tips_query_info =
{
"GtkTipsQuery",
sizeof (GtkTipsQuery),

View File

@ -71,7 +71,7 @@ gtk_toggle_button_get_type (void)
if (!toggle_button_type)
{
GtkTypeInfo toggle_button_info =
static const GtkTypeInfo toggle_button_info =
{
"GtkToggleButton",
sizeof (GtkToggleButton),

View File

@ -74,7 +74,7 @@ gtk_toolbar_get_type (void)
if (!toolbar_type)
{
GtkTypeInfo toolbar_info =
static const GtkTypeInfo toolbar_info =
{
"GtkToolbar",
sizeof (GtkToolbar),

Some files were not shown because too many files have changed in this diff Show More