From 182c28faf8f76730279d97f2631173027887c01f Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Mon, 18 Mar 2024 19:49:50 +0700 Subject: [PATCH] Allow passing `const float*` to `make` functions. --- docs/source/mat2.rst | 2 +- docs/source/mat2x3.rst | 2 +- docs/source/mat2x4.rst | 2 +- docs/source/mat3.rst | 2 +- docs/source/mat3x2.rst | 2 +- docs/source/mat3x4.rst | 2 +- docs/source/mat4.rst | 2 +- docs/source/mat4x2.rst | 2 +- docs/source/mat4x3.rst | 2 +- docs/source/quat.rst | 2 +- docs/source/vec2.rst | 2 +- docs/source/vec3.rst | 2 +- docs/source/vec4.rst | 2 +- include/cglm/call/mat2.h | 2 +- include/cglm/call/mat2x3.h | 2 +- include/cglm/call/mat2x4.h | 2 +- include/cglm/call/mat3.h | 2 +- include/cglm/call/mat3x2.h | 2 +- include/cglm/call/mat3x4.h | 2 +- include/cglm/call/mat4.h | 2 +- include/cglm/call/mat4x2.h | 2 +- include/cglm/call/mat4x3.h | 2 +- include/cglm/call/quat.h | 2 +- include/cglm/call/vec2.h | 2 +- include/cglm/call/vec3.h | 2 +- include/cglm/call/vec4.h | 2 +- include/cglm/mat2.h | 2 +- include/cglm/mat2x3.h | 4 ++-- include/cglm/mat2x4.h | 4 ++-- include/cglm/mat3.h | 2 +- include/cglm/mat3x2.h | 4 ++-- include/cglm/mat3x4.h | 4 ++-- include/cglm/mat4.h | 2 +- include/cglm/mat4x2.h | 4 ++-- include/cglm/mat4x3.h | 4 ++-- include/cglm/quat.h | 2 +- include/cglm/struct/mat2.h | 4 ++-- include/cglm/struct/mat2x3.h | 4 ++-- include/cglm/struct/mat2x4.h | 4 ++-- include/cglm/struct/mat3.h | 4 ++-- include/cglm/struct/mat3x2.h | 4 ++-- include/cglm/struct/mat3x4.h | 4 ++-- include/cglm/struct/mat4.h | 4 ++-- include/cglm/struct/mat4x2.h | 4 ++-- include/cglm/struct/mat4x3.h | 4 ++-- include/cglm/struct/quat.h | 2 +- include/cglm/struct/vec2.h | 2 +- include/cglm/struct/vec3.h | 2 +- include/cglm/struct/vec4.h | 2 +- include/cglm/vec2.h | 2 +- include/cglm/vec3.h | 2 +- include/cglm/vec4.h | 2 +- src/mat2.c | 2 +- src/mat2x3.c | 2 +- src/mat2x4.c | 2 +- src/mat3.c | 2 +- src/mat3x2.c | 2 +- src/mat3x4.c | 2 +- src/mat4.c | 2 +- src/mat4x2.c | 2 +- src/mat4x3.c | 2 +- src/quat.c | 2 +- src/vec2.c | 2 +- src/vec3.c | 2 +- src/vec4.c | 2 +- 65 files changed, 80 insertions(+), 80 deletions(-) diff --git a/docs/source/mat2.rst b/docs/source/mat2.rst index 0be19f8..60b2360 100644 --- a/docs/source/mat2.rst +++ b/docs/source/mat2.rst @@ -180,7 +180,7 @@ Functions documentation Returns: scalar value e.g. Matrix1x1 -.. c:function:: void glm_mat2_make(float * __restrict src, mat2 dest) +.. c:function:: void glm_mat2_make(const float * __restrict src, mat2 dest) Create mat2 matrix from pointer diff --git a/docs/source/mat2x3.rst b/docs/source/mat2x3.rst index d3e735b..433c637 100644 --- a/docs/source/mat2x3.rst +++ b/docs/source/mat2x3.rst @@ -41,7 +41,7 @@ Functions documentation Parameters: | *[in,out]* **mat** matrix -.. c:function:: void glm_mat2x3_make(float * __restrict src, mat2x3 dest) +.. c:function:: void glm_mat2x3_make(const float * __restrict src, mat2x3 dest) Create mat2x3 matrix from pointer diff --git a/docs/source/mat2x4.rst b/docs/source/mat2x4.rst index 9c97be3..9a0445f 100644 --- a/docs/source/mat2x4.rst +++ b/docs/source/mat2x4.rst @@ -41,7 +41,7 @@ Functions documentation Parameters: | *[in,out]* **mat** matrix -.. c:function:: void glm_mat2x4_make(float * __restrict src, mat2x4 dest) +.. c:function:: void glm_mat2x4_make(const float * __restrict src, mat2x4 dest) Create mat2x4 matrix from pointer diff --git a/docs/source/mat3.rst b/docs/source/mat3.rst index f294cf8..34d4ab7 100644 --- a/docs/source/mat3.rst +++ b/docs/source/mat3.rst @@ -190,7 +190,7 @@ Functions documentation Returns: scalar value e.g. Matrix1x1 -.. c:function:: void glm_mat3_make(float * __restrict src, mat3 dest) +.. c:function:: void glm_mat3_make(const float * __restrict src, mat3 dest) Create mat3 matrix from pointer diff --git a/docs/source/mat3x2.rst b/docs/source/mat3x2.rst index 9920e17..7290153 100644 --- a/docs/source/mat3x2.rst +++ b/docs/source/mat3x2.rst @@ -41,7 +41,7 @@ Functions documentation Parameters: | *[in,out]* **mat** matrix -.. c:function:: void glm_mat3x2_make(float * __restrict src, mat3x2 dest) +.. c:function:: void glm_mat3x2_make(const float * __restrict src, mat3x2 dest) Create mat3x2 matrix from pointer diff --git a/docs/source/mat3x4.rst b/docs/source/mat3x4.rst index 6221136..9c23d06 100644 --- a/docs/source/mat3x4.rst +++ b/docs/source/mat3x4.rst @@ -41,7 +41,7 @@ Functions documentation Parameters: | *[in,out]* **mat** matrix -.. c:function:: void glm_mat3x4_make(float * __restrict src, mat3x4 dest) +.. c:function:: void glm_mat3x4_make(const float * __restrict src, mat3x4 dest) Create mat3x4 matrix from pointer diff --git a/docs/source/mat4.rst b/docs/source/mat4.rst index d0df906..ed85d46 100644 --- a/docs/source/mat4.rst +++ b/docs/source/mat4.rst @@ -304,7 +304,7 @@ Functions documentation Returns: scalar value e.g. Matrix1x1 -.. c:function:: void glm_mat4_make(float * __restrict src, mat4 dest) +.. c:function:: void glm_mat4_make(const float * __restrict src, mat4 dest) Create mat4 matrix from pointer diff --git a/docs/source/mat4x2.rst b/docs/source/mat4x2.rst index 3d605eb..4b7f291 100644 --- a/docs/source/mat4x2.rst +++ b/docs/source/mat4x2.rst @@ -41,7 +41,7 @@ Functions documentation Parameters: | *[in,out]* **mat** matrix -.. c:function:: void glm_mat4x2_make(float * __restrict src, mat4x2 dest) +.. c:function:: void glm_mat4x2_make(const float * __restrict src, mat4x2 dest) Create mat4x2 matrix from pointer diff --git a/docs/source/mat4x3.rst b/docs/source/mat4x3.rst index 0641a19..574c09a 100644 --- a/docs/source/mat4x3.rst +++ b/docs/source/mat4x3.rst @@ -41,7 +41,7 @@ Functions documentation Parameters: | *[in,out]* **mat** matrix -.. c:function:: void glm_mat4x3_make(float * __restrict src, mat4x3 dest) +.. c:function:: void glm_mat4x3_make(const float * __restrict src, mat4x3 dest) Create mat4x3 matrix from pointer diff --git a/docs/source/quat.rst b/docs/source/quat.rst index deb2e86..c52a235 100644 --- a/docs/source/quat.rst +++ b/docs/source/quat.rst @@ -422,7 +422,7 @@ Functions documentation | *[in]* **q** quaternion | *[in]* **pivot** pivot -.. c:function:: void glm_quat_make(float * __restrict src, versor dest) +.. c:function:: void glm_quat_make(const float * __restrict src, versor dest) Create quaternion from pointer diff --git a/docs/source/vec2.rst b/docs/source/vec2.rst index e299799..102f4fa 100644 --- a/docs/source/vec2.rst +++ b/docs/source/vec2.rst @@ -385,7 +385,7 @@ Functions documentation | *[in]* **t** interpolant (amount) clamped between 0 and 1 | *[out]* **dest** destination -.. c:function:: void glm_vec2_make(float * __restrict src, vec2 dest) +.. c:function:: void glm_vec2_make(const float * __restrict src, vec2 dest) Create two dimensional vector from pointer diff --git a/docs/source/vec3.rst b/docs/source/vec3.rst index 69fe52c..c7d92c8 100644 --- a/docs/source/vec3.rst +++ b/docs/source/vec3.rst @@ -503,7 +503,7 @@ Functions documentation | *[in]* **t** interpolant (amount) clamped between 0 and 1 | *[out]* **dest** destination -.. c:function:: void glm_vec3_make(float * __restrict src, vec3 dest) +.. c:function:: void glm_vec3_make(const float * __restrict src, vec3 dest) Create three dimensional vector from pointer diff --git a/docs/source/vec4.rst b/docs/source/vec4.rst index ab074d1..4281816 100644 --- a/docs/source/vec4.rst +++ b/docs/source/vec4.rst @@ -415,7 +415,7 @@ Functions documentation | *[in]* **s** parameter | *[out]* **dest** destination -.. c:function:: void glm_vec4_make(float * __restrict src, vec4 dest) +.. c:function:: void glm_vec4_make(const float * __restrict src, vec4 dest) Create four dimensional vector from pointer diff --git a/include/cglm/call/mat2.h b/include/cglm/call/mat2.h index fbac296..598b5c8 100644 --- a/include/cglm/call/mat2.h +++ b/include/cglm/call/mat2.h @@ -75,7 +75,7 @@ glmc_mat2_rmc(vec2 r, mat2 m, vec2 c); CGLM_EXPORT void -glmc_mat2_make(float * __restrict src, mat2 dest); +glmc_mat2_make(const float * __restrict src, mat2 dest); #ifdef __cplusplus } diff --git a/include/cglm/call/mat2x3.h b/include/cglm/call/mat2x3.h index c70bbf6..90ff606 100644 --- a/include/cglm/call/mat2x3.h +++ b/include/cglm/call/mat2x3.h @@ -23,7 +23,7 @@ glmc_mat2x3_zero(mat2x3 mat); CGLM_EXPORT void -glmc_mat2x3_make(float * __restrict src, mat2x3 dest); +glmc_mat2x3_make(const float * __restrict src, mat2x3 dest); CGLM_EXPORT void diff --git a/include/cglm/call/mat2x4.h b/include/cglm/call/mat2x4.h index 2c7fa52..b11fd0e 100644 --- a/include/cglm/call/mat2x4.h +++ b/include/cglm/call/mat2x4.h @@ -23,7 +23,7 @@ glmc_mat2x4_zero(mat2x4 mat); CGLM_EXPORT void -glmc_mat2x4_make(float * __restrict src, mat2x4 dest); +glmc_mat2x4_make(const float * __restrict src, mat2x4 dest); CGLM_EXPORT void diff --git a/include/cglm/call/mat3.h b/include/cglm/call/mat3.h index 9738fb4..3659b6f 100644 --- a/include/cglm/call/mat3.h +++ b/include/cglm/call/mat3.h @@ -82,7 +82,7 @@ glmc_mat3_rmc(vec3 r, mat3 m, vec3 c); CGLM_EXPORT void -glmc_mat3_make(float * __restrict src, mat3 dest); +glmc_mat3_make(const float * __restrict src, mat3 dest); #ifdef __cplusplus } diff --git a/include/cglm/call/mat3x2.h b/include/cglm/call/mat3x2.h index 4d78712..302ae93 100644 --- a/include/cglm/call/mat3x2.h +++ b/include/cglm/call/mat3x2.h @@ -23,7 +23,7 @@ glmc_mat3x2_zero(mat3x2 mat); CGLM_EXPORT void -glmc_mat3x2_make(float * __restrict src, mat3x2 dest); +glmc_mat3x2_make(const float * __restrict src, mat3x2 dest); CGLM_EXPORT void diff --git a/include/cglm/call/mat3x4.h b/include/cglm/call/mat3x4.h index 60fe949..5339e16 100644 --- a/include/cglm/call/mat3x4.h +++ b/include/cglm/call/mat3x4.h @@ -23,7 +23,7 @@ glmc_mat3x4_zero(mat3x4 mat); CGLM_EXPORT void -glmc_mat3x4_make(float * __restrict src, mat3x4 dest); +glmc_mat3x4_make(const float * __restrict src, mat3x4 dest); CGLM_EXPORT void diff --git a/include/cglm/call/mat4.h b/include/cglm/call/mat4.h index f85ef2d..5a33f72 100644 --- a/include/cglm/call/mat4.h +++ b/include/cglm/call/mat4.h @@ -123,7 +123,7 @@ glmc_mat4_rmc(vec4 r, mat4 m, vec4 c); CGLM_EXPORT void -glmc_mat4_make(float * __restrict src, mat4 dest); +glmc_mat4_make(const float * __restrict src, mat4 dest); #ifdef __cplusplus } diff --git a/include/cglm/call/mat4x2.h b/include/cglm/call/mat4x2.h index ba60fce..b60125d 100644 --- a/include/cglm/call/mat4x2.h +++ b/include/cglm/call/mat4x2.h @@ -23,7 +23,7 @@ glmc_mat4x2_zero(mat4x2 mat); CGLM_EXPORT void -glmc_mat4x2_make(float * __restrict src, mat4x2 dest); +glmc_mat4x2_make(const float * __restrict src, mat4x2 dest); CGLM_EXPORT void diff --git a/include/cglm/call/mat4x3.h b/include/cglm/call/mat4x3.h index 411ea11..131cf51 100644 --- a/include/cglm/call/mat4x3.h +++ b/include/cglm/call/mat4x3.h @@ -23,7 +23,7 @@ glmc_mat4x3_zero(mat4x3 mat); CGLM_EXPORT void -glmc_mat4x3_make(float * __restrict src, mat4x3 dest); +glmc_mat4x3_make(const float * __restrict src, mat4x3 dest); CGLM_EXPORT void diff --git a/include/cglm/call/quat.h b/include/cglm/call/quat.h index 1fe5195..acf4313 100644 --- a/include/cglm/call/quat.h +++ b/include/cglm/call/quat.h @@ -163,7 +163,7 @@ glmc_quat_rotate_atm(mat4 m, versor q, vec3 pivot); CGLM_EXPORT void -glmc_quat_make(float * __restrict src, versor dest); +glmc_quat_make(const float * __restrict src, versor dest); #ifdef __cplusplus } diff --git a/include/cglm/call/vec2.h b/include/cglm/call/vec2.h index 34a5597..f951663 100644 --- a/include/cglm/call/vec2.h +++ b/include/cglm/call/vec2.h @@ -195,7 +195,7 @@ glmc_vec2_complex_conjugate(vec2 a, vec2 dest); CGLM_EXPORT void -glmc_vec2_make(float * __restrict src, vec2 dest); +glmc_vec2_make(const float * __restrict src, vec2 dest); #ifdef __cplusplus } diff --git a/include/cglm/call/vec3.h b/include/cglm/call/vec3.h index e6dc7f9..f3ab653 100644 --- a/include/cglm/call/vec3.h +++ b/include/cglm/call/vec3.h @@ -332,7 +332,7 @@ glmc_vec3_sqrt(vec3 v, vec3 dest); CGLM_EXPORT void -glmc_vec3_make(float * __restrict src, vec3 dest); +glmc_vec3_make(const float * __restrict src, vec3 dest); #ifdef __cplusplus } diff --git a/include/cglm/call/vec4.h b/include/cglm/call/vec4.h index 9585feb..644facf 100644 --- a/include/cglm/call/vec4.h +++ b/include/cglm/call/vec4.h @@ -309,7 +309,7 @@ glmc_vec4_sqrt(vec4 v, vec4 dest); CGLM_EXPORT void -glmc_vec4_make(float * __restrict src, vec4 dest); +glmc_vec4_make(const float * __restrict src, vec4 dest); #ifdef __cplusplus } diff --git a/include/cglm/mat2.h b/include/cglm/mat2.h index 3773f93..7fba348 100644 --- a/include/cglm/mat2.h +++ b/include/cglm/mat2.h @@ -354,7 +354,7 @@ glm_mat2_rmc(vec2 r, mat2 m, vec2 c) { */ CGLM_INLINE void -glm_mat2_make(float * __restrict src, mat2 dest) { +glm_mat2_make(const float * __restrict src, mat2 dest) { dest[0][0] = src[0]; dest[0][1] = src[1]; dest[1][0] = src[2]; diff --git a/include/cglm/mat2x3.h b/include/cglm/mat2x3.h index f7a3930..06fec14 100644 --- a/include/cglm/mat2x3.h +++ b/include/cglm/mat2x3.h @@ -13,7 +13,7 @@ Functions: CGLM_INLINE void glm_mat2x3_copy(mat2x3 mat, mat2x3 dest); CGLM_INLINE void glm_mat2x3_zero(mat2x3 mat); - CGLM_INLINE void glm_mat2x3_make(float * __restrict src, mat2x3 dest); + CGLM_INLINE void glm_mat2x3_make(const float * __restrict src, mat2x3 dest); CGLM_INLINE void glm_mat2x3_mul(mat2x3 m1, mat3x2 m2, mat2 dest); CGLM_INLINE void glm_mat2x3_mulv(mat2x3 m, vec3 v, vec2 dest); CGLM_INLINE void glm_mat2x3_transpose(mat2x3 m, mat3x2 dest); @@ -68,7 +68,7 @@ glm_mat2x3_zero(mat2x3 mat) { */ CGLM_INLINE void -glm_mat2x3_make(float * __restrict src, mat2x3 dest) { +glm_mat2x3_make(const float * __restrict src, mat2x3 dest) { dest[0][0] = src[0]; dest[0][1] = src[1]; dest[0][2] = src[2]; diff --git a/include/cglm/mat2x4.h b/include/cglm/mat2x4.h index 9ec8d9e..9b1bd48 100644 --- a/include/cglm/mat2x4.h +++ b/include/cglm/mat2x4.h @@ -13,7 +13,7 @@ Functions: CGLM_INLINE void glm_mat2x4_copy(mat2x4 mat, mat2x4 dest); CGLM_INLINE void glm_mat2x4_zero(mat2x4 mat); - CGLM_INLINE void glm_mat2x4_make(float * __restrict src, mat2x4 dest); + CGLM_INLINE void glm_mat2x4_make(const float * __restrict src, mat2x4 dest); CGLM_INLINE void glm_mat2x4_mul(mat2x4 m1, mat4x2 m2, mat2 dest); CGLM_INLINE void glm_mat2x4_mulv(mat2x4 m, vec4 v, vec2 dest); CGLM_INLINE void glm_mat2x4_transpose(mat2x4 m, mat4x2 dest); @@ -64,7 +64,7 @@ glm_mat2x4_zero(mat2x4 mat) { */ CGLM_INLINE void -glm_mat2x4_make(float * __restrict src, mat2x4 dest) { +glm_mat2x4_make(const float * __restrict src, mat2x4 dest) { dest[0][0] = src[0]; dest[0][1] = src[1]; dest[0][2] = src[2]; diff --git a/include/cglm/mat3.h b/include/cglm/mat3.h index 2c83fed..7db616d 100644 --- a/include/cglm/mat3.h +++ b/include/cglm/mat3.h @@ -436,7 +436,7 @@ glm_mat3_rmc(vec3 r, mat3 m, vec3 c) { */ CGLM_INLINE void -glm_mat3_make(float * __restrict src, mat3 dest) { +glm_mat3_make(const float * __restrict src, mat3 dest) { dest[0][0] = src[0]; dest[0][1] = src[1]; dest[0][2] = src[2]; diff --git a/include/cglm/mat3x2.h b/include/cglm/mat3x2.h index 3b45a96..0ed466f 100644 --- a/include/cglm/mat3x2.h +++ b/include/cglm/mat3x2.h @@ -13,7 +13,7 @@ Functions: CGLM_INLINE void glm_mat3x2_copy(mat3x2 mat, mat3x2 dest); CGLM_INLINE void glm_mat3x2_zero(mat3x2 mat); - CGLM_INLINE void glm_mat3x2_make(float * __restrict src, mat3x2 dest); + CGLM_INLINE void glm_mat3x2_make(const float * __restrict src, mat3x2 dest); CGLM_INLINE void glm_mat3x2_mul(mat3x2 m1, mat2x3 m2, mat3 dest); CGLM_INLINE void glm_mat3x2_mulv(mat3x2 m, vec2 v, vec3 dest); CGLM_INLINE void glm_mat3x2_transpose(mat3x2 m, mat2x3 dest); @@ -69,7 +69,7 @@ glm_mat3x2_zero(mat3x2 mat) { */ CGLM_INLINE void -glm_mat3x2_make(float * __restrict src, mat3x2 dest) { +glm_mat3x2_make(const float * __restrict src, mat3x2 dest) { dest[0][0] = src[0]; dest[0][1] = src[1]; diff --git a/include/cglm/mat3x4.h b/include/cglm/mat3x4.h index 24ed442..aec4295 100644 --- a/include/cglm/mat3x4.h +++ b/include/cglm/mat3x4.h @@ -13,7 +13,7 @@ Functions: CGLM_INLINE void glm_mat3x4_copy(mat3x4 mat, mat3x4 dest); CGLM_INLINE void glm_mat3x4_zero(mat3x4 mat); - CGLM_INLINE void glm_mat3x4_make(float * __restrict src, mat3x4 dest); + CGLM_INLINE void glm_mat3x4_make(const float * __restrict src, mat3x4 dest); CGLM_INLINE void glm_mat3x4_mul(mat3x4 m1, mat4x3 m2, mat3 dest); CGLM_INLINE void glm_mat3x4_mulv(mat3x4 m, vec4 v, vec3 dest); CGLM_INLINE void glm_mat3x4_transpose(mat3x4 m, mat4x3 dest); @@ -66,7 +66,7 @@ glm_mat3x4_zero(mat3x4 mat) { */ CGLM_INLINE void -glm_mat3x4_make(float * __restrict src, mat3x4 dest) { +glm_mat3x4_make(const float * __restrict src, mat3x4 dest) { dest[0][0] = src[0]; dest[0][1] = src[1]; dest[0][2] = src[2]; diff --git a/include/cglm/mat4.h b/include/cglm/mat4.h index 08310a4..742b0cb 100644 --- a/include/cglm/mat4.h +++ b/include/cglm/mat4.h @@ -790,7 +790,7 @@ glm_mat4_rmc(vec4 r, mat4 m, vec4 c) { */ CGLM_INLINE void -glm_mat4_make(float * __restrict src, mat4 dest) { +glm_mat4_make(const float * __restrict src, mat4 dest) { dest[0][0] = src[0]; dest[1][0] = src[4]; dest[0][1] = src[1]; dest[1][1] = src[5]; dest[0][2] = src[2]; dest[1][2] = src[6]; diff --git a/include/cglm/mat4x2.h b/include/cglm/mat4x2.h index 6842d7a..b1784d4 100644 --- a/include/cglm/mat4x2.h +++ b/include/cglm/mat4x2.h @@ -13,7 +13,7 @@ Functions: CGLM_INLINE void glm_mat4x2_copy(mat4x2 mat, mat4x2 dest); CGLM_INLINE void glm_mat4x2_zero(mat4x2 mat); - CGLM_INLINE void glm_mat4x2_make(float * __restrict src, mat4x2 dest); + CGLM_INLINE void glm_mat4x2_make(const float * __restrict src, mat4x2 dest); CGLM_INLINE void glm_mat4x2_mul(mat4x2 m1, mat2x4 m2, mat4 dest); CGLM_INLINE void glm_mat4x2_mulv(mat4x2 m, vec2 v, vec4 dest); CGLM_INLINE void glm_mat4x2_transpose(mat4x2 m, mat2x4 dest); @@ -72,7 +72,7 @@ glm_mat4x2_zero(mat4x2 mat) { */ CGLM_INLINE void -glm_mat4x2_make(float * __restrict src, mat4x2 dest) { +glm_mat4x2_make(const float * __restrict src, mat4x2 dest) { dest[0][0] = src[0]; dest[0][1] = src[1]; diff --git a/include/cglm/mat4x3.h b/include/cglm/mat4x3.h index c120371..4266278 100644 --- a/include/cglm/mat4x3.h +++ b/include/cglm/mat4x3.h @@ -13,7 +13,7 @@ Functions: CGLM_INLINE void glm_mat4x3_copy(mat4x3 mat, mat4x3 dest); CGLM_INLINE void glm_mat4x3_zero(mat4x3 mat); - CGLM_INLINE void glm_mat4x3_make(float * __restrict src, mat4x3 dest); + CGLM_INLINE void glm_mat4x3_make(const float * __restrict src, mat4x3 dest); CGLM_INLINE void glm_mat4x3_mul(mat4x3 m1, mat3x4 m2, mat4 dest); CGLM_INLINE void glm_mat4x3_mulv(mat4x3 m, vec3 v, vec4 dest); CGLM_INLINE void glm_mat4x3_transpose(mat4x3 m, mat3x4 dest); @@ -77,7 +77,7 @@ glm_mat4x3_zero(mat4x3 mat) { */ CGLM_INLINE void -glm_mat4x3_make(float * __restrict src, mat4x3 dest) { +glm_mat4x3_make(const float * __restrict src, mat4x3 dest) { dest[0][0] = src[0]; dest[0][1] = src[1]; dest[0][2] = src[2]; diff --git a/include/cglm/quat.h b/include/cglm/quat.h index 8807e6e..18892d3 100644 --- a/include/cglm/quat.h +++ b/include/cglm/quat.h @@ -894,7 +894,7 @@ glm_quat_rotate_atm(mat4 m, versor q, vec3 pivot) { */ CGLM_INLINE void -glm_quat_make(float * __restrict src, versor dest) { +glm_quat_make(const float * __restrict src, versor dest) { dest[0] = src[0]; dest[1] = src[1]; dest[2] = src[2]; dest[3] = src[3]; } diff --git a/include/cglm/struct/mat2.h b/include/cglm/struct/mat2.h index a1518e3..5942ced 100644 --- a/include/cglm/struct/mat2.h +++ b/include/cglm/struct/mat2.h @@ -27,7 +27,7 @@ CGLM_INLINE void glms_mat2_swap_col(mat2 mat, int col1, int col2) CGLM_INLINE void glms_mat2_swap_row(mat2 mat, int row1, int row2) CGLM_INLINE float glms_mat2_rmc(vec2 r, mat2 m, vec2 c) - CGLM_INLINE mat2s glms_mat2_make(float * __restrict src); + CGLM_INLINE mat2s glms_mat2_make(const float * __restrict src); */ #ifndef cglms_mat2_h @@ -267,7 +267,7 @@ glms_mat2_(rmc)(vec2s r, mat2s m, vec2s c) { */ CGLM_INLINE mat2s -glms_mat2_(make)(float * __restrict src) { +glms_mat2_(make)(const float * __restrict src) { mat2s r; glm_mat2_make(src, r.raw); return r; diff --git a/include/cglm/struct/mat2x3.h b/include/cglm/struct/mat2x3.h index ec4ebfb..77084a7 100644 --- a/include/cglm/struct/mat2x3.h +++ b/include/cglm/struct/mat2x3.h @@ -12,7 +12,7 @@ Functions: CGLM_INLINE mat2x3s glms_mat2x3_zero(void); - CGLM_INLINE mat2x3s glms_mat2x3_make(float * __restrict src); + CGLM_INLINE mat2x3s glms_mat2x3_make(const float * __restrict src); CGLM_INLINE mat2s glms_mat2x3_mul(mat2x3s m1, mat3x2s m2); CGLM_INLINE vec2s glms_mat2x3_mulv(mat2x3s m, vec3s v); CGLM_INLINE mat3x2s glms_mat2x3_transpose(mat2x3s m); @@ -55,7 +55,7 @@ glms_mat2x3_(zero)(void) { */ CGLM_INLINE mat2x3s -glms_mat2x3_(make)(float * __restrict src) { +glms_mat2x3_(make)(const float * __restrict src) { mat2x3s r; glm_mat2x3_make(src, r.raw); return r; diff --git a/include/cglm/struct/mat2x4.h b/include/cglm/struct/mat2x4.h index d882fc2..fbb63e0 100644 --- a/include/cglm/struct/mat2x4.h +++ b/include/cglm/struct/mat2x4.h @@ -12,7 +12,7 @@ Functions: CGLM_INLINE mat2x4s glms_mat2x4_zero(void); - CGLM_INLINE mat2x4s glms_mat2x4_make(float * __restrict src); + CGLM_INLINE mat2x4s glms_mat2x4_make(const float * __restrict src); CGLM_INLINE mat2s glms_mat2x4_mul(mat2x4s m1, mat4x2s m2); CGLM_INLINE vec2s glms_mat2x4_mulv(mat2x4s m, vec4s v); CGLM_INLINE mat4x2s glms_mat2x4_transpose(mat2x4s m); @@ -55,7 +55,7 @@ glms_mat2x4_(zero)(void) { */ CGLM_INLINE mat2x4s -glms_mat2x4_(make)(float * __restrict src) { +glms_mat2x4_(make)(const float * __restrict src) { mat2x4s r; glm_mat2x4_make(src, r.raw); return r; diff --git a/include/cglm/struct/mat3.h b/include/cglm/struct/mat3.h index 3df5d72..4bfdde8 100644 --- a/include/cglm/struct/mat3.h +++ b/include/cglm/struct/mat3.h @@ -28,7 +28,7 @@ CGLM_INLINE mat3s glms_mat3_swap_col(mat3s mat, int col1, int col2); CGLM_INLINE mat3s glms_mat3_swap_row(mat3s mat, int row1, int row2); CGLM_INLINE float glms_mat3_rmc(vec3s r, mat3s m, vec3s c); - CGLM_INLINE mat3s glms_mat3_make(float * __restrict src); + CGLM_INLINE mat3s glms_mat3_make(const float * __restrict src); */ #ifndef cglms_mat3s_h @@ -294,7 +294,7 @@ glms_mat3_(rmc)(vec3s r, mat3s m, vec3s c) { */ CGLM_INLINE mat3s -glms_mat3_(make)(float * __restrict src) { +glms_mat3_(make)(const float * __restrict src) { mat3s r; glm_mat3_make(src, r.raw); return r; diff --git a/include/cglm/struct/mat3x2.h b/include/cglm/struct/mat3x2.h index c2329b3..e9d077b 100644 --- a/include/cglm/struct/mat3x2.h +++ b/include/cglm/struct/mat3x2.h @@ -12,7 +12,7 @@ Functions: CGLM_INLINE mat3x2s glms_mat3x2_zero(void); - CGLM_INLINE mat3x2s glms_mat3x2_make(float * __restrict src); + CGLM_INLINE mat3x2s glms_mat3x2_make(const float * __restrict src); CGLM_INLINE mat3s glms_mat3x2_mul(mat3x2s m1, mat2x3s m2); CGLM_INLINE vec3s glms_mat3x2_mulv(mat3x2s m, vec2s v); CGLM_INLINE mat2x3s glms_mat3x2_transpose(mat3x2s m); @@ -55,7 +55,7 @@ glms_mat3x2_(zero)(void) { */ CGLM_INLINE mat3x2s -glms_mat3x2_(make)(float * __restrict src) { +glms_mat3x2_(make)(const float * __restrict src) { mat3x2s r; glm_mat3x2_make(src, r.raw); return r; diff --git a/include/cglm/struct/mat3x4.h b/include/cglm/struct/mat3x4.h index 2ad5499..29dd870 100644 --- a/include/cglm/struct/mat3x4.h +++ b/include/cglm/struct/mat3x4.h @@ -12,7 +12,7 @@ Functions: CGLM_INLINE mat3x4s glms_mat3x4_zero(void); - CGLM_INLINE mat3x4s glms_mat3x4_make(float * __restrict src); + CGLM_INLINE mat3x4s glms_mat3x4_make(const float * __restrict src); CGLM_INLINE mat3s glms_mat3x4_mul(mat3x4s m1, mat4x3s m2); CGLM_INLINE vec3s glms_mat3x4_mulv(mat3x4s m, vec4s v); CGLM_INLINE mat4x3s glms_mat3x4_transpose(mat3x4s m); @@ -55,7 +55,7 @@ glms_mat3x4_(zero)(void) { */ CGLM_INLINE mat3x4s -glms_mat3x4_(make)(float * __restrict src) { +glms_mat3x4_(make)(const float * __restrict src) { mat3x4s r; glm_mat3x4_make(src, r.raw); return r; diff --git a/include/cglm/struct/mat4.h b/include/cglm/struct/mat4.h index 77e60b5..35b184b 100644 --- a/include/cglm/struct/mat4.h +++ b/include/cglm/struct/mat4.h @@ -42,7 +42,7 @@ CGLM_INLINE mat4s glms_mat4_swap_col(mat4s mat, int col1, int col2); CGLM_INLINE mat4s glms_mat4_swap_row(mat4s mat, int row1, int row2); CGLM_INLINE float glms_mat4_rmc(vec4s r, mat4s m, vec4s c); - CGLM_INLINE mat4s glms_mat4_make(float * __restrict src); + CGLM_INLINE mat4s glms_mat4_make(const float * __restrict src); */ #ifndef cglms_mat4s_h @@ -468,7 +468,7 @@ glms_mat4_(rmc)(vec4s r, mat4s m, vec4s c) { */ CGLM_INLINE mat4s -glms_mat4_(make)(float * __restrict src) { +glms_mat4_(make)(const float * __restrict src) { mat4s r; glm_mat4_make(src, r.raw); return r; diff --git a/include/cglm/struct/mat4x2.h b/include/cglm/struct/mat4x2.h index 17f5743..3a0db6f 100644 --- a/include/cglm/struct/mat4x2.h +++ b/include/cglm/struct/mat4x2.h @@ -12,7 +12,7 @@ Functions: CGLM_INLINE mat4x2s glms_mat4x2_zero(void); - CGLM_INLINE mat4x2s glms_mat4x2_make(float * __restrict src); + CGLM_INLINE mat4x2s glms_mat4x2_make(const float * __restrict src); CGLM_INLINE mat4s glms_mat4x2_mul(mat4x2s m1, mat2x4s m2); CGLM_INLINE vec4s glms_mat4x2_mulv(mat4x2s m, vec2s v); CGLM_INLINE mat2x4s glms_mat4x2_transpose(mat4x2s m); @@ -56,7 +56,7 @@ glms_mat4x2_(zero)(void) { */ CGLM_INLINE mat4x2s -glms_mat4x2_(make)(float * __restrict src) { +glms_mat4x2_(make)(const float * __restrict src) { mat4x2s r; glm_mat4x2_make(src, r.raw); return r; diff --git a/include/cglm/struct/mat4x3.h b/include/cglm/struct/mat4x3.h index 68e7c70..f2cc7bb 100644 --- a/include/cglm/struct/mat4x3.h +++ b/include/cglm/struct/mat4x3.h @@ -12,7 +12,7 @@ Functions: CGLM_INLINE mat4x3s glms_mat4x3_zero(void); - CGLM_INLINE mat4x3s glms_mat4x3_make(float * __restrict src); + CGLM_INLINE mat4x3s glms_mat4x3_make(const float * __restrict src); CGLM_INLINE mat4s glms_mat4x3_mul(mat4x3s m1, mat3x4s m2); CGLM_INLINE vec4s glms_mat4x3_mulv(mat4x3s m, vec3s v); CGLM_INLINE mat3x4s glms_mat4x3_transpose(mat4x3s m); @@ -55,7 +55,7 @@ glms_mat4x3_(zero)(void) { */ CGLM_INLINE mat4x3s -glms_mat4x3_(make)(float * __restrict src) { +glms_mat4x3_(make)(const float * __restrict src) { mat4x3s r; glm_mat4x3_make(src, r.raw); return r; diff --git a/include/cglm/struct/quat.h b/include/cglm/struct/quat.h index 1a56daf..859b664 100644 --- a/include/cglm/struct/quat.h +++ b/include/cglm/struct/quat.h @@ -574,7 +574,7 @@ glms_quat_(rotate_atm)(versors q, vec3s pivot) { */ CGLM_INLINE versors -glms_quat_(make)(float * __restrict src) { +glms_quat_(make)(const float * __restrict src) { versors dest; glm_quat_make(src, dest.raw); return dest; diff --git a/include/cglm/struct/vec2.h b/include/cglm/struct/vec2.h index d9fe6a3..99db56a 100644 --- a/include/cglm/struct/vec2.h +++ b/include/cglm/struct/vec2.h @@ -685,7 +685,7 @@ glms_vec2_(lerp)(vec2s from, vec2s to, float t) { */ CGLM_INLINE vec2s -glms_vec2_(make)(float * __restrict src) { +glms_vec2_(make)(const float * __restrict src) { vec2s dest; glm_vec2_make(src, dest.raw); return dest; diff --git a/include/cglm/struct/vec3.h b/include/cglm/struct/vec3.h index bb3951d..2cd208f 100644 --- a/include/cglm/struct/vec3.h +++ b/include/cglm/struct/vec3.h @@ -1077,7 +1077,7 @@ glms_vec3_(swizzle)(vec3s v, int mask) { */ CGLM_INLINE vec3s -glms_vec3_(make)(float * __restrict src) { +glms_vec3_(make)(const float * __restrict src) { vec3s dest; glm_vec3_make(src, dest.raw); return dest; diff --git a/include/cglm/struct/vec4.h b/include/cglm/struct/vec4.h index 25dc870..c4f200d 100644 --- a/include/cglm/struct/vec4.h +++ b/include/cglm/struct/vec4.h @@ -921,7 +921,7 @@ glms_vec4_(swizzle)(vec4s v, int mask) { */ CGLM_INLINE vec4s -glms_vec4_(make)(float * __restrict src) { +glms_vec4_(make)(const float * __restrict src) { vec4s dest; glm_vec4_make(src, dest.raw); return dest; diff --git a/include/cglm/vec2.h b/include/cglm/vec2.h index 4b53a33..5abf616 100644 --- a/include/cglm/vec2.h +++ b/include/cglm/vec2.h @@ -708,7 +708,7 @@ glm_vec2_lerp(vec2 from, vec2 to, float t, vec2 dest) { */ CGLM_INLINE void -glm_vec2_make(float * __restrict src, vec2 dest) { +glm_vec2_make(const float * __restrict src, vec2 dest) { dest[0] = src[0]; dest[1] = src[1]; } diff --git a/include/cglm/vec3.h b/include/cglm/vec3.h index 59ff146..a53cd28 100644 --- a/include/cglm/vec3.h +++ b/include/cglm/vec3.h @@ -1196,7 +1196,7 @@ glm_normalize_to(vec3 v, vec3 dest) { */ CGLM_INLINE void -glm_vec3_make(float * __restrict src, vec3 dest) { +glm_vec3_make(const float * __restrict src, vec3 dest) { dest[0] = src[0]; dest[1] = src[1]; dest[2] = src[2]; diff --git a/include/cglm/vec4.h b/include/cglm/vec4.h index b7e79db..8dd5b85 100644 --- a/include/cglm/vec4.h +++ b/include/cglm/vec4.h @@ -1299,7 +1299,7 @@ glm_vec4_swizzle(vec4 v, int mask, vec4 dest) { */ CGLM_INLINE void -glm_vec4_make(float * __restrict src, vec4 dest) { +glm_vec4_make(const float * __restrict src, vec4 dest) { dest[0] = src[0]; dest[1] = src[1]; dest[2] = src[2]; dest[3] = src[3]; } diff --git a/src/mat2.c b/src/mat2.c index 118668e..3f0750c 100644 --- a/src/mat2.c +++ b/src/mat2.c @@ -100,6 +100,6 @@ glmc_mat2_rmc(vec2 r, mat2 m, vec2 c) { CGLM_EXPORT void -glmc_mat2_make(float * __restrict src, mat2 dest) { +glmc_mat2_make(const float * __restrict src, mat2 dest) { glm_mat2_make(src, dest); } diff --git a/src/mat2x3.c b/src/mat2x3.c index da508e8..dc5fd30 100644 --- a/src/mat2x3.c +++ b/src/mat2x3.c @@ -22,7 +22,7 @@ glmc_mat2x3_zero(mat2x3 mat) { CGLM_EXPORT void -glmc_mat2x3_make(float * __restrict src, mat2x3 dest) { +glmc_mat2x3_make(const float * __restrict src, mat2x3 dest) { glm_mat2x3_make(src, dest); } diff --git a/src/mat2x4.c b/src/mat2x4.c index b941d63..73db032 100644 --- a/src/mat2x4.c +++ b/src/mat2x4.c @@ -22,7 +22,7 @@ glmc_mat2x4_zero(mat2x4 mat) { CGLM_EXPORT void -glmc_mat2x4_make(float * __restrict src, mat2x4 dest) { +glmc_mat2x4_make(const float * __restrict src, mat2x4 dest) { glm_mat2x4_make(src, dest); } diff --git a/src/mat3.c b/src/mat3.c index 3933274..a325a4c 100644 --- a/src/mat3.c +++ b/src/mat3.c @@ -106,6 +106,6 @@ glmc_mat3_rmc(vec3 r, mat3 m, vec3 c) { CGLM_EXPORT void -glmc_mat3_make(float * __restrict src, mat3 dest) { +glmc_mat3_make(const float * __restrict src, mat3 dest) { glm_mat3_make(src, dest); } diff --git a/src/mat3x2.c b/src/mat3x2.c index 3b0067e..8517a9e 100644 --- a/src/mat3x2.c +++ b/src/mat3x2.c @@ -22,7 +22,7 @@ glmc_mat3x2_zero(mat3x2 mat) { CGLM_EXPORT void -glmc_mat3x2_make(float * __restrict src, mat3x2 dest) { +glmc_mat3x2_make(const float * __restrict src, mat3x2 dest) { glm_mat3x2_make(src, dest); } diff --git a/src/mat3x4.c b/src/mat3x4.c index 9232e51..efc9062 100644 --- a/src/mat3x4.c +++ b/src/mat3x4.c @@ -22,7 +22,7 @@ glmc_mat3x4_zero(mat3x4 mat) { CGLM_EXPORT void -glmc_mat3x4_make(float * __restrict src, mat3x4 dest) { +glmc_mat3x4_make(const float * __restrict src, mat3x4 dest) { glm_mat3x4_make(src, dest); } diff --git a/src/mat4.c b/src/mat4.c index 44c6c58..c4d1111 100644 --- a/src/mat4.c +++ b/src/mat4.c @@ -166,6 +166,6 @@ glmc_mat4_rmc(vec4 r, mat4 m, vec4 c) { CGLM_EXPORT void -glmc_mat4_make(float * __restrict src, mat4 dest) { +glmc_mat4_make(const float * __restrict src, mat4 dest) { glm_mat4_make(src, dest); } diff --git a/src/mat4x2.c b/src/mat4x2.c index f462557..2edd2e0 100644 --- a/src/mat4x2.c +++ b/src/mat4x2.c @@ -22,7 +22,7 @@ glmc_mat4x2_zero(mat4x2 mat) { CGLM_EXPORT void -glmc_mat4x2_make(float * __restrict src, mat4x2 dest) { +glmc_mat4x2_make(const float * __restrict src, mat4x2 dest) { glm_mat4x2_make(src, dest); } diff --git a/src/mat4x3.c b/src/mat4x3.c index 969ee90..a50b983 100644 --- a/src/mat4x3.c +++ b/src/mat4x3.c @@ -22,7 +22,7 @@ glmc_mat4x3_zero(mat4x3 mat) { CGLM_EXPORT void -glmc_mat4x3_make(float * __restrict src, mat4x3 dest) { +glmc_mat4x3_make(const float * __restrict src, mat4x3 dest) { glm_mat4x3_make(src, dest); } diff --git a/src/quat.c b/src/quat.c index 1796939..56cda30 100644 --- a/src/quat.c +++ b/src/quat.c @@ -232,6 +232,6 @@ glmc_quat_rotate_atm(mat4 m, versor q, vec3 pivot) { CGLM_EXPORT void -glmc_quat_make(float * __restrict src, versor dest) { +glmc_quat_make(const float * __restrict src, versor dest) { glm_quat_make(src, dest); } diff --git a/src/vec2.c b/src/vec2.c index bd2e526..5a23ff5 100644 --- a/src/vec2.c +++ b/src/vec2.c @@ -299,6 +299,6 @@ glmc_vec2_complex_conjugate(vec2 a, vec2 dest) { CGLM_EXPORT void -glmc_vec2_make(float * __restrict src, vec2 dest) { +glmc_vec2_make(const float * __restrict src, vec2 dest) { glm_vec2_make(src, dest); } diff --git a/src/vec3.c b/src/vec3.c index 780f96a..86660c8 100644 --- a/src/vec3.c +++ b/src/vec3.c @@ -456,6 +456,6 @@ glmc_vec3_sqrt(vec3 v, vec3 dest) { CGLM_EXPORT void -glmc_vec3_make(float * __restrict src, vec3 dest) { +glmc_vec3_make(const float * __restrict src, vec3 dest) { glm_vec3_make(src, dest); } diff --git a/src/vec4.c b/src/vec4.c index 72fc407..2fcd4ca 100644 --- a/src/vec4.c +++ b/src/vec4.c @@ -420,6 +420,6 @@ glmc_vec4_sqrt(vec4 v, vec4 dest) { CGLM_EXPORT void -glmc_vec4_make(float * __restrict src, vec4 dest) { +glmc_vec4_make(const float * __restrict src, vec4 dest) { glm_vec4_make(src, dest); }