diff options
author | 2015-01-31 21:39:49 +0200 | |
---|---|---|
committer | 2015-03-03 23:36:31 +0200 | |
commit | 7577b64fe883d5b2e6f52f45e15b5a3575b8dac5 (patch) | |
tree | 8bec1f5e729b6e2d075244624b649ebd02536a43 | |
parent | 8b26e3ef33e3871762ebd62acbff85b2c3abd9fc (diff) | |
download | librin-7577b64fe883d5b2e6f52f45e15b5a3575b8dac5.tar.gz librin-7577b64fe883d5b2e6f52f45e15b5a3575b8dac5.tar.bz2 librin-7577b64fe883d5b2e6f52f45e15b5a3575b8dac5.zip |
float: Move everything under the "rin_" namespace.
-rw-r--r-- | include/rin/float.h | 12 | ||||
-rw-r--r-- | include/rin/float_types.h | 21 | ||||
-rw-r--r-- | src/float/float.c | 12 |
3 files changed, 22 insertions, 23 deletions
diff --git a/include/rin/float.h b/include/rin/float.h index afd63f5..16d1f7e 100644 --- a/include/rin/float.h +++ b/include/rin/float.h @@ -48,14 +48,14 @@ char *rin_float_to_hexstring(const float num, char *str, unsigned int mode); char *rin_double_to_hexstring(const double num, char *str, unsigned int mode); unsigned int rin_compare_float(const float a, const float b, uint32_t max_ulps); -unsigned int rin_compare_vec2(const struct vec2 a, const struct vec2 b, uint32_t max_ulps); -unsigned int rin_compare_vec3(const struct vec3 a, const struct vec3 b, uint32_t max_ulps); -unsigned int rin_compare_vec4(const struct vec4 a, const struct vec4 b, uint32_t max_ulps); +unsigned int rin_compare_rin_vec2(const struct rin_vec2 a, const struct rin_vec2 b, uint32_t max_ulps); +unsigned int rin_compare_rin_vec3(const struct rin_vec3 a, const struct rin_vec3 b, uint32_t max_ulps); +unsigned int rin_compare_rin_vec4(const struct rin_vec4 a, const struct rin_vec4 b, uint32_t max_ulps); unsigned int rin_compare_double(const double a, const double b, uint64_t max_ulps); -unsigned int rin_compare_vec2d(const struct vec2d a, const struct vec2d b, uint64_t max_ulps); -unsigned int rin_compare_vec3d(const struct vec3d a, const struct vec3d b, uint64_t max_ulps); -unsigned int rin_compare_vec4d(const struct vec4d a, const struct vec4d b, uint64_t max_ulps); +unsigned int rin_compare_rin_vec2d(const struct rin_vec2d a, const struct rin_vec2d b, uint64_t max_ulps); +unsigned int rin_compare_rin_vec3d(const struct rin_vec3d a, const struct rin_vec3d b, uint64_t max_ulps); +unsigned int rin_compare_rin_vec4d(const struct rin_vec4d a, const struct rin_vec4d b, uint64_t max_ulps); uint32_t rin_float_to_uint(const float num); int32_t rin_float_to_int(const float num); diff --git a/include/rin/float_types.h b/include/rin/float_types.h index 2d99b2f..4510178 100644 --- a/include/rin/float_types.h +++ b/include/rin/float_types.h @@ -21,14 +21,13 @@ #ifndef LIBRIN_FLOAT_TYPES_INCLUDED #define LIBRIN_FLOAT_TYPES_INCLUDED -/* These vec[num] types mostly mimic the analogous types found in OpenGL - * Might get renamed to rin_vec[num] in case namespace clashes +/* These rin_vec[num] types mostly mimic the analogous types found in OpenGL * with other existing libraries get noticed. * - * vecd[num] use double instead of float, but are otherwise identical to vec[num]. + * rin_vecd[num] use double instead of float, but are otherwise identical to rin_vec[num]. */ -struct vec2 { +struct rin_vec2 { union { struct { float x; @@ -45,7 +44,7 @@ struct vec2 { }; }; -struct vec3 { +struct rin_vec3 { union { struct { float x; @@ -65,7 +64,7 @@ struct vec3 { }; }; -struct vec4 { +struct rin_vec4 { union { struct { float x; @@ -88,7 +87,7 @@ struct vec4 { }; }; -struct vec2d { +struct rin_vec2d { union { struct { double x; @@ -105,7 +104,7 @@ struct vec2d { }; }; -struct vec3d { +struct rin_vec3d { union { struct { double x; @@ -125,7 +124,7 @@ struct vec3d { }; }; -struct vec4d { +struct rin_vec4d { union { struct { double x; @@ -150,8 +149,8 @@ struct vec4d { /* A simple 3D vertex with position and normal data. */ struct vertex { - struct vec3 position; - struct vec3 normal; + struct rin_vec3 position; + struct rin_vec3 normal; }; #endif /* LIBRIN_FLOAT_TYPES_INCLUDED */ diff --git a/src/float/float.c b/src/float/float.c index 97fcb41..9520bea 100644 --- a/src/float/float.c +++ b/src/float/float.c @@ -124,7 +124,7 @@ unsigned int rin_compare_float(const float a, const float b, uint32_t max_ulps) } } -unsigned int rin_compare_vec2(const struct vec2 a, const struct vec2 b, uint32_t max_ulps) +unsigned int rin_compare_rin_vec2(const struct rin_vec2 a, const struct rin_vec2 b, uint32_t max_ulps) { unsigned int ret; @@ -134,7 +134,7 @@ unsigned int rin_compare_vec2(const struct vec2 a, const struct vec2 b, uint32_t return ret; } -unsigned int rin_compare_vec3(const struct vec3 a, const struct vec3 b, uint32_t max_ulps) +unsigned int rin_compare_rin_vec3(const struct rin_vec3 a, const struct rin_vec3 b, uint32_t max_ulps) { unsigned int ret; @@ -145,7 +145,7 @@ unsigned int rin_compare_vec3(const struct vec3 a, const struct vec3 b, uint32_t return ret; } -unsigned int rin_compare_vec4(const struct vec4 a, const struct vec4 b, uint32_t max_ulps) +unsigned int rin_compare_rin_vec4(const struct rin_vec4 a, const struct rin_vec4 b, uint32_t max_ulps) { unsigned int ret; @@ -172,7 +172,7 @@ unsigned int rin_compare_double(const double a, const double b, uint64_t max_ulp } } -unsigned int rin_compare_vec2d(const struct vec2d a, const struct vec2d b, uint64_t max_ulps) +unsigned int rin_compare_rin_vec2d(const struct rin_vec2d a, const struct rin_vec2d b, uint64_t max_ulps) { unsigned int ret; @@ -182,7 +182,7 @@ unsigned int rin_compare_vec2d(const struct vec2d a, const struct vec2d b, uint6 return ret; } -unsigned int rin_compare_vec3d(const struct vec3d a, const struct vec3d b, uint64_t max_ulps) +unsigned int rin_compare_rin_vec3d(const struct rin_vec3d a, const struct rin_vec3d b, uint64_t max_ulps) { unsigned int ret; @@ -193,7 +193,7 @@ unsigned int rin_compare_vec3d(const struct vec3d a, const struct vec3d b, uint6 return ret; } -unsigned int rin_compare_vec4d(const struct vec4d a, const struct vec4d b, uint64_t max_ulps) +unsigned int rin_compare_rin_vec4d(const struct rin_vec4d a, const struct rin_vec4d b, uint64_t max_ulps) { unsigned int ret; |