diff options
| author | 2015-01-05 15:05:28 +0000 | |
|---|---|---|
| committer | 2015-01-05 16:38:12 +0000 | |
| commit | 66e06f65c40bfe5a602e456fa1f217b59b65ab7f (patch) | |
| tree | 8d266af57f3c0cc001f6b5a34a76e864e6b1ecdb /src | |
| parent | Common: Remove the unused x86-specific 128-bit float type. (diff) | |
| download | yuzu-66e06f65c40bfe5a602e456fa1f217b59b65ab7f.tar.gz yuzu-66e06f65c40bfe5a602e456fa1f217b59b65ab7f.tar.xz yuzu-66e06f65c40bfe5a602e456fa1f217b59b65ab7f.zip | |
Common: Use std::abs instead of abs, using abs with cmath fails on some systems.
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/common_types.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/common_types.h b/src/common/common_types.h index 0e86cb2cf..94e1406b1 100644 --- a/src/common/common_types.h +++ b/src/common/common_types.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | 26 | ||
| 27 | #include <cmath> | 27 | #include <cmath> |
| 28 | #include <cstdint> | 28 | #include <cstdint> |
| 29 | #include <cstdlib> | ||
| 29 | 30 | ||
| 30 | typedef std::uint8_t u8; ///< 8-bit unsigned byte | 31 | typedef std::uint8_t u8; ///< 8-bit unsigned byte |
| 31 | typedef std::uint16_t u16; ///< 16-bit unsigned short | 32 | typedef std::uint16_t u16; ///< 16-bit unsigned short |
| @@ -83,8 +84,8 @@ public: | |||
| 83 | int x1_; ///< Rect bottom left X-coordinate | 84 | int x1_; ///< Rect bottom left X-coordinate |
| 84 | int y1_; ///< Rect bottom right Y-coordinate | 85 | int y1_; ///< Rect bottom right Y-coordinate |
| 85 | 86 | ||
| 86 | inline u32 width() const { return abs(x1_ - x0_); } | 87 | inline u32 width() const { return std::abs(x1_ - x0_); } |
| 87 | inline u32 height() const { return abs(y1_ - y0_); } | 88 | inline u32 height() const { return std::abs(y1_ - y0_); } |
| 88 | 89 | ||
| 89 | inline bool operator == (const Rect& val) const { | 90 | inline bool operator == (const Rect& val) const { |
| 90 | return (x0_ == val.x0_ && y0_ == val.y0_ && x1_ == val.x1_ && y1_ == val.y1_); | 91 | return (x0_ == val.x0_ && y0_ == val.y0_ && x1_ == val.x1_ && y1_ == val.y1_); |