Fix for build break with clang.

Change-Id: I7af0b6b787324aa478c654f9a20e9008823a6378
This commit is contained in:
Thomas Inskip 2015-03-18 14:35:25 -07:00
parent 055ccde14f
commit f494f1f760
3 changed files with 6 additions and 6 deletions

View File

@ -35,7 +35,7 @@ IoCache::~IoCache() {
Close(); Close();
} }
int64_t IoCache::Read(void* buffer, uint64_t size) { uint64_t IoCache::Read(void* buffer, uint64_t size) {
DCHECK(buffer); DCHECK(buffer);
AutoLock lock(lock_); AutoLock lock(lock_);
@ -65,7 +65,7 @@ int64_t IoCache::Read(void* buffer, uint64_t size) {
return 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); DCHECK(buffer);
const uint8_t* r_ptr(static_cast<const uint8_t*>(buffer)); const uint8_t* r_ptr(static_cast<const uint8_t*>(buffer));

View File

@ -28,7 +28,7 @@ class IoCache {
/// @param size is the size of @a buffer. /// @param size is the size of @a buffer.
/// @return the number of bytes read into @a buffer, or 0 if the call /// @return the number of bytes read into @a buffer, or 0 if the call
/// unblocked because the cache has been closed. /// 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 /// Write data to the cache. This function may block until there is enough
/// room in the cache. /// room in the cache.
@ -37,7 +37,7 @@ class IoCache {
/// @return the amount of data written to the buffer (which will equal /// @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 /// @a data), or 0 if the call unblocked because the cache has been
/// closed. /// closed.
int64_t Write(const void* buffer, uint64_t size); uint64_t Write(const void* buffer, uint64_t size);
/// Empties the cache. /// Empties the cache.
void Clear(); void Clear();

View File

@ -147,7 +147,7 @@ TEST_F(IoCacheTest, LotsOfUnalignedBlocks) {
while (verify_index < verify_buffer.size()) { while (verify_index < verify_buffer.size()) {
std::vector<uint8_t> read_buffer2(kBlockSize); std::vector<uint8_t> read_buffer2(kBlockSize);
uint64_t bytes_read = cache_->Read(&read_buffer2[0], 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], EXPECT_FALSE(memcmp(&verify_buffer[verify_index],
&read_buffer2[0], &read_buffer2[0],
bytes_read)); bytes_read));
@ -204,7 +204,7 @@ TEST_F(IoCacheTest, CloseByWriter) {
uint8_t test_buffer[kBlockSize]; uint8_t test_buffer[kBlockSize];
std::vector<uint8_t> write_buffer; std::vector<uint8_t> write_buffer;
WriteToCacheThreaded(write_buffer, 0, 0, true); WriteToCacheThreaded(write_buffer, 0, 0, true);
EXPECT_EQ(0, cache_->Read(test_buffer, kBlockSize)); EXPECT_EQ(0U, cache_->Read(test_buffer, kBlockSize));
WaitForWriterThread(); WaitForWriterThread();
} }