diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2002-11-13 20:23:02 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2002-11-13 20:23:02 +0000 |
commit | 050c933b346f5bd34ef74b5eabf7e108085aabe2 (patch) | |
tree | 6d55c9eb8b637b27604d4655a66ed0217783edcf /gtk | |
parent | 530fda038f20a3d69492df07de12e001ed7b7947 (diff) | |
download | gtk+-050c933b346f5bd34ef74b5eabf7e108085aabe2.tar.gz |
Add a const here.
* gtk/theme-bits/decompose-bits.c (do_part): Add a const here.
* gtk/gtkcolorsel.c:
* gtk/gtkimcontextsimple.c:
* gtk/gtkstyle.c: Mark constant data as const to give the compiler
a chance to put it in a readonly section. (#75754)
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkcolorsel.c | 4 | ||||
-rw-r--r-- | gtk/gtkimcontextsimple.c | 6 | ||||
-rw-r--r-- | gtk/gtkstyle.c | 38 | ||||
-rw-r--r-- | gtk/theme-bits/decompose-bits.c | 2 |
4 files changed, 25 insertions, 25 deletions
diff --git a/gtk/gtkcolorsel.c b/gtk/gtkcolorsel.c index 3d61c3a130..f7aa7a5d59 100644 --- a/gtk/gtkcolorsel.c +++ b/gtk/gtkcolorsel.c @@ -185,14 +185,14 @@ static GtkColorSelectionChangePaletteWithScreenFunc change_palette_hook = defaul #define DROPPER_Y_HOT 16 -static guchar dropper_bits[] = { +static const guchar dropper_bits[] = { 0xff, 0x8f, 0x01, 0xff, 0x77, 0x01, 0xff, 0xfb, 0x00, 0xff, 0xf8, 0x00, 0x7f, 0xff, 0x00, 0xff, 0x7e, 0x01, 0xff, 0x9d, 0x01, 0xff, 0xd8, 0x01, 0x7f, 0xd4, 0x01, 0x3f, 0xee, 0x01, 0x1f, 0xff, 0x01, 0x8f, 0xff, 0x01, 0xc7, 0xff, 0x01, 0xe3, 0xff, 0x01, 0xf3, 0xff, 0x01, 0xfd, 0xff, 0x01, 0xff, 0xff, 0x01, }; -static guchar dropper_mask[] = { +static const guchar dropper_mask[] = { 0x00, 0x70, 0x00, 0x00, 0xf8, 0x00, 0x00, 0xfc, 0x01, 0x00, 0xff, 0x01, 0x80, 0xff, 0x01, 0x00, 0xff, 0x00, 0x00, 0x7f, 0x00, 0x80, 0x3f, 0x00, 0xc0, 0x3f, 0x00, 0xe0, 0x13, 0x00, 0xf0, 0x01, 0x00, 0xf8, 0x00, 0x00, diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c index a39b7c74cc..6976f31624 100644 --- a/gtk/gtkimcontextsimple.c +++ b/gtk/gtkimcontextsimple.c @@ -27,7 +27,7 @@ typedef struct _GtkComposeTable GtkComposeTable; struct _GtkComposeTable { - guint16 *data; + const guint16 *data; gint max_seq_len; gint n_seqs; }; @@ -55,7 +55,7 @@ struct _GtkComposeTable * that depend on the locale or selected input method. */ -static guint16 gtk_compose_seqs[] = { +static const guint16 gtk_compose_seqs[] = { GDK_dead_grave, GDK_space, 0, 0, 0, 0x0060, /* GRAVE_ACCENT */ GDK_dead_grave, GDK_A, 0, 0, 0, 0x00C0, /* LATIN_CAPITAL_LETTER_A_WITH_GRAVE */ GDK_dead_grave, GDK_E, 0, 0, 0, 0x00C8, /* LATIN_CAPITAL_LETTER_E_WITH_GRAVE */ @@ -832,7 +832,7 @@ static const GtkComposeTable gtk_compose_table = { G_N_ELEMENTS (gtk_compose_seqs) / 6 }; -guint16 gtk_compose_ignore[] = { +static const guint16 gtk_compose_ignore[] = { GDK_Shift_L, GDK_Shift_R, GDK_Control_L, diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index aa3fb77594..9032cd60af 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -344,39 +344,39 @@ typedef enum { /* * Extracted from check-13.png, width=13, height=13 */ -static guchar check_black_bits[] = { +static const guchar check_black_bits[] = { 0x00,0x00,0xfe,0x0f,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02, 0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x00,0x00,0x00,0x00}; -static guchar check_dark_bits[] = { +static const guchar check_dark_bits[] = { 0xff,0x1f,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01, 0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x00,0x00}; -static guchar check_mid_bits[] = { +static const guchar check_mid_bits[] = { 0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00,0x08,0x00, 0x08,0x00,0x08,0x00,0x08,0x00,0x08,0xfc,0x0f,0x00,0x00,0x00,0x00}; -static guchar check_light_bits[] = { +static const guchar check_light_bits[] = { 0x00,0x00,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00, 0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x10,0xfe,0x1f,0x00,0x00}; -static guchar check_text_bits[] = { +static const guchar check_text_bits[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x03,0x80,0x01,0x80,0x00,0x58, 0x00,0x60,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; -static guchar check_aa_bits[] = { +static const guchar check_aa_bits[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x58,0x00,0xa0, 0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; -static guchar check_base_bits[] = { +static const guchar check_base_bits[] = { 0x00,0x00,0x00,0x00,0xfc,0x07,0xfc,0x07,0xfc,0x07,0xfc,0x07,0xfc,0x07,0xfc, 0x07,0xfc,0x07,0xfc,0x07,0xfc,0x07,0x00,0x00,0x00,0x00,0x00,0x00}; /* * Extracted from check-13-inconsistent.png, width=13, height=13 */ -static guchar check_inconsistent_text_bits[] = { +static const guchar check_inconsistent_text_bits[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x03,0xf8, 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; #if 0 /* * check_inconsistent_aa_bits is currently not used, since it is all zeros. */ -static guchar check_inconsistent_aa_bits[] = { +static const guchar check_inconsistent_aa_bits[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; #endif @@ -384,45 +384,45 @@ static guchar check_inconsistent_aa_bits[] = { /* * Extracted from radio-13.png, width=13, height=13 */ -static guchar radio_black_bits[] = { +static const guchar radio_black_bits[] = { 0x00,0x00,0xf0,0x01,0x0c,0x02,0x04,0x00,0x02,0x00,0x02,0x00,0x02,0x00,0x02, 0x00,0x02,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x08}; -static guchar radio_dark_bits[] = { +static const guchar radio_dark_bits[] = { 0xf0,0x00,0x0c,0x02,0x02,0x04,0x02,0x04,0x01,0x08,0x01,0x08,0x01,0x08,0x01, 0x08,0x00,0x08,0x02,0x04,0x0c,0x06,0xf0,0x01,0x00,0x00,0x00,0x00}; -static guchar radio_mid_bits[] = { +static const guchar radio_mid_bits[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; -static guchar radio_light_bits[] = { +static const guchar radio_light_bits[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x10,0x00, 0x10,0x00,0x10,0x00,0x08,0x00,0x08,0x00,0x06,0xe0,0x01,0x00,0x00}; -static guchar radio_text_bits[] = { +static const guchar radio_text_bits[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x00,0xf0,0x01,0xf0,0x01,0xf0, 0x01,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; #if 0 /* * radio_aa_bits is currently not used, since it is all zeros. */ -static guchar radio_aa_bits[] = { +static const guchar radio_aa_bits[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; #endif -static guchar radio_base_bits[] = { +static const guchar radio_base_bits[] = { 0x00,0x00,0x00,0x00,0xf0,0x01,0xf8,0x03,0xfc,0x07,0xfc,0x07,0xfc,0x07,0xfc, 0x07,0xfc,0x07,0xf8,0x03,0xf0,0x01,0x00,0x00,0x00,0x00,0x00,0x00}; /* * Extracted from radio-13.png, width=13, height=13 */ -static guchar radio_inconsistent_text_bits[] = { +static const guchar radio_inconsistent_text_bits[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x03,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; -static guchar radio_inconsistent_aa_bits[] = { +static const guchar radio_inconsistent_aa_bits[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x03,0x00,0x00,0xf8, 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}; static struct { - guchar *bits; + const guchar *bits; GList *bmap_list; /* list of GdkBitmap */ } indicator_parts[] = { { check_aa_bits, NULL }, diff --git a/gtk/theme-bits/decompose-bits.c b/gtk/theme-bits/decompose-bits.c index 3b6cd85189..69f27a8ebe 100644 --- a/gtk/theme-bits/decompose-bits.c +++ b/gtk/theme-bits/decompose-bits.c @@ -46,7 +46,7 @@ do_part (GdkPixbuf *pixbuf, color3 = pixels + part3_index * n_channels; pixels += rowstride; - printf ("static guchar %s_%s_bits[] = {\n", base_name, part_name); + printf ("static const guchar %s_%s_bits[] = {\n", base_name, part_name); printf (" "); while (height--) |