aboutsummaryrefslogtreecommitdiffstats
path: root/test
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
parent1512dce0b223b5c17b43e6785fa5d988a95b49d4 (diff)
downloadpugl-6f24133e291ccd784db38fed57d32c10f8c8cf7b.tar.gz
pugl-6f24133e291ccd784db38fed57d32c10f8c8cf7b.tar.bz2
pugl-6f24133e291ccd784db38fed57d32c10f8c8cf7b.zip
Strengthen ultra-strict warnings with clang
Diffstat (limited to 'test')
-rw-r--r--test/pugl_cairo_test.c4
-rw-r--r--test/pugl_gl3_test.c7
-rw-r--r--test/pugl_test.c16
3 files changed, 15 insertions, 12 deletions
diff --git a/test/pugl_cairo_test.c b/test/pugl_cairo_test.c
index 8e44bb2..4cabec9 100644
--- a/test/pugl_cairo_test.c
+++ b/test/pugl_cairo_test.c
@@ -29,8 +29,8 @@
#include <stdbool.h>
#include <stdio.h>
-static PuglWorld* world = NULL;
-PuglTestOptions opts = {0};
+static PuglWorld* world = NULL;
+static PuglTestOptions opts = {0};
static int quit = 0;
static bool entered = false;
diff --git a/test/pugl_gl3_test.c b/test/pugl_gl3_test.c
index e990c25..8b05665 100644
--- a/test/pugl_gl3_test.c
+++ b/test/pugl_gl3_test.c
@@ -147,8 +147,11 @@ onExpose(PuglView* view)
app->numRects * sizeof(Rect),
app->rects);
- glDrawElementsInstanced(
- GL_TRIANGLE_STRIP, 4, GL_UNSIGNED_INT, NULL, app->numRects * 4);
+ glDrawElementsInstanced(GL_TRIANGLE_STRIP,
+ 4,
+ GL_UNSIGNED_INT,
+ NULL,
+ (GLsizei)app->numRects * 4);
++app->framesDrawn;
}
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);