Bug 761170 - Warnings building with clang

Fix a bunch of clang warnings.
This commit is contained in:
Michael Natterer 2016-02-12 22:48:59 +01:00
parent c1902c31ab
commit f2d581a536
9 changed files with 25 additions and 26 deletions

View File

@ -1917,8 +1917,10 @@ gimp_context_get_by_type (GimpContext *context,
GimpObject *object = NULL;
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail ((prop = gimp_context_type_to_property (type)) != -1,
NULL);
prop = gimp_context_type_to_property (type);
g_return_val_if_fail (prop != -1, NULL);
g_object_get (context,
gimp_context_prop_names[prop], &object,
@ -1941,7 +1943,10 @@ gimp_context_set_by_type (GimpContext *context,
GimpContextPropType prop;
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail ((prop = gimp_context_type_to_property (type)) != -1);
prop = gimp_context_type_to_property (type);
g_return_if_fail (prop != -1);
g_object_set (context,
gimp_context_prop_names[prop], object,
@ -1956,7 +1961,10 @@ gimp_context_changed_by_type (GimpContext *context,
GimpObject *object;
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail ((prop = gimp_context_type_to_property (type)) != -1);
prop = gimp_context_type_to_property (type);
g_return_if_fail (prop != -1);
object = gimp_context_get_by_type (context, type);

View File

@ -332,7 +332,7 @@ gimp_image_new_from_pixbuf (Gimp *gimp,
GimpImage *new_image;
GimpLayer *layer;
GimpImageBaseType base_type;
gboolean has_alpha;
gboolean has_alpha = FALSE;
guint8 *icc_data;
gsize icc_len;

View File

@ -13,10 +13,6 @@
#include "gimp-intl.h"
static const guint8 goatpb2[];
static const guint8 goatpb[];
static const guint8 wanda[];
/* phish code */
#define PHSHFRAMES 8
#define PHSHORIGWIDTH 288

View File

@ -489,7 +489,7 @@ static void
gimp_cursor_view_set_label_italic (GtkWidget *label,
gboolean italic)
{
PangoAttrType attribute = italic ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL;
PangoStyle attribute = italic ? PANGO_STYLE_ITALIC : PANGO_STYLE_NORMAL;
gimp_label_set_attributes (GTK_LABEL (label),
PANGO_ATTR_STYLE, attribute,

View File

@ -688,8 +688,8 @@ gimp_cage_tool_button_release (GimpTool *tool,
{
GeglRectangle area = { MIN (ct->selection_start_x, coords->x) - ct->offset_x,
MIN (ct->selection_start_y, coords->y) - ct->offset_y,
abs (ct->selection_start_x - coords->x),
abs (ct->selection_start_y - coords->y) };
ABS (ct->selection_start_x - coords->x),
ABS (ct->selection_start_y - coords->y) };
if (state & gimp_get_extend_selection_mask ())
{
@ -718,8 +718,8 @@ gimp_cage_tool_button_release (GimpTool *tool,
{
GeglRectangle area = { MIN (ct->selection_start_x, coords->x) - ct->offset_x,
MIN (ct->selection_start_y, coords->y) - ct->offset_y,
abs (ct->selection_start_x - coords->x),
abs (ct->selection_start_y - coords->y) };
ABS (ct->selection_start_x - coords->x),
ABS (ct->selection_start_y - coords->y) };
if (state & gimp_get_extend_selection_mask ())
{
@ -884,8 +884,8 @@ gimp_cage_tool_draw (GimpDrawTool *draw_tool)
FALSE,
MIN (ct->selection_start_x, ct->cursor_x),
MIN (ct->selection_start_y, ct->cursor_y),
abs (ct->selection_start_x - ct->cursor_x),
abs (ct->selection_start_y - ct->cursor_y));
ABS (ct->selection_start_x - ct->cursor_x),
ABS (ct->selection_start_y - ct->cursor_y));
}
}
@ -1035,7 +1035,7 @@ gimp_cage_tool_is_on_edge (GimpCageTool *ct,
lEB = lAB / 2 + (SQR (lBC) - SQR (lAC)) / (2 * lAB);
lEC = sqrt (SQR (lBC) - SQR (lEB));
if ((lEC < handle_size / 2) && (abs (SQR (lBC) - SQR (lAC)) <= SQR (lAB)))
if ((lEC < handle_size / 2) && (ABS (SQR (lBC) - SQR (lAC)) <= SQR (lAB)))
return i;
A = B;

View File

@ -182,9 +182,9 @@ gimp_shear_tool_motion (GimpTransformTool *tr_tool)
if (tr_tool->trans_info[HORZ_OR_VERT] == GIMP_ORIENTATION_UNKNOWN)
{
if (abs (diffx) > MIN_MOVE || abs (diffy) > MIN_MOVE)
if (ABS (diffx) > MIN_MOVE || ABS (diffy) > MIN_MOVE)
{
if (abs (diffx) > abs (diffy))
if (ABS (diffx) > ABS (diffy))
{
tr_tool->trans_info[HORZ_OR_VERT] = GIMP_ORIENTATION_HORIZONTAL;
tr_tool->trans_info[XSHEAR] = 0.0;

View File

@ -773,7 +773,7 @@ gimp_plug_in_directory_file (const gchar *first_element,
const gchar *
gimp_user_directory (GimpUserDirectory type)
{
return g_get_user_special_dir (type);
return g_get_user_special_dir ((GUserDirectory) type);
}
/**

View File

@ -234,7 +234,7 @@ gimp_ruler_init (GimpRuler *ruler)
gtk_widget_set_has_window (GTK_WIDGET (ruler), FALSE);
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
priv->unit = GIMP_PIXELS;
priv->unit = GIMP_UNIT_PIXEL;
priv->lower = 0;
priv->upper = 0;
priv->position = 0;

View File

@ -86,11 +86,6 @@ static const GimpModuleInfo colorsel_water_info =
"1998-2006"
};
static const GtkTargetEntry targets[] =
{
{ "application/x-color", 0 }
};
G_DEFINE_DYNAMIC_TYPE (ColorselWater, colorsel_water,
GIMP_TYPE_COLOR_SELECTOR)