Commit c35ff719 authored by Michael Natterer's avatar Michael Natterer 😴

app/libgimp*: remove stuff found by -Wunused-but-set-variable

parent 092e2693
...@@ -167,7 +167,6 @@ drawable_actions_update (GimpActionGroup *group, ...@@ -167,7 +167,6 @@ drawable_actions_update (GimpActionGroup *group,
GimpImage *image; GimpImage *image;
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
gboolean is_rgb = FALSE; gboolean is_rgb = FALSE;
gboolean is_gray = FALSE;
gboolean is_indexed = FALSE; gboolean is_indexed = FALSE;
gboolean visible = FALSE; gboolean visible = FALSE;
gboolean linked = FALSE; gboolean linked = FALSE;
...@@ -188,7 +187,6 @@ drawable_actions_update (GimpActionGroup *group, ...@@ -188,7 +187,6 @@ drawable_actions_update (GimpActionGroup *group,
GimpItem *item; GimpItem *item;
is_rgb = GIMP_IMAGE_TYPE_IS_RGB (drawable_type); is_rgb = GIMP_IMAGE_TYPE_IS_RGB (drawable_type);
is_gray = GIMP_IMAGE_TYPE_IS_GRAY (drawable_type);
is_indexed = GIMP_IMAGE_TYPE_IS_INDEXED (drawable_type); is_indexed = GIMP_IMAGE_TYPE_IS_INDEXED (drawable_type);
if (GIMP_IS_LAYER_MASK (drawable)) if (GIMP_IS_LAYER_MASK (drawable))
......
...@@ -229,7 +229,6 @@ image_actions_update (GimpActionGroup *group, ...@@ -229,7 +229,6 @@ image_actions_update (GimpActionGroup *group,
gpointer data) gpointer data)
{ {
GimpImage *image = action_data_get_image (data); GimpImage *image = action_data_get_image (data);
gboolean fs = FALSE;
gboolean aux = FALSE; gboolean aux = FALSE;
gboolean lp = FALSE; gboolean lp = FALSE;
gboolean sel = FALSE; gboolean sel = FALSE;
...@@ -257,7 +256,6 @@ image_actions_update (GimpActionGroup *group, ...@@ -257,7 +256,6 @@ image_actions_update (GimpActionGroup *group,
gimp_action_group_set_action_active (group, action, TRUE); gimp_action_group_set_action_active (group, action, TRUE);
fs = (gimp_image_get_floating_selection (image) != NULL);
aux = (gimp_image_get_active_channel (image) != NULL); aux = (gimp_image_get_active_channel (image) != NULL);
lp = ! gimp_image_is_empty (image); lp = ! gimp_image_is_empty (image);
sel = ! gimp_channel_is_empty (gimp_image_get_mask (image)); sel = ! gimp_channel_is_empty (gimp_image_get_mask (image));
......
...@@ -248,7 +248,6 @@ vectors_actions_update (GimpActionGroup *group, ...@@ -248,7 +248,6 @@ vectors_actions_update (GimpActionGroup *group,
GimpDrawable *drawable = NULL; GimpDrawable *drawable = NULL;
gint n_vectors = 0; gint n_vectors = 0;
gboolean mask_empty = TRUE; gboolean mask_empty = TRUE;
gboolean global_buf = FALSE;
gboolean visible = FALSE; gboolean visible = FALSE;
gboolean linked = FALSE; gboolean linked = FALSE;
gboolean locked = FALSE; gboolean locked = FALSE;
...@@ -262,7 +261,6 @@ vectors_actions_update (GimpActionGroup *group, ...@@ -262,7 +261,6 @@ vectors_actions_update (GimpActionGroup *group,
{ {
n_vectors = gimp_image_get_n_vectors (image); n_vectors = gimp_image_get_n_vectors (image);
mask_empty = gimp_channel_is_empty (gimp_image_get_mask (image)); mask_empty = gimp_channel_is_empty (gimp_image_get_mask (image));
global_buf = FALSE;
vectors = gimp_image_get_active_vectors (image); vectors = gimp_image_get_active_vectors (image);
......
...@@ -63,18 +63,15 @@ gimp_rc_serialize_properties_diff (GimpConfig *config, ...@@ -63,18 +63,15 @@ gimp_rc_serialize_properties_diff (GimpConfig *config,
GimpConfig *compare, GimpConfig *compare,
GimpConfigWriter *writer) GimpConfigWriter *writer)
{ {
GObjectClass *klass; GList *diff;
GList *diff; GList *list;
GList *list; gboolean retval = TRUE;
gboolean retval = TRUE;
g_return_val_if_fail (G_IS_OBJECT (config), FALSE); g_return_val_if_fail (G_IS_OBJECT (config), FALSE);
g_return_val_if_fail (G_IS_OBJECT (compare), FALSE); g_return_val_if_fail (G_IS_OBJECT (compare), FALSE);
g_return_val_if_fail (G_TYPE_FROM_INSTANCE (config) == g_return_val_if_fail (G_TYPE_FROM_INSTANCE (config) ==
G_TYPE_FROM_INSTANCE (compare), FALSE); G_TYPE_FROM_INSTANCE (compare), FALSE);
klass = G_OBJECT_GET_CLASS (config);
diff = gimp_config_diff (G_OBJECT (config), diff = gimp_config_diff (G_OBJECT (config),
G_OBJECT (compare), GIMP_CONFIG_PARAM_SERIALIZE); G_OBJECT (compare), GIMP_CONFIG_PARAM_SERIALIZE);
......
...@@ -688,7 +688,6 @@ gimp_brush_load_abr_brush_v6 (FILE *file, ...@@ -688,7 +688,6 @@ gimp_brush_load_abr_brush_v6 (FILE *file,
gint32 brush_size; gint32 brush_size;
gint32 brush_end; gint32 brush_end;
gint32 complement_to_4;
gint32 next_brush; gint32 next_brush;
gint32 top, left, bottom, right; gint32 top, left, bottom, right;
...@@ -704,9 +703,11 @@ gimp_brush_load_abr_brush_v6 (FILE *file, ...@@ -704,9 +703,11 @@ gimp_brush_load_abr_brush_v6 (FILE *file,
brush_size = abr_read_long (file); brush_size = abr_read_long (file);
brush_end = brush_size; brush_end = brush_size;
/* complement to 4 */ /* complement to 4 */
while (brush_end % 4 != 0) brush_end++; while (brush_end % 4 != 0)
complement_to_4 = brush_end - brush_size; brush_end++;
next_brush = ftell (file) + brush_end; next_brush = ftell (file) + brush_end;
if (abr_hdr->count == 1) if (abr_hdr->count == 1)
......
...@@ -199,16 +199,11 @@ gimp_brush_pipe_select_brush (GimpBrush *brush, ...@@ -199,16 +199,11 @@ gimp_brush_pipe_select_brush (GimpBrush *brush,
{ {
GimpBrushPipe *pipe = GIMP_BRUSH_PIPE (brush); GimpBrushPipe *pipe = GIMP_BRUSH_PIPE (brush);
gint i, brushix, ix; gint i, brushix, ix;
gdouble velocity, spacing; gdouble velocity;
if (pipe->n_brushes == 1) if (pipe->n_brushes == 1)
return GIMP_BRUSH (pipe->current); return GIMP_BRUSH (pipe->current);
/* calculates brush native spacing in pixels, based on it's width)*/
spacing = ((gdouble) gimp_brush_get_spacing (pipe->current) / 100) *
MAX (brush->mask->width, brush->mask->height);
brushix = 0; brushix = 0;
for (i = 0; i < pipe->dimension; i++) for (i = 0; i < pipe->dimension; i++)
{ {
......
...@@ -221,14 +221,10 @@ gimp_buffer_new (TileManager *tiles, ...@@ -221,14 +221,10 @@ gimp_buffer_new (TileManager *tiles,
gboolean copy_pixels) gboolean copy_pixels)
{ {
GimpBuffer *buffer; GimpBuffer *buffer;
gint width, height;
g_return_val_if_fail (tiles != NULL, NULL); g_return_val_if_fail (tiles != NULL, NULL);
g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (name != NULL, NULL);
width = tile_manager_width (tiles);
height = tile_manager_height (tiles);
buffer = g_object_new (GIMP_TYPE_BUFFER, buffer = g_object_new (GIMP_TYPE_BUFFER,
"name", name, "name", name,
NULL); NULL);
......
...@@ -60,7 +60,6 @@ static void ...@@ -60,7 +60,6 @@ static void
gimp_channel_prop_undo_constructed (GObject *object) gimp_channel_prop_undo_constructed (GObject *object)
{ {
GimpChannelPropUndo *channel_prop_undo = GIMP_CHANNEL_PROP_UNDO (object); GimpChannelPropUndo *channel_prop_undo = GIMP_CHANNEL_PROP_UNDO (object);
GimpImage *image;
GimpChannel *channel; GimpChannel *channel;
if (G_OBJECT_CLASS (parent_class)->constructed) if (G_OBJECT_CLASS (parent_class)->constructed)
...@@ -68,7 +67,6 @@ gimp_channel_prop_undo_constructed (GObject *object) ...@@ -68,7 +67,6 @@ gimp_channel_prop_undo_constructed (GObject *object)
g_assert (GIMP_IS_CHANNEL (GIMP_ITEM_UNDO (object)->item)); g_assert (GIMP_IS_CHANNEL (GIMP_ITEM_UNDO (object)->item));
image = GIMP_UNDO (object)->image;
channel = GIMP_CHANNEL (GIMP_ITEM_UNDO (object)->item); channel = GIMP_CHANNEL (GIMP_ITEM_UNDO (object)->item);
switch (GIMP_UNDO (object)->undo_type) switch (GIMP_UNDO (object)->undo_type)
......
...@@ -36,13 +36,13 @@ gboolean ...@@ -36,13 +36,13 @@ gboolean
gimp_curve_save (GimpData *data, gimp_curve_save (GimpData *data,
GError **error) GError **error)
{ {
GimpCurve *curve; /* GimpCurve *curve; */
FILE *file; FILE *file;
g_return_val_if_fail (GIMP_IS_CURVE (data), FALSE); g_return_val_if_fail (GIMP_IS_CURVE (data), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
curve = GIMP_CURVE (data); /* curve = GIMP_CURVE (data); */
file = g_fopen (gimp_data_get_filename (data), "wb"); file = g_fopen (gimp_data_get_filename (data), "wb");
......
...@@ -63,7 +63,6 @@ gimp_drawable_bucket_fill (GimpDrawable *drawable, ...@@ -63,7 +63,6 @@ gimp_drawable_bucket_fill (GimpDrawable *drawable,
gdouble y, gdouble y,
GError **error) GError **error)
{ {
GimpImage *image;
GimpRGB color; GimpRGB color;
GimpPattern *pattern = NULL; GimpPattern *pattern = NULL;
...@@ -72,8 +71,6 @@ gimp_drawable_bucket_fill (GimpDrawable *drawable, ...@@ -72,8 +71,6 @@ gimp_drawable_bucket_fill (GimpDrawable *drawable,
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE); g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
image = gimp_item_get_image (GIMP_ITEM (drawable));
if (fill_mode == GIMP_FG_BUCKET_FILL) if (fill_mode == GIMP_FG_BUCKET_FILL)
{ {
gimp_context_get_foreground (context, &color); gimp_context_get_foreground (context, &color);
......
...@@ -78,7 +78,6 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable, ...@@ -78,7 +78,6 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
gint *new_offset_y, gint *new_offset_y,
GimpProgress *progress) GimpProgress *progress)
{ {
GimpImage *image;
PixelRegion destPR; PixelRegion destPR;
TileManager *new_tiles; TileManager *new_tiles;
GimpMatrix3 m; GimpMatrix3 m;
...@@ -95,8 +94,6 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable, ...@@ -95,8 +94,6 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
g_return_val_if_fail (new_offset_y != NULL, NULL); g_return_val_if_fail (new_offset_y != NULL, NULL);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL); g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), NULL);
image = gimp_item_get_image (GIMP_ITEM (drawable));
m = *matrix; m = *matrix;
inv = *matrix; inv = *matrix;
......
...@@ -1482,15 +1482,13 @@ gimp_drawable_set_tiles_full (GimpDrawable *drawable, ...@@ -1482,15 +1482,13 @@ gimp_drawable_set_tiles_full (GimpDrawable *drawable,
gint offset_x, gint offset_x,
gint offset_y) gint offset_y)
{ {
GimpItem *item; GimpItem *item;
GimpImage *image;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable)); g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (tiles != NULL); g_return_if_fail (tiles != NULL);
g_return_if_fail (tile_manager_bpp (tiles) == GIMP_IMAGE_TYPE_BYTES (type)); g_return_if_fail (tile_manager_bpp (tiles) == GIMP_IMAGE_TYPE_BYTES (type));
item = GIMP_ITEM (drawable); item = GIMP_ITEM (drawable);
image = gimp_item_get_image (item);
if (! gimp_item_is_attached (GIMP_ITEM (drawable))) if (! gimp_item_is_attached (GIMP_ITEM (drawable)))
push_undo = FALSE; push_undo = FALSE;
......
...@@ -60,7 +60,6 @@ static void ...@@ -60,7 +60,6 @@ static void
gimp_layer_prop_undo_constructed (GObject *object) gimp_layer_prop_undo_constructed (GObject *object)
{ {
GimpLayerPropUndo *layer_prop_undo = GIMP_LAYER_PROP_UNDO (object); GimpLayerPropUndo *layer_prop_undo = GIMP_LAYER_PROP_UNDO (object);
GimpImage *image;
GimpLayer *layer; GimpLayer *layer;
if (G_OBJECT_CLASS (parent_class)->constructed) if (G_OBJECT_CLASS (parent_class)->constructed)
...@@ -68,7 +67,6 @@ gimp_layer_prop_undo_constructed (GObject *object) ...@@ -68,7 +67,6 @@ gimp_layer_prop_undo_constructed (GObject *object)
g_assert (GIMP_IS_LAYER (GIMP_ITEM_UNDO (object)->item)); g_assert (GIMP_IS_LAYER (GIMP_ITEM_UNDO (object)->item));
image = GIMP_UNDO (object)->image;
layer = GIMP_LAYER (GIMP_ITEM_UNDO (object)->item); layer = GIMP_LAYER (GIMP_ITEM_UNDO (object)->item);
switch (GIMP_UNDO (object)->undo_type) switch (GIMP_UNDO (object)->undo_type)
......
...@@ -530,13 +530,9 @@ gimp_undo_type_to_name (GimpUndoType type) ...@@ -530,13 +530,9 @@ gimp_undo_type_to_name (GimpUndoType type)
gboolean gboolean
gimp_undo_is_weak (GimpUndo *undo) gimp_undo_is_weak (GimpUndo *undo)
{ {
GimpUndoType type;
if (! undo) if (! undo)
return FALSE; return FALSE;
type = undo->undo_type;
switch (undo->undo_type) switch (undo->undo_type)
{ {
case GIMP_UNDO_GROUP_ITEM_VISIBILITY: case GIMP_UNDO_GROUP_ITEM_VISIBILITY:
......
...@@ -77,7 +77,6 @@ fade_dialog_new (GimpImage *image, ...@@ -77,7 +77,6 @@ fade_dialog_new (GimpImage *image,
GtkWidget *main_vbox; GtkWidget *main_vbox;
GtkWidget *table; GtkWidget *table;
GtkWidget *menu; GtkWidget *menu;
GtkWidget *label;
gchar *title; gchar *title;
gint table_row = 0; gint table_row = 0;
...@@ -153,9 +152,9 @@ fade_dialog_new (GimpImage *image, ...@@ -153,9 +152,9 @@ fade_dialog_new (GimpImage *image,
/* the paint mode menu */ /* the paint mode menu */
menu = gimp_prop_paint_mode_menu_new (G_OBJECT (private->context), menu = gimp_prop_paint_mode_menu_new (G_OBJECT (private->context),
"paint-mode", TRUE, TRUE); "paint-mode", TRUE, TRUE);
label = gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++, gimp_table_attach_aligned (GTK_TABLE (table), 0, table_row++,
_("_Mode:"), 0.0, 0.5, _("_Mode:"), 0.0, 0.5,
menu, 2, FALSE); menu, 2, FALSE);
/* the opacity scale */ /* the opacity scale */
gimp_prop_opacity_entry_new (G_OBJECT (private->context), "opacity", gimp_prop_opacity_entry_new (G_OBJECT (private->context), "opacity",
......
...@@ -107,27 +107,11 @@ gimp_display_shell_update_scrollbars_and_rulers (GimpDisplayShell *shell) ...@@ -107,27 +107,11 @@ gimp_display_shell_update_scrollbars_and_rulers (GimpDisplayShell *shell)
void void
gimp_display_shell_scale_update_scrollbars (GimpDisplayShell *shell) gimp_display_shell_scale_update_scrollbars (GimpDisplayShell *shell)
{ {
GimpImage *image; g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
gint image_width;
gint image_height;
if (! shell->display) if (! shell->display)
return; return;
image = gimp_display_get_image (shell->display);
if (image)
{
image_width = gimp_image_get_width (image);
image_height = gimp_image_get_height (image);
}
else
{
image_width = shell->disp_width;
image_height = shell->disp_height;
}
/* Horizontal scrollbar */ /* Horizontal scrollbar */
g_object_freeze_notify (G_OBJECT (shell->hsbdata)); g_object_freeze_notify (G_OBJECT (shell->hsbdata));
......
...@@ -904,24 +904,21 @@ void ...@@ -904,24 +904,21 @@ void
gimp_image_window_shrink_wrap (GimpImageWindow *window, gimp_image_window_shrink_wrap (GimpImageWindow *window,
gboolean grow_only) gboolean grow_only)
{ {
GimpImageWindowPrivate *private; GimpDisplayShell *active_shell;
GimpDisplayShell *active_shell; GimpImage *image;
GimpImage *image; GtkWidget *widget;
GtkWidget *widget; GtkAllocation allocation;
GtkAllocation allocation; GdkScreen *screen;
GdkScreen *screen; GdkRectangle rect;
GdkRectangle rect; gint monitor;
gint monitor; gint disp_width, disp_height;
gint disp_width, disp_height; gint width, height;
gint width, height; gint max_auto_width, max_auto_height;
gint max_auto_width, max_auto_height; gint border_width, border_height;
gint border_width, border_height; gboolean resize = FALSE;
gboolean resize = FALSE;
g_return_if_fail (GIMP_IS_IMAGE_WINDOW (window)); g_return_if_fail (GIMP_IS_IMAGE_WINDOW (window));
private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
if (! gtk_widget_get_realized (GTK_WIDGET (window))) if (! gtk_widget_get_realized (GTK_WIDGET (window)))
return; return;
......
...@@ -127,9 +127,6 @@ color_pixels_mask (guchar *dest, ...@@ -127,9 +127,6 @@ color_pixels_mask (guchar *dest,
guint bytes) guint bytes)
{ {
guchar c0, c1, c2; guchar c0, c1, c2;
gint alpha;
alpha = HAS_ALPHA (bytes) ? bytes - 1 : bytes;
switch (bytes) switch (bytes)
{ {
......
...@@ -108,7 +108,6 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core, ...@@ -108,7 +108,6 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core,
gboolean push_undo, gboolean push_undo,
GError **error) GError **error)
{ {
GimpImage *image;
BoundSeg *stroke_segs; BoundSeg *stroke_segs;
gint n_stroke_segs; gint n_stroke_segs;
gint off_x; gint off_x;
...@@ -126,8 +125,6 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core, ...@@ -126,8 +125,6 @@ gimp_paint_core_stroke_boundary (GimpPaintCore *core,
g_return_val_if_fail (bound_segs != NULL && n_bound_segs > 0, FALSE); g_return_val_if_fail (bound_segs != NULL && n_bound_segs > 0, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
image = gimp_item_get_image (GIMP_ITEM (drawable));
stroke_segs = boundary_sort (bound_segs, n_bound_segs, &n_stroke_segs); stroke_segs = boundary_sort (bound_segs, n_bound_segs, &n_stroke_segs);
if (n_stroke_segs == 0) if (n_stroke_segs == 0)
......
...@@ -163,14 +163,11 @@ gimp_smudge_start (GimpPaintCore *paint_core, ...@@ -163,14 +163,11 @@ gimp_smudge_start (GimpPaintCore *paint_core,
const GimpCoords *coords) const GimpCoords *coords)
{ {
GimpSmudge *smudge = GIMP_SMUDGE (paint_core); GimpSmudge *smudge = GIMP_SMUDGE (paint_core);
GimpImage *image;
TempBuf *area; TempBuf *area;
PixelRegion srcPR; PixelRegion srcPR;
gint bytes; gint bytes;
gint x, y, w, h; gint x, y, w, h;
image = gimp_item_get_image (GIMP_ITEM (drawable));
if (gimp_drawable_is_indexed (drawable)) if (gimp_drawable_is_indexed (drawable))
return FALSE; return FALSE;
......
...@@ -298,12 +298,9 @@ gimp_image_map_tool_initialize (GimpTool *tool, ...@@ -298,12 +298,9 @@ gimp_image_map_tool_initialize (GimpTool *tool,
GtkWidget *dialog; GtkWidget *dialog;
GtkWidget *vbox; GtkWidget *vbox;
GtkWidget *toggle; GtkWidget *toggle;
const gchar *stock_id;
klass = GIMP_IMAGE_MAP_TOOL_GET_CLASS (image_map_tool); klass = GIMP_IMAGE_MAP_TOOL_GET_CLASS (image_map_tool);
stock_id = gimp_viewable_get_stock_id (GIMP_VIEWABLE (tool_info));
window = gimp_display_shell_get_window (display_shell); window = gimp_display_shell_get_window (display_shell);
image_map_tool->overlay = gimp_image_window_get_fullscreen (window); image_map_tool->overlay = gimp_image_window_get_fullscreen (window);
......
...@@ -1812,7 +1812,7 @@ find_max_gradient (GimpIscissorsTool *iscissors, ...@@ -1812,7 +1812,7 @@ find_max_gradient (GimpIscissorsTool *iscissors,
gint radius; gint radius;
gint i, j; gint i, j;
gint endx, endy; gint endx, endy;
gint sx, sy, cx, cy; gint cx, cy;
gint x1, y1, x2, y2; gint x1, y1, x2, y2;
gpointer pr; gpointer pr;
gfloat max_gradient; gfloat max_gradient;
...@@ -1827,8 +1827,6 @@ find_max_gradient (GimpIscissorsTool *iscissors, ...@@ -1827,8 +1827,6 @@ find_max_gradient (GimpIscissorsTool *iscissors,
/* calculate the extent of the search */ /* calculate the extent of the search */
cx = CLAMP (*x, 0, gimp_image_get_width (image)); cx = CLAMP (*x, 0, gimp_image_get_width (image));
cy = CLAMP (*y, 0, gimp_image_get_height (image)); cy = CLAMP (*y, 0, gimp_image_get_height (image));
sx = cx - radius;
sy = cy - radius;
x1 = CLAMP (cx - radius, 0, gimp_image_get_width (image)); x1 = CLAMP (cx - radius, 0, gimp_image_get_width (image));
y1 = CLAMP (cy - radius, 0, gimp_image_get_height (image)); y1 = CLAMP (cy - radius, 0, gimp_image_get_height (image));
x2 = CLAMP (cx + radius, 0, gimp_image_get_width (image)); x2 = CLAMP (cx + radius, 0, gimp_image_get_width (image));
......
...@@ -556,12 +556,8 @@ gimp_rectangle_select_tool_oper_update (GimpTool *tool, ...@@ -556,12 +556,8 @@ gimp_rectangle_select_tool_oper_update (GimpTool *tool,
gboolean proximity, gboolean proximity,
GimpDisplay *display) GimpDisplay *display)
{ {
GimpRectangleFunction function;
gimp_rectangle_tool_oper_update (tool, coords, state, proximity, display); gimp_rectangle_tool_oper_update (tool, coords, state, proximity, display);
function = gimp_rectangle_tool_get_function (GIMP_RECTANGLE_TOOL (tool));
GIMP_TOOL_CLASS (parent_class)->oper_update (tool, coords, state, proximity, GIMP_TOOL_CLASS (parent_class)->oper_update (tool, coords, state, proximity,
display); display);
} }
......
...@@ -897,21 +897,17 @@ gimp_rectangle_tool_button_press (GimpTool *tool, ...@@ -897,21 +897,17 @@ gimp_rectangle_tool_button_press (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *display) GimpDisplay *display)
{ {
GimpRectangleTool *rect_tool; GimpRectangleTool *rect_tool;
GimpDrawTool *draw_tool; GimpDrawTool *draw_tool;
GimpRectangleToolPrivate *private; GimpRectangleToolPrivate *private;
GimpRectangleOptions *options; gdouble snapped_x, snapped_y;
GimpRectangleOptionsPrivate *options_private; gint snap_x, snap_y;
gdouble snapped_x, snapped_y;
gint snap_x, snap_y;
g_return_if_fail (GIMP_IS_RECTANGLE_TOOL (tool)); g_return_if_fail (GIMP_IS_RECTANGLE_TOOL (tool));
rect_tool = GIMP_RECTANGLE_TOOL (tool); rect_tool = GIMP_RECTANGLE_TOOL (tool);
draw_tool = GIMP_DRAW_TOOL (tool); draw_tool = GIMP_DRAW_TOOL (tool);
private = GIMP_RECTANGLE_TOOL_GET_PRIVATE (tool); private = GIMP_RECTANGLE_TOOL_GET_PRIVATE (tool);
options = GIMP_RECTANGLE_TOOL_GET_OPTIONS (tool);
options_private = GIMP_RECTANGLE_OPTIONS_GET_PRIVATE (options);
gimp_draw_tool_pause (draw_tool); gimp_draw_tool_pause (draw_tool);
...@@ -1019,13 +1015,11 @@ gimp_rectangle_tool_button_release (GimpTool *tool, ...@@ -1019,13 +1015,11 @@ gimp_rectangle_tool_button_release (GimpTool *tool,
{ {
GimpRectangleTool *rect_tool; GimpRectangleTool *rect_tool;
GimpRectangleToolPrivate *private; GimpRectangleToolPrivate *private;
GimpRectangleOptions *options;
g_return_if_fail (GIMP_IS_RECTANGLE_TOOL (tool)); g_return_if_fail (GIMP_IS_RECTANGLE_TOOL (tool));
rect_tool = GIMP_RECTANGLE_TOOL (tool); rect_tool = GIMP_RECTANGLE_TOOL (tool);
private = GIMP_RECTANGLE_TOOL_GET_PRIVATE (tool); private = GIMP_RECTANGLE_TOOL_GET_PRIVATE (tool);
options = GIMP_RECTANGLE_TOOL_GET_OPTIONS (tool);
gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool)); gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
...@@ -1093,20 +1087,18 @@ gimp_rectangle_tool_motion (GimpTool *tool, ...@@ -1093,20 +1087,18 @@ gimp_rectangle_tool_motion (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *display) GimpDisplay *display)
{ {
GimpRectangleTool *rect_tool; GimpRectangleTool *rect_tool;
GimpRectangleToolPrivate *private; GimpRectangleToolPrivate *private;
GimpRectangleOptions *options; GimpRectangleOptions *options;
GimpRectangleOptionsPrivate *options_private; gdouble snapped_x;
gdouble snapped_x; gdouble snapped_y;
gdouble snapped_y; gint snap_x, snap_y;
gint snap_x, snap_y;
g_return_if_fail (GIMP_IS_RECTANGLE_TOOL (tool)); g_return_if_fail (GIMP_IS_RECTANGLE_TOOL (tool));
rect_tool = GIMP_RECTANGLE_TOOL (tool); rect_tool = GIMP_RECTANGLE_TOOL (tool);
private = GIMP_RECTANGLE_TOOL_GET_PRIVATE (tool); private = GIMP_RECTANGLE_TOOL_GET_PRIVATE (tool);
options = GIMP_RECTANGLE_TOOL_GET_OPTIONS (tool); options = GIMP_RECTANGLE_TOOL_GET_OPTIONS (tool);
options_private = GIMP_RECTANGLE_OPTIONS_GET_PRIVATE (options);
/* Motion events should be ignored when we're just waiting for the /* Motion events should be ignored when we're just waiting for the
* button release event to execute or if the user has grabbed a dead * button release event to execute or if the user has grabbed a dead
...@@ -1668,15 +1660,13 @@ gimp_rectangle_tool_cursor_update (GimpTool *tool, ...@@ -1668,15 +1660,13 @@ gimp_rectangle_tool_cursor_update (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *display) GimpDisplay *display)
{ {
GimpRectangleTool *rect_tool;