From d9e43ea120d1a7d68b2490a6044f89fb88bfe975 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 10 Nov 2015 14:07:30 +0100 Subject: [PATCH] Fix example build errors on legacy MinGW --- deps/linmath.h | 4 ++-- examples/heightmap.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deps/linmath.h b/deps/linmath.h index ec63a040..985e9f92 100644 --- a/deps/linmath.h +++ b/deps/linmath.h @@ -37,7 +37,7 @@ static inline float vec##n##_mul_inner(vec##n const a, vec##n const b) \ } \ static inline float vec##n##_len(vec##n const v) \ { \ - return sqrtf(vec##n##_mul_inner(v,v)); \ + return (float) sqrt(vec##n##_mul_inner(v,v)); \ } \ static inline void vec##n##_norm(vec##n r, vec##n const v) \ { \ @@ -554,7 +554,7 @@ static inline void quat_from_mat4x4(quat q, mat4x4 M) p = &perm[i]; } - r = sqrtf(1.f + M[p[0]][p[0]] - M[p[1]][p[1]] - M[p[2]][p[2]] ); + r = (float) sqrt(1.f + M[p[0]][p[0]] - M[p[1]][p[1]] - M[p[2]][p[2]] ); if(r < 1e-6) { q[0] = 1.f; diff --git a/examples/heightmap.c b/examples/heightmap.c index 782eef46..b57815eb 100644 --- a/examples/heightmap.c +++ b/examples/heightmap.c @@ -319,7 +319,7 @@ static void update_map(int num_iter) { GLfloat dx = center_x - map_vertices[0][ii]; GLfloat dz = center_z - map_vertices[2][ii]; - GLfloat pd = (2.0f * sqrtf((dx * dx) + (dz * dz))) / circle_size; + GLfloat pd = (2.0f * (float) sqrt((dx * dx) + (dz * dz))) / circle_size; if (fabs(pd) <= 1.0f) { /* tx,tz is within the circle */