aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLittleboy2011-05-20 05:02:53 -0400
committerLittleboy2011-05-24 00:56:48 -0400
commit89e954c65362b593101786e8c220a95279481645 (patch)
treede54bb2aaf43177c3674062cf091f25f780fa0d1
parent488759c8b6582c7349e5bb8e4982eed6d3742a98 (diff)
downloadscummvm-rg350-89e954c65362b593101786e8c220a95279481645.tar.gz
scummvm-rg350-89e954c65362b593101786e8c220a95279481645.tar.bz2
scummvm-rg350-89e954c65362b593101786e8c220a95279481645.zip
COMMON: Silence MSVC warning for Common::gcd calls with an unsigned type
-rw-r--r--common/algorithm.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/algorithm.h b/common/algorithm.h
index be810d6e9d..fa9d08b380 100644
--- a/common/algorithm.h
+++ b/common/algorithm.h
@@ -234,6 +234,11 @@ void sort(T first, T last) {
sort(first, last, Common::Less<typename T::ValueType>());
}
+// MSVC is complaining about the minus operator being applied to an unsigned type
+// We disable this warning for the affected section of code
+#pragma warning(push)
+#pragma warning(disable: 4146)
+
/**
* Euclid's algorithm to compute the greatest common divisor.
*/
@@ -256,6 +261,8 @@ T gcd(T a, T b) {
return b;
}
+#pragma warning(pop)
+
} // End of namespace Common
#endif