dtinfo: Resolve coverity warnings related to uninitialised members of classes

This commit is contained in:
Peter Howkins
2018-04-19 23:25:47 +01:00
parent 02d43dabe6
commit 6e7e9d91e1
48 changed files with 167 additions and 32 deletions

View File

@@ -47,7 +47,7 @@ static ostrstream& terminate(ostrstream& ost)
#endif
DocParser::DocParser(Resolver &r)
: f_resolver(r),
: f_resolver(r), f_ignoring_element(0),
#if defined(SC3) || defined(__osf__)
f_buffer(new char[DATA_BUF_SIZ]),
f_output(f_buffer, DATA_BUF_SIZ)

View File

@@ -121,6 +121,10 @@ debug(cerr, base_ds);
}
end_try;
}
#ifdef C_API
f_index_id = 0;
#endif
MESSAGE(cerr, form("info base %s in %s available.", base_name, base_dir));
}

View File

@@ -63,6 +63,8 @@ btree::btree(const char* store_name)
btree_info.prefix = NULL;
btree_info.lorder = 0;
key_DBT.data = 0;
key_DBT.size = 0;
int mode = O_CREAT|O_RDWR;

View File

@@ -51,7 +51,7 @@
#include "compression/code.h"
encoding_unit::encoding_unit(ostring* w, unsigned int f) :
word(w), freq(f), code(0)
word(w), freq(f), code(0), bits(0), leaf_htr_node(NULL)
{
}

View File

@@ -32,6 +32,7 @@ CC_Tokenizer::CC_Tokenizer( const CC_String &s )
*((char *) memcpy(str_, s.data(), len) + len) = '\0';
current_ptr = str_;
touched = FALSE;
strtok_buf = 0;
}

View File

@@ -40,7 +40,7 @@ char *Exception::g_next_avail = Exception::g_temp_space;
// /////////////////////////////////////////////////////////////////
Exception::Exception()
: f_thrown(0), f_thrown_as_pointer(1), f_temporary(0), f_line(0)
: f_thrown(0), f_thrown_as_pointer(1), f_temporary(0), f_line(0), f_file(NULL), f_previous_exception(NULL)
{
PRINTF (("Constructed Exception obj @ %p\n", this));
}

View File

@@ -63,7 +63,7 @@ void c_index::init_persistent_info(persistent_info* x)
set_mode(SWAP_ALLOWED, false);
}
c_index::c_index(c_code_t c_cd) : composite(c_cd)
c_index::c_index(c_code_t c_cd) : composite(c_cd), v_inv_lists_hd(NULL)
{
v_cmp_selector = 0;
}

View File

@@ -62,6 +62,7 @@ mphf_index::mphf_index() : c_index(MPHF_INDEX_CODE), f_key_file_name(0)
v_mphf = 0;
v_inv_lists_hd = 0;
v_key_loc_pair_out = NULL;
}
void mphf_index::init_data_member(fast_mphf_handler* mp,

View File

@@ -109,6 +109,8 @@ oid_t::oid_t(const char* source, Boolean ascii_format, Boolean swap_order)
}
}
v_e_code = 0;
/*
MESSAGE(cerr, "constr oid_t using a string");
debug(cerr, v_c_code);

View File

@@ -51,7 +51,7 @@
#include "oliasdb/mark.h"
umark::umark() : mmdb_tuple(2, USER_MARK_CODE)
umark::umark() : mmdb_tuple(2, USER_MARK_CODE), mark_set_hd_ptr(NULL)
{
}

View File

@@ -57,6 +57,7 @@
mark_base::mark_base(user_base::rw_flag_t rw) :
user_base(MARK_SPEC, rw)
{
mark_set_hd = NULL;
}
@@ -67,8 +68,10 @@ mark_base::mark_base( const char* base_dir,
) :
user_base(base_dir, base_nm, base_ds, MARK_SPEC, rw)
{
if ( checking_status != SUCC )
if ( checking_status != SUCC ) {
mark_set_hd = NULL;
return;
}
desc* ptr = first_desc_ptr;

View File

@@ -68,7 +68,7 @@ extern void schemarestart(FILE*);
extern FILE *schemain;
object_dict::object_dict() :
v_dict(desc_name_eq, desc_name_ls), v_desc_ptr(0)
v_dict(desc_name_eq, desc_name_ls), v_desc_ptr(0), v_last_desc_ptr(NULL)
{
v_db_path[0] = 0;
}

View File

@@ -76,6 +76,8 @@ store_desc::store_desc(const char* name) : desc(name)
if ( order_str == 0 )
throw(stringException("machine type not supported"));
v_store_ptr = NULL;
}
store_desc::store_desc(int tp, const char* comment):
@@ -95,6 +97,8 @@ store_desc::store_desc(int tp, const char* comment):
if ( order_str == 0 )
throw(stringException("machine type not supported"));
v_store_ptr = NULL;
}
store_desc::~store_desc()

View File

@@ -59,6 +59,8 @@ xtime::xtime() :
v_cpu_stamp(0), v_elapsed_stamp(0)
{
memset(&v_time_regs, 0, sizeof(struct tms));
memset(&v_tv, 0, sizeof(struct timeval));
}
void xtime::stop(float &cpu_time, long &elp_time)