From 2e15bcd025388f15abd35a6456fd67d09a2e0e8a Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Thu, 2 Feb 2017 15:05:26 -0500 Subject: [PATCH] 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 --- src/rgw/rgw_formats.cc | 7 +------ src/rgw/rgw_formats.h | 10 +++++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/rgw/rgw_formats.cc b/src/rgw/rgw_formats.cc index 1d416e2ea37d1..7a0a1bf762412 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 917b778c5c03e..acf3a0fb7dea4 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; }; -- 2.39.5