Fixes V576 warning from PVS-Studio - in this case PVS is somewhat
pedantic, as it warns about printf'ing of malloc'ed memory and risk the
associated problems in OOM situations.
In this case it can be a problem, as LOG_MSG aka GFX_ShowMsg
allocates memory during printing in result an error message could cause
stack overflow, although it's extremely unlikely on modern OSes.
Avoid triggering this warning by using memory-safe container and using
C++11 data() accessor to vector internal buffer; in case of OOM
situation, stack will be unrolled and program should exit with nice
error message.
This is a small issue pointed out by Coverity; this variable might be
later used uninitialized in several places.
Making this change to test if Coverity updates report summary only after
the numbers actually changed (we just had fresh scan, but Coverity keeps
showing summary from few days ago).
Revisions 4314 and 4315 were reverted:
- r4314 introduced several technical issues; keeping it away from
the master branch until some improvements will land in SVN.
- r4315 touches code related to overlay, which was completely removed when
porting to SDL2; this revert makes future merge commit cleaner.
This function uses its boolean return code to indicate success
or failure, which all callers check prior to using any of the
referenced arguments. Therefore it's unecessary to zero-out
referenced arguments or use intermediate variables.
The specification says that legal track values range from 1 to 99,
where as the prior code would return 0 if any issue was encountered.
The spec has no allowance for issues in this function, and therefore
we're bound to simply return 1 instead.
For example, audio CD players will typically position themselves in
preparation to play the first audio track when "Play" is pushed.
This even occurs for mixed-mode CDs, where the player will start
playing at the first audio track. Therefore, we try to find the most
viable audio track and only fall back to defaults if needed.
(instead of "all zeros" like before).
With types refined, we can switch to cleaner integer
math and avoid casting (to float and back to ints), and also
avoid ceil((float) a / b) by using the pure-integer form
of (a + b - 1) / b
This is simplified by no longer retaining the read position,
which is unecessary because all read operations are offset
from an initial absolute position (so this was unecessary code).
Bitu (aka uintptr_t) is not necessary for handling shortened files,
as we can represent max 10^7 shortened files anyway; unsigned is good
enough.
This allows use to use simple %u for conversion instead of PRIuPTR,
which caused a bug on AmigaOS on PPC.
Fixes: #162
Class DOS_Drive_Cache is declared in dos_system.h, but this header was
indirectly included. Remove faulty windows.h include (the correct one
exists in cross.h already).
A number of "templated" scaler implementations are unused in the
implementation. If any single one of them needs to be brought back
(unlikely), then it's a simple matter of removing an ifdef.
These templates turn off compilation of following scaler
implementations:
void Normal1x_9_8_L(const void*)
void Normal1x_9_8_R(const void*)
void Normal2x_9_8_L(const void*)
void Normal2x_9_8_R(const void*)
void Normal3x_9_8_L(const void*)
void Normal3x_9_8_R(const void*)
void NormalDw_9_8_L(const void*)
void NormalDw_9_8_R(const void*)
void NormalDh_9_8_L(const void*)
void NormalDh_9_8_R(const void*)
void HQ2x_15_L()
void HQ2x_15_R()
void HQ3x_15_L()
void HQ3x_15_R()
void Super2xSaI_15_L()
void Super2xSaI_15_R()
void SuperEagle_15_L()
void SuperEagle_15_R()
void _2xSaI_15_L()
void _2xSaI_15_R()
void AdvMame2x_15_L()
void AdvMame2x_15_R()
void AdvMame3x_15_L()
void AdvMame3x_15_R()
void Cache_9_8(const void*)