[gimp] Bug 761170 - Warnings building with clang



commit f2d581a53639bef26227edcd21925bf228b0162a
Author: Michael Natterer <mitch gimp org>
Date:   Fri Feb 12 22:48:59 2016 +0100

    Bug 761170 - Warnings building with clang
    
    Fix a bunch of clang warnings.

 app/core/gimpcontext.c         |   16 ++++++++++++----
 app/core/gimpimage-new.c       |    2 +-
 app/dialogs/lebl-dialog.c      |    4 ----
 app/display/gimpcursorview.c   |    2 +-
 app/tools/gimpcagetool.c       |   14 +++++++-------
 app/tools/gimpsheartool.c      |    4 ++--
 libgimpbase/gimpenv.c          |    2 +-
 libgimpwidgets/gimpruler.c     |    2 +-
 modules/color-selector-water.c |    5 -----
 9 files changed, 25 insertions(+), 26 deletions(-)
---
diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c
index bb1d657..9b0f3c8 100644
--- a/app/core/gimpcontext.c
+++ b/app/core/gimpcontext.c
@@ -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);
 
diff --git a/app/core/gimpimage-new.c b/app/core/gimpimage-new.c
index 9fdb868..4ebd670 100644
--- a/app/core/gimpimage-new.c
+++ b/app/core/gimpimage-new.c
@@ -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;
 
diff --git a/app/dialogs/lebl-dialog.c b/app/dialogs/lebl-dialog.c
index 87e5c25..54ac72a 100644
--- a/app/dialogs/lebl-dialog.c
+++ b/app/dialogs/lebl-dialog.c
@@ -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
diff --git a/app/display/gimpcursorview.c b/app/display/gimpcursorview.c
index 57636f2..28f05bd 100644
--- a/app/display/gimpcursorview.c
+++ b/app/display/gimpcursorview.c
@@ -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,
diff --git a/app/tools/gimpcagetool.c b/app/tools/gimpcagetool.c
index ddb96a7..2a44576 100644
--- a/app/tools/gimpcagetool.c
+++ b/app/tools/gimpcagetool.c
@@ -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;
diff --git a/app/tools/gimpsheartool.c b/app/tools/gimpsheartool.c
index 1179bf9..ce6fa26 100644
--- a/app/tools/gimpsheartool.c
+++ b/app/tools/gimpsheartool.c
@@ -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;
diff --git a/libgimpbase/gimpenv.c b/libgimpbase/gimpenv.c
index 92ef709..1587523 100644
--- a/libgimpbase/gimpenv.c
+++ b/libgimpbase/gimpenv.c
@@ -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);
 }
 
 /**
diff --git a/libgimpwidgets/gimpruler.c b/libgimpwidgets/gimpruler.c
index 1011c5e..880a82e 100644
--- a/libgimpwidgets/gimpruler.c
+++ b/libgimpwidgets/gimpruler.c
@@ -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;
diff --git a/modules/color-selector-water.c b/modules/color-selector-water.c
index 99d9bb2..2abfef4 100644
--- a/modules/color-selector-water.c
+++ b/modules/color-selector-water.c
@@ -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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]