Avoid using reserved identifier in the global namespace

apps/launcher/datafilespage.cpp:762:12: warning: declaration uses identifier '_reloadCellsMutex', which is reserved in the global namespace [bugprone-reserved-identifier]
std::mutex _reloadCellsMutex;
           ^~~~~~~~~~~~~~~~~
           reloadCellsMutex

apps/openmw/mwgui/journalwindow.cpp:86:103: warning: declaration uses identifier '_sender', which is reserved in the global namespace [bugprone-reserved-identifier]
        void adviseButtonClick (char const * name, void (JournalWindowImpl::*Handler) (MyGUI::Widget* _sender))
                                                                                                      ^~~~~~~
                                                                                                      sender

apps/openmw/mwgui/journalwindow.cpp:92:100: warning: declaration uses identifier '_sender', which is reserved in the global namespace [bugprone-reserved-identifier]
        void adviseKeyPress (char const * name, void (JournalWindowImpl::*Handler) (MyGUI::Widget* _sender, MyGUI::KeyCode key, MyGUI::Char character))
                                                                                                   ^~~~~~~
                                                                                                   sender
LTO-timing^2
elsid 3 years ago
parent 72bda2bd10
commit 4ecee2e167
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -759,13 +759,13 @@ void Launcher::DataFilesPage::slotAddonDataChanged()
} }
// Mutex lock to run reloadCells synchronously. // Mutex lock to run reloadCells synchronously.
std::mutex _reloadCellsMutex; static std::mutex reloadCellsMutex;
void Launcher::DataFilesPage::reloadCells(QStringList selectedFiles) void Launcher::DataFilesPage::reloadCells(QStringList selectedFiles)
{ {
// Use a mutex lock so that we can prevent two threads from executing the rest of this code at the same time // Use a mutex lock so that we can prevent two threads from executing the rest of this code at the same time
// Based on https://stackoverflow.com/a/5429695/531762 // Based on https://stackoverflow.com/a/5429695/531762
std::unique_lock<std::mutex> lock(_reloadCellsMutex); std::unique_lock<std::mutex> lock(reloadCellsMutex);
// The following code will run only if there is not another thread currently running it // The following code will run only if there is not another thread currently running it
CellNameLoader cellNameLoader; CellNameLoader cellNameLoader;

@ -83,16 +83,16 @@ namespace
setVisible (visible); setVisible (visible);
} }
void adviseButtonClick (char const * name, void (JournalWindowImpl::*Handler) (MyGUI::Widget* _sender)) void adviseButtonClick (char const * name, void (JournalWindowImpl::*handler)(MyGUI::Widget*))
{ {
getWidget <MyGUI::Widget> (name) -> getWidget <MyGUI::Widget> (name) ->
eventMouseButtonClick += newDelegate(this, Handler); eventMouseButtonClick += newDelegate(this, handler);
} }
void adviseKeyPress (char const * name, void (JournalWindowImpl::*Handler) (MyGUI::Widget* _sender, MyGUI::KeyCode key, MyGUI::Char character)) void adviseKeyPress (char const * name, void (JournalWindowImpl::*handler)(MyGUI::Widget*, MyGUI::KeyCode, MyGUI::Char))
{ {
getWidget <MyGUI::Widget> (name) -> getWidget <MyGUI::Widget> (name) ->
eventKeyButtonPressed += newDelegate(this, Handler); eventKeyButtonPressed += newDelegate(this, handler);
} }
MWGui::BookPage* getPage (char const * name) MWGui::BookPage* getPage (char const * name)

Loading…
Cancel
Save