Fix unused private field warning in NDEBUG builds.
This commit is contained in:
14
snappy.cc
14
snappy.cc
@@ -1048,12 +1048,14 @@ size_t Compress(Source* reader, Sink* writer) {
|
|||||||
// Writer template argument to SnappyDecompressor::DecompressAllTags().
|
// Writer template argument to SnappyDecompressor::DecompressAllTags().
|
||||||
class SnappyIOVecWriter {
|
class SnappyIOVecWriter {
|
||||||
private:
|
private:
|
||||||
const struct iovec* output_iov_;
|
|
||||||
|
|
||||||
// output_iov_end_ is set to iov + count and used to determine when
|
// output_iov_end_ is set to iov + count and used to determine when
|
||||||
// the end of the iovs is reached.
|
// the end of the iovs is reached.
|
||||||
const struct iovec* output_iov_end_;
|
const struct iovec* output_iov_end_;
|
||||||
|
|
||||||
|
#if !defined(NDEBUG)
|
||||||
|
const struct iovec* output_iov_;
|
||||||
|
#endif // !defined(NDEBUG)
|
||||||
|
|
||||||
// Current iov that is being written into.
|
// Current iov that is being written into.
|
||||||
const struct iovec* curr_iov_;
|
const struct iovec* curr_iov_;
|
||||||
|
|
||||||
@@ -1077,8 +1079,10 @@ class SnappyIOVecWriter {
|
|||||||
// Does not take ownership of iov. iov must be valid during the
|
// Does not take ownership of iov. iov must be valid during the
|
||||||
// entire lifetime of the SnappyIOVecWriter.
|
// entire lifetime of the SnappyIOVecWriter.
|
||||||
inline SnappyIOVecWriter(const struct iovec* iov, size_t iov_count)
|
inline SnappyIOVecWriter(const struct iovec* iov, size_t iov_count)
|
||||||
: output_iov_(iov),
|
: output_iov_end_(iov + iov_count),
|
||||||
output_iov_end_(iov + iov_count),
|
#if !defined(NDEBUG)
|
||||||
|
output_iov_(iov),
|
||||||
|
#endif // !defined(NDEBUG)
|
||||||
curr_iov_(iov),
|
curr_iov_(iov),
|
||||||
curr_iov_output_(iov_count ? reinterpret_cast<char*>(iov->iov_base)
|
curr_iov_output_(iov_count ? reinterpret_cast<char*>(iov->iov_base)
|
||||||
: nullptr),
|
: nullptr),
|
||||||
@@ -1163,7 +1167,9 @@ class SnappyIOVecWriter {
|
|||||||
|
|
||||||
offset -= from_iov_offset;
|
offset -= from_iov_offset;
|
||||||
--from_iov;
|
--from_iov;
|
||||||
|
#if !defined(NDEBUG)
|
||||||
assert(from_iov >= output_iov_);
|
assert(from_iov >= output_iov_);
|
||||||
|
#endif // !defined(NDEBUG)
|
||||||
from_iov_offset = from_iov->iov_len;
|
from_iov_offset = from_iov->iov_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user