From 71c460a1d5a9ee51dcc3f2df475fe4e9d27f16f0 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 27 Aug 2024 17:16:01 -0700 Subject: Clear 9 -Wuseless-cast warnings No point in casting struct members to the same type they were defined as. Signed-off-by: Alan Coopersmith Part-of: --- Scale.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Scale.c b/Scale.c index ce2064a..aa196f7 100644 --- a/Scale.c +++ b/Scale.c @@ -573,12 +573,10 @@ Redisplay(Widget w, XEvent *event, Region region) height = event->xexpose.height; } - img_x = min(max((Position) floor((float) x - / (float) sw->scale.scale_x), 0), + img_x = min(max((Position) floor((float) x / sw->scale.scale_x), 0), (Position) sw->scale.image->width - 1); - img_y = min(max((Position) floor((float) y - / (float) sw->scale.scale_y), 0), + img_y = min(max((Position) floor((float) y / sw->scale.scale_y), 0), (Position) sw->scale.image->height - 1); if (sw->core.visible) { @@ -771,7 +769,7 @@ Realize(Widget wid, Mask *vmask, XSetWindowAttributes *attr) { ScaleWidget sw = (ScaleWidget) wid; XtCreateWindow(wid, (unsigned int) InputOutput, - (Visual *) sw->scale.visual, *vmask, attr); + sw->scale.visual, *vmask, attr); } -- cgit v1.2.3