aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaios <naios-dev@live.de>2015-04-05 21:30:22 +0200
committerNaios <naios-dev@live.de>2015-04-05 21:31:31 +0200
commitf48b6f286c065ea39a17ec1705a54a844865cbdd (patch)
tree46377a89a7f4d21fe5b8d404a5ce3b599c46aeff
parent51f58e8b30e6b53499af35fd8f9120575613855b (diff)
Dep/CppFormat: Update cppformat to cppformat/cppformat@fd53bb6fb88a23e3
* fixes /W4 warning spamming. (cherry picked from commit 66ce97c87e347ab9426ffbd60b6fe5aa90a96b9b)
-rw-r--r--dep/PackageList.txt2
-rw-r--r--dep/cppformat/format.h10
2 files changed, 8 insertions, 4 deletions
diff --git a/dep/PackageList.txt b/dep/PackageList.txt
index da9b2c13c97..d2047d32c7c 100644
--- a/dep/PackageList.txt
+++ b/dep/PackageList.txt
@@ -14,7 +14,7 @@ bzip2 (a freely available, patent free, high-quality data compressor)
cppformat (type safe format library)
https://github.com/cppformat/cppformat
- Version: 1.1.0 aab64b55a4c5db598c123e1a2770b9eb6507d7d8
+ Version: 1.1.0 fd53bb6fb88a23e38ec4fe331bfe95d7372d49c9
G3D (a commercial-grade C++ 3D engine available as Open Source (BSD License)
http://g3d.sourceforge.net/
diff --git a/dep/cppformat/format.h b/dep/cppformat/format.h
index 3a82f8272c0..8d54bf521c7 100644
--- a/dep/cppformat/format.h
+++ b/dep/cppformat/format.h
@@ -800,6 +800,10 @@ struct EnableIf {};
template<class T>
struct EnableIf<true, T> { typedef T type; };
+// A helper function to suppress bogus "conditional expression is constant"
+// warnings.
+inline bool check(bool value) { return value; }
+
// Makes an Arg object from any type.
template <typename Char>
class MakeValue : public Arg {
@@ -859,7 +863,7 @@ class MakeValue : public Arg {
MakeValue(long value) {
// To minimize the number of types we need to deal with, long is
// translated either to int or to long long depending on its size.
- if (sizeof(long) == sizeof(int))
+ if (check(sizeof(long) == sizeof(int)))
int_value = static_cast<int>(value);
else
long_long_value = value;
@@ -869,7 +873,7 @@ class MakeValue : public Arg {
}
MakeValue(unsigned long value) {
- if (sizeof(unsigned long) == sizeof(unsigned))
+ if (check(sizeof(unsigned long) == sizeof(unsigned)))
uint_value = static_cast<unsigned>(value);
else
ulong_long_value = value;
@@ -2634,7 +2638,7 @@ struct ArgArraySize {
Arg array[fmt::internal::ArgArraySize<sizeof...(Args)>::VALUE] = { \
fmt::internal::MakeValue<Char>(args)... \
}; \
- if (sizeof...(Args) > fmt::ArgList::MAX_PACKED_ARGS) \
+ if (fmt::internal::check((sizeof...(Args) > fmt::ArgList::MAX_PACKED_ARGS))) \
set_types(array, args...); \
call(FMT_FOR_EACH(FMT_GET_ARG_NAME, __VA_ARGS__), \
fmt::ArgList(fmt::internal::make_type(args...), array)); \