diff options
author | Elliot Lee <sopwith@cuc.ml.org> | 1998-11-30 19:07:15 +0000 |
---|---|---|
committer | Elliot Lee <sopwith@src.gnome.org> | 1998-11-30 19:07:15 +0000 |
commit | 060978e069b3c1726c7a1fb3916c3e8c8348a813 (patch) | |
tree | b92907dd3d6ca58cb5e5bf7e7481277feada033c /gdk/gdkvisual.c | |
parent | 58ca2448eb7d0a337fd83bd2951f5d9adde81b7c (diff) | |
download | gtk+-060978e069b3c1726c7a1fb3916c3e8c8348a813.tar.gz |
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.
Diffstat (limited to 'gdk/gdkvisual.c')
-rw-r--r-- | gdk/gdkvisual.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gdk/gdkvisual.c b/gdk/gdkvisual.c index 693020ef61..ebdcccb127 100644 --- a/gdk/gdkvisual.c +++ b/gdk/gdkvisual.c @@ -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; |