From c240a129a2a4fb6f27632d0de5df47562ffb3a5b Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Fri, 21 Dec 2012 15:02:25 -0800 Subject: [PATCH] Fix warnings. --- format.cc | 2 ++ format_test.cc | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/format.cc b/format.cc index 55b2504d..6244c915 100644 --- a/format.cc +++ b/format.cc @@ -28,6 +28,8 @@ // Disable useless MSVC warnings. #undef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#undef _SCL_SECURE_NO_WARNINGS +#define _SCL_SECURE_NO_WARNINGS #include "format.h" diff --git a/format_test.cc b/format_test.cc index 85fa2344..b3d7ff65 100644 --- a/format_test.cc +++ b/format_test.cc @@ -28,6 +28,8 @@ // Disable useless MSVC warnings. #undef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS +#undef _SCL_SECURE_NO_WARNINGS +#define _SCL_SECURE_NO_WARNINGS #include #include @@ -456,7 +458,8 @@ TEST(FormatterTest, RuntimePrecision) { EXPECT_THROW_MSG(Format("{0:.{1}}") << 0 << -1l, FormatError, "negative precision in format"); if (sizeof(long) > sizeof(int)) { - EXPECT_THROW_MSG(Format("{0:.{1}}") << 0 << (INT_MAX + 1l), + long value = INT_MAX; + EXPECT_THROW_MSG(Format("{0:.{1}}") << 0 << (value + 1), FormatError, "number is too big in format"); } EXPECT_THROW_MSG(Format("{0:.{1}}") << 0 << (INT_MAX + 1ul),