From f494f1f7608cdc54bcefd726304a218f20628629 Mon Sep 17 00:00:00 2001 From: Thomas Inskip Date: Wed, 18 Mar 2015 14:35:25 -0700 Subject: [PATCH] Fix for build break with clang. Change-Id: I7af0b6b787324aa478c654f9a20e9008823a6378 --- packager/media/file/io_cache.cc | 4 ++-- packager/media/file/io_cache.h | 4 ++-- packager/media/file/io_cache_unittest.cc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packager/media/file/io_cache.cc b/packager/media/file/io_cache.cc index 136ba09080..3e04aaa4db 100644 --- a/packager/media/file/io_cache.cc +++ b/packager/media/file/io_cache.cc @@ -35,7 +35,7 @@ IoCache::~IoCache() { Close(); } -int64_t IoCache::Read(void* buffer, uint64_t size) { +uint64_t IoCache::Read(void* buffer, uint64_t size) { DCHECK(buffer); AutoLock lock(lock_); @@ -65,7 +65,7 @@ int64_t IoCache::Read(void* buffer, uint64_t size) { return size; } -int64_t IoCache::Write(const void* buffer, uint64_t size) { +uint64_t IoCache::Write(const void* buffer, uint64_t size) { DCHECK(buffer); const uint8_t* r_ptr(static_cast(buffer)); diff --git a/packager/media/file/io_cache.h b/packager/media/file/io_cache.h index b6cc6ae9c5..fb898aef4e 100644 --- a/packager/media/file/io_cache.h +++ b/packager/media/file/io_cache.h @@ -28,7 +28,7 @@ class IoCache { /// @param size is the size of @a buffer. /// @return the number of bytes read into @a buffer, or 0 if the call /// unblocked because the cache has been closed. - int64_t Read(void* buffer, uint64_t size); + uint64_t Read(void* buffer, uint64_t size); /// Write data to the cache. This function may block until there is enough /// room in the cache. @@ -37,7 +37,7 @@ class IoCache { /// @return the amount of data written to the buffer (which will equal /// @a data), or 0 if the call unblocked because the cache has been /// closed. - int64_t Write(const void* buffer, uint64_t size); + uint64_t Write(const void* buffer, uint64_t size); /// Empties the cache. void Clear(); diff --git a/packager/media/file/io_cache_unittest.cc b/packager/media/file/io_cache_unittest.cc index a377775d21..d3fbeeae50 100644 --- a/packager/media/file/io_cache_unittest.cc +++ b/packager/media/file/io_cache_unittest.cc @@ -147,7 +147,7 @@ TEST_F(IoCacheTest, LotsOfUnalignedBlocks) { while (verify_index < verify_buffer.size()) { std::vector read_buffer2(kBlockSize); uint64_t bytes_read = cache_->Read(&read_buffer2[0], kBlockSize); - EXPECT_NE(0, bytes_read); + EXPECT_NE(0U, bytes_read); EXPECT_FALSE(memcmp(&verify_buffer[verify_index], &read_buffer2[0], bytes_read)); @@ -204,7 +204,7 @@ TEST_F(IoCacheTest, CloseByWriter) { uint8_t test_buffer[kBlockSize]; std::vector write_buffer; WriteToCacheThreaded(write_buffer, 0, 0, true); - EXPECT_EQ(0, cache_->Read(test_buffer, kBlockSize)); + EXPECT_EQ(0U, cache_->Read(test_buffer, kBlockSize)); WaitForWriterThread(); }