From: Jason Dillaman Date: Tue, 7 Oct 2014 20:23:03 +0000 (-0400) Subject: encoding: wrap ENCODE_START/FINISH arguments X-Git-Tag: v0.92~20^2~9 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3646e1e438a1bf05363dc18786b51bfe581ee648;p=ceph.git 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 --- diff --git a/src/include/encoding.h b/src/include/encoding.h index 82f7fa95a69..4fa2331cccb 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; \