1
0
mirror of https://github.com/upx/upx synced 2025-09-28 19:06:07 +08:00

Replace some negative enum constants with "static const unsigned" vars.

This commit is contained in:
Markus F.X.J. Oberhumer 2017-01-03 12:57:10 +01:00
parent 5d3be8da1d
commit 14710dea55
2 changed files with 9 additions and 0 deletions

View File

@ -32,10 +32,15 @@
__packed_struct(Mach_fat_header)
BE32 magic;
# if 0
enum { // note conflict with java bytecode PackLinuxI386
FAT_MAGIC = 0xcafebabe,
FAT_MAGIC_SWAB = 0xbebafeca
};
# else
static const unsigned FAT_MAGIC = 0xcafebabe;
static const unsigned FAT_MAGIC_SWAB = 0xbebafeca;
# endif
BE32 nfat_arch; // Number of Mach_fat_arch which follow.
__packed_struct_end()

View File

@ -35,9 +35,13 @@
#ifdef WANT_MACH_HEADER_ENUM /*{*/
#undef WANT_MACH_HEADER_ENUM
# if 0
enum { // magic
MH_MAGIC = 0xfeedface
};
# else
static const unsigned MH_MAGIC = 0xfeedface;
# endif
enum { // cputype
CPU_TYPE_I386 = 7,
CPU_TYPE_X86_64 = 0x01000007,