Skip to content

Commit

Permalink
ImgLoader: Fix member initialization (#247)
Browse files Browse the repository at this point in the history
メンバ変数の初期化を変更してcppcheckの警告
(warning) Member variable 'ImgLoader::m_loadlevel' is not initialized
in the constructor. を修正する。

[src/jdlib/imgloader.cpp:18]: (warning) Member variable 'ImgLoader::m_loadlevel' is not initialized in the constructor.
  • Loading branch information
ma8ma committed Apr 23, 2020
1 parent bccb9db commit e85a236
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
8 changes: 2 additions & 6 deletions src/jdlib/imgloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ using namespace JDLIB;
/* constructions ******************************************/

ImgLoader::ImgLoader( const std::string& file )
: m_file( file ),
m_width( 0 ),
m_height( 0 ),
m_stop( false ),
m_y( 0 ),
m_loadedlevel( LOADLEVEL_INIT )
: m_file( file )
, m_loadedlevel( LOADLEVEL_INIT )
{
#ifdef _DEBUG
std::cout << "ImgLoader::ImgLoader file = " << m_file << std::endl;
Expand Down
12 changes: 6 additions & 6 deletions src/jdlib/imgloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ namespace JDLIB

std::string m_file;
std::string m_errmsg;
int m_width;
int m_height;
bool m_stop;
int m_y;
int m_loadlevel;
int m_width{};
int m_height{};

bool m_stop{};
int m_y{};
int m_loadlevel{};
int m_loadedlevel;

public:
Expand Down

0 comments on commit e85a236

Please sign in to comment.