ソースを参照

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


読み込み中…
キャンセル
保存