[gimp/gimp-2-8] Bug 676270 - cppcheck report



commit 779264f237be1464f80343d3121ccea32cc97051
Author: Michael Natterer <mitch gimp org>
Date:   Sat Aug 4 03:20:36 2012 +0200

    Bug 676270 - cppcheck report
    
    Fix a couple of harmless stuff pointed out in the report, and one
    real bug: gimp_plug_in_close() was killing each process 10 times
    on windows.
    
    (cherry picked from commit 47c987b09e21b460e3d7f5c9e706ffaef4f198a3)
    
    Conflicts:
        app/actions/image-actions.c

 app/display/gimpmotionbuffer.c |    4 ++--
 app/plug-in/gimpplugin.c       |    2 +-
 app/tools/gimpmovetool.c       |    7 +++----
 app/xcf/xcf-save.c             |    5 +++--
 4 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/app/display/gimpmotionbuffer.c b/app/display/gimpmotionbuffer.c
index b8bd566..cb73a6c 100644
--- a/app/display/gimpmotionbuffer.c
+++ b/app/display/gimpmotionbuffer.c
@@ -264,8 +264,6 @@ gimp_motion_buffer_motion_event (GimpMotionBuffer *buffer,
   gdouble  delta_time  = 0.001;
   gdouble  delta_x     = 0.0;
   gdouble  delta_y     = 0.0;
-  gdouble  dir_delta_x = 0.0;
-  gdouble  dir_delta_y = 0.0;
   gdouble  distance    = 1.0;
 
   g_return_val_if_fail (GIMP_IS_MOTION_BUFFER (buffer), FALSE);
@@ -292,6 +290,8 @@ gimp_motion_buffer_motion_event (GimpMotionBuffer *buffer,
       gdouble    filter;
       gdouble    dist;
       gdouble    delta_dir;
+      gdouble    dir_delta_x = 0.0;
+      gdouble    dir_delta_y = 0.0;
 
       delta_x = last_dir_event.x - coords->x;
       delta_y = last_dir_event.y - coords->y;
diff --git a/app/plug-in/gimpplugin.c b/app/plug-in/gimpplugin.c
index 1162fb2..78465f9 100644
--- a/app/plug-in/gimpplugin.c
+++ b/app/plug-in/gimpplugin.c
@@ -476,7 +476,7 @@ gimp_plug_in_close (GimpPlugIn *plug_in,
           DWORD dwExitCode = STILL_ACTIVE;
           DWORD dwTries    = 10;
 
-          while (dwExitCode == dwExitCode &&
+          while (dwExitCode == STILL_ACTIVE &&
                  GetExitCodeProcess ((HANDLE) plug_in->pid, &dwExitCode) &&
                  (dwTries > 0))
             {
diff --git a/app/tools/gimpmovetool.c b/app/tools/gimpmovetool.c
index 39b9b5d..7ace036 100644
--- a/app/tools/gimpmovetool.c
+++ b/app/tools/gimpmovetool.c
@@ -725,14 +725,13 @@ gimp_move_tool_cursor_update (GimpTool         *tool,
     }
   else
     {
-      GimpGuide  *guide;
       GimpLayer  *layer;
       const gint  snap_distance = display->config->snap_distance;
 
       if (gimp_display_shell_get_show_guides (shell) &&
-          (guide = gimp_image_find_guide (image, coords->x, coords->y,
-                                          FUNSCALEX (shell, snap_distance),
-                                          FUNSCALEY (shell, snap_distance))))
+          gimp_image_find_guide (image, coords->x, coords->y,
+                                 FUNSCALEX (shell, snap_distance),
+                                 FUNSCALEY (shell, snap_distance)))
         {
           tool_cursor = GIMP_TOOL_CURSOR_HAND;
           modifier    = GIMP_CURSOR_MODIFIER_MOVE;
diff --git a/app/xcf/xcf-save.c b/app/xcf/xcf-save.c
index 44e4785..1be1560 100644
--- a/app/xcf/xcf-save.c
+++ b/app/xcf/xcf-save.c
@@ -947,13 +947,14 @@ xcf_save_prop (XcfInfo    *info,
     case PROP_PARASITES:
       {
         GimpParasiteList *list;
-        guint32           base, length;
-        long              pos;
 
         list = va_arg (args, GimpParasiteList *);
 
         if (gimp_parasite_list_persistent_length (list) > 0)
           {
+            guint32 base, length;
+            long    pos;
+
             xcf_write_prop_type_check_error (info, prop_type);
 
             /* because we don't know how much room the parasite list will take


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