fmt::format() worked on my main system, but on Xubuntu 16.04, it didn't
work because the fmt headers aren't included:
src/kde/xattr/Ext2AttrView.cpp: In member function ‘void Ext2AttrViewPrivate::retranslateUi_nonDesigner()’:
src/kde/xattr/Ext2AttrView.cpp:94:13: error: ‘fmt’ has not been declared
s_label = fmt::format(FRUN(s_lsattr_fmt), p->lsattr_chr,
^
src/kde/xattr/Ext2AttrView.cpp:94:42: error: ‘FRUN’ was not declared in this scope
s_label = fmt::format(FRUN(s_lsattr_fmt), p->lsattr_chr,
^
We're not linking to fmt in the XAttrView plugin, so use QString::arg()
instead. (I'm guessing CMake auto-magically linked to fmt because
libromdata links to it...)
NOTE: The debug build still links to libfmt-11.so (and a bunch of other
libraries that aren't actually needed). The release build no longer links
to libfmt-11.so. I'm guessing CMake is skipping .so trimming in the debug
builds in order to save time.
This doesn't affect the compiled output, but it's needed by gcc-5.4
in order to be marked as constexpr.
The uninitialized union *is* allowed as of C++20, supported in
gcc-10.1 and later.
Also, put 'd' first so the whole DWORD is initialized instead of just
one 16-bit WORD.
This doesn't affect the compiled output, but it's needed by gcc-5.4
in order to be marked as constexpr.
The uninitialized union *is* allowed as of C++20, supported in
gcc-10.1 and later.
aflplusplus, and the debug version of rpcli, was hanging on some fuzzed
XEXes with ~4 GB headers because the debug version of std::vector<> was
initializing each byte, one at a time.
Headers shouldn't be that big, but we'll go with a maximum of 16 MB
just in case.
Found using aflplusplus-4.32c.
This cleans up the code a bit, but does increase the .o size due to the
use of std::string.
Code size difference: (64-bit Gentoo Linux, gcc-15.1.0, release build, no LTO)
text data bss dec hex filename
6898 8 0 6906 1afa conversion_iconv.cpp.o [before]
9780 8 0 9788 263c conversion_iconv.cpp.o [after]
+2882 0 0 +2882 +b42 Difference
- DoFile(): JSON errors should be printed to stdout, not stderr.
- _tmain(): Remove an extra newline after the `default:` case's
"skipping unknown switch" message.
Interestingly, this didn't print any warnings or errors on gcc, but on
MSVC, this warning was produced:
src\librpbase\TextOut_text.cpp(359,20): error C2220: the following warning is treated as an error
src\librpbase\TextOut_text.cpp(359,20): warning C4996: 'fmt::v11::localtime': was declared deprecated
Only 5 bits are currently used, and this reduces padding due to 64-bit
alignment in the mxh union.
Total struct size before: 9,176
Total struct size after: 9,168
Difference: -8
These functions do non-localized checks, which improves performance in
most cases (due to not need to do locale lookups) and is more "correct"
when checking ROM headers in most cases.
[rpcli] vt.cpp: Removed vt_isdigit() and vt_isalpha(). We can use
isdigit_ascii() and isalpha_ascii() instead.
[libromdata] Updated most IS*() uses to is*_ascii().
NOTE: ISPRINT() and ISSPACE() are left as-is for now.
VirtualBoy: We can mark all of the private is*() functions as
constexpr now.
vWii packages use v0 tickets and TMDs. The "content groups" doesn't
exist, nor does the FST, the system XMLs, or the TGA icons.
Skip all of these if a v0 TMD is detected.
TODO: Change the system name for v0?
Needed to enable hexpand and set xalign.
Not sure if this is needed or supported on GTK2 or GTK3, but using
gtk_box_pack_end() seems to work on the older versions anyway.
XAttrView: Set the compression algorithm in Ext2AttrView.
We're using Ext2AttrView because most Linux file systems that support
compression also support Ext2-style attributes.
Named "zAlgorithm"; will rename the XAttrReader functions next.
XAttrView: Set the compression algorithm in Ext2AttrView.
We're using Ext2AttrView because most Linux file systems that support
compression also support Ext2-style attributes.
When testing non-RomData files with `rp-stub -R`, I got random crashes.
gdb traced it back to an invalid g_bytes_unref() due to pngBytes not
being initialized properly.
This only affects the GTK4 version.
This fixes a regression from commit bc32b0c3a2.
([gtk] DragImage: Implement GTK4 drag & drop.)
Affects: v2.4 - v2.5
If supported, this will get the compression algorithm in use for
the specified file.
Currently, this is only implemented on Windows for both the read
functionality and the display functionality.
Regular NTFS compression uses LZNT1 and is indicated by the presence
of FILE_ATTRIBUTE_COMPRESSED.
Newer compression formats were added in Windows 10:
- XPRESS4K
- LZX
- XPRESS8K
- XPRESS16K
These do *not* set FILE_ATTRIBUTE_COMPRESSED, but for our purposes,
if one of these is set, the "Compressed" box will be checked.
A dropdown is shown that lists the current compression algorithm,
and all other algorithms. This might be changed to just a label
display later, unless I actually add the ability to change it later...
These are used for truecolor and 256-color formatting, which aren't
supported by the old Windows console. Skip the extra parameters so
they don't cause problems:
- truecolor (2): skip 3 extra parameters
- 256-color (5): skip 1 extra parameter
This required switching from a range-based `for` loop to a regular
index-based `for` loop, since we can't adjust the counter in a
range-based `for` loop.