From 3646e1e438a1bf05363dc18786b51bfe581ee648 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 7 Oct 2014 16:23:03 -0400 Subject: [PATCH] encoding: wrap ENCODE_START/FINISH arguments Wrapped the bufferlist argument with parentheses to prevent compile errors when attempting to pass a dereferenced bufferlist pointer to the ENCODE_START/FINISH macros. Signed-off-by: Jason Dillaman --- src/include/encoding.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/include/encoding.h b/src/include/encoding.h index 82f7fa95a6903..4fa2331cccb43 100644 --- a/src/include/encoding.h +++ b/src/include/encoding.h @@ -756,14 +756,14 @@ inline void decode(std::deque& ls, bufferlist::iterator& p) */ #define ENCODE_START(v, compat, bl) \ __u8 struct_v = v, struct_compat = compat; \ - ::encode(struct_v, bl); \ - ::encode(struct_compat, bl); \ - buffer::list::iterator struct_compat_it = bl.end(); \ + ::encode(struct_v, (bl)); \ + ::encode(struct_compat, (bl)); \ + buffer::list::iterator struct_compat_it = (bl).end(); \ struct_compat_it.advance(-1); \ ceph_le32 struct_len; \ struct_len = 0; \ - ::encode(struct_len, bl); \ - buffer::list::iterator struct_len_it = bl.end(); \ + ::encode(struct_len, (bl)); \ + buffer::list::iterator struct_len_it = (bl).end(); \ struct_len_it.advance(-4); \ do { @@ -775,7 +775,7 @@ inline void decode(std::deque& ls, bufferlist::iterator& p) */ #define ENCODE_FINISH_NEW_COMPAT(bl, new_struct_compat) \ } while (false); \ - struct_len = bl.length() - struct_len_it.get_off() - sizeof(struct_len); \ + struct_len = (bl).length() - struct_len_it.get_off() - sizeof(struct_len); \ struct_len_it.copy_in(4, (char *)&struct_len); \ if (new_struct_compat) { \ struct_compat = new_struct_compat; \ -- 2.39.5