From 3797c55154b08da891f3b9e56737b8a948b272a2 Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Mon, 3 Jun 2019 12:54:27 +0300 Subject: [PATCH] fix test build, supress warnings, update header guards for struct api --- include/cglm/struct/affine.h | 8 ++++---- include/cglm/struct/box.h | 8 ++++---- include/cglm/struct/color.h | 6 +++--- include/cglm/struct/curve.h | 6 +++--- include/cglm/struct/frustum.h | 6 +++--- include/cglm/struct/io.h | 6 +++--- include/cglm/struct/mat3.h | 6 +++--- include/cglm/struct/mat4.h | 7 +++---- include/cglm/struct/plane.h | 6 +++--- include/cglm/struct/project.h | 8 ++++---- include/cglm/struct/sphere.h | 6 +++--- include/cglm/struct/vec3-ext.h | 6 +++--- include/cglm/struct/vec3.h | 29 ++++++----------------------- include/cglm/struct/vec4-ext.h | 6 +++--- include/cglm/struct/vec4.h | 12 +++++------- test/src/test_common.h | 6 +++--- 16 files changed, 56 insertions(+), 76 deletions(-) diff --git a/include/cglm/struct/affine.h b/include/cglm/struct/affine.h index 0f753c5..36dbe0f 100644 --- a/include/cglm/struct/affine.h +++ b/include/cglm/struct/affine.h @@ -29,8 +29,8 @@ CGLM_INLINE void glms_decompose(mat4s m, vec4s t, mat4s * r, vec3s * s); */ -#ifndef cglm_affines_h -#define cglm_affines_h +#ifndef cglms_affines_h +#define cglms_affines_h #include "../common.h" #include "../types-struct.h" @@ -117,8 +117,8 @@ glms_translate_make(vec3s v) { /*! * @brief creates NEW scale matrix by v vector * - * @param[out] m affine transfrom * @param[in] v scale vector [x, y, z] + * @returns affine transfrom */ CGLM_INLINE mat4s @@ -334,4 +334,4 @@ glms_decompose(mat4s m, vec4s * __restrict t, mat4s * __restrict r, vec3s * __re glm_decompose(m.raw, t->raw, r->raw, s->raw); } -#endif /* cglm_affines_h */ +#endif /* cglms_affines_h */ diff --git a/include/cglm/struct/box.h b/include/cglm/struct/box.h index 9dc915e..a55884f 100644 --- a/include/cglm/struct/box.h +++ b/include/cglm/struct/box.h @@ -5,8 +5,8 @@ * Full license can be found in the LICENSE file */ -#ifndef cglm_boxs_h -#define cglm_boxs_h +#ifndef cglms_boxs_h +#define cglms_boxs_h #include "../common.h" #include "../types-struct.h" @@ -178,7 +178,7 @@ glms_aabb_radius(vec3s box[2]) { * @brief computes center point of AABB * * @param[in] box bounding box - * @param[out] dest center of bounding box + * @returns center of bounding box */ CGLM_INLINE vec3s @@ -253,4 +253,4 @@ glms_aabb_contains(vec3s box[2], vec3s other[2]) { return glm_aabb_contains(rawBox, rawOther); } -#endif /* cglm_boxs_h */ +#endif /* cglms_boxs_h */ diff --git a/include/cglm/struct/color.h b/include/cglm/struct/color.h index e9ddc0c..3ce78da 100644 --- a/include/cglm/struct/color.h +++ b/include/cglm/struct/color.h @@ -5,8 +5,8 @@ * Full license can be found in the LICENSE file */ -#ifndef cglm_colors_h -#define cglm_colors_h +#ifndef cglms_colors_h +#define cglms_colors_h #include "../common.h" #include "../types-struct.h" @@ -24,4 +24,4 @@ glms_luminance(vec3s rgb) { return glm_luminance(rgb.raw); } -#endif /* cglm_colors_h */ +#endif /* cglms_colors_h */ diff --git a/include/cglm/struct/curve.h b/include/cglm/struct/curve.h index 0972f0f..53ea359 100644 --- a/include/cglm/struct/curve.h +++ b/include/cglm/struct/curve.h @@ -5,8 +5,8 @@ * Full license can be found in the LICENSE file */ -#ifndef cglm_curves_h -#define cglm_curves_h +#ifndef cglms_curves_h +#define cglms_curves_h #include "../common.h" #include "../types-struct.h" @@ -37,4 +37,4 @@ glms_smc(float s, mat4s m, vec4s c) { return glm_smc(s, m.raw, c.raw); } -#endif /* cglm_curves_h */ +#endif /* cglms_curves_h */ diff --git a/include/cglm/struct/frustum.h b/include/cglm/struct/frustum.h index 98931f4..2c51d6d 100644 --- a/include/cglm/struct/frustum.h +++ b/include/cglm/struct/frustum.h @@ -5,8 +5,8 @@ * Full license can be found in the LICENSE file */ -#ifndef cglm_frustums_h -#define cglm_frustums_h +#ifndef cglms_frustums_h +#define cglms_frustums_h #include "../common.h" #include "../types-struct.h" @@ -152,4 +152,4 @@ glms_frustum_corners_at(vec4s corners[8], glms_vec4_pack(planeCorners, rawPlaneCorners, 8); } -#endif /* cglm_frustums_h */ +#endif /* cglms_frustums_h */ diff --git a/include/cglm/struct/io.h b/include/cglm/struct/io.h index 0a084e4..ec28129 100644 --- a/include/cglm/struct/io.h +++ b/include/cglm/struct/io.h @@ -15,8 +15,8 @@ CGLM_INLINE void glm_versor_print(versor vec, FILE *ostream); */ -#ifndef cglm_ios_h -#define cglm_ios_h +#ifndef cglms_ios_h +#define cglms_ios_h #include "../common.h" #include "../io.h" @@ -79,4 +79,4 @@ glms_aabb_print(vec3s bbox[2], glm_aabb_print(rawBbox, tag, ostream); } -#endif /* cglm_ios_h */ +#endif /* cglms_ios_h */ diff --git a/include/cglm/struct/mat3.h b/include/cglm/struct/mat3.h index 8072746..5c474e6 100644 --- a/include/cglm/struct/mat3.h +++ b/include/cglm/struct/mat3.h @@ -30,8 +30,8 @@ CGLM_INLINE float glms_mat3_rmc(vec3s r, mat3s m, vec3s c); */ -#ifndef cglm_mat3s_h -#define cglm_mat3s_h +#ifndef cglms_mat3s_h +#define cglms_mat3s_h #include "../common.h" #include "../types-struct.h" @@ -286,4 +286,4 @@ glms_mat3_rmc(vec3s r, mat3s m, vec3s c) { return glm_mat3_rmc(r.raw, m.raw, c.raw); } -#endif /* cglm_mat3s_h */ +#endif /* cglms_mat3s_h */ diff --git a/include/cglm/struct/mat4.h b/include/cglm/struct/mat4.h index 5947dc0..ef72e31 100644 --- a/include/cglm/struct/mat4.h +++ b/include/cglm/struct/mat4.h @@ -44,8 +44,8 @@ CGLM_INLINE float glms_mat4_rmc(vec4s r, mat4s m, vec4s c); */ -#ifndef cglm_mat4s_h -#define cglm_mat4s_h +#ifndef cglms_mat4s_h +#define cglms_mat4s_h #include "../common.h" #include "../types-struct.h" @@ -463,5 +463,4 @@ glms_mat4_rmc(vec4s r, mat4s m, vec4s c) { return glm_mat4_rmc(r.raw, m.raw, c.raw); } -#endif /* cglm_mat4s_h */ - \ No newline at end of file +#endif /* cglms_mat4s_h */ diff --git a/include/cglm/struct/plane.h b/include/cglm/struct/plane.h index cea7e8c..6a84ac7 100644 --- a/include/cglm/struct/plane.h +++ b/include/cglm/struct/plane.h @@ -5,8 +5,8 @@ * Full license can be found in the LICENSE file */ -#ifndef cglm_planes_h -#define cglm_planes_h +#ifndef cglms_planes_h +#define cglms_planes_h #include "../common.h" #include "../types-struct.h" @@ -37,4 +37,4 @@ glms_plane_normalize(vec4s plane) { return plane; } -#endif /* cglm_planes_h */ +#endif /* cglms_planes_h */ diff --git a/include/cglm/struct/project.h b/include/cglm/struct/project.h index d45ba3d..8a2635f 100644 --- a/include/cglm/struct/project.h +++ b/include/cglm/struct/project.h @@ -5,8 +5,8 @@ * Full license can be found in the LICENSE file */ -#ifndef cglm_projects_h -#define cglm_projects_h +#ifndef cglms_projects_h +#define cglms_projects_h #include "../common.h" #include "../types-struct.h" @@ -91,7 +91,7 @@ glms_unproject(vec3s pos, mat4s m, vec4s vp) { * @param[in] pos object coordinates * @param[in] m MVP matrix * @param[in] vp viewport as [x, y, width, height] - * @param[out] dest projected coordinates + * @returns projected coordinates */ CGLM_INLINE vec3s @@ -101,4 +101,4 @@ glms_project(vec3s pos, mat4s m, vec4s vp) { return r; } -#endif /* cglm_projects_h */ +#endif /* cglms_projects_h */ diff --git a/include/cglm/struct/sphere.h b/include/cglm/struct/sphere.h index 164e8bc..95c36bc 100644 --- a/include/cglm/struct/sphere.h +++ b/include/cglm/struct/sphere.h @@ -5,8 +5,8 @@ * Full license can be found in the LICENSE file */ -#ifndef cglm_spheres_h -#define cglm_spheres_h +#ifndef cglms_spheres_h +#define cglms_spheres_h #include "../common.h" #include "../types-struct.h" @@ -90,4 +90,4 @@ glms_sphere_point(vec4s s, vec3s point) { return glm_sphere_point(s.raw, point.raw); } -#endif /* cglm_spheres_h */ +#endif /* cglms_spheres_h */ diff --git a/include/cglm/struct/vec3-ext.h b/include/cglm/struct/vec3-ext.h index 53a1199..2cd8749 100644 --- a/include/cglm/struct/vec3-ext.h +++ b/include/cglm/struct/vec3-ext.h @@ -26,8 +26,8 @@ CGLM_INLINE vec3s glms_vec3_sqrt(vec3s v); */ -#ifndef cglm_vec3s_ext_h -#define cglm_vec3s_ext_h +#ifndef cglms_vec3s_ext_h +#define cglms_vec3s_ext_h #include "../common.h" #include "../types-struct.h" @@ -195,4 +195,4 @@ glms_vec3_sqrt(vec3s v) { return r; } -#endif /* cglm_vec3s_ext_h */ +#endif /* cglms_vec3s_ext_h */ diff --git a/include/cglm/struct/vec3.h b/include/cglm/struct/vec3.h index 91389a2..fbe716d 100644 --- a/include/cglm/struct/vec3.h +++ b/include/cglm/struct/vec3.h @@ -17,7 +17,6 @@ Functions: CGLM_INLINE vec3s glms_vec3(vec4s v4); - CGLM_INLINE vec3s glms_vec3_copy(vec3s v); CGLM_INLINE void glms_vec3_pack(vec3s dst[], vec3 src[], size_t len); CGLM_INLINE void glms_vec3_unpack(vec3 dst[], vec3s src[], size_t len); CGLM_INLINE vec3s glms_vec3_zero(); @@ -66,8 +65,8 @@ CGLM_INLINE vec3s glms_normalize(vec3s v); */ -#ifndef cglm_vec3s_h -#define cglm_vec3s_h +#ifndef cglms_vec3s_h +#define cglms_vec3s_h #include "../common.h" #include "../types-struct.h" @@ -99,20 +98,6 @@ glms_vec3(vec4s v4) { return r; } -/*! - * @brief copy all members of [a] to [dest] - * - * @param[in] a source - * @returns destination - */ -CGLM_INLINE -vec3s -glms_vec3_copy(vec3s v) { - vec3s r; - glm_vec3_copy(v.raw, r.raw); - return r; -} - /*! * @brief pack an array of vec3 into an array of vec3s * @@ -150,7 +135,6 @@ glms_vec3_unpack(vec3 dst[], vec3s src[], size_t len) { /*! * @brief make vector zero * - * @param[in] v vector * @returns zero vector */ CGLM_INLINE @@ -164,7 +148,6 @@ glms_vec3_zero() { /*! * @brief make vector one * - * @param[in] v vector * @returns one vector */ CGLM_INLINE @@ -237,7 +220,7 @@ glms_vec3_add(vec3s a, vec3s b) { /*! * @brief add scalar to v vector store result in dest (d = v + s) * - * @param[in] v vector + * @param[in] a vector * @param[in] s scalar * @returns destination vector */ @@ -267,7 +250,7 @@ glms_vec3_sub(vec3s a, vec3s b) { /*! * @brief subtract scalar from v vector store result in dest (d = v - s) * - * @param[in] v vector + * @param[in] a vector * @param[in] s scalar * @returns destination vector */ @@ -342,7 +325,7 @@ glms_vec3_div(vec3s a, vec3s b) { /*! * @brief div vector with scalar: d = v / s * - * @param[in] v vector + * @param[in] a vector * @param[in] s scalar * @returns result = (a[0]/s, a[1]/s, a[2]/s) */ @@ -764,4 +747,4 @@ glms_normalize(vec3s v) { return v; } -#endif /* cglm_vec3s_h */ +#endif /* cglms_vec3s_h */ diff --git a/include/cglm/struct/vec4-ext.h b/include/cglm/struct/vec4-ext.h index fdc5059..52c438e 100644 --- a/include/cglm/struct/vec4-ext.h +++ b/include/cglm/struct/vec4-ext.h @@ -26,8 +26,8 @@ CGLM_INLINE vec4s glms_vec4_sqrt(vec4s v); */ -#ifndef cglm_vec4s_ext_h -#define cglm_vec4s_ext_h +#ifndef cglms_vec4s_ext_h +#define cglms_vec4s_ext_h #include "../common.h" #include "../types-struct.h" @@ -195,4 +195,4 @@ glms_vec4_sqrt(vec4s v) { return r; } -#endif /* cglm_vec4s_ext_h */ +#endif /* cglms_vec4s_ext_h */ diff --git a/include/cglm/struct/vec4.h b/include/cglm/struct/vec4.h index f96725f..4fe75ba 100644 --- a/include/cglm/struct/vec4.h +++ b/include/cglm/struct/vec4.h @@ -50,8 +50,8 @@ CGLM_INLINE vec4s glms_vec4_cubic(float s); */ -#ifndef cglm_vec4s_h -#define cglm_vec4s_h +#ifndef cglms_vec4s_h +#define cglms_vec4s_h #include "../common.h" #include "../types-struct.h" @@ -85,8 +85,8 @@ glms_vec4(vec3s v3, float last) { /*! * @brief copy first 3 members of [a] to [dest] * - * @param[in] a source - * @returns destination + * @param[in] v source + * @returns vec3 */ CGLM_INLINE vec3s @@ -163,7 +163,6 @@ glms_vec4_unpack(vec4 dst[], vec4s src[], size_t len) { /*! * @brief make vector zero * - * @param[in] v vector * @returns zero vector */ CGLM_INLINE @@ -177,7 +176,6 @@ glms_vec4_zero() { /*! * @brief make vector one * - * @param[in] v vector * @returns one vector */ CGLM_INLINE @@ -579,4 +577,4 @@ glms_vec4_cubic(float s) { return r; } -#endif /* cglm_vec4s_h */ +#endif /* cglms_vec4s_h */ diff --git a/test/src/test_common.h b/test/src/test_common.h index 51d1826..690d249 100644 --- a/test/src/test_common.h +++ b/test/src/test_common.h @@ -20,7 +20,7 @@ #include #include -#include +#include #include void @@ -63,13 +63,13 @@ void test_rand_vec3(vec3 dest); vec3s -test_rand_vec3s(); +test_rand_vec3s(void); void test_rand_vec4(vec4 dest); vec4s -test_rand_vec4s(); +test_rand_vec4s(void); float test_rand(void);