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

Rename local variable to avoid shadowing #349

Merged
merged 6 commits into from
Jun 20, 2020

Commits on Jun 20, 2020

  1. BBSListViewBase: Rename local variable to avoid shadowing

    ローカル変数の名前がシャドウイングされているとcppcheckに指摘されたため
    外側のスコープの名前を変更します。
    
    cppcheckのレポート
    ```
    src/bbslist/bbslistviewbase.cpp:2539:23: style: Local variable 'path' shadows outer variable [shadowVariable]
            Gtk::TreePath path = GET_PATH( row );
                          ^
    src/bbslist/bbslistviewbase.cpp:2526:19: note: Shadowed declaration
        Gtk::TreePath path = m_treeview.get_current_path();
                      ^
    src/bbslist/bbslistviewbase.cpp:2539:23: note: Shadow variable
            Gtk::TreePath path = GET_PATH( row );
                          ^
    ```
    ma8ma committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    65562a5 View commit details
    Browse the repository at this point in the history
  2. CONTROL: Rename local variable to avoid shadowing

    ローカル変数の名前がシャドウイングされているとcppcheckに指摘されたため
    内側のスコープの名前を変更します。
    
    cppcheckのレポート
    ```
    src/control/controlutil.cpp:214:29: style: Local variable 'label' shadows outer variable [shadowVariable]
                    Gtk::Label *label = Gtk::manage( new Gtk::Label( str_label + ( str_motions.empty() ? "" : "  " ), true ) );
                                ^
    src/control/controlutil.cpp:198:21: note: Shadowed declaration
            auto* const label = dynamic_cast< Gtk::Label* >( item->get_child() );
                        ^
    src/control/controlutil.cpp:214:29: note: Shadow variable
                    Gtk::Label *label = Gtk::manage( new Gtk::Label( str_label + ( str_motions.empty() ? "" : "  " ), true ) );
                                ^
    ```
    ma8ma committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    8b2af32 View commit details
    Browse the repository at this point in the history
  3. DrawAreaBase: Rename local variable to avoid shadowing

    ローカル変数の名前がシャドウイングされているとcppcheckに指摘されたため
    内側のスコープの名前を変更します。
    
    cppcheckのレポート
    ```
    src/article/drawareabase.cpp:3619:24: style: Local variable 'caret_pos' shadows outer variable [shadowVariable]
            CARET_POSITION caret_pos;
                           ^
    src/article/drawareabase.cpp:3441:20: note: Shadowed declaration
        CARET_POSITION caret_pos;
                       ^
    src/article/drawareabase.cpp:3619:24: note: Shadow variable
            CARET_POSITION caret_pos;
                           ^
    ```
    ma8ma committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    446f8fc View commit details
    Browse the repository at this point in the history
  4. History_Manager: Rename local variable to avoid shadowing

    ローカル変数の名前がシャドウイングされているとcppcheckに指摘されたため
    内側のスコープの名前を変更します。
    
    cppcheckのレポート
    ```
    src/history/historymanager.cpp:258:23: style: Local variable 'type' shadows outer variable [shadowVariable]
                const int type = XML::get_type( histitem->nodeName() );
                          ^
    src/history/historymanager.cpp:234:19: note: Shadowed declaration
            const int type = XML::get_type( subdir->nodeName() );
                      ^
    src/history/historymanager.cpp:258:23: note: Shadow variable
                const int type = XML::get_type( histitem->nodeName() );
                          ^
    ```
    ma8ma committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    6e760bd View commit details
    Browse the repository at this point in the history
  5. Post: Rename local variable to avoid shadowing

    ローカル変数の名前がシャドウイングされているとcppcheckに指摘されたため
    内側のスコープの名前を変更します。
    
    cppcheckのレポート
    ```
    src/message/post.cpp:434:23: style: Local variable 'ret' shadows outer variable [shadowVariable]
                const int ret = mdiag.run();
                          ^
    src/message/post.cpp:283:10: note: Shadowed declaration
        bool ret;
             ^
    src/message/post.cpp:434:23: note: Shadow variable
                const int ret = mdiag.run();
                          ^
    ```
    ma8ma committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    4085364 View commit details
    Browse the repository at this point in the history
  6. EditTreeView: Rename local variables to avoid shadowing

    ローカル変数の名前がシャドウイングされているとcppcheckに指摘されたため
    名前を変更します。
    
    cppcheckのレポート
    ```
    src/skeleton/edittreeview.cpp:1210:20: style: Local variable 'dir' shadows outer variable [shadowVariable]
            const bool dir = false;
                       ^
    src/skeleton/edittreeview.cpp:1195:16: note: Shadowed declaration
        const bool dir = true;
                   ^
    src/skeleton/edittreeview.cpp:1210:20: note: Shadow variable
            const bool dir = false;
                       ^
    ```
    ma8ma committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    6a7a919 View commit details
    Browse the repository at this point in the history