Changeset 1161


Ignore:
Timestamp:
Mar 12, 2012, 7:58:54 PM (9 years ago)
Author:
gary
Message:

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

Location:
trunk/src/lol/math
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lol/math/half.h

    r1160 r1161  
    7474    bool operator >=(half x) const { return (float)*this >= (float)x; }
    7575
    76     bool operator !() const { return !(bool)*this; }
    77     operator bool() const { return bits & 0x7fffu; }
     76    bool operator !() const { return !(bits & 0x7fffu); }
     77    operator bool() const { return !!*this; }
    7878
    7979    inline half operator -() const { return makebits(bits ^ 0x8000u); }
  • trunk/src/lol/math/vector.h

    r1160 r1161  
    12261226    /* DECLARE_ALL_VECTOR_COERCE_OPS_INNER(tname, long double, real) */
    12271227
     1228/* Disable warning about unary operator applied to unsigned type */
     1229#if defined _MSC_VER
     1230#   pragma warning(push)
     1231#   pragma warning(disable: 4146)
     1232#endif
     1233
    12281234DECLARE_ALL_NONVECTOR_OPS(Cmplx)
    12291235DECLARE_ALL_NONVECTOR_OPS(Quat)
     
    12321238DECLARE_ALL_VECTOR_OPS(Vec3)
    12331239DECLARE_ALL_VECTOR_OPS(Vec4)
     1240
     1241#if defined _MSC_VER
     1242#   pragma warning(pop)
     1243#endif
    12341244
    12351245/* Disable warnings in the >= > etc. operators about comparing signed and
Note: See TracChangeset for help on using the changeset viewer.