소스 검색

math: fix minor warnings in half.h and vector.h.

legacy
Sam Hocevar gary 13 년 전
부모
커밋
7867c6ea3e
2개의 변경된 파일12개의 추가작업 그리고 2개의 파일을 삭제
  1. +2
    -2
      src/lol/math/half.h
  2. +10
    -0
      src/lol/math/vector.h

+ 2
- 2
src/lol/math/half.h 파일 보기

@@ -73,8 +73,8 @@ public:
bool operator <=(half x) const { return (float)*this <= (float)x; }
bool operator >=(half x) const { return (float)*this >= (float)x; }

bool operator !() const { return !(bool)*this; }
operator bool() const { return bits & 0x7fffu; }
bool operator !() const { return !(bits & 0x7fffu); }
operator bool() const { return !!*this; }

inline half operator -() const { return makebits(bits ^ 0x8000u); }
inline half operator +() const { return *this; }


+ 10
- 0
src/lol/math/vector.h 파일 보기

@@ -1225,6 +1225,12 @@ static inline Quat<T> operator /(Quat<T> x, Quat<T> const &y)
\
/* DECLARE_ALL_VECTOR_COERCE_OPS_INNER(tname, long double, real) */

/* Disable warning about unary operator applied to unsigned type */
#if defined _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4146)
#endif

DECLARE_ALL_NONVECTOR_OPS(Cmplx)
DECLARE_ALL_NONVECTOR_OPS(Quat)

@@ -1232,6 +1238,10 @@ DECLARE_ALL_VECTOR_OPS(Vec2)
DECLARE_ALL_VECTOR_OPS(Vec3)
DECLARE_ALL_VECTOR_OPS(Vec4)

#if defined _MSC_VER
# pragma warning(pop)
#endif

/* Disable warnings in the >= > etc. operators about comparing signed and
* unsigned. Ideally we would like to get these warnings only when the
* inlined operators are actually used, but they seem to be triggered at


불러오는 중...
취소
저장