Commit 47c987b0 authored by Michael Natterer's avatar Michael Natterer 😴

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.
parent 1f996587
......@@ -281,7 +281,6 @@ image_actions_update (GimpActionGroup *group,
case GIMP_RGB: action = "image-convert-rgb"; break;
case GIMP_GRAY: action = "image-convert-grayscale"; break;
case GIMP_INDEXED: action = "image-convert-indexed"; break;
break;
}
gimp_action_group_set_action_active (group, action, TRUE);
......@@ -293,7 +292,6 @@ image_actions_update (GimpActionGroup *group,
case GIMP_PRECISION_U32: action = "image-convert-u32"; break;
case GIMP_PRECISION_HALF: action = "image-convert-half"; break;
case GIMP_PRECISION_FLOAT: action = "image-convert-float"; break;
break;
}
gimp_action_group_set_action_active (group, action, TRUE);
......
......@@ -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;
......
......@@ -478,7 +478,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))
{
......
......@@ -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;
......
......@@ -958,13 +958,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment