use static and reinterpret cast instead of c cast
This commit is contained in:
parent
c9cf4b8997
commit
7d47ef0b82
|
|
@ -15,13 +15,13 @@ enum class cascade_type
|
||||||
ALL = REMOVE | UPDATE | INSERT /**< Cascade type all */
|
ALL = REMOVE | UPDATE | INSERT /**< Cascade type all */
|
||||||
};
|
};
|
||||||
|
|
||||||
inline cascade_type operator~ (cascade_type a) { return (cascade_type)~(int)a; }
|
inline cascade_type operator~ (cascade_type a) { return static_cast<cascade_type>(~static_cast<int>(a)); }
|
||||||
inline cascade_type operator| (cascade_type a, cascade_type b) { return (cascade_type)((int)a | (int)b); }
|
inline cascade_type operator| (cascade_type a, cascade_type b) { return static_cast<cascade_type>(static_cast<int>(a) | static_cast<int>(b)); }
|
||||||
inline cascade_type operator& (cascade_type a, cascade_type b) { return (cascade_type)((int)a & (int)b); }
|
inline cascade_type operator& (cascade_type a, cascade_type b) { return static_cast<cascade_type>(static_cast<int>(a) & static_cast<int>(b)); }
|
||||||
inline cascade_type operator^ (cascade_type a, cascade_type b) { return (cascade_type)((int)a ^ (int)b); }
|
inline cascade_type operator^ (cascade_type a, cascade_type b) { return static_cast<cascade_type>(static_cast<int>(a) ^ static_cast<int>(b)); }
|
||||||
inline cascade_type& operator|= (cascade_type& a, cascade_type b) { return (cascade_type&)((int&)a |= (int)b); }
|
inline cascade_type& operator|= (cascade_type& a, cascade_type b) { return reinterpret_cast<cascade_type &>(reinterpret_cast<int &>(a) |= static_cast<int>(b)); }
|
||||||
inline cascade_type& operator&= (cascade_type& a, cascade_type b) { return (cascade_type&)((int&)a &= (int)b); }
|
inline cascade_type& operator&= (cascade_type& a, cascade_type b) { return reinterpret_cast<cascade_type &>(reinterpret_cast<int &>(a) &= static_cast<int>(b)); }
|
||||||
inline cascade_type& operator^= (cascade_type& a, cascade_type b) { return (cascade_type&)((int&)a ^= (int)b); }
|
inline cascade_type& operator^= (cascade_type& a, cascade_type b) { return reinterpret_cast<cascade_type &>(reinterpret_cast<int &>(a) ^= static_cast<int>(b)); }
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif //OOS_CASCADE_TYPE_HPP
|
#endif //OOS_CASCADE_TYPE_HPP
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue