diff options
| author | untodesu <kirill@untode.su> | 2025-06-25 00:44:36 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-06-25 00:44:36 +0500 |
| commit | 88c01588aa0830e219eaa62588839e4d1e2883ce (patch) | |
| tree | 602bb27dd3399aab4aae8c19630e3b7a8dac824b /core/floathacks.hh | |
| parent | 99cf6cca8dbbc1e563c10cf0167432d3d8af9783 (diff) | |
| download | voxelius-88c01588aa0830e219eaa62588839e4d1e2883ce.tar.bz2 voxelius-88c01588aa0830e219eaa62588839e4d1e2883ce.zip | |
Clang-format the entire source code
Diffstat (limited to 'core/floathacks.hh')
| -rw-r--r-- | core/floathacks.hh | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/core/floathacks.hh b/core/floathacks.hh index 2c6a3e1..0796b10 100644 --- a/core/floathacks.hh +++ b/core/floathacks.hh @@ -14,17 +14,22 @@ static inline float floathacks::int32_to_float(const std::int32_t value) {
static_assert(std::numeric_limits<float>::is_iec559);
static_assert(sizeof(std::int32_t) == sizeof(float));
- union { std::int32_t src; float dst; } hack;
+ union {
+ std::int32_t src;
+ float dst;
+ } hack;
hack.src = value;
return hack.dst;
-
}
static inline float floathacks::uint32_to_float(const std::uint32_t value)
{
static_assert(std::numeric_limits<float>::is_iec559);
static_assert(sizeof(std::uint32_t) == sizeof(float));
- union { std::uint32_t src; float dst; } hack;
+ union {
+ std::uint32_t src;
+ float dst;
+ } hack;
hack.src = value;
return hack.dst;
}
@@ -33,7 +38,10 @@ static inline std::int32_t floathacks::float_to_int32(const float value) {
static_assert(std::numeric_limits<float>::is_iec559);
static_assert(sizeof(std::int32_t) == sizeof(float));
- union { float src; std::int32_t dst; } hack;
+ union {
+ float src;
+ std::int32_t dst;
+ } hack;
hack.src = value;
return hack.dst;
}
@@ -42,7 +50,10 @@ static inline std::uint32_t floathacks::float_to_uint32(const float value) {
static_assert(std::numeric_limits<float>::is_iec559);
static_assert(sizeof(std::uint32_t) == sizeof(float));
- union { float src; std::uint32_t dst; } hack;
+ union {
+ float src;
+ std::uint32_t dst;
+ } hack;
hack.src = value;
return hack.dst;
}
|
