X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Fio%2FRecordIO.cpp;h=50c854ec01062bb23b0c0c1b6d216f14393f7724;hb=641ad8da9ecd87271bb3fcf05d06d9b7d85e5ff9;hp=37efc51a8a979989bb1083165735c21edb206fc0;hpb=1c098e2758d1bd55c48ffa26dab389dbbe96a666;p=folly.git diff --git a/folly/io/RecordIO.cpp b/folly/io/RecordIO.cpp index 37efc51a..50c854ec 100644 --- a/folly/io/RecordIO.cpp +++ b/folly/io/RecordIO.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2016 Facebook, Inc. + * Copyright 2017 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,7 +66,7 @@ void RecordIOWriter::write(std::unique_ptr buf) { #endif checkUnixError(bytes, "pwrite() failed"); - DCHECK_EQ(bytes, totalLength); + DCHECK_EQ(size_t(bytes), totalLength); } RecordIOReader::RecordIOReader(File file, uint32_t fileId) @@ -84,7 +84,7 @@ RecordIOReader::Iterator::Iterator(ByteRange range, uint32_t fileId, off_t pos) range_.clear(); } else { recordAndPos_.second = pos; - range_.advance(pos); + range_.advance(size_t(pos)); advanceToValid(); } } @@ -95,7 +95,7 @@ void RecordIOReader::Iterator::advanceToValid() { recordAndPos_ = std::make_pair(ByteRange(), off_t(-1)); range_.clear(); // at end } else { - size_t skipped = record.begin() - range_.begin(); + size_t skipped = size_t(record.begin() - range_.begin()); DCHECK_GE(skipped, headerSize()); skipped -= headerSize(); range_.advance(skipped);