compressor: Use unqualified encode/decode

This is a portion of the namespace project.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
Adam C. Emerson 2017-12-22 22:05:32 -05:00
parent 06aa3dd961
commit 62c97dea24
2 changed files with 8 additions and 8 deletions

View File

@ -40,7 +40,7 @@ class LZ4Compressor : public Compressor {
unsigned num = src.get_num_buffers();
uint32_t origin_len;
int compressed_len;
::encode((uint32_t)num, dst);
encode((uint32_t)num, dst);
while (left) {
origin_len = p.get_ptr_and_advance(left, &data);
compressed_len = LZ4_compress_fast_continue(
@ -50,8 +50,8 @@ class LZ4Compressor : public Compressor {
return -1;
pos += compressed_len;
left -= origin_len;
::encode(origin_len, dst);
::encode((uint32_t)compressed_len, dst);
encode(origin_len, dst);
encode((uint32_t)compressed_len, dst);
}
assert(p.end());
@ -69,12 +69,12 @@ class LZ4Compressor : public Compressor {
bufferlist &dst) override {
uint32_t count;
std::vector<std::pair<uint32_t, uint32_t> > compressed_pairs;
::decode(count, p);
decode(count, p);
compressed_pairs.resize(count);
uint32_t total_origin = 0;
for (unsigned i = 0; i < count; ++i) {
::decode(compressed_pairs[i].first, p);
::decode(compressed_pairs[i].second, p);
decode(compressed_pairs[i].first, p);
decode(compressed_pairs[i].second, p);
total_origin += compressed_pairs[i].first;
}
compressed_len -= (sizeof(uint32_t) + sizeof(uint32_t) * count * 2);

View File

@ -58,7 +58,7 @@ class ZstdCompressor : public Compressor {
ZSTD_freeCStream(s);
// prefix with decompressed length
::encode((uint32_t)src.length(), dst);
encode((uint32_t)src.length(), dst);
dst.append(outptr, 0, outbuf.pos);
return 0;
}
@ -76,7 +76,7 @@ class ZstdCompressor : public Compressor {
}
compressed_len -= 4;
uint32_t dst_len;
::decode(dst_len, p);
decode(dst_len, p);
bufferptr dstptr(dst_len);
ZSTD_outBuffer_s outbuf;