|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72124 - in sandbox/endian/boost/endian: . detail
From: bdawes_at_[hidden]
Date: 2011-05-23 12:32:16
Author: bemandawes
Date: 2011-05-23 12:32:15 EDT (Mon, 23 May 2011)
New Revision: 72124
URL: http://svn.boost.org/trac/boost/changeset/72124
Log:
Eliminate warnings
Added:
sandbox/endian/boost/endian/detail/
sandbox/endian/boost/endian/detail/disable_warnings.hpp (contents, props changed)
sandbox/endian/boost/endian/detail/disable_warnings_pop.hpp (contents, props changed)
Text files modified:
sandbox/endian/boost/endian/conversion.hpp | 81 +++++++++------------------------------
1 files changed, 19 insertions(+), 62 deletions(-)
Modified: sandbox/endian/boost/endian/conversion.hpp
==============================================================================
--- sandbox/endian/boost/endian/conversion.hpp (original)
+++ sandbox/endian/boost/endian/conversion.hpp 2011-05-23 12:32:15 EDT (Mon, 23 May 2011)
@@ -196,69 +196,26 @@
*--t = *++s;
}
- template <class T> inline void to_big(T& x)
- {
-# ifdef BOOST_LITTLE_ENDIAN
- flip(x);
-# endif
- }
-
- template <class T> inline void to_little(T& x)
- {
-# ifdef BOOST_BIG_ENDIAN
- flip(x);
-# endif
- }
-
- template <class T> inline void from_big(T& x)
- {
-# ifdef BOOST_LITTLE_ENDIAN
- flip(x);
-# endif
- }
-
- template <class T> inline void from_little(T& x)
- {
-# ifdef BOOST_BIG_ENDIAN
- flip(x);
-# endif
- }
+#ifdef BOOST_LITTLE_ENDIAN
+ template <class T> inline void to_big(T& x) { flip(x); }
+ template <class T> inline void to_little(T&) {}
+ template <class T> inline void from_big(T& x) { flip(x); }
+ template <class T> inline void from_little(T&) {}
+ template <class T> inline void to_big(T native, T& big) { flip(native, big); }
+ template <class T> inline void to_little(T native, T& little) { little = native; }
+ template <class T> inline void from_big(T big, T& native) { flip(big, native); }
+ template <class T> inline void from_little(T little, T& native) { native = little; }
+#else
+ template <class T> inline void to_big(T&) {}
+ template <class T> inline void to_little(T& x) { flip(x); }
+ template <class T> inline void from_big(T&) {}
+ template <class T> inline void from_little(T& x) { flip(x); }
+ template <class T> inline void to_big(T native, T& big) { big = native; }
+ template <class T> inline void to_little(T native, T& little) { flip(native, little); }
+ template <class T> inline void from_big(T big, T& native) { native = big; }
+ template <class T> inline void from_little(T little, T& native) { flip(little, native); }
+#endif
- template <class T> inline void to_big(T native, T& big)
- {
-# ifdef BOOST_LITTLE_ENDIAN
- flip(native, big);
-# else
- big = native;
-# endif
- }
-
- template <class T> inline void to_little(T native, T& little)
- {
-# ifdef BOOST_BIG_ENDIAN
- flip(native, little);
-# else
- little = native;
-# endif
- }
-
- template <class T> inline void from_big(T big, T& native)
- {
-# ifdef BOOST_LITTLE_ENDIAN
- flip(big, native);
-# else
- native = big;
-# endif
- }
-
- template <class T> inline void from_little(T little, T& native)
- {
-# ifdef BOOST_BIG_ENDIAN
- flip(little, native);
-# else
- native = little;
-# endif
- }
} // namespace endian
} // namespace boost
Added: sandbox/endian/boost/endian/detail/disable_warnings.hpp
==============================================================================
--- (empty file)
+++ sandbox/endian/boost/endian/detail/disable_warnings.hpp 2011-05-23 12:32:15 EDT (Mon, 23 May 2011)
@@ -0,0 +1,23 @@
+// disable_warnings.hpp --------------------------------------------------------------//
+
+// Copyright Beman Dawes 2011
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+//--------------------------------------------------------------------------------------//
+
+#ifdef _MSC_VER
+# pragma warning(push)
+
+// triggered by boost/detail/lightweight_test.hpp
+# pragma warning( disable : 4640 ) // ... construction of local static object is not thread-safe
+
+// triggered by Microsoft's own headers, so disable
+# pragma warning( disable : 4820 ) // padding added after data member
+# pragma warning( disable : 4548 ) // expression before comma has no effect
+# pragma warning( disable : 4668 ) // ... is not defined as a preprocessor macro
+# pragma warning( disable : 4514 ) // ... unreferenced inline function has been removed
+# pragma warning( disable : 4710 ) // ... function not inlined
+# pragma warning( disable : 4986 ) // ... exception specification does not match previous declaration
+#endif
Added: sandbox/endian/boost/endian/detail/disable_warnings_pop.hpp
==============================================================================
--- (empty file)
+++ sandbox/endian/boost/endian/detail/disable_warnings_pop.hpp 2011-05-23 12:32:15 EDT (Mon, 23 May 2011)
@@ -0,0 +1,12 @@
+// disable_warnings_pop.hpp ----------------------------------------------------------//
+
+// Copyright Beman Dawes 2011
+
+// Distributed under the Boost Software License, Version 1.0.
+// See http://www.boost.org/LICENSE_1_0.txt
+
+//--------------------------------------------------------------------------------------//
+
+#ifdef _MSC_VER
+# pragma warning(push)
+#endif
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk