From b0cb219d92529e2e333fc1fad705c61b7dd9d24c Mon Sep 17 00:00:00 2001 From: Masayuki Yamamoto <15698961+ma8ma@users.noreply.github.com> Date: Sat, 18 Dec 2021 21:35:35 +0900 Subject: [PATCH] Root: Rename local variable to avoid shadow function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ローカル変数の名前が関数をシャドーイングしているとcppcheck 2.6.2に 指摘されたため修正します。 cppcheckのレポート ``` src/dbtree/root.cpp:706:15: style: Local variable 'stat' shadows outer function [shadowFunction] const int stat = is_moved( root, path_board, name, &board, etc ); ^ /usr/include/x86_64-linux-gnu/sys/stat.h:205:12: note: Shadowed declaration extern int stat (const char *__restrict __file, ^ src/dbtree/root.cpp:706:15: note: Shadow variable const int stat = is_moved( root, path_board, name, &board, etc ); ^ ``` --- src/dbtree/root.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dbtree/root.cpp b/src/dbtree/root.cpp index c196c7a6c..2bac8e420 100644 --- a/src/dbtree/root.cpp +++ b/src/dbtree/root.cpp @@ -703,15 +703,15 @@ bool Root::set_board( const std::string& url, const std::string& name, const std // 移転チェック BoardBase* board = nullptr; - const int stat = is_moved( root, path_board, name, &board, etc ); + const int state = is_moved( root, path_board, name, &board, etc ); #ifdef _SHOW_BOARD std::cout << "root = " << root << " path_board = " << path_board - << " basicauth = " << basicauth <<" type = " << type << " stat = " << stat << std::endl; + << " basicauth = " << basicauth <<" type = " << type << " state = " << state << std::endl; #endif // 新板登録 - if( stat == BOARD_NEW ){ + if( state == BOARD_NEW ){ auto uniq = DBTREE::BoardFactory( type, root, path_board, name, basicauth ); if( uniq ){ @@ -722,7 +722,7 @@ bool Root::set_board( const std::string& url, const std::string& name, const std } // 移転処理 - else if( stat == BOARD_MOVED ){ + else if( state == BOARD_MOVED ){ // XML解析中に、 //