Ensure all C++ class member raw pointers are default-initialized to nullptr.

This commit is contained in:
John Ralls
2018-08-10 12:21:28 -07:00
parent 1e87d069f6
commit 2f861bc2a4
7 changed files with 15 additions and 15 deletions

View File

@@ -53,7 +53,7 @@ public:
void add_where_cond(QofIdTypeConst, const PairVec&) override;
private:
const GncSqlConnection* m_conn;
const GncSqlConnection* m_conn = nullptr;
std::string m_sql;
};

View File

@@ -86,7 +86,7 @@ public:
const ColVec& info_vec) const noexcept;
bool drop_indexes() noexcept;
private:
QofBackend* m_qbe;
QofBackend* m_qbe = nullptr;
dbi_conn m_conn;
std::unique_ptr<GncDbiProvider> m_provider;
/** Used by the error handler routines to flag if the connection is ok to

View File

@@ -63,11 +63,11 @@ protected:
return dbi_result_field_is_null(m_inst->m_dbi_result, col);
}
private:
GncDbiSqlResult* m_inst;
GncDbiSqlResult* m_inst = nullptr;
};
private:
const GncDbiSqlConnection* m_conn;
const GncDbiSqlConnection* m_conn = nullptr;
dbi_result m_dbi_result;
IteratorImpl m_iter;
GncSqlRow m_row;

View File

@@ -241,12 +241,12 @@ public:
void finish_progress() const noexcept;
protected:
GncSqlConnection* m_conn; /**< SQL connection */
QofBook* m_book; /**< The primary, main open book */
GncSqlConnection* m_conn = nullptr; /**< SQL connection */
QofBook* m_book = nullptr; /**< The primary, main open book */
bool m_loading; /**< We are performing an initial load */
bool m_in_query; /**< We are processing a query */
bool m_is_pristine_db; /**< Are we saving to a new pristine db? */
const char* m_timespec_format; /**< Server-specific date-time string format */
const char* m_timespec_format = nullptr; /**< Server-specific date-time string format */
VersionVec m_versions; /**< Version number for each table */
private:
bool write_account_tree(Account*);

View File

@@ -231,12 +231,12 @@ protected:
*/
void add_objectref_guid_to_table (ColVec& vec) const noexcept;
private:
const char* m_col_name; /**< Column name */
const char* m_col_name = nullptr; /**< Column name */
const GncSqlObjectType m_col_type; /**< Column type */
unsigned int m_size; /**< Column size in bytes, for string columns */
ColumnFlags m_flags; /**< Column flags */
const char* m_gobj_param_name; /**< If non-null, g_object param name */
const char* m_qof_param_name; /**< If non-null, qof parameter name */
const char* m_gobj_param_name = nullptr; /**< If non-null, g_object param name */
const char* m_qof_param_name = nullptr; /**< If non-null, qof parameter name */
QofAccessFunc m_getter; /**< General access function */
QofSetterFunc m_setter; /**< General setter function */
template <typename T> T get_row_value_from_object(QofIdTypeConst obj_name,

View File

@@ -131,9 +131,9 @@ struct write_objects_t
void commit (QofInstance* inst) {
if (is_ok) is_ok = obe->commit (be, inst);
}
GncSqlBackend* be;
bool is_ok;
GncSqlObjectBackend* obe;
GncSqlBackend* be = nullptr;
bool is_ok = false;
GncSqlObjectBackend* obe = nullptr;
};

View File

@@ -42,8 +42,8 @@ public:
}
protected:
KvpFrameImpl t_root;
KvpValue *t_int_val;
KvpValue *t_str_val;
KvpValue *t_int_val = nullptr;
KvpValue *t_str_val = nullptr;
};
template <typename A, typename B> void