diff --git a/ChangeLog b/ChangeLog index c10166b1fc..fe653c37e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2006-04-06 Sven Neumann + + * app/core/gimpcontext.c + * app/core/gimpimage.c + * app/paint-funcs/paint-funcs.c + * app/widgets/gimpcontrollerkeyboard.c + * app/widgets/gimpcontrollerwheel.c + * app/widgets/gimpcursor.c + * app/widgets/gimpdockable.c + * app/widgets/gimpdockbook.c + * app/widgets/gimpdockseparator.c + * libgimp/gimpbrushselect.c + * libgimp/gimpfontselect.c + * libgimp/gimpgradientselect.c + * libgimp/gimppaletteselect.c + * libgimp/gimppatternselect.c + * libgimpwidgets/gimpchainbutton.c + * libgimpwidgets/gimpcolorscales.c + * libgimpwidgets/gimpcolorselect.c + * libgimpwidgets/gimppickbutton.c + * libgimpwidgets/gimpstock.c: sprinkled some const qualifiers. + 2006-04-06 Sven Neumann * app/core/gimpdata.c (gimp_data_error_quark) diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c index ca31bd2357..9fc8cd7b6e 100644 --- a/app/core/gimpcontext.c +++ b/app/core/gimpcontext.c @@ -279,7 +279,7 @@ enum LAST_SIGNAL }; -static gchar *gimp_context_prop_names[] = +static const gchar *gimp_context_prop_names[] = { NULL, /* PROP_0 */ "gimp", diff --git a/app/core/gimpimage.c b/app/core/gimpimage.c index 9aa0eee9df..bcd14c62ca 100644 --- a/app/core/gimpimage.c +++ b/app/core/gimpimage.c @@ -179,7 +179,7 @@ static void gimp_image_channel_color_changed (GimpChannel *channel, GimpImage *image); -static gint valid_combinations[][MAX_CHANNELS + 1] = +static const gint valid_combinations[][MAX_CHANNELS + 1] = { /* GIMP_RGB_IMAGE */ { -1, -1, -1, COMBINE_INTEN_INTEN, COMBINE_INTEN_INTEN_A }, diff --git a/app/paint-funcs/paint-funcs.c b/app/paint-funcs/paint-funcs.c index 380212a92e..96a673271c 100644 --- a/app/paint-funcs/paint-funcs.c +++ b/app/paint-funcs/paint-funcs.c @@ -47,9 +47,10 @@ typedef struct _LayerMode LayerMode; struct _LayerMode { - guint affect_alpha : 1; /* does the layer mode affect the alpha channel */ - guint increase_opacity : 1; /* layer mode can increase opacity */ - guint decrease_opacity : 1; /* layer mode can decrease opacity */ + const guint affect_alpha : 1; /* does the layer mode affect the + alpha channel */ + const guint increase_opacity : 1; /* layer mode can increase opacity */ + const guint decrease_opacity : 1; /* layer mode can decrease opacity */ }; static const LayerMode layer_modes[] = @@ -86,8 +87,10 @@ static const LayerMode layer_modes[] = { TRUE, TRUE, FALSE, } /* GIMP_ANTI_ERASE_MODE */ }; + typedef void (* LayerModeFunc) (struct apply_layer_mode_struct *); -static LayerModeFunc layer_mode_funcs[] = + +static const LayerModeFunc layer_mode_funcs[] = { layer_normal_mode, layer_dissolve_mode, diff --git a/app/widgets/gimpcontrollerkeyboard.c b/app/widgets/gimpcontrollerkeyboard.c index 6233911306..19cca903d7 100644 --- a/app/widgets/gimpcontrollerkeyboard.c +++ b/app/widgets/gimpcontrollerkeyboard.c @@ -40,10 +40,10 @@ typedef struct _KeyboardEvent KeyboardEvent; struct _KeyboardEvent { - guint keyval; - GdkModifierType modifiers; - const gchar *name; - gchar *blurb; + const guint keyval; + const GdkModifierType modifiers; + const gchar *name; + gchar *blurb; }; diff --git a/app/widgets/gimpcontrollerwheel.c b/app/widgets/gimpcontrollerwheel.c index 3203a7e272..0814383c46 100644 --- a/app/widgets/gimpcontrollerwheel.c +++ b/app/widgets/gimpcontrollerwheel.c @@ -39,10 +39,10 @@ typedef struct _WheelEvent WheelEvent; struct _WheelEvent { - GdkScrollDirection direction; - GdkModifierType modifiers; - const gchar *name; - gchar *blurb; + const GdkScrollDirection direction; + const GdkModifierType modifiers; + const gchar *name; + gchar *blurb; }; diff --git a/app/widgets/gimpcursor.c b/app/widgets/gimpcursor.c index ea34fc254f..9b2b181dee 100644 --- a/app/widgets/gimpcursor.c +++ b/app/widgets/gimpcursor.c @@ -140,10 +140,10 @@ typedef struct _GimpCursor GimpCursor; struct _GimpCursor { - guchar *bits; - guchar *mask_bits; - gint width, height; - gint x_hot, y_hot; + const guchar *bits; + const guchar *mask_bits; + const gint width, height; + const gint x_hot, y_hot; const guint8 *pixbuf_data; GdkBitmap *bitmap; @@ -166,7 +166,7 @@ static GimpCursor gimp_cursors[] = cursor_mouse_bits, cursor_mouse_mask_bits, cursor_mouse_width, cursor_mouse_height, cursor_mouse_x_hot, cursor_mouse_y_hot, - cursor_mouse, + cursor_mouse, NULL, NULL, NULL }, { cursor_crosshair_bits, cursor_crosshair_mask_bits, diff --git a/app/widgets/gimpdockable.c b/app/widgets/gimpdockable.c index 9f9690b390..a3c7940c8a 100644 --- a/app/widgets/gimpdockable.c +++ b/app/widgets/gimpdockable.c @@ -94,7 +94,7 @@ G_DEFINE_TYPE (GimpDockable, gimp_dockable, GTK_TYPE_BIN); #define parent_class gimp_dockable_parent_class -static GtkTargetEntry dialog_target_table[] = { GIMP_TARGET_DIALOG }; +static const GtkTargetEntry dialog_target_table[] = { GIMP_TARGET_DIALOG }; static void diff --git a/app/widgets/gimpdockbook.c b/app/widgets/gimpdockbook.c index 9b89e30637..211df181d1 100644 --- a/app/widgets/gimpdockbook.c +++ b/app/widgets/gimpdockbook.c @@ -101,10 +101,7 @@ G_DEFINE_TYPE (GimpDockbook, gimp_dockbook, GTK_TYPE_NOTEBOOK); static guint dockbook_signals[LAST_SIGNAL] = { 0 }; -static GtkTargetEntry dialog_target_table[] = -{ - GIMP_TARGET_DIALOG -}; +static const GtkTargetEntry dialog_target_table[] = { GIMP_TARGET_DIALOG }; static void diff --git a/app/widgets/gimpdockseparator.c b/app/widgets/gimpdockseparator.c index 164667fc5a..8a900301ed 100644 --- a/app/widgets/gimpdockseparator.c +++ b/app/widgets/gimpdockseparator.c @@ -67,7 +67,7 @@ G_DEFINE_TYPE (GimpDockSeparator, gimp_dock_separator, GTK_TYPE_EVENT_BOX); #define parent_class gimp_dock_separator_parent_class -static GtkTargetEntry dialog_target_table[] = { GIMP_TARGET_DIALOG }; +static const GtkTargetEntry dialog_target_table[] = { GIMP_TARGET_DIALOG }; static void diff --git a/libgimp/gimpbrushselect.c b/libgimp/gimpbrushselect.c index af96f01891..f2607f7ca7 100644 --- a/libgimp/gimpbrushselect.c +++ b/libgimp/gimpbrushselect.c @@ -69,7 +69,7 @@ gimp_brush_select_new (const gchar *title, GimpRunBrushCallback callback, gpointer data) { - static GimpParamDef args[] = + static const GimpParamDef args[] = { { GIMP_PDB_STRING, "str", "String" }, { GIMP_PDB_FLOAT, "opacity", "Opacity" }, diff --git a/libgimp/gimpfontselect.c b/libgimp/gimpfontselect.c index c329182b13..2f7a079990 100644 --- a/libgimp/gimpfontselect.c +++ b/libgimp/gimpfontselect.c @@ -60,7 +60,7 @@ gimp_font_select_new (const gchar *title, GimpRunFontCallback callback, gpointer data) { - static GimpParamDef args[] = + static const GimpParamDef args[] = { { GIMP_PDB_STRING, "str", "String" }, { GIMP_PDB_INT32, "dialog status", "If the dialog was closing " diff --git a/libgimp/gimpgradientselect.c b/libgimp/gimpgradientselect.c index 1bb6d01033..33fcf41ad0 100644 --- a/libgimp/gimpgradientselect.c +++ b/libgimp/gimpgradientselect.c @@ -63,7 +63,7 @@ gimp_gradient_select_new (const gchar *title, GimpRunGradientCallback callback, gpointer data) { - static GimpParamDef args[] = + static const GimpParamDef args[] = { { GIMP_PDB_STRING, "str", "String" }, { GIMP_PDB_INT32, "grad width", "Gradient width" }, diff --git a/libgimp/gimppaletteselect.c b/libgimp/gimppaletteselect.c index ca70aa8d3d..4ed54dce8d 100644 --- a/libgimp/gimppaletteselect.c +++ b/libgimp/gimppaletteselect.c @@ -60,7 +60,7 @@ gimp_palette_select_new (const gchar *title, GimpRunPaletteCallback callback, gpointer data) { - static GimpParamDef args[] = + static const GimpParamDef args[] = { { GIMP_PDB_STRING, "str", "String" }, { GIMP_PDB_INT32, "dialog status", "If the dialog was closing " diff --git a/libgimp/gimppatternselect.c b/libgimp/gimppatternselect.c index 39e17c3d6e..001fc51a4d 100644 --- a/libgimp/gimppatternselect.c +++ b/libgimp/gimppatternselect.c @@ -64,7 +64,7 @@ gimp_pattern_select_new (const gchar *title, GimpRunPatternCallback callback, gpointer data) { - static GimpParamDef args[] = + static const GimpParamDef args[] = { { GIMP_PDB_STRING, "str", "String" }, { GIMP_PDB_INT32, "mask width", "Pattern width" }, diff --git a/libgimpwidgets/gimpchainbutton.c b/libgimpwidgets/gimpchainbutton.c index ee13448ed7..106a80e0e1 100644 --- a/libgimpwidgets/gimpchainbutton.c +++ b/libgimpwidgets/gimpchainbutton.c @@ -48,7 +48,7 @@ G_DEFINE_TYPE (GimpChainButton, gimp_chain_button, GTK_TYPE_TABLE); static guint gimp_chain_button_signals[LAST_SIGNAL] = { 0 }; -static const gchar *gimp_chain_stock_items[] = +static const gchar * const gimp_chain_stock_items[] = { GIMP_STOCK_HCHAIN, GIMP_STOCK_HCHAIN_BROKEN, diff --git a/libgimpwidgets/gimpcolorscales.c b/libgimpwidgets/gimpcolorscales.c index 27b1305a60..2395ac1dc9 100644 --- a/libgimpwidgets/gimpcolorscales.c +++ b/libgimpwidgets/gimpcolorscales.c @@ -114,9 +114,12 @@ gimp_color_scales_init (GimpColorScales *scales) GSList *group; gint i; - static gdouble slider_initial_vals[] = { 0, 0, 0, 0, 0, 0, 0 }; - static gdouble slider_max_vals[] = { 360, 100, 100, 255, 255, 255, 100 }; - static gdouble slider_incs[] = { 30, 10, 10, 16, 16, 16, 10 }; + static const gdouble slider_initial_vals[] = + { 0, 0, 0, 0, 0, 0, 0 }; + static const gdouble slider_max_vals[] = + { 360, 100, 100, 255, 255, 255, 100 }; + static const gdouble slider_incs[] = + { 30, 10, 10, 16, 16, 16, 10 }; /* don't needs the toggles for our own operation */ selector->toggles_visible = FALSE; diff --git a/libgimpwidgets/gimpcolorselect.c b/libgimpwidgets/gimpcolorselect.c index b914d09607..5d81eea7fb 100644 --- a/libgimpwidgets/gimpcolorselect.c +++ b/libgimpwidgets/gimpcolorselect.c @@ -197,7 +197,7 @@ G_DEFINE_TYPE (GimpColorSelect, gimp_color_select, GIMP_TYPE_COLOR_SELECTOR); #define parent_class gimp_color_select_parent_class -static ColorSelectFillUpdateProc update_procs[] = +static const ColorSelectFillUpdateProc update_procs[] = { color_select_update_hue, color_select_update_saturation, diff --git a/libgimpwidgets/gimppickbutton.c b/libgimpwidgets/gimppickbutton.c index f26a0f0805..e01594f282 100644 --- a/libgimpwidgets/gimppickbutton.c +++ b/libgimpwidgets/gimppickbutton.c @@ -157,7 +157,7 @@ gimp_pick_button_new (void) #define DROPPER_X_HOT 2 #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, @@ -166,7 +166,7 @@ static guchar dropper_bits[] = 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, @@ -178,9 +178,9 @@ static guchar dropper_mask[] = static GdkCursor * make_cursor (void) { - GdkCursor *cursor; - GdkColor bg = { 0, 0xffff, 0xffff, 0xffff }; - GdkColor fg = { 0, 0x0000, 0x0000, 0x0000 }; + GdkCursor *cursor; + const GdkColor bg = { 0, 0xffff, 0xffff, 0xffff }; + const GdkColor fg = { 0, 0x0000, 0x0000, 0x0000 }; GdkPixmap *pixmap = gdk_bitmap_create_from_data (NULL, diff --git a/libgimpwidgets/gimpstock.c b/libgimpwidgets/gimpstock.c index 469913fe26..e98840ca84 100644 --- a/libgimpwidgets/gimpstock.c +++ b/libgimpwidgets/gimpstock.c @@ -108,7 +108,7 @@ add_sized_with_same_fallback (GtkIconFactory *factory, } -static GtkStockItem gimp_stock_items[] = +static const GtkStockItem gimp_stock_items[] = { { GIMP_STOCK_ANCHOR, N_("Anchor"), 0, 0, LIBGIMP_DOMAIN }, { GIMP_STOCK_CENTER, N_("C_enter"), 0, 0, LIBGIMP_DOMAIN }, @@ -445,7 +445,7 @@ gimp_stock_button_pixbufs[] = { GIMP_STOCK_VIDEO, stock_video_24 } }; -static struct +static const struct { const gchar *stock_id; gconstpointer inline_data; @@ -600,7 +600,7 @@ gimp_stock_menu_pixbufs[] = { GIMP_STOCK_JOIN_BEVEL, stock_join_bevel_16 } }; -static struct +static const struct { const gchar *stock_id; gconstpointer inline_data; @@ -621,7 +621,7 @@ gimp_stock_dnd_pixbufs[] = { GIMP_STOCK_FLOATING_SELECTION, stock_floating_selection_32 } }; -static struct +static const struct { const gchar *stock_id; gconstpointer inline_data; @@ -652,7 +652,7 @@ gimp_stock_dialog_pixbufs[] = { GIMP_STOCK_TEXTURE, stock_texture_64 } }; -static struct +static const struct { const gchar *stock_id; gconstpointer inline_data_ltr;