aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/MemoryBuffer.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-05-05 18:30:58 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-05-05 18:30:58 +0000
commit34cd4a484e532cc463fd5a4bf59b88d13c5467c1 (patch)
treeeefdfb1d225da0317e7f7912079c430b5c3ed92c /lib/Support/MemoryBuffer.cpp
parentb61bfdb56e1c018f10a2c1c9fb49d7e2a78ed24e (diff)
Fix more -Wshorten-64-to-32 warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/MemoryBuffer.cpp')
-rw-r--r--lib/Support/MemoryBuffer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Support/MemoryBuffer.cpp b/lib/Support/MemoryBuffer.cpp
index 9c2eb42443..83f149423c 100644
--- a/lib/Support/MemoryBuffer.cpp
+++ b/lib/Support/MemoryBuffer.cpp
@@ -106,7 +106,7 @@ MemoryBuffer *MemoryBuffer::getMemBufferCopy(const char *StartPtr,
/// that is completely initialized to zeros. Note that the caller should
/// initialize the memory allocated by this method. The memory is owned by
/// the MemoryBuffer object.
-MemoryBuffer *MemoryBuffer::getNewUninitMemBuffer(unsigned Size,
+MemoryBuffer *MemoryBuffer::getNewUninitMemBuffer(size_t Size,
const char *BufferName) {
char *Buf = new char[Size+1];
Buf[Size] = 0;
@@ -120,7 +120,7 @@ MemoryBuffer *MemoryBuffer::getNewUninitMemBuffer(unsigned Size,
/// is completely initialized to zeros. Note that the caller should
/// initialize the memory allocated by this method. The memory is owned by
/// the MemoryBuffer object.
-MemoryBuffer *MemoryBuffer::getNewMemBuffer(unsigned Size,
+MemoryBuffer *MemoryBuffer::getNewMemBuffer(size_t Size,
const char *BufferName) {
MemoryBuffer *SB = getNewUninitMemBuffer(Size, BufferName);
memset(const_cast<char*>(SB->getBufferStart()), 0, Size+1);
@@ -214,7 +214,7 @@ MemoryBuffer *MemoryBuffer::getFile(const char *Filename, std::string *ErrStr,
SB.reset(MemoryBuffer::getNewUninitMemBuffer(FileSize, Filename));
char *BufPtr = const_cast<char*>(SB->getBufferStart());
- unsigned BytesLeft = FileSize;
+ size_t BytesLeft = FileSize;
while (BytesLeft) {
ssize_t NumRead = ::read(FD, BufPtr, BytesLeft);
if (NumRead != -1) {