mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
clean this up, fix std::min ambiguity on some platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100894 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
16ddd885d8
commit
2ebad5ad41
@ -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
|
// The LLVM Compiler Infrastructure
|
||||||
//
|
//
|
||||||
@ -12,9 +12,7 @@
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
#include "llvm/Support/circular_raw_ostream.h"
|
#include "llvm/Support/circular_raw_ostream.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
void circular_raw_ostream::write_impl(const char *Ptr, size_t Size) {
|
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.
|
// Write into the buffer, wrapping if necessary.
|
||||||
while (Size != 0) {
|
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);
|
memcpy(Cur, Ptr, Bytes);
|
||||||
Size -= Bytes;
|
Size -= Bytes;
|
||||||
Cur += 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) {
|
if (BufferSize != 0) {
|
||||||
// Write out the buffer
|
// Write out the buffer
|
||||||
int num = std::strlen(Banner);
|
TheStream->write(Banner, std::strlen(Banner));
|
||||||
TheStream->write(Banner, num);
|
|
||||||
flushBuffer();
|
flushBuffer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user