[Patch] Erroneous configuration catch for getaint() etc.
Original Reporter info from Mantis: CuriousKit @CuriousKit
-
Reporter name: J. Gareth Moreton
Original Reporter info from Mantis: CuriousKit @CuriousKit
- Reporter name: J. Gareth Moreton
Description:
This patch cleans up the case blocks for getaint() and similar methods in TEntryFile. The result used to be set to 0 or even 4 (it's meant to be a generic integer, not a size) if the size is not an expected value of 1, 2, 4 or 8. Now, there is an "else" section in the case blocks that set the error flag, thus providing a potential performance boost since the result isn't set twice (it was set to the weird default value first, then the size-specific one) and optimisation via constant propagation and removing case branches that will never get executed.
Steps to reproduce:
Apply patch and confirm identical behaviour and the smallest of performance gains.
Additional information:
Ideally, the else block should call InternalError, and these statements exist in the patch, albeit commented out. Unfortunately, the PPUDump tool uses entfile and if the "verbose" unit (which defines "InternalError") is used, the utility fails to compile as part of the "make all" process.
Mantis conversion info:
- Mantis ID: 35409
- OS: Microsoft Windows
- OS Build: 10 Professional
- Build: r41892
- Platform: Cross-platform
- Version: 3.3.1
- Fixed in revision: 41896 (#ec76e879)
- Target version: 3.3.1