[llvm-commits] [llvm] r100894 - /llvm/trunk/lib/Support/circular_raw_ostream.cpp
Chris Lattner
sabre at nondot.org
Fri Apr 9 13:43:54 PDT 2010
Author: lattner
Date: Fri Apr 9 15:43:54 2010
New Revision: 100894
URL: http://llvm.org/viewvc/llvm-project?rev=100894&view=rev
Log:
clean this up, fix std::min ambiguity on some platforms.
Modified:
llvm/trunk/lib/Support/circular_raw_ostream.cpp
Modified: llvm/trunk/lib/Support/circular_raw_ostream.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/circular_raw_ostream.cpp?rev=100894&r1=100893&r2=100894&view=diff
==============================================================================
--- llvm/trunk/lib/Support/circular_raw_ostream.cpp (original)
+++ llvm/trunk/lib/Support/circular_raw_ostream.cpp Fri Apr 9 15:43:54 2010
@@ -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 <algorithm>
-
using namespace llvm;
void circular_raw_ostream::write_impl(const char *Ptr, size_t Size) {
@@ -25,7 +23,8 @@
// 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::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();
}
}
More information about the llvm-commits
mailing list