]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
encoding: wrap ENCODE_START/FINISH arguments
authorJason Dillaman <dillaman@redhat.com>
Tue, 7 Oct 2014 20:23:03 +0000 (16:23 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 8 Jan 2015 02:25:04 +0000 (21:25 -0500)
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 <dillaman@redhat.com>
src/include/encoding.h

index 82f7fa95a690394e53f3de8955b3603c37579e9a..4fa2331cccb4321001c6fae3b262a2f5e4e0d72e 100644 (file)
@@ -756,14 +756,14 @@ inline void decode(std::deque<T>& 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<T>& 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;                                 \