aboutsummaryrefslogtreecommitdiffstats
path: root/test/pugl_test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-03-02 23:25:53 +0100
committerDavid Robillard <d@drobilla.net>2020-03-02 23:25:53 +0100
commit6f24133e291ccd784db38fed57d32c10f8c8cf7b (patch)
tree8f55a0f1a86c88ec64f6b0c158f4b77ba2c54fef /test/pugl_test.c
parent1512dce0b223b5c17b43e6785fa5d988a95b49d4 (diff)
downloadpugl-6f24133e291ccd784db38fed57d32c10f8c8cf7b.tar.gz
pugl-6f24133e291ccd784db38fed57d32c10f8c8cf7b.tar.bz2
pugl-6f24133e291ccd784db38fed57d32c10f8c8cf7b.zip
Strengthen ultra-strict warnings with clang
Diffstat (limited to 'test/pugl_test.c')
-rw-r--r--test/pugl_test.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/pugl_test.c b/test/pugl_test.c
index e158da2..57b86cf 100644
--- a/test/pugl_test.c
+++ b/test/pugl_test.c
@@ -41,8 +41,8 @@ typedef struct
PuglView* child;
bool continuous;
int quit;
- float xAngle;
- float yAngle;
+ double xAngle;
+ double yAngle;
float dist;
double lastMouseX;
double lastMouseY;
@@ -93,15 +93,15 @@ onDisplay(PuglView* view)
const double thisTime = puglGetTime(app->world);
if (app->continuous) {
const double dTime = thisTime - app->lastDrawTime;
- app->xAngle = fmodf((float)(app->xAngle + dTime * 100.0f), 360.0f);
- app->yAngle = fmodf((float)(app->yAngle + dTime * 100.0f), 360.0f);
+ app->xAngle = fmod(app->xAngle + dTime * 100.0, 360.0);
+ app->yAngle = fmod(app->yAngle + dTime * 100.0, 360.0);
}
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0.0f, 0.0f, app->dist * -1);
- glRotatef(app->xAngle, 0.0f, 1.0f, 0.0f);
- glRotatef(app->yAngle, 1.0f, 0.0f, 0.0f);
+ glRotatef((float)app->xAngle, 0.0f, 1.0f, 0.0f);
+ glRotatef((float)app->yAngle, 1.0f, 0.0f, 0.0f);
const float bg = app->mouseEntered ? 0.2f : 0.1f;
glClearColor(bg, bg, bg, 1.0f);
@@ -266,8 +266,8 @@ onEvent(PuglView* view, const PuglEvent* event)
onKeyPress(view, &event->key, "Child: ");
break;
case PUGL_MOTION_NOTIFY:
- app->xAngle = fmodf(app->xAngle - (float)(event->motion.x - app->lastMouseX), 360.0f);
- app->yAngle = fmodf(app->yAngle + (float)(event->motion.y - app->lastMouseY), 360.0f);
+ app->xAngle = fmod(app->xAngle - event->motion.x - app->lastMouseX, 360.0);
+ app->yAngle = fmod(app->yAngle + event->motion.y - app->lastMouseY, 360.0);
app->lastMouseX = event->motion.x;
app->lastMouseY = event->motion.y;
puglPostRedisplay(view);