git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100894
91177308-0d34-0410-b5e6-
96231b3b80d8
-//===- 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
//
//===----------------------------------------------------------------------===//
#include "llvm/Support/circular_raw_ostream.h"
//===----------------------------------------------------------------------===//
#include "llvm/Support/circular_raw_ostream.h"
using namespace llvm;
void circular_raw_ostream::write_impl(const char *Ptr, size_t Size) {
using namespace llvm;
void circular_raw_ostream::write_impl(const char *Ptr, size_t Size) {
// Write into the buffer, wrapping if necessary.
while (Size != 0) {
// 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;
memcpy(Cur, Ptr, Bytes);
Size -= Bytes;
Cur += Bytes;
-void circular_raw_ostream::flushBufferWithBanner(void) {
+void circular_raw_ostream::flushBufferWithBanner() {
if (BufferSize != 0) {
// Write out the buffer
if (BufferSize != 0) {
// Write out the buffer
- int num = std::strlen(Banner);
- TheStream->write(Banner, num);
+ TheStream->write(Banner, std::strlen(Banner));