Fix for build break with clang.
Change-Id: I7af0b6b787324aa478c654f9a20e9008823a6378
This commit is contained in:
parent
055ccde14f
commit
f494f1f760
|
@ -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<const uint8_t*>(buffer));
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -147,7 +147,7 @@ TEST_F(IoCacheTest, LotsOfUnalignedBlocks) {
|
|||
while (verify_index < verify_buffer.size()) {
|
||||
std::vector<uint8_t> 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<uint8_t> 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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue