mirror of
https://github.com/g-truc/glm.git
synced 2024-09-20 08:22:17 +00:00
Fixed Visual C++ 2013 warnings in vector relational code #782
This commit is contained in:
parent
2b22509678
commit
87ecf4a233
@ -3,6 +3,13 @@
|
|||||||
|
|
||||||
#include "compute_vector_relational.hpp"
|
#include "compute_vector_relational.hpp"
|
||||||
|
|
||||||
|
// Bug #782: Warning C4701: potentially uninitialized local variable 'Result' used
|
||||||
|
#if ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12))
|
||||||
|
# define GLM_BUG_VC_INIT (false)
|
||||||
|
#else
|
||||||
|
# define GLM_BUG_VC_INIT
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace glm
|
namespace glm
|
||||||
{
|
{
|
||||||
template<length_t L, typename T, qualifier Q>
|
template<length_t L, typename T, qualifier Q>
|
||||||
@ -10,7 +17,7 @@ namespace glm
|
|||||||
{
|
{
|
||||||
assert(x.length() == y.length());
|
assert(x.length() == y.length());
|
||||||
|
|
||||||
vec<L, bool, Q> Result;
|
vec<L, bool, Q> Result GLM_BUG_VC_INIT;
|
||||||
for(length_t i = 0; i < x.length(); ++i)
|
for(length_t i = 0; i < x.length(); ++i)
|
||||||
Result[i] = x[i] < y[i];
|
Result[i] = x[i] < y[i];
|
||||||
|
|
||||||
@ -22,7 +29,7 @@ namespace glm
|
|||||||
{
|
{
|
||||||
assert(x.length() == y.length());
|
assert(x.length() == y.length());
|
||||||
|
|
||||||
vec<L, bool, Q> Result;
|
vec<L, bool, Q> Result GLM_BUG_VC_INIT;
|
||||||
for(length_t i = 0; i < x.length(); ++i)
|
for(length_t i = 0; i < x.length(); ++i)
|
||||||
Result[i] = x[i] <= y[i];
|
Result[i] = x[i] <= y[i];
|
||||||
return Result;
|
return Result;
|
||||||
@ -33,7 +40,7 @@ namespace glm
|
|||||||
{
|
{
|
||||||
assert(x.length() == y.length());
|
assert(x.length() == y.length());
|
||||||
|
|
||||||
vec<L, bool, Q> Result;
|
vec<L, bool, Q> Result GLM_BUG_VC_INIT;
|
||||||
for(length_t i = 0; i < x.length(); ++i)
|
for(length_t i = 0; i < x.length(); ++i)
|
||||||
Result[i] = x[i] > y[i];
|
Result[i] = x[i] > y[i];
|
||||||
return Result;
|
return Result;
|
||||||
@ -44,7 +51,7 @@ namespace glm
|
|||||||
{
|
{
|
||||||
assert(x.length() == y.length());
|
assert(x.length() == y.length());
|
||||||
|
|
||||||
vec<L, bool, Q> Result;
|
vec<L, bool, Q> Result GLM_BUG_VC_INIT;
|
||||||
for(length_t i = 0; i < x.length(); ++i)
|
for(length_t i = 0; i < x.length(); ++i)
|
||||||
Result[i] = x[i] >= y[i];
|
Result[i] = x[i] >= y[i];
|
||||||
return Result;
|
return Result;
|
||||||
@ -55,7 +62,7 @@ namespace glm
|
|||||||
{
|
{
|
||||||
assert(x.length() == y.length());
|
assert(x.length() == y.length());
|
||||||
|
|
||||||
vec<L, bool, Q> Result;
|
vec<L, bool, Q> Result GLM_BUG_VC_INIT;
|
||||||
for(length_t i = 0; i < x.length(); ++i)
|
for(length_t i = 0; i < x.length(); ++i)
|
||||||
Result[i] = detail::compute_equal<T, std::numeric_limits<T>::is_iec559>::call(x[i], y[i]);
|
Result[i] = detail::compute_equal<T, std::numeric_limits<T>::is_iec559>::call(x[i], y[i]);
|
||||||
return Result;
|
return Result;
|
||||||
@ -66,7 +73,7 @@ namespace glm
|
|||||||
{
|
{
|
||||||
assert(x.length() == y.length());
|
assert(x.length() == y.length());
|
||||||
|
|
||||||
vec<L, bool, Q> Result;
|
vec<L, bool, Q> Result GLM_BUG_VC_INIT;
|
||||||
for(length_t i = 0; i < x.length(); ++i)
|
for(length_t i = 0; i < x.length(); ++i)
|
||||||
Result[i] = !detail::compute_equal<T, std::numeric_limits<T>::is_iec559>::call(x[i], y[i]);
|
Result[i] = !detail::compute_equal<T, std::numeric_limits<T>::is_iec559>::call(x[i], y[i]);
|
||||||
return Result;
|
return Result;
|
||||||
|
@ -67,6 +67,7 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate)
|
|||||||
- Fixed int mod
|
- Fixed int mod
|
||||||
- Anonymous unions require C++ language extensions
|
- Anonymous unions require C++ language extensions
|
||||||
- Fixed ortho #790
|
- Fixed ortho #790
|
||||||
|
- Fixed Visual C++ 2013 warnings in vector relational code #782
|
||||||
|
|
||||||
### [GLM 0.9.9.0](https://github.com/g-truc/glm/releases/tag/0.9.9.0) - 2018-05-22
|
### [GLM 0.9.9.0](https://github.com/g-truc/glm/releases/tag/0.9.9.0) - 2018-05-22
|
||||||
#### Features:
|
#### Features:
|
||||||
|
Loading…
Reference in New Issue
Block a user