[gimp] Removes various easy compilation warnings.



commit 56c2e19733e05d48282f3537fa4a9e69b31469b1
Author: Jehan <jehan girinstud io>
Date:   Sun Sep 28 18:18:00 2014 +0200

    Removes various easy compilation warnings.

 app/file/file-remote.c    |   10 +++++-----
 app/tools/gimpblendtool.c |   15 ++++++++-------
 tools/gimptool.c          |    7 +++++--
 3 files changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/app/file/file-remote.c b/app/file/file-remote.c
index c2efcb5..bf2bdb3 100644
--- a/app/file/file-remote.c
+++ b/app/file/file-remote.c
@@ -207,11 +207,11 @@ file_remote_upload_image_finish (Gimp          *gimp,
                                  GimpProgress  *progress,
                                  GError       **error)
 {
-  g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
-  g_return_val_if_fail (G_IS_FILE (file), NULL);
-  g_return_val_if_fail (G_IS_FILE (local_file), NULL);
-  g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
-  g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+  g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
+  g_return_val_if_fail (G_IS_FILE (file), FALSE);
+  g_return_val_if_fail (G_IS_FILE (local_file), FALSE);
+  g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
   if (! file_remote_copy_file (gimp, local_file, file, UPLOAD,
                                progress, error))
diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c
index fb54c3a..3b89ae5 100644
--- a/app/tools/gimpblendtool.c
+++ b/app/tools/gimpblendtool.c
@@ -404,12 +404,14 @@ gimp_blend_tool_motion (GimpTool         *tool,
 {
   GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (tool);
   GimpDrawTool  *draw_tool  = GIMP_DRAW_TOOL (tool);
+  gdouble last_x;
+  gdouble last_y;
 
   gimp_draw_tool_pause (draw_tool);
 
   /* Save the mouse coordinates from last call */
-  gdouble last_x = blend_tool->mouse_x;
-  gdouble last_y = blend_tool->mouse_y;
+  last_x = blend_tool->mouse_x;
+  last_y = blend_tool->mouse_y;
 
   blend_tool->mouse_x = coords->x;
   blend_tool->mouse_y = coords->y;
@@ -576,8 +578,10 @@ gimp_blend_tool_cursor_update (GimpTool         *tool,
 static void
 gimp_blend_tool_draw (GimpDrawTool *draw_tool)
 {
-  GimpBlendTool  *blend_tool = GIMP_BLEND_TOOL (draw_tool);
-  GimpCanvasItem *start_handle_cross, *end_handle_cross;
+  GimpBlendTool      *blend_tool = GIMP_BLEND_TOOL (draw_tool);
+  GimpCanvasItem     *start_handle_cross, *end_handle_cross;
+  GimpBlendToolPoint  hilight_point;
+  gboolean            start_visible, end_visible;
 
   gimp_draw_tool_add_line (draw_tool,
                            blend_tool->start_x,
@@ -603,9 +607,6 @@ gimp_blend_tool_draw (GimpDrawTool *draw_tool)
                                HANDLE_CROSS_DIAMETER,
                                GIMP_HANDLE_ANCHOR_CENTER);
 
-  GimpBlendToolPoint hilight_point;
-  gboolean           start_visible, end_visible;
-
   /* Calculate handle visibility */
   if (blend_tool->grabbed_point)
     {
diff --git a/tools/gimptool.c b/tools/gimptool.c
index bd0ab0d..f861fa1 100644
--- a/tools/gimptool.c
+++ b/tools/gimptool.c
@@ -427,8 +427,11 @@ maybe_run (gchar *cmd)
   if (!silent)
     g_print ("%s\n", cmd);
 
-  if (!dry_run)
-    system (cmd);
+  /* system() declared with attribute warn_unused_result.
+   * Trick to get rid of the compilation warning without using the result.
+   */
+  if (dry_run || system (cmd))
+    ;
 }
 
 static void


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