all: pacify clang-tidy, CI and cmake updates

This commit is contained in:
Markus F.X.J. Oberhumer
2024-02-14 15:14:47 +01:00
parent be44cefbe7
commit fdcdaf596a
9 changed files with 44 additions and 7 deletions
+2 -2
View File
@@ -261,8 +261,8 @@ struct Z2_X2 : public X2 {
**************************************************************************/
TEST_CASE("Deleter") {
LE16 *o = {}; // object
LE32 *a = {}; // array
LE16 *o = nullptr; // object
LE32 *a = nullptr; // array
{
const upx::ObjectDeleter<LE16 **> o_deleter{&o, 1};
o = new LE16;
+1
View File
@@ -1239,6 +1239,7 @@ void PeFile::Export::build(char *newbase, unsigned newoffs) {
edir.addrtable = newoffs + ptr_diff_bytes(functionp, newbase);
edir.ordinaltable = newoffs + ptr_diff_bytes(ordinalp, newbase);
assert(ordinals != nullptr); // pacify clang-tidy
memcpy(ordinalp, ordinals, 2 * edir.names);
edir.name = newoffs + ptr_diff_bytes(enamep, newbase);
+1 -1
View File
@@ -179,7 +179,7 @@ forceinline Result ptr_static_cast(const From *ptr) noexcept {
return static_cast<Result>(static_cast<const void *>(ptr));
}
// helper classes so we don't leak memory on exceptions
// helper classes so we don't leak memory on exceptions; NOT thread-safe
template <class T> // T is "Type **"
struct ObjectDeleter final {
static_assert(std::is_pointer_v<T>);