CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Guillaume Melquiond <[EMAIL PROTECTED]> 05/01/19 21:40:38
Modified files:
src : util.hpp
Log message:
Shut VC warning about unsigned types by casting to a signed type.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/util.hpp.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
Patches:
Index: wesnoth/src/util.hpp
diff -u wesnoth/src/util.hpp:1.19 wesnoth/src/util.hpp:1.20
--- wesnoth/src/util.hpp:1.19 Sun Dec 26 21:58:18 2004
+++ wesnoth/src/util.hpp Wed Jan 19 21:40:37 2005
@@ -1,4 +1,4 @@
-/* $Id: util.hpp,v 1.19 2004/12/26 21:58:18 silene Exp $ */
+/* $Id: util.hpp,v 1.20 2005/01/19 21:40:37 silene Exp $ */
/*
Copyright (C) 2003 by David White <[EMAIL PROTECTED]>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -32,7 +32,10 @@
inline const T& maximum(const T& a, const T& b) { return a < b ? b : a; }
template<typename T>
-inline bool is_odd(T num) { return (static_cast<unsigned int>(num > 0 ? num :
-num)&1) == 1; }
+inline bool is_odd(T num) {
+ int n = static_cast< int >(num);
+ return static_cast< unsigned int >(n >= 0 ? n : -n) & 1;
+}
template<typename T>
inline bool is_even(T num) { return !is_odd(num); }