Browse Source

Math: fixed strict aliasing warning.

Is there _any_ use case of reinterpret_cast where GCC won't loudly
complain?
pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
9ccc63b4aa
  1. 2
      src/Math/Geometry/Rectangle.h

2
src/Math/Geometry/Rectangle.h

@ -163,7 +163,7 @@ template<class T> struct ConfigurationValue<Magnum::Math::Geometry::Rectangle<T>
/** @brief Reads elements separated with whitespace */ /** @brief Reads elements separated with whitespace */
static Magnum::Math::Geometry::Rectangle<T> fromString(const std::string& stringValue, const ConfigurationValueFlags flags) { static Magnum::Math::Geometry::Rectangle<T> fromString(const std::string& stringValue, const ConfigurationValueFlags flags) {
const auto vec = ConfigurationValue<Magnum::Math::Vector<4, T>>::fromString(stringValue, flags); const auto vec = ConfigurationValue<Magnum::Math::Vector<4, T>>::fromString(stringValue, flags);
return reinterpret_cast<const Magnum::Math::Geometry::Rectangle<T>&>(vec); return {{vec[0], vec[1]}, {vec[2], vec[3]}};
} }
}; };

Loading…
Cancel
Save