plug-ins/common/channel_mixer.c get rid of compiler warnings about
2007-04-12 Sven Neumann <sven@gimp.org> * plug-ins/common/channel_mixer.c * plug-ins/gfig/gfig-style.c: get rid of compiler warnings about dereferencing type-punned pointers. svn path=/trunk/; revision=22239
This commit is contained in:

committed by
Sven Neumann

parent
c68c91c94d
commit
866514572c
@ -1,3 +1,9 @@
|
|||||||
|
2007-04-12 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* plug-ins/common/channel_mixer.c
|
||||||
|
* plug-ins/gfig/gfig-style.c: get rid of compiler warnings about
|
||||||
|
dereferencing type-punned pointers.
|
||||||
|
|
||||||
2007-04-12 Sven Neumann <sven@gimp.org>
|
2007-04-12 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/tools/gimplevelstool.c
|
* app/tools/gimplevelstool.c
|
||||||
|
@ -1144,10 +1144,14 @@ static void
|
|||||||
cm_combo_callback (GtkWidget *widget,
|
cm_combo_callback (GtkWidget *widget,
|
||||||
CmParamsType *mix)
|
CmParamsType *mix)
|
||||||
{
|
{
|
||||||
gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget),
|
gint value;
|
||||||
(gint *) &mix->output_channel);
|
|
||||||
|
|
||||||
cm_set_adjusters (mix);
|
if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value))
|
||||||
|
{
|
||||||
|
mix->output_channel = value;
|
||||||
|
|
||||||
|
cm_set_adjusters (mix);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -204,6 +204,7 @@ gfig_load_style (Style *style,
|
|||||||
gchar load_buf2[MAX_LOAD_LINE];
|
gchar load_buf2[MAX_LOAD_LINE];
|
||||||
gchar *style_text[100];
|
gchar *style_text[100];
|
||||||
gint nitems = 0;
|
gint nitems = 0;
|
||||||
|
gint value;
|
||||||
gint k;
|
gint k;
|
||||||
gchar name[100];
|
gchar name[100];
|
||||||
|
|
||||||
@ -243,18 +244,28 @@ gfig_load_style (Style *style,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gfig_read_parameter_string (style_text, nitems, "BrushName", &style->brush_name);
|
gfig_read_parameter_string (style_text, nitems, "BrushName",
|
||||||
if (! &style->brush_name )
|
&style->brush_name);
|
||||||
|
|
||||||
|
if (style->brush_name == NULL)
|
||||||
g_message ("Error loading style: got NULL for brush name.");
|
g_message ("Error loading style: got NULL for brush name.");
|
||||||
|
|
||||||
gfig_read_parameter_string (style_text, nitems, "Pattern", &style->pattern);
|
gfig_read_parameter_string (style_text, nitems, "Pattern", &style->pattern);
|
||||||
gfig_read_parameter_string (style_text, nitems, "Gradient", &style->gradient);
|
gfig_read_parameter_string (style_text, nitems, "Gradient", &style->gradient);
|
||||||
gfig_read_parameter_gimp_rgb (style_text, nitems, "Foreground", &style->foreground);
|
|
||||||
gfig_read_parameter_gimp_rgb (style_text, nitems, "Background", &style->background);
|
gfig_read_parameter_gimp_rgb (style_text, nitems, "Foreground",
|
||||||
gfig_read_parameter_int (style_text, nitems, "FillType", (gint *)&style->fill_type);
|
&style->foreground);
|
||||||
gfig_read_parameter_int (style_text, nitems, "PaintType", (gint *)&style->paint_type);
|
gfig_read_parameter_gimp_rgb (style_text, nitems, "Background",
|
||||||
gfig_read_parameter_double (style_text, nitems, "FillOpacity",
|
&style->background);
|
||||||
(gdouble *)&style->fill_opacity);
|
|
||||||
|
gfig_read_parameter_int (style_text, nitems, "FillType", &value);
|
||||||
|
style->fill_type = value;
|
||||||
|
|
||||||
|
gfig_read_parameter_int (style_text, nitems, "PaintType", &value);
|
||||||
|
style->paint_type = value;
|
||||||
|
|
||||||
|
gfig_read_parameter_double (style_text, nitems, "FillOpacity",
|
||||||
|
&style->fill_opacity);
|
||||||
|
|
||||||
for (k = 0; k < nitems; k++)
|
for (k = 0; k < nitems; k++)
|
||||||
{
|
{
|
||||||
@ -694,8 +705,9 @@ gfig_style_set_context_from_style (Style *style)
|
|||||||
void
|
void
|
||||||
gfig_style_set_style_from_context (Style *style)
|
gfig_style_set_style_from_context (Style *style)
|
||||||
{
|
{
|
||||||
GimpRGB color;
|
|
||||||
Style *current_style;
|
Style *current_style;
|
||||||
|
GimpRGB color;
|
||||||
|
gint value;
|
||||||
|
|
||||||
style->name = "object";
|
style->name = "object";
|
||||||
current_style = gfig_context_get_current_style ();
|
current_style = gfig_context_get_current_style ();
|
||||||
@ -711,23 +723,22 @@ gfig_style_set_style_from_context (Style *style)
|
|||||||
&color);
|
&color);
|
||||||
gfig_rgba_copy (&style->background, &color);
|
gfig_rgba_copy (&style->background, &color);
|
||||||
|
|
||||||
style->brush_name = current_style->brush_name;
|
style->brush_name = current_style->brush_name;
|
||||||
|
|
||||||
if (!style->pattern || strcmp (style->pattern, current_style->pattern))
|
if (!style->pattern || strcmp (style->pattern, current_style->pattern))
|
||||||
{
|
{
|
||||||
style->pattern = g_strdup (current_style->pattern); /* why strduping? */
|
style->pattern = g_strdup (current_style->pattern); /* why strduping? */
|
||||||
}
|
}
|
||||||
|
|
||||||
style->gradient = current_style->gradient;
|
style->gradient = current_style->gradient;
|
||||||
|
|
||||||
gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (gfig_context->fillstyle_combo),
|
if (gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (gfig_context->fillstyle_combo), &value))
|
||||||
(gint *) &style->fill_type);
|
style->fill_type = value;
|
||||||
|
|
||||||
/* FIXME when there is an opacity control widget to read */
|
/* FIXME when there is an opacity control widget to read */
|
||||||
style->fill_opacity = 100.;
|
style->fill_opacity = 100.;
|
||||||
|
|
||||||
style->paint_type =
|
style->paint_type = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gfig_context->paint_type_toggle));
|
||||||
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gfig_context->paint_type_toggle));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user