mirror of https://github.com/GNOME/gimp.git
app/tools/gimplevelstool.c app/tools/gimpcurvestool.c app/xcf/xcf-save.c
2007-04-12 Sven Neumann <sven@gimp.org> * app/tools/gimplevelstool.c * app/tools/gimpcurvestool.c * app/xcf/xcf-save.c * app/xcf/xcf-load.c * app/widgets/gimppaletteeditor.c * app/widgets/gimpcolormapeditor.c * app/widgets/gimpcolorframe.c: get rid of compiler warnings about dereferencing type-punned pointers. svn path=/trunk/; revision=22238
This commit is contained in:
parent
fb095cf281
commit
c68c91c94d
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2007-04-12 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/tools/gimplevelstool.c
|
||||
* app/tools/gimpcurvestool.c
|
||||
* app/xcf/xcf-save.c
|
||||
* app/xcf/xcf-load.c
|
||||
* app/widgets/gimppaletteeditor.c
|
||||
* app/widgets/gimpcolormapeditor.c
|
||||
* app/widgets/gimpcolorframe.c: get rid of compiler warnings about
|
||||
dereferencing type-punned pointers.
|
||||
|
||||
2007-04-12 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* libgimpbase/gimpprotocol.[ch] (struct _GPParam): don't redefine
|
||||
|
|
|
@ -895,19 +895,23 @@ static void
|
|||
curves_channel_callback (GtkWidget *widget,
|
||||
GimpCurvesTool *tool)
|
||||
{
|
||||
gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget),
|
||||
(gint *) &tool->channel);
|
||||
gimp_histogram_view_set_channel (GIMP_HISTOGRAM_VIEW (tool->graph),
|
||||
tool->channel);
|
||||
gint value;
|
||||
|
||||
/* FIXME: hack */
|
||||
if (! tool->color)
|
||||
tool->channel = (tool->channel == GIMP_HISTOGRAM_ALPHA) ? 1 : 0;
|
||||
if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value))
|
||||
{
|
||||
tool->channel = value;
|
||||
gimp_histogram_view_set_channel (GIMP_HISTOGRAM_VIEW (tool->graph),
|
||||
tool->channel);
|
||||
|
||||
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (tool->curve_type),
|
||||
tool->curves->curve_type[tool->channel]);
|
||||
/* FIXME: hack */
|
||||
if (! tool->color)
|
||||
tool->channel = (tool->channel == GIMP_HISTOGRAM_ALPHA) ? 1 : 0;
|
||||
|
||||
curves_update (tool, ALL);
|
||||
gimp_int_radio_group_set_active (GTK_RADIO_BUTTON (tool->curve_type),
|
||||
tool->curves->curve_type[tool->channel]);
|
||||
|
||||
curves_update (tool, ALL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -857,17 +857,20 @@ static void
|
|||
levels_channel_callback (GtkWidget *widget,
|
||||
GimpLevelsTool *tool)
|
||||
{
|
||||
gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget),
|
||||
(gint *) &tool->channel);
|
||||
gint value;
|
||||
|
||||
gimp_histogram_view_set_channel (GIMP_HISTOGRAM_VIEW (tool->hist_view),
|
||||
tool->channel);
|
||||
if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value))
|
||||
{
|
||||
tool->channel = value;
|
||||
gimp_histogram_view_set_channel (GIMP_HISTOGRAM_VIEW (tool->hist_view),
|
||||
tool->channel);
|
||||
|
||||
/* FIXME: hack */
|
||||
if (! tool->color)
|
||||
tool->channel = (tool->channel == GIMP_HISTOGRAM_ALPHA) ? 1 : 0;
|
||||
/* FIXME: hack */
|
||||
if (! tool->color)
|
||||
tool->channel = (tool->channel == GIMP_HISTOGRAM_ALPHA) ? 1 : 0;
|
||||
|
||||
levels_update (tool, ALL);
|
||||
levels_update (tool, ALL);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -385,9 +385,13 @@ static void
|
|||
gimp_color_frame_menu_callback (GtkWidget *widget,
|
||||
GimpColorFrame *frame)
|
||||
{
|
||||
gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget),
|
||||
(gint *) &frame->frame_mode);
|
||||
gimp_color_frame_update (frame);
|
||||
gint value;
|
||||
|
||||
if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value))
|
||||
{
|
||||
frame->frame_mode = value;
|
||||
gimp_color_frame_update (frame);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -158,6 +158,7 @@ gimp_colormap_editor_init (GimpColormapEditor *editor)
|
|||
{
|
||||
GtkWidget *frame;
|
||||
GtkWidget *table;
|
||||
GtkObject *adj;
|
||||
|
||||
editor->col_index = 0;
|
||||
editor->dnd_col_index = 0;
|
||||
|
@ -198,9 +199,9 @@ gimp_colormap_editor_init (GimpColormapEditor *editor)
|
|||
gtk_box_pack_end (GTK_BOX (editor), table, FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
editor->index_spinbutton =
|
||||
gimp_spin_button_new ((GtkObject **) &editor->index_adjustment,
|
||||
0, 0, 0, 1, 10, 10, 1.0, 0);
|
||||
editor->index_spinbutton = gimp_spin_button_new (&adj,
|
||||
0, 0, 0, 1, 10, 10, 1.0, 0);
|
||||
editor->index_adjustment = GTK_ADJUSTMENT (adj);
|
||||
gimp_table_attach_aligned (GTK_TABLE (table), 0, 0,
|
||||
_("Color index:"), 0.0, 0.5,
|
||||
editor->index_spinbutton, 1, TRUE);
|
||||
|
|
|
@ -177,6 +177,7 @@ gimp_palette_editor_init (GimpPaletteEditor *editor)
|
|||
GtkWidget *hbox;
|
||||
GtkWidget *label;
|
||||
GtkWidget *spinbutton;
|
||||
GtkObject *adj;
|
||||
|
||||
editor->zoom_factor = 1.0;
|
||||
editor->col_width = 0;
|
||||
|
@ -263,8 +264,8 @@ gimp_palette_editor_init (GimpPaletteEditor *editor)
|
|||
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
||||
gtk_widget_show (label);
|
||||
|
||||
spinbutton = gimp_spin_button_new ((GtkObject **) &editor->columns_data,
|
||||
0, 0, 64, 1, 4, 4, 1, 0);
|
||||
spinbutton = gimp_spin_button_new (&adj, 0, 0, 64, 1, 4, 4, 1, 0);
|
||||
editor->columns_data = GTK_ADJUSTMENT (adj);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), spinbutton, FALSE, FALSE, 0);
|
||||
gtk_widget_show (spinbutton);
|
||||
|
||||
|
|
|
@ -620,6 +620,7 @@ xcf_load_layer_props (XcfInfo *info,
|
|||
{
|
||||
PropType prop_type;
|
||||
guint32 prop_size;
|
||||
guint32 value;
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
|
@ -700,7 +701,8 @@ xcf_load_layer_props (XcfInfo *info,
|
|||
break;
|
||||
|
||||
case PROP_MODE:
|
||||
info->cp += xcf_read_int32 (info->fp, (guint32 *) &layer->mode, 1);
|
||||
info->cp += xcf_read_int32 (info->fp, &value, 1);
|
||||
layer->mode = value;
|
||||
break;
|
||||
|
||||
case PROP_TATTOO:
|
||||
|
|
|
@ -282,13 +282,14 @@ xcf_save_image (XcfInfo *info,
|
|||
GimpLayer *layer;
|
||||
GimpLayer *floating_layer;
|
||||
GimpChannel *channel;
|
||||
GList *list;
|
||||
guint32 saved_pos;
|
||||
guint32 offset;
|
||||
guint32 value;
|
||||
guint nlayers;
|
||||
guint nchannels;
|
||||
guint progress = 0;
|
||||
guint max_progress;
|
||||
GList *list;
|
||||
gboolean have_selection;
|
||||
gint t1, t2, t3, t4;
|
||||
gchar version_tag[16];
|
||||
|
@ -313,7 +314,9 @@ xcf_save_image (XcfInfo *info,
|
|||
/* write out the width, height and image type information for the image */
|
||||
xcf_write_int32_print_error (info, (guint32 *) &image->width, 1);
|
||||
xcf_write_int32_print_error (info, (guint32 *) &image->height, 1);
|
||||
xcf_write_int32_print_error (info, (guint32 *) &image->base_type, 1);
|
||||
|
||||
value = image->base_type;
|
||||
xcf_write_int32_print_error (info, &value, 1);
|
||||
|
||||
/* determine the number of layers and channels in the image */
|
||||
nlayers = (guint) gimp_container_num_children (image->layers);
|
||||
|
@ -1133,10 +1136,10 @@ xcf_save_layer (XcfInfo *info,
|
|||
GimpLayer *layer,
|
||||
GError **error)
|
||||
{
|
||||
guint32 saved_pos;
|
||||
guint32 offset;
|
||||
|
||||
GError *tmp_error = NULL;
|
||||
guint32 saved_pos;
|
||||
guint32 offset;
|
||||
guint32 value;
|
||||
GError *tmp_error = NULL;
|
||||
|
||||
/* check and see if this is the drawable that the floating
|
||||
* selection is attached to.
|
||||
|
@ -1154,8 +1157,9 @@ xcf_save_layer (XcfInfo *info,
|
|||
(guint32 *) &GIMP_ITEM (layer)->width, 1);
|
||||
xcf_write_int32_check_error (info,
|
||||
(guint32 *) &GIMP_ITEM (layer)->height, 1);
|
||||
xcf_write_int32_check_error (info,
|
||||
(guint32 *) &GIMP_DRAWABLE (layer)->type, 1);
|
||||
|
||||
value = gimp_drawable_type (GIMP_DRAWABLE (layer));
|
||||
xcf_write_int32_check_error (info, &value, 1);
|
||||
|
||||
/* write out the layers name */
|
||||
xcf_write_string_check_error (info, &GIMP_OBJECT (layer)->name, 1);
|
||||
|
|
Loading…
Reference in New Issue