From cd7b368e656aad64c17c48c94ad1e9f57e514a26 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 9 Apr 2010 20:43:54 +0000 Subject: [PATCH] clean this up, fix std::min ambiguity on some platforms. llvm-svn: 100894 --- lib/Support/circular_raw_ostream.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/Support/circular_raw_ostream.cpp b/lib/Support/circular_raw_ostream.cpp index e52996dc505..ca0d30db388 100644 --- a/lib/Support/circular_raw_ostream.cpp +++ b/lib/Support/circular_raw_ostream.cpp @@ -1,4 +1,4 @@ -//===- circulat_raw_ostream.cpp - Implement the circular_raw_ostream class -===// +//===- circular_raw_ostream.cpp - Implement circular_raw_ostream ----------===// // // The LLVM Compiler Infrastructure // @@ -12,9 +12,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Support/circular_raw_ostream.h" - #include - using namespace llvm; void circular_raw_ostream::write_impl(const char *Ptr, size_t Size) { @@ -25,7 +23,8 @@ void circular_raw_ostream::write_impl(const char *Ptr, size_t Size) { // Write into the buffer, wrapping if necessary. while (Size != 0) { - unsigned Bytes = std::min(Size, BufferSize - (Cur - BufferArray)); + unsigned Bytes = + std::min(unsigned(Size), unsigned(BufferSize - (Cur - BufferArray))); memcpy(Cur, Ptr, Bytes); Size -= Bytes; Cur += Bytes; @@ -37,11 +36,10 @@ void circular_raw_ostream::write_impl(const char *Ptr, size_t Size) { } } -void circular_raw_ostream::flushBufferWithBanner(void) { +void circular_raw_ostream::flushBufferWithBanner() { if (BufferSize != 0) { // Write out the buffer - int num = std::strlen(Banner); - TheStream->write(Banner, num); + TheStream->write(Banner, std::strlen(Banner)); flushBuffer(); } }