CI updates and minor cleanups
This commit is contained in:
+1
-1
@@ -96,7 +96,7 @@ ifeq ($(shell uname),Linux)
|
||||
CLANG_FORMAT_EXCLUDE_FILES += miniacc.h stub/%.h
|
||||
CLANG_FORMAT_EXCLUDE_FILES += p_elf.h p_elf_enum.h p_lx_% p_mach% p_unix% p_vmlin%
|
||||
CLANG_FORMAT_FILES := $(sort $(wildcard *.[ch]* ../maint/src/*.[ch]* */*.[ch]*))
|
||||
CLANG_FORMAT_FILES += stub/tools/armpe/armpe_tester.c
|
||||
CLANG_FORMAT_FILES += $(sort $(wildcard stub/tools/*/*.[ch]*))
|
||||
CLANG_FORMAT_FILES := $(filter-out $(CLANG_FORMAT_EXCLUDE_FILES),$(CLANG_FORMAT_FILES))
|
||||
clang-format: PHONY $(CLANG_FORMAT_FILES)
|
||||
@echo "running upx-clang-format"
|
||||
|
||||
+33
-14
@@ -94,21 +94,40 @@ ACC_COMPILE_TIME_ASSERT_HEADER(compile_time::string_le("abc", "abz"))
|
||||
TEST_CASE("ptr_reinterpret_cast") {
|
||||
// check that we don't trigger any -Wcast-align warnings
|
||||
using upx::ptr_reinterpret_cast;
|
||||
byte *an = nullptr;
|
||||
int *in = nullptr;
|
||||
CHECK((an == ptr_reinterpret_cast<byte *>(an)));
|
||||
CHECK((an == ptr_reinterpret_cast<byte *>(in)));
|
||||
CHECK((in == ptr_reinterpret_cast<int *>(an)));
|
||||
CHECK((in == ptr_reinterpret_cast<int *>(in)));
|
||||
const byte *ac = nullptr;
|
||||
void *vp = nullptr;
|
||||
byte *bp = nullptr;
|
||||
int *ip = nullptr;
|
||||
double *dp = nullptr;
|
||||
|
||||
CHECK((vp == ptr_reinterpret_cast<void *>(vp)));
|
||||
CHECK((vp == ptr_reinterpret_cast<void *>(bp)));
|
||||
CHECK((vp == ptr_reinterpret_cast<void *>(ip)));
|
||||
CHECK((vp == ptr_reinterpret_cast<void *>(dp)));
|
||||
|
||||
CHECK((bp == ptr_reinterpret_cast<byte *>(vp)));
|
||||
CHECK((bp == ptr_reinterpret_cast<byte *>(bp)));
|
||||
CHECK((bp == ptr_reinterpret_cast<byte *>(ip)));
|
||||
CHECK((bp == ptr_reinterpret_cast<byte *>(dp)));
|
||||
|
||||
CHECK((ip == ptr_reinterpret_cast<int *>(vp)));
|
||||
CHECK((ip == ptr_reinterpret_cast<int *>(bp)));
|
||||
CHECK((ip == ptr_reinterpret_cast<int *>(ip)));
|
||||
CHECK((ip == ptr_reinterpret_cast<int *>(dp)));
|
||||
|
||||
CHECK((dp == ptr_reinterpret_cast<double *>(vp)));
|
||||
CHECK((dp == ptr_reinterpret_cast<double *>(bp)));
|
||||
CHECK((dp == ptr_reinterpret_cast<double *>(ip)));
|
||||
CHECK((dp == ptr_reinterpret_cast<double *>(dp)));
|
||||
|
||||
const byte *bc = nullptr;
|
||||
const int *ic = nullptr;
|
||||
CHECK((ac == ptr_reinterpret_cast<byte *>(an)));
|
||||
CHECK((ac == ptr_reinterpret_cast<const byte *>(ac)));
|
||||
CHECK((ac == ptr_reinterpret_cast<byte *>(in)));
|
||||
CHECK((ac == ptr_reinterpret_cast<const byte *>(ic)));
|
||||
CHECK((ic == ptr_reinterpret_cast<int *>(an)));
|
||||
CHECK((ic == ptr_reinterpret_cast<const int *>(ac)));
|
||||
CHECK((ic == ptr_reinterpret_cast<int *>(in)));
|
||||
CHECK((bc == ptr_reinterpret_cast<byte *>(bp)));
|
||||
CHECK((bc == ptr_reinterpret_cast<const byte *>(bc)));
|
||||
CHECK((bc == ptr_reinterpret_cast<byte *>(ip)));
|
||||
CHECK((bc == ptr_reinterpret_cast<const byte *>(ic)));
|
||||
CHECK((ic == ptr_reinterpret_cast<int *>(bp)));
|
||||
CHECK((ic == ptr_reinterpret_cast<const int *>(bc)));
|
||||
CHECK((ic == ptr_reinterpret_cast<int *>(ip)));
|
||||
CHECK((ic == ptr_reinterpret_cast<const int *>(ic)));
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
http://www.oberhumer.com/
|
||||
*/
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
#ifndef __ACC_H_INCLUDED
|
||||
#define __ACC_H_INCLUDED 1
|
||||
#define ACC_VERSION 20230625L
|
||||
|
||||
+4
-4
@@ -356,7 +356,7 @@ protected:
|
||||
RT_LAST
|
||||
};
|
||||
|
||||
class Interval : private noncopyable {
|
||||
class Interval final : private noncopyable {
|
||||
unsigned capacity = 0;
|
||||
void *base = nullptr;
|
||||
public:
|
||||
@@ -382,7 +382,7 @@ protected:
|
||||
static int __acc_cdecl_qsort compare(const void *p1, const void *p2);
|
||||
};
|
||||
|
||||
class Reloc : private noncopyable {
|
||||
class Reloc final : private noncopyable {
|
||||
// these are set in constructor
|
||||
byte *start = nullptr;
|
||||
unsigned start_size_in_bytes = 0;
|
||||
@@ -418,7 +418,7 @@ protected:
|
||||
void finish(byte *(&result_ptr), unsigned &result_size); // => transfer ownership
|
||||
};
|
||||
|
||||
class Resource : private noncopyable {
|
||||
class Resource final : private noncopyable {
|
||||
struct res_dir_entry;
|
||||
struct res_dir;
|
||||
struct res_data;
|
||||
@@ -474,7 +474,7 @@ protected:
|
||||
*/
|
||||
};
|
||||
|
||||
class Export : private noncopyable {
|
||||
class Export final : private noncopyable {
|
||||
struct alignas(1) export_dir_t {
|
||||
byte _[12]; // flags, timedate, version
|
||||
LE32 name;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
// Copyright 2022 BitWagon Software LLC. All rights reserved.
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/* http://www.muppetlabs.com/~breadbox/software/elfkickers.html */
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
/* sstrip: Copyright (C) 1999-2001 by Brian Raiter, under the GNU
|
||||
* General Public License. No warranty. See COPYING for details.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user