Fix uninitialized private members when constructors are called.

This commit is contained in:
Tetsuo Kiso 2011-11-14 12:53:20 +09:00
parent 625fe118e0
commit 20afe4babb
2 changed files with 4 additions and 3 deletions

View File

@ -13,7 +13,7 @@ bool IsGzipFile(const std::string &filename) {
} // namespace
inputfilestream::inputfilestream(const std::string &filePath)
: std::istream(0), m_streambuf(0)
: std::istream(0), m_streambuf(0), is_good(false)
{
// check if file is readable
std::filebuf* fb = new std::filebuf();
@ -40,7 +40,7 @@ void inputfilestream::close()
}
outputfilestream::outputfilestream(const std::string &filePath)
: std::ostream(0), m_streambuf(0)
: std::ostream(0), m_streambuf(0), is_good(false)
{
// check if file is readable
std::filebuf* fb = new std::filebuf();

View File

@ -18,7 +18,8 @@ const char SCORES_BIN_BEGIN[] = "SCORES_BIN_BEGIN_0";
const char SCORES_BIN_END[] = "SCORES_BIN_END_0";
} // namespace
ScoreArray::ScoreArray() : idx("") {}
ScoreArray::ScoreArray()
: number_of_scores(0), idx("") {}
void ScoreArray::savetxt(std::ofstream& outFile, const std::string& sctype)
{