From 14710dea55edff7fec19ff61f188493b4174b680 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Tue, 3 Jan 2017 12:57:10 +0100 Subject: [PATCH] Replace some negative enum constants with "static const unsigned" vars. --- src/p_mach.h | 5 +++++ src/p_mach_enum.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/p_mach.h b/src/p_mach.h index 3ea84282..956a3249 100644 --- a/src/p_mach.h +++ b/src/p_mach.h @@ -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() diff --git a/src/p_mach_enum.h b/src/p_mach_enum.h index 3c630451..abefaeb0 100644 --- a/src/p_mach_enum.h +++ b/src/p_mach_enum.h @@ -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,