diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-07-30 22:59:18 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-07-30 22:59:18 +0200 |
commit | 5e637ca0288ddd631ec33e1d620cd4a73bcdc2be (patch) | |
tree | b26b0e9572f101744aba712133e646fb93ed58d2 /src/graphics/core | |
parent | d8a0c8d32e160e7ae86bb5b85ead8e5f71b1fd01 (diff) | |
download | colobot-5e637ca0288ddd631ec33e1d620cd4a73bcdc2be.tar.gz colobot-5e637ca0288ddd631ec33e1d620cd4a73bcdc2be.tar.bz2 colobot-5e637ca0288ddd631ec33e1d620cd4a73bcdc2be.zip |
Switched to new style casts
- rewrote old C-style casts to new ..._cast<>
- corrected some dangerous casts
- added -Wold-style-cast to compile flags
Diffstat (limited to 'src/graphics/core')
-rw-r--r-- | src/graphics/core/color.cpp | 2 | ||||
-rw-r--r-- | src/graphics/core/color.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/graphics/core/color.cpp b/src/graphics/core/color.cpp index 8dec0e4..f241227 100644 --- a/src/graphics/core/color.cpp +++ b/src/graphics/core/color.cpp @@ -79,7 +79,7 @@ Gfx::Color Gfx::HSV2RGB(Gfx::ColorHSV color) { if ( color.h == 360.0f ) color.h = 0.0f; color.h /= 60.0f; - int i = (int)color.h; // integer part (0 .. 5) + int i = static_cast<int>(color.h); // integer part (0 .. 5) float f = color.h-i; // fractional part float v = color.v; diff --git a/src/graphics/core/color.h b/src/graphics/core/color.h index 907a3b9..6973644 100644 --- a/src/graphics/core/color.h +++ b/src/graphics/core/color.h @@ -44,13 +44,13 @@ struct Color //! Returns the struct cast to \c float* array; use with care! inline float* Array() { - return (float*)this; + return reinterpret_cast<float*>(this); } //! Returns the struct cast to <tt>const float*</tt> array; use with care! inline const float* Array() const { - return (const float*)this; + return reinterpret_cast<const float*>(this); } //! Returns a string (r, g, b, a) |