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

ImageViewBase: Move local variables to inner scope to avoid shadowing #351

Merged

Conversation

ma8ma
Copy link
Collaborator

@ma8ma ma8ma commented Jun 21, 2020

ローカル変数の名前がシャドウイングされているとcppcheckに指摘されたため内側のスコープへ変数宣言を移動します。

cppcheckのレポート

src/image/imageviewbase.cpp:1200:43: style: Local variable 'tact' shadows outer variable [shadowVariable]
        Glib::RefPtr< Gtk::ToggleAction > tact = Glib::RefPtr< Gtk::ToggleAction >::cast_dynamic( act );
                                          ^
src/image/imageviewbase.cpp:1192:39: note: Shadowed declaration
    Glib::RefPtr< Gtk::ToggleAction > tact;
                                      ^
src/image/imageviewbase.cpp:1200:43: note: Shadow variable
        Glib::RefPtr< Gtk::ToggleAction > tact = Glib::RefPtr< Gtk::ToggleAction >::cast_dynamic( act );
                                          ^

ローカル変数の名前がシャドウイングされているとcppcheckに指摘されたため
内側のスコープへ変数宣言を移動します。

cppcheckのレポート
```
src/image/imageviewbase.cpp:1200:43: style: Local variable 'tact' shadows outer variable [shadowVariable]
        Glib::RefPtr< Gtk::ToggleAction > tact = Glib::RefPtr< Gtk::ToggleAction >::cast_dynamic( act );
                                          ^
src/image/imageviewbase.cpp:1192:39: note: Shadowed declaration
    Glib::RefPtr< Gtk::ToggleAction > tact;
                                      ^
src/image/imageviewbase.cpp:1200:43: note: Shadow variable
        Glib::RefPtr< Gtk::ToggleAction > tact = Glib::RefPtr< Gtk::ToggleAction >::cast_dynamic( act );
                                          ^
```
@ma8ma ma8ma added the refactoring コードの整理 (バグ修正でも機能変更でもない) label Jun 21, 2020
@ma8ma ma8ma merged commit c994454 into JDimproved:master Jun 21, 2020
@ma8ma ma8ma added this to Done in State of JDim-v0.3.0+ via automation Jun 21, 2020
@ma8ma ma8ma deleted the imageviewbase-move-local-var-to-inner-scope branch June 21, 2020 05:45
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