]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Fix rgw_format construction order
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 2 Feb 2017 20:05:26 +0000 (15:05 -0500)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 3 Feb 2017 22:23:23 +0000 (17:23 -0500)
Since we have only one constructor, just use default initialization for
every member that doesn't depend on an argument.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_formats.cc
src/rgw/rgw_formats.h

index 1d416e2ea37d1371936ec2eb39869a439f5d6bfa..7a0a1bf762412b00052cc85da2e6b079445568d7 100644 (file)
 #define dout_subsys ceph_subsys_rgw
 
 RGWFormatter_Plain::RGWFormatter_Plain(const bool ukv)
-  : buf(NULL),
-    len(0),
-    max_len(0),
-    wrote_something(false),
-    min_stack_level(0),
-    use_kv(ukv)
+  : use_kv(ukv)
 {
 }
 
index 917b778c5c03e5da26206359c77532e9b352b691..acf3a0fb7dea404ceb981a60c092d7d75de0aea5 100644 (file)
@@ -50,14 +50,14 @@ private:
   void write_data(const char *fmt, ...);
   void dump_value_int(const char *name, const char *fmt, ...);
 
-  char *buf;
-  int len;
-  int max_len;
+  char *buf = nullptr;
+  int len = 0;
+  int max_len = 0;
 
   std::list<struct plain_stack_entry> stack;
-  size_t min_stack_level;
+  size_t min_stack_level = 0;
   bool use_kv;
-  bool wrote_something;
+  bool wrote_something = 0;
 };