From ad60f660c6fd1999a3e21823128d37aca62e9285 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 16 Jul 2009 15:24:40 +0000 Subject: Use size_t. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76069 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/FormattedStream.h | 4 ++-- include/llvm/Support/raw_ostream.h | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'include/llvm') diff --git a/include/llvm/Support/FormattedStream.h b/include/llvm/Support/FormattedStream.h index 7260c3fba3..1c50476a63 100644 --- a/include/llvm/Support/FormattedStream.h +++ b/include/llvm/Support/FormattedStream.h @@ -47,7 +47,7 @@ namespace llvm /// unsigned Column; - virtual void write_impl(const char *Ptr, unsigned Size) { + virtual void write_impl(const char *Ptr, size_t Size) { ComputeColumn(Ptr, Size); TheStream->write(Ptr, Size); } @@ -63,7 +63,7 @@ namespace llvm /// ComputeColumn - Examine the current output and figure out /// which column we end up in after output. /// - void ComputeColumn(const char *Ptr, unsigned Size); + void ComputeColumn(const char *Ptr, size_t Size); public: /// formatted_raw_ostream - Open the specified file for diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h index 367c35ca12..55cc957b20 100644 --- a/include/llvm/Support/raw_ostream.h +++ b/include/llvm/Support/raw_ostream.h @@ -93,7 +93,7 @@ public: /// SetBufferSize - Set the internal buffer size to the specified amount /// instead of the default. - void SetBufferSize(unsigned Size=4096) { + void SetBufferSize(size_t Size=4096) { assert(Size >= 64 && "Buffer size must be somewhat large for invariants to hold"); flush(); @@ -117,7 +117,7 @@ public: Unbuffered = true; } - unsigned GetNumBytesInBuffer() const { + size_t GetNumBytesInBuffer() const { return OutBufCur - OutBufStart; } @@ -155,7 +155,7 @@ public: // Inline fast path, particulary for constant strings where a // sufficiently smart compiler will simplify strlen. - unsigned Size = strlen(Str); + size_t Size = strlen(Str); // Make sure we can use the fast path. if (OutBufCur+Size > OutBufEnd) @@ -192,7 +192,7 @@ public: } raw_ostream &write(unsigned char C); - raw_ostream &write(const char *Ptr, unsigned Size); + raw_ostream &write(const char *Ptr, size_t Size); // Formatted output, see the format() function in Support/Format.h. raw_ostream &operator<<(const format_object_base &Fmt); @@ -221,7 +221,7 @@ private: /// \arg Ptr to the underlying stream. /// /// \invariant { Size > 0 } - virtual void write_impl(const char *Ptr, unsigned Size) = 0; + virtual void write_impl(const char *Ptr, size_t Size) = 0; // An out of line virtual method to provide a home for the class vtable. virtual void handle(); @@ -257,7 +257,7 @@ class raw_fd_ostream : public raw_ostream { uint64_t pos; /// write_impl - See raw_ostream::write_impl. - virtual void write_impl(const char *Ptr, unsigned Size); + virtual void write_impl(const char *Ptr, size_t Size); /// current_pos - Return the current position within the stream, not /// counting the bytes currently in the buffer. @@ -339,7 +339,7 @@ class raw_os_ostream : public raw_ostream { std::ostream &OS; /// write_impl - See raw_ostream::write_impl. - virtual void write_impl(const char *Ptr, unsigned Size); + virtual void write_impl(const char *Ptr, size_t Size); /// current_pos - Return the current position within the stream, not /// counting the bytes currently in the buffer. @@ -359,7 +359,7 @@ class raw_string_ostream : public raw_ostream { std::string &OS; /// write_impl - See raw_ostream::write_impl. - virtual void write_impl(const char *Ptr, unsigned Size); + virtual void write_impl(const char *Ptr, size_t Size); /// current_pos - Return the current position within the stream, not /// counting the bytes currently in the buffer. @@ -386,7 +386,7 @@ class raw_svector_ostream : public raw_ostream { SmallVectorImpl &OS; /// write_impl - See raw_ostream::write_impl. - virtual void write_impl(const char *Ptr, unsigned Size); + virtual void write_impl(const char *Ptr, size_t Size); /// current_pos - Return the current position within the stream, not /// counting the bytes currently in the buffer. -- cgit v1.2.3