From 6e285496f17193447ca89fab731fbf63bbc3b634 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 17 Feb 2017 19:21:34 +0800 Subject: [PATCH] common/perf_histogram: initialize member vars of axis_config_d addresses CID 1400670: (UNINIT_CTOR) Signed-off-by: Kefu Chai --- src/common/perf_histogram.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/common/perf_histogram.h b/src/common/perf_histogram.h index 6d315905db3e3..4fdc657ef817a 100644 --- a/src/common/perf_histogram.h +++ b/src/common/perf_histogram.h @@ -29,11 +29,23 @@ public: }; struct axis_config_d { - const char *m_name; - scale_type_d m_scale_type; - int64_t m_min; - int64_t m_quant_size; - int32_t m_buckets; + const char *m_name = nullptr; + scale_type_d m_scale_type = SCALE_LINEAR; + int64_t m_min = 0; + int64_t m_quant_size = 0; + int32_t m_buckets = 0; + axis_config_d() = default; + axis_config_d(const char* name, + scale_type_d scale_type, + int64_t min, + int64_t quant_size, + int32_t buckets) + : m_name(name), + m_scale_type(scale_type), + m_min(min), + m_quant_size(quant_size), + m_buckets(buckets) + {} }; protected: -- 2.39.5