Thanks for merging this fix. It's been a while, but I don't remember having any problems with the patch when I was testing it.
Is there a way to handle conflicting recommendations when using multiple --libraries where one should override another? I include both posix.cfg and gnu.cfg, since Linux is my primary platform; gnu.cfg is not a superset of posix.cfg, so I would be missing out on potential warnings if I just include gnu.cfg. The readdir warning makes sense for posix.cfg, since readdir() is not thread-safe in the current POSIX specification, but when using glibc 2.24 or later, readdir_r() is marked as deprecated in...
👍 I have another potential ticket for you, but I'll create a new thread for it since it is completely unrelated to this one. :)
I am new to cppcheck, and was surprised to find that this code generates a warning: #include <map> int main() { std::map<char const*, int> m{ {"a", 1} }; if (auto iter = m.find("x"); iter != m.end()) { return iter->second; } return 0; } To reproduce the warning, use cppcheck --enable=all --std=c++17 <filename>.cpp. Using the latest git head (2a4b28c267059b5520f47f528a67f903d910f2df), I get: [if-init.cpp:6]: (warning) Suspicious condition. The result of find() is an iterator, but it is not properly...
Untested fix for the wizard's eye spell: diff --git a/exult.cc b/exult.cc index 6977cd7a..37905113 100644 --- a/exult.cc +++ b/exult.cc @@ -2053,6 +2053,7 @@ void Wizard_eye( uint32 last_repaint = 0; // For insuring animation repaints. uint32 stop_time = SDL_GetTicks() + msecs; bool timeout = false; + bool window_grab_enabled = false; while (!timeout) { Delay(); // Wait a fraction of a second. @@ -2091,8 +2092,18 @@ void Wizard_eye( int ms = SDL_GetMouseState(&x, &y); int mx, my; gwin->get_win()->screen_to_game(x,...
Untested fix for the wizard's eye spell: diff --git a/exult.cc b/exult.cc index 6977cd7a..64afc801 100644 --- a/exult.cc +++ b/exult.cc @@ -2053,6 +2053,7 @@ void Wizard_eye( uint32 last_repaint = 0; // For insuring animation repaints. uint32 stop_time = SDL_GetTicks() + msecs; bool timeout = false; + bool window_grab_enabled = false; while (!timeout) { Delay(); // Wait a fraction of a second. @@ -2091,8 +2092,18 @@ void Wizard_eye( int ms = SDL_GetMouseState(&x, &y); int mx, my; gwin->get_win()->screen_to_game(x,...
Thanks for the tip regarding Wizard_eye. Don't remember ever using that spell, so I was not aware. :) Btw, the patch I attached when I created this ticket also patches MenuList::handle_events(), even though that's not a place where you would normally need this fix. The only reason I patched that method was to get a faster edit-compile-test loop (no need to launch the game and load a save, just test it immediately after starting Exult).
Suggested fix for broken mouse behavior in latest Exult