libs/base/src/base/cint.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | namespace eu | ||
| 4 | { | ||
| 5 | |||
| 6 | ✗ | constexpr float float_from_int(int i) | |
| 7 | { | ||
| 8 | ✗ | return static_cast<float>(i); | |
| 9 | } | ||
| 10 | |||
| 11 | ✗ | constexpr int int_from_float(float f) | |
| 12 | { | ||
| 13 | ✗ | return static_cast<int>(f); | |
| 14 | } | ||
| 15 | |||
| 16 | ✗ | constexpr std::size_t sizet_from_int(int i) | |
| 17 | { | ||
| 18 | ✗ | return static_cast<std::size_t>(i); | |
| 19 | } | ||
| 20 | |||
| 21 | constexpr u32 u32_from_sizet(std::size_t i) | ||
| 22 | { | ||
| 23 | return static_cast<u32>(i); | ||
| 24 | } | ||
| 25 | |||
| 26 | ✗ | constexpr int int_from_sizet(std::size_t i) | |
| 27 | { | ||
| 28 | ✗ | return static_cast<int>(i); | |
| 29 | } | ||
| 30 | |||
| 31 | ✗ | constexpr int int_from_unsigned_int(unsigned int i) | |
| 32 | { | ||
| 33 | ✗ | return static_cast<int>(i); | |
| 34 | } | ||
| 35 | |||
| 36 | } | ||
| 37 |