Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Root: Rename local variable to avoid shadow function #879

Merged

Conversation

ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Dec 18, 2021

ローカル変数の名前が関数をシャドーイングしていると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 );
              ^

関連のpull request: #865

ローカル変数の名前が関数をシャドーイングしていると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 );
              ^
```
@ma8ma ma8ma added the refactoring コードの整理 (バグ修正でも機能変更でもない) label Dec 18, 2021
@ma8ma ma8ma added this to In progress in State of JDim-v0.6.0+ via automation Dec 18, 2021
@ma8ma ma8ma merged commit 1897322 into JDimproved:master Dec 18, 2021
State of JDim-v0.6.0+ automation moved this from In progress to Done Dec 18, 2021
@ma8ma ma8ma deleted the root-rename-local-var-to-avoid-shadowing branch December 18, 2021 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring コードの整理 (バグ修正でも機能変更でもない)
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

1 participant