-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Fix error in FindScreenOfXY #1073
Conversation
With this change, can we ever get into a situation where In which case, I'd probably set m_min to NULL initially and make it a fatal error if it's still NULL before we return from the function. |
No, there shouldn't be any case that |
af64974
to
fa90346
Compare
By fatal error, do you just mean return the NULL and let things break? That is what I assumed. |
fa90346
to
d65d852
Compare
I guess since integers will overflow and become negative, the only way |
@ThomasAdam One more thing, I just took this from the previous code, but |
Perhaps something like this:
Note that this isn't on top of this PR, but you get the idea... |
d65d852
to
530ee7c
Compare
I also noticed I need to skip the global monitor. Note I didn't also test that monitor_get_count() > 0, is this something that could happen? I assumed if we have only a single monitor, that equals the global monitor, and that should match every XY position provided, and thus we wouldn't get to this step. |
Right... you should just be able to do:
You're right though -- no need to check |
In the previous commit, I defined the m_min variable both inside and outside of an if block (forgot to delete the inside one). So delete the extra definition. Also set m_min to NULL to suppress complier warnings. m_min should always be found, so exit if not.
530ee7c
to
ff93241
Compare
I can't see anything else which needs changing. Will merge... |
In the previous commit, I defined the m_min variable both inside and outside of an if block (forgot to delete the inside one). So delete the extra definition. Also set m_min to the old return of RB_MIN just in case (this also suppresses warnings from my compiler).