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

build: fix level 1 msvc warnings #1295

Merged
merged 1 commit into from
Nov 19, 2023
Merged

Conversation

invertego
Copy link
Contributor

Level 1 warnings are considered "severe" and, unsurprisingly, turning them on revealed some true bugs.

  • file-buffer.hpp: What should have been a zero extend followed by a complement was instead a complement followed by a zero extend, inadvertently truncating the file seek offset to 32 bits.
  • file-map.cpp: What should have been a nullptr check after CreateFileMapping() was instead a check for INVALID_HANDLE_VALUE. The warning pointing me toward this was not technically about the misuse but rather the redefinition of INVALID_HANDLE_VALUE in nall. I've removed this and any reference to INVALID_HANDLE_VALUE except for error checks immediately after calls to the few APIs that return it.

Level 1 warnings are considered "severe" and, unsurprisingly, turning
them on revealed some true bugs.

- file-buffer.hpp: What should have been a zero extend followed by a
  complement was instead a complement followed by a zero extend,
  inadvertently truncating the file seek offset to 32 bits.
- file-map.cpp: What should have been a nullptr check after
  CreateFileMapping() was instead a check for INVALID_HANDLE_VALUE. The
  warning pointing me toward this was not technically about the misuse
  but rather the redefinition of INVALID_HANDLE_VALUE in nall. I've
  removed this and any reference to INVALID_HANDLE_VALUE except for
  error checks immediately after calls to the few APIs that return it.
@LukeUsher LukeUsher merged commit 7faebad into ares-emulator:master Nov 19, 2023
3 checks passed
@invertego invertego deleted the msvc_w1 branch November 24, 2023 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants