Suppress more bogus warnings

This commit is contained in:
Victor Zverovich 2014-12-17 06:53:32 -08:00
parent ecd2b80e8f
commit fb12cfd196
2 changed files with 5 additions and 2 deletions

View File

@ -212,7 +212,8 @@ TEST(WriterTest, Allocator) {
typedef AllocatorRef<MockAllocator> TestAllocator; typedef AllocatorRef<MockAllocator> TestAllocator;
MockAllocator alloc; MockAllocator alloc;
fmt::BasicMemoryWriter<char, TestAllocator> w((TestAllocator(&alloc))); fmt::BasicMemoryWriter<char, TestAllocator> w((TestAllocator(&alloc)));
std::size_t size = 1.5 * fmt::internal::INLINE_BUFFER_SIZE; std::size_t size =
static_cast<std::size_t>(1.5 * fmt::internal::INLINE_BUFFER_SIZE);
std::vector<char> mem(size); std::vector<char> mem(size);
EXPECT_CALL(alloc, allocate(size)).WillOnce(testing::Return(&mem[0])); EXPECT_CALL(alloc, allocate(size)).WillOnce(testing::Return(&mem[0]));
for (int i = 0; i < fmt::internal::INLINE_BUFFER_SIZE + 1; ++i) for (int i = 0; i < fmt::internal::INLINE_BUFFER_SIZE + 1; ++i)

View File

@ -25,6 +25,9 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
// Disable bogus MSVC warnings.
#define _CRT_SECURE_NO_WARNINGS
#include "posix-test.h" #include "posix-test.h"
#include <errno.h> #include <errno.h>
@ -32,7 +35,6 @@
#include <climits> #include <climits>
#ifdef _WIN32 #ifdef _WIN32
# define _CRT_SECURE_NO_WARNINGS
# include <io.h> # include <io.h>
# undef max # undef max
# undef ERROR # undef ERROR