aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/detail
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-06-07 12:47:20 +0200
committerDavid Robillard <d@drobilla.net>2020-06-13 17:18:23 +0200
commit580e7b6e06d1c9806b8b920f27f894b5d1d8cc49 (patch)
tree21341eb10e76ced727c8565f6d01e0dce0f6ccc6 /pugl/detail
parentabcff5b7f125a9e0d203025207fae07e58c40d8f (diff)
downloadpugl-580e7b6e06d1c9806b8b920f27f894b5d1d8cc49.tar.gz
pugl-580e7b6e06d1c9806b8b920f27f894b5d1d8cc49.tar.bz2
pugl-580e7b6e06d1c9806b8b920f27f894b5d1d8cc49.zip
Cleanup: Fix implicit conversion warnings with clang
Diffstat (limited to 'pugl/detail')
-rw-r--r--pugl/detail/x11.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c
index 987f55f..da7b23d 100644
--- a/pugl/detail/x11.c
+++ b/pugl/detail/x11.c
@@ -534,7 +534,7 @@ translateEvent(PuglView* view, XEvent xevent)
break;
case MotionNotify:
event.type = PUGL_MOTION;
- event.motion.time = xevent.xmotion.time / 1e3;
+ event.motion.time = (double)xevent.xmotion.time / 1e3;
event.motion.x = xevent.xmotion.x;
event.motion.y = xevent.xmotion.y;
event.motion.xRoot = xevent.xmotion.x_root;
@@ -545,7 +545,7 @@ translateEvent(PuglView* view, XEvent xevent)
case ButtonPress:
if (xevent.xbutton.button >= 4 && xevent.xbutton.button <= 7) {
event.type = PUGL_SCROLL;
- event.scroll.time = xevent.xbutton.time / 1e3;
+ event.scroll.time = (double)xevent.xbutton.time / 1e3;
event.scroll.x = xevent.xbutton.x;
event.scroll.y = xevent.xbutton.y;
event.scroll.xRoot = xevent.xbutton.x_root;
@@ -567,7 +567,7 @@ translateEvent(PuglView* view, XEvent xevent)
event.button.type = ((xevent.type == ButtonPress)
? PUGL_BUTTON_PRESS
: PUGL_BUTTON_RELEASE);
- event.button.time = xevent.xbutton.time / 1e3;
+ event.button.time = (double)xevent.xbutton.time / 1e3;
event.button.x = xevent.xbutton.x;
event.button.y = xevent.xbutton.y;
event.button.xRoot = xevent.xbutton.x_root;
@@ -581,7 +581,7 @@ translateEvent(PuglView* view, XEvent xevent)
event.type = ((xevent.type == KeyPress)
? PUGL_KEY_PRESS
: PUGL_KEY_RELEASE);
- event.key.time = xevent.xkey.time / 1e3;
+ event.key.time = (double)xevent.xkey.time / 1e3;
event.key.x = xevent.xkey.x;
event.key.y = xevent.xkey.y;
event.key.xRoot = xevent.xkey.x_root;
@@ -594,7 +594,7 @@ translateEvent(PuglView* view, XEvent xevent)
event.type = ((xevent.type == EnterNotify)
? PUGL_POINTER_IN
: PUGL_POINTER_OUT);
- event.crossing.time = xevent.xcrossing.time / 1e3;
+ event.crossing.time = (double)xevent.xcrossing.time / 1e3;
event.crossing.x = xevent.xcrossing.x;
event.crossing.y = xevent.xcrossing.y;
event.crossing.xRoot = xevent.xcrossing.x_root;
@@ -1063,7 +1063,8 @@ puglGetTime(const PuglWorld* world)
{
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
- return ((double)ts.tv_sec + ts.tv_nsec / 1000000000.0) - world->startTime;
+ return ((double)ts.tv_sec + (double)ts.tv_nsec / 1000000000.0) -
+ world->startTime;
}
PuglStatus