Users, who try to compile keep tripping over it, despite documentation
in the INSTALL file. Also, autoconf-archive might be hard to install
for users, who opted not to use MSYS2 and stick to MinGW only.
This commit bundles macros:
AX_CXX_COMPILE_STDCXX (version/serial 10)
AX_CXX_COMPILE_STDCXX_11 (version/serial 18)
MSVC replaced its own non-standard implementation of stricmp with
ISO-compliant _stricmp, and issues a security warnings when old name is
used.
This tiny redefine solves 129 warnings in Visual Studio 2019.
There are two functions: one for handling EGA and VGA machines, and
"other" handling all remaining cases. This makes it somewhat clear which
cases should be handled where.
M_TANDY16 seems incorrectly handled in 2 places; this patch decides not
preserve existing behaviour (and adds TODOs). Runtime behaviour changed
only for debug builds.
This way we prevent pointless dynamic_cast; correct usage of
dynamic_cast requires a nullcheck, which was missing in this case
causing Coverity to complain.
Instead of changing cast, let's make this method a virtual one in base
class - this way we could reuse it in future for cases outside of CD-ROM
(e.g. write-protected floppies).
Coverity finds use after free on value pointed by sample_list, but fails
to detect, that this is a global variable, that is being updated by
Sound_FreeSample before freeing any memory.
This code is obviously written with the purpose of freeing whole list,
so there's nothing unexpected here - this is definitely a false
positive finding.
We could mark this issue as false-positive in Coverity, but I think it's
better to avoid tripping it in the first place.
PVS-Studio is a tool for detecting bugs and security weaknesses in the
source code of programs, written in C, C++, C# and Java. It works under
64-bit systems in Windows, Linux and macOS environments, and can analyze
source code intended for 32-bit, 64-bit and embedded ARM platforms.
https://www.viva64.com/en/pvs-studio/
It's very easy to setup and run headless on Linux; although on Windows I
couldn't find instruction describing how to automate the install.
It quickly generates a relatively unique set of issues versus those
reported by Clang's and Coverity's checkers, so it's valuable in that
regard.
Output can be customized in various formats (stdout, gcc-error format,
or HTML), and it produces a nice summary of results that (for a later PR)
we can capture and compare against a maximum warning count similar
to our other checkers.
This PR generates a full HTML report with embedded source snippets,
which are uploaded as a zipped asset.
Break lines in descriptions, so that generated .conf file have at most
~80 columns, making it easier to read. This change is made only in
sblaster section.
This removes the last warnings in this area; in this case changing endianess
is not used for accessing emulated memory, just to flip few values to
low endian for storage.
This merge had serious conflicts; some of changes could be applied, but
others needed to be removed.
- Code for new SETMODE_RESTARTS_SUBSYSTEM was removed, as it depends on
SDL 1.2 functionality (SDL_SetVideoMode) and seems rather pointless
for SDL 2.0.
- Support for setting windowresolution as a percentage was retained, but
window centering of this feature likely won't work, as it depends on
SDL 1.2 env variable SDL_VIDEO_CENTERED.
- Support for applying windowresolution as a percentage was removed, as
it was implemented purely in code removed during transition to
SDL 2.0.
GitHub's ongoing issue of limitting the cache size has recently
been fixed (https://github.com/actions/cache/issues/6), so this
PR create a combined Clang+GCC cache for separate 32-bit and 64-bit
architectures under Windows.
When using C++11 code that can possibly throw exceptions (such as
std::make_shared(...) linking libstdc++.a using Clang on MSYS2
will generate errors such as:
libstdc++.a(eh_personality.o): duplicate section
`.rdata$_ZTSSt9exception[_ZTSSt9exception]' has different size
Although potential suggested fixes involve allowing duplicate symbols,
-Wl,--allow-multiple-definition, this solution can introduce unexpected
behavior when one symbol clobbers another symbol.
To solve this, switching to dynamic linking of the libstdc++ library
appears to be all that's needed.
Unmounting single binary-file CDROM images would result in a
crash as flagged by @dreamer_ in issue #112, who noted that
multiple tracks point to the same TrackFile (track.file field).
During destruction, the pre-C++11 code used a temporary
`TrackFile* last` variable to store the currently deleted
track.file's value and only delete the next track.file if it's
not equal to `last`. The result of this is that only the
first-encountered track.file was deleted and all subsequent
and back-to-back duplicate track.file values were left as-is.
This commit replaces the Track object's 'file' member pointer
with a shared_ptr, which effectively does the same thing by
only deleting the last reference.
The shared_ptr simplifies some error-cases where we previously
had to delete the Track.file allocation, but can now simply
let the Track object go out-of-scope and let the shared_ptr
delete it's managed object (if it has one).
Also re-order to perform shellcheck first because it
requires the least installation work compared to pylint
and markdownlint. The reason being if we're going to fail
during shellcheck, then we fail faster (and leave heavier
tasks for further down the line).
Add way to restart graphics subsystem on fullscreen/windowed mode transitions in OpenGL mode (disabled by default)
Add check for pixels being valid in OpenGL to prevent direct crash when the allocation fails.
Add define to turn off Pixel Buffer Object usage. (disabled by default)
Add a way to specify the windowresolution as percentage of your current resolution. (This centers the window.)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4306
Judging by the usage, this header belongs in there instead of being
limited to dos module only. This change makes it easier to reuse code
for new features related to drives mounting/unmounting.
The single use from friended class is in public interface. Removal of
friend designators allows Clang to pinpoint few additional unused
private fields.
Use the exact formatting suggested in COPYING file.
This change is basically a pretext to trigger a new clean build in
order to check if Coverity is capable of accepting new builds for
analysis finally.