Age | Commit message (Collapse) | Author |
|
|
|
|
|
This is deliberate because the byte-ordering of the bit-view's data cannot
be assumed. For example, the byte ordering of a 16-bit register populated
within a DOS emulator will be little-endian, even when running on a
big-endian host, where as native data types on big-endian hardware will be
big-endian.
|
|
This new "libmisc_stubs_dep" provides a stand-alone libmisc
with all (other misc) functions supported, however without
requiring even more DOSBox libs to satisfy all the symbols.
|
|
|
|
|
|
This cleanups a handful of "empty table" warnings generated
by ranlib on macos.
|
|
When adding the random generator to the test cases, VisualStudio indicated
that their random distribution type can only go down to 16-bit:
"C:\Program Files\Microsoft Visual
Studio\2022\Enterprise\VC\Tools\MSVC\14.29.30133\include\random(1839,5):
error C2338: note: char, signed char, unsigned char, char8_t, int8_t, and
uint8_t are not allowed"
|
|
|
|
|
|
|
|
This is part of larger piece of work of getting rid of "kitchen sink"
style utility/helper files.
|
|
|
|
Also, colors now need to be specified using 8-bit components (just like
in CSS and HTML).
|
|
|
|
|
|
The majority of people building Staging want release builds without
complications due to system libraries. This includes users on windows
using MSYS2, Raspberry Pi users (via RetroPie), macOS users, and Linux
users with OSes that might be very new or slightly out-of-date.
Packagers can configure meson to use shared libraries and not fallback
to wraps, and additionally ask to have specific libraries provided
from the system using -Duse_system_libs=lib1,lib2, instead of wraps.
|
|
Flagged by Coverity:
The source buffer may be a string larger than the destination buffer, causing
buffer overflow.
In DOS_FCBOpen(unsigned short, unsigned short): Size of destination buffer is
smaller than the size of the source buffer (CWE-120)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Changed on the advice given by @LowLevelMahn
|
|
|
|
|
|
|
|
|
|
Fixes a warning from MSYS2 clang:
warning: definition of implicit copy constructor is deprecated
because it has a user-provided copy assignment operator
[-Wdeprecated-copy-with-user-provided-copy].
In this case, we now provide a matching user-provide copy
constructor to go along with the same type handled in the
copy assignment operator.
|
|
"bit_view" is a better description for how the class
operates given it's a "view" of the bits held in the the
underlying storage.
This is meant to be similar to "string_view", which is
also a similar "functional wrapper" around the underlying
char* data.
---
The author of the BitField class also describes it like
this:
Q. How do you ensure all the bitfields are usable? Because
inherently, union will only use the max size member.
You will not be able to see unique data for other
members, if one is assigned a value, it will be the
value for all other members.
A. Remember that this isn't actually using bit-fields, but
is emulating the effect of them. The "bits" are just a
"view" into the underlying storage. Changing one is
intended to be reflected in both.
---
Other changes:
- Use lower-case types and name similar to 'string_view',
given there's nothing DOSBox-specific about it. This
makes it feel more like "standard plumbing", and
indeed, anyone can take this class into other projects
- Add compile-time asserts to catch index and width
issues
- Make all functionality constexpr (compile-time
evaluation)
- Add unit tests for all functions
- Fix decrement bug caught in unit tests
- Fix comparison bugs caught in unit tests
- Drop single-bit template specialization. A bit_view
with a size of 1 is already known and optimized at
compile-time now using "constexpr"
- Remove the bool cast operators in favour of exact
value operator, which are clearer to understand
- Add member functions from bitops:
- clear(): sets bits to zero
- flip(): flip bits
- none(): check if all bits are unset
- any(): check if at least one bit is set
- all(): check if all bits are set
- Add comments
- License as GPL v2+ (from public domain), given all
lines have changed. Credit and thanks given to Evan
Teran (thanks!)
|
|
|
|
|
|
|
|
|
|
|
|
Co-authored-by: kcgen <1557255+kcgen@users.noreply.github.com>
Co-authored-by: shermp <14854761+shermp@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
This reverts commit 15e106100fdf3a29c1e74ea0635f51164e4710b1.
|
|
|
|
Prevent situation when one of these dependencies is pulled from OS
repository and another one is pulled via Meson wrap.
When gtest and gmock are incompatible, it might result in compilation
issues, or even worse: false negative test results.
|
|
Bit operations can often be done in different ways:
- one based bits? (not recommended, industy uses zero-based)
- zero based bits? (recommended, but many unaware of this)
- hex numbers? (common, but hard to read for multi-bits)
- binary-literals? (gets massive and unreadable for larger
bit depth: so then need to pick a different
style leading to inconsistencies)
- decimals? (confusion with counter and purpose)
- on-the-fly conversion (1 << 4) (OK, but visually messy)
this attempts to standardize these operations and also make
the code more self-documenting.
The functions are "const-correct", and all can be evaluated
at compile-time when literals are used.
|
|
Bit operations can often be done in different ways:
- one based bits? (not recommended, industy uses zero-based)
- zero based bits? (recommended, but many unaware of this)
- hex numbers? (common, but hard to read for multi-bits)
- binary-literals? (gets massive and unreadable for larger
bit depth: so then need to pick a different
style leading to inconsistencies)
- decimals? (confusion with counter and purpose)
- on-the-fly conversion (1 << 4) (OK, but visually messy)
this attempts to standardize these operations and also make
the code more self-documenting.
The functions are "const-correct", and all can be evaluated
at compile-time when literals are used.
|
|
|
|
|