CI updates and minor cleanups.

This commit is contained in:
Markus F.X.J. Oberhumer
2023-12-02 01:48:26 +01:00
parent 67564513d2
commit 1e6e4043ed
11 changed files with 39 additions and 34 deletions
+18 -18
View File
@@ -753,6 +753,24 @@ inline unsigned UPX_MIN(const LE32 &a, unsigned b) { return UPX_MIN(unsigned(a),
// misc support
**************************************************************************/
// <type_traits> upx_is_integral; see conf.h
#define TT_UPX_IS_INTEGRAL(T) \
template <> \
struct upx_is_integral<T> : public std::true_type {}; \
template <> \
struct upx_is_integral<const T> : public std::true_type {}; \
template <> \
struct upx_is_integral<volatile T> : public std::true_type {}; \
template <> \
struct upx_is_integral<const volatile T> : public std::true_type {}
TT_UPX_IS_INTEGRAL(BE16);
TT_UPX_IS_INTEGRAL(BE32);
TT_UPX_IS_INTEGRAL(BE64);
TT_UPX_IS_INTEGRAL(LE16);
TT_UPX_IS_INTEGRAL(LE32);
TT_UPX_IS_INTEGRAL(LE64);
#undef TT_UPX_IS_INTEGRAL
// native types
#if (ACC_ABI_BIG_ENDIAN)
typedef BE16 NE16;
@@ -776,24 +794,6 @@ typedef LE64 NE64;
#define ne64_compare_signed le64_compare_signed
#endif
// <type_traits> upx_is_integral
#define TT_IS_INTEGRAL(T) \
template <> \
struct upx_is_integral<T> : public std::true_type {}; \
template <> \
struct upx_is_integral<const T> : public std::true_type {}; \
template <> \
struct upx_is_integral<volatile T> : public std::true_type {}; \
template <> \
struct upx_is_integral<const volatile T> : public std::true_type {}
TT_IS_INTEGRAL(BE16);
TT_IS_INTEGRAL(BE32);
TT_IS_INTEGRAL(BE64);
TT_IS_INTEGRAL(LE16);
TT_IS_INTEGRAL(LE32);
TT_IS_INTEGRAL(LE64);
#undef TT_IS_INTEGRAL
// for use with qsort()
extern "C" {
int __acc_cdecl_qsort be16_compare(const void *, const void *);
+2 -1
View File
@@ -138,7 +138,8 @@ PackerBase *PackMaster::visitAllPackers(visit_func_t func, InputFile *f, const O
void *user) may_throw {
#define D(Klass) \
do { \
COMPILE_TIME_ASSERT(std::is_nothrow_destructible_v<Klass>) \
static_assert(std::is_class_v<Klass>); \
static_assert(std::is_nothrow_destructible_v<Klass>); \
auto pb = std::unique_ptr<PackerBase>(new Klass(f)); \
if (o->debug.debug_level) \
fprintf(stderr, "visitAllPackers: (ver=%d, fmt=%3d) %s\n", pb->getVersion(), \
+2 -1
View File
@@ -686,7 +686,8 @@ const LE32 &PeFile::IDADDR(unsigned x) const { return iddirs[x].vaddr; }
*/
class PeFile::ImportLinker final : public ElfLinkerAMD64 {
struct TStr final : private ::noncopyable { // temporary string owner, deletes on destruction
// temporary string owner, deletes on destruction
struct TStr final : private upx::noncopyable {
explicit TStr(char *str) noexcept : s(str) {}
~TStr() noexcept { delete[] s; } // delete!
operator char *() noexcept { return s; }
+1 -1
View File
@@ -383,7 +383,7 @@ protected:
};
class Reloc final : private noncopyable {
// these are set in constructor
// these are set in the constructor:
byte *start = nullptr;
unsigned start_size_in_bytes = 0;
bool start_did_alloc = false;
+3 -2
View File
@@ -67,7 +67,7 @@
namespace {
struct XStat {
struct XStat final {
struct stat st;
#if USE_SETFILETIME
FILETIME ft_atime;
@@ -307,8 +307,9 @@ void do_one_file(const char *const iname, char *const oname) may_throw {
flags = get_open_flags(WO_MUST_EXIST_TRUNCATE);
copy_timestamp_only = true;
}
} else if (opt->force_overwrite || opt->force)
} else if (opt->force_overwrite || opt->force) {
flags = get_open_flags(WO_CREATE_OR_TRUNCATE);
}
int shmode = SH_DENYWR;
#if (ACC_ARCH_M68K && ACC_OS_TOS && ACC_CC_GNUC) && defined(__MINT__)
// TODO later: check current mintlib if this hack is still needed