From 9d23ddbd87dcf7f38f70fc30a5e0ee69d67f2972 Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Thu, 28 Mar 2019 21:04:19 -0400 Subject: [PATCH] include: Update encoding.h to work without using namespace Signed-off-by: Adam C. Emerson --- src/include/encoding.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/include/encoding.h b/src/include/encoding.h index 3b991596828ba..9963cf7a53382 100644 --- a/src/include/encoding.h +++ b/src/include/encoding.h @@ -158,7 +158,7 @@ WRITE_INTTYPE_ENCODER(int16_t, le16) #define WRITE_CLASS_ENCODER(cl) \ - inline void encode(const cl &c, ::ceph::bufferlist &bl, uint64_t features=0) { \ + inline void encode(const cl& c, ::ceph::buffer::list &bl, uint64_t features=0) { \ ENCODE_DUMP_PRE(); c.encode(bl); ENCODE_DUMP_POST(cl); } \ inline void decode(cl &c, ::ceph::bufferlist::const_iterator &p) { c.decode(p); } @@ -1280,7 +1280,7 @@ decode(std::array& v, bufferlist::const_iterator& p) __u8 struct_v = v; \ __u8 struct_compat = compat; \ ceph_le32 struct_len; \ - auto filler = (bl).append_hole(sizeof(struct_v) + \ + auto filler = (bl).append_hole(sizeof(struct_v) + \ sizeof(struct_compat) + sizeof(struct_len)); \ const auto starting_bl_len = (bl).length(); \ using ::ceph::encode; \ @@ -1334,7 +1334,7 @@ decode(std::array& v, bufferlist::const_iterator& p) decode(struct_v, bl); \ decode(struct_compat, bl); \ if (v < struct_compat) \ - throw buffer::malformed_input(DECODE_ERR_OLDVERSION(__PRETTY_FUNCTION__, v, struct_compat)); \ + throw ::ceph::buffer::malformed_input(DECODE_ERR_OLDVERSION(__PRETTY_FUNCTION__, v, struct_compat)); \ __u32 struct_len; \ decode(struct_len, bl); \ if (struct_len > bl.get_remaining()) \ @@ -1352,10 +1352,10 @@ decode(std::array& v, bufferlist::const_iterator& p) __u8 struct_compat; \ decode(struct_compat, bl); \ if (v < struct_compat) \ - throw buffer::malformed_input(DECODE_ERR_OLDVERSION(__PRETTY_FUNCTION__, v, struct_compat)); \ + throw ::ceph::buffer::malformed_input(DECODE_ERR_OLDVERSION(__PRETTY_FUNCTION__, v, struct_compat)); \ } else if (skip_v) { \ if (bl.get_remaining() < skip_v) \ - throw buffer::malformed_input(DECODE_ERR_PAST(__PRETTY_FUNCTION__)); \ + throw ::ceph::buffer::malformed_input(DECODE_ERR_PAST(__PRETTY_FUNCTION__)); \ bl.advance(skip_v); \ } \ unsigned struct_end = 0; \ @@ -1363,7 +1363,7 @@ decode(std::array& v, bufferlist::const_iterator& p) __u32 struct_len; \ decode(struct_len, bl); \ if (struct_len > bl.get_remaining()) \ - throw buffer::malformed_input(DECODE_ERR_PAST(__PRETTY_FUNCTION__)); \ + throw ::ceph::buffer::malformed_input(DECODE_ERR_PAST(__PRETTY_FUNCTION__)); \ struct_end = bl.get_off() + struct_len; \ } \ do { @@ -1394,7 +1394,7 @@ decode(std::array& v, bufferlist::const_iterator& p) __u8 struct_compat; \ decode(struct_compat, bl); \ if (v < struct_compat) \ - throw buffer::malformed_input(DECODE_ERR_OLDVERSION( \ + throw ::ceph::buffer::malformed_input(DECODE_ERR_OLDVERSION( \ __PRETTY_FUNCTION__, v, struct_compat)); \ } \ unsigned struct_end = 0; \ @@ -1402,7 +1402,7 @@ decode(std::array& v, bufferlist::const_iterator& p) __u32 struct_len; \ decode(struct_len, bl); \ if (struct_len > bl.get_remaining()) \ - throw buffer::malformed_input(DECODE_ERR_PAST(__PRETTY_FUNCTION__)); \ + throw ::ceph::buffer::malformed_input(DECODE_ERR_PAST(__PRETTY_FUNCTION__)); \ struct_end = bl.get_off() + struct_len; \ } \ do { @@ -1439,7 +1439,7 @@ decode(std::array& v, bufferlist::const_iterator& p) } while (false); \ if (struct_end) { \ if (bl.get_off() > struct_end) \ - throw buffer::malformed_input(DECODE_ERR_PAST(__PRETTY_FUNCTION__)); \ + throw ::ceph::buffer::malformed_input(DECODE_ERR_PAST(__PRETTY_FUNCTION__)); \ if (bl.get_off() < struct_end) \ bl.advance(struct_end - bl.get_off()); \ } @@ -1455,9 +1455,9 @@ inline ssize_t decode_file(int fd, std::string &str) bufferlist bl; __u32 len = 0; bl.read_fd(fd, sizeof(len)); - decode(len, bl); + decode(len, bl); bl.read_fd(fd, len); - decode(str, bl); + decode(str, bl); return bl.length(); } -- 2.39.5