From: Adam C. Emerson Date: Thu, 2 Feb 2017 20:05:26 +0000 (-0500) Subject: rgw: Fix rgw_format construction order X-Git-Tag: v12.0.1~478^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2e15bcd025388f15abd35a6456fd67d09a2e0e8a;p=ceph.git rgw: Fix rgw_format construction order 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 --- diff --git a/src/rgw/rgw_formats.cc b/src/rgw/rgw_formats.cc index 1d416e2ea37d..7a0a1bf76241 100644 --- a/src/rgw/rgw_formats.cc +++ b/src/rgw/rgw_formats.cc @@ -25,12 +25,7 @@ #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) { } diff --git a/src/rgw/rgw_formats.h b/src/rgw/rgw_formats.h index 917b778c5c03..acf3a0fb7dea 100644 --- a/src/rgw/rgw_formats.h +++ b/src/rgw/rgw_formats.h @@ -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 stack; - size_t min_stack_level; + size_t min_stack_level = 0; bool use_kv; - bool wrote_something; + bool wrote_something = 0; };