summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2024-08-27 17:16:01 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2024-08-27 17:16:01 -0700
commit71c460a1d5a9ee51dcc3f2df475fe4e9d27f16f0 (patch)
tree86cdbf4c2f6bb2989c3cb93685d8dca469cc0ebf
parenta67a5771ecf2cdce8c4214dec58489ba6eb48219 (diff)
Clear 9 -Wuseless-cast warnings
No point in casting struct members to the same type they were defined as. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/app/xmag/-/merge_requests/5>
-rw-r--r--Scale.c8
1 files 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);
}