clang-format more files.

"Gofmt's style is nobody's favourite, but gofmt is everybody's favourite."
    - Rob Pike
This commit is contained in:
Markus F.X.J. Oberhumer
2021-01-04 20:26:31 +01:00
parent 8236276a90
commit 2575eef3c0
14 changed files with 1590 additions and 1871 deletions
+43 -41
View File
@@ -25,11 +25,9 @@
<markus@oberhumer.com> <ezerotven+github@gmail.com>
*/
#ifndef __UPX_OPTIONS_H
#define __UPX_OPTIONS_H 1
/*************************************************************************
// globals
**************************************************************************/
@@ -37,11 +35,16 @@
// options - command
enum {
CMD_NONE,
CMD_COMPRESS, CMD_DECOMPRESS, CMD_TEST, CMD_LIST, CMD_FILEINFO,
CMD_HELP, CMD_LICENSE, CMD_VERSION
CMD_COMPRESS,
CMD_DECOMPRESS,
CMD_TEST,
CMD_LIST,
CMD_FILEINFO,
CMD_HELP,
CMD_LICENSE,
CMD_VERSION
};
struct options_t {
int cmd;
@@ -56,15 +59,15 @@ struct options_t {
bool method_nrv2b_seen;
bool method_nrv2d_seen;
bool method_nrv2e_seen;
int level; // compression level 1..10
int filter; // preferred filter from Packer::getFilters()
int level; // compression level 1..10
int filter; // preferred filter from Packer::getFilters()
bool ultra_brute;
bool all_methods; // try all available compression methods ?
bool all_methods; // try all available compression methods ?
bool all_methods_use_lzma;
bool all_filters; // try all available filters ?
bool no_filter; // force no filter
bool prefer_ucl; // prefer UCL
bool exact; // user requires byte-identical decompression
bool all_filters; // try all available filters ?
bool no_filter; // force no filter
bool prefer_ucl; // prefer UCL
bool exact; // user requires byte-identical decompression
// other options
int backup;
@@ -85,38 +88,38 @@ struct options_t {
// debug options
struct {
int debug_level;
bool disable_random_id; // for Packer::getRandomId()
bool disable_random_id; // for Packer::getRandomId()
const char *dump_stub_loader;
char fake_stub_version[4+1]; // for internal debugging
char fake_stub_year[4+1]; // for internal debugging
char fake_stub_version[4 + 1]; // for internal debugging
char fake_stub_year[4 + 1]; // for internal debugging
} debug;
// overlay handling
enum {
SKIP_OVERLAY = 0,
COPY_OVERLAY = 1,
STRIP_OVERLAY = 2
};
enum { SKIP_OVERLAY = 0, COPY_OVERLAY = 1, STRIP_OVERLAY = 2 };
int overlay;
// compression runtime parameters - see struct XXX_compress_config_t
struct crp_t {
lzma_compress_config_t crp_lzma;
ucl_compress_config_t crp_ucl;
zlib_compress_config_t crp_zlib;
void reset() { crp_lzma.reset(); crp_ucl.reset(); crp_zlib.reset(); }
lzma_compress_config_t crp_lzma;
ucl_compress_config_t crp_ucl;
zlib_compress_config_t crp_zlib;
void reset() {
crp_lzma.reset();
crp_ucl.reset();
crp_zlib.reset();
}
};
crp_t crp;
// CPU
enum {
CPU_DEFAULT = 0,
CPU_8086 = 1,
CPU_286 = 2,
CPU_386 = 3,
CPU_486 = 4,
CPU_586 = 5,
CPU_686 = 6
CPU_8086 = 1,
CPU_286 = 2,
CPU_386 = 3,
CPU_486 = 4,
CPU_586 = 5,
CPU_686 = 6
};
int cpu;
@@ -139,15 +142,15 @@ struct options_t {
} ps1_exe;
struct {
unsigned blocksize;
bool force_execve; // force the linux/386 execve format
bool is_ptinterp; // is PT_INTERP, so don't adjust auxv_t
bool use_ptinterp; // use PT_INTERP /opt/upx/run
bool make_ptinterp; // make PT_INTERP [ignore current file!]
bool unmap_all_pages; // thus /proc/self/exe vanishes
unsigned char osabi0; // replacement if 0==.e_ident[EI_OSABI]
bool preserve_build_id; // copy the build-id to the compressed binary
bool android_shlib; // keep some ElfXX_Shdr for dlopen()
bool force_pie; // choose DF_1_PIE instead of is_shlib
bool force_execve; // force the linux/386 execve format
bool is_ptinterp; // is PT_INTERP, so don't adjust auxv_t
bool use_ptinterp; // use PT_INTERP /opt/upx/run
bool make_ptinterp; // make PT_INTERP [ignore current file!]
bool unmap_all_pages; // thus /proc/self/exe vanishes
unsigned char osabi0; // replacement if 0==.e_ident[EI_OSABI]
bool preserve_build_id; // copy the build-id to the compressed binary
bool android_shlib; // keep some ElfXX_Shdr for dlopen()
bool force_pie; // choose DF_1_PIE instead of is_shlib
} o_unix;
struct {
bool le;
@@ -156,7 +159,7 @@ struct options_t {
int compress_exports;
int compress_icons;
int compress_resources;
signed char compress_rt[25]; // 25 == RT_LAST
signed char compress_rt[25]; // 25 == RT_LAST
int strip_relocs;
const char *keep_resource;
} win32_pe;
@@ -166,7 +169,6 @@ struct options_t {
extern struct options_t *opt;
#endif /* already included */
/* vim:set ts=4 sw=4 et: */