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:
@ -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),
|
||||
|
||||
Reference in New Issue
Block a user