From 8d61e037f92f2d86a00fc8be3f23d9cfde2c867e Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Sun, 20 Nov 2016 13:16:19 +0100 Subject: [PATCH] Cleanups. --- src/conf.h | 5 +++++ src/linker.cpp | 6 +++--- src/linker.h | 6 +++--- src/p_mach.cpp | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/conf.h b/src/conf.h index 4c852e58..1b146dff 100644 --- a/src/conf.h +++ b/src/conf.h @@ -55,8 +55,13 @@ ACC_COMPILE_TIME_ASSERT_HEADER(sizeof(int) == 4) ACC_COMPILE_TIME_ASSERT_HEADER((1u << 31) << 1 == 0) ACC_COMPILE_TIME_ASSERT_HEADER(((int)(1u << 31)) >> 31 == -1) // arithmetic right shift +ACC_COMPILE_TIME_ASSERT_HEADER(CHAR_MAX == 255) // -funsigned-char ACC_COMPILE_TIME_ASSERT_HEADER((char)(-1) > 0) // -funsigned-char +#if (ACC_CC_MSC) +# pragma warning(error: 4319) +#endif + // FIXME - quick hack for arm-wince-gcc-3.4 (Debian pocketpc-*.deb packages) #if 1 && (ACC_ARCH_ARM) && defined(__pe__) && !defined(__CEGCC__) && !defined(_WIN32) # undef HAVE_CHMOD diff --git a/src/linker.cpp b/src/linker.cpp index dbd7accc..23b632f7 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -207,7 +207,7 @@ void ElfLinker::init(const void *pdata_v, int plen) } } -void ElfLinker::preprocessSections(char *start, char const *end) +void ElfLinker::preprocessSections(char *start, char *end) { char *nextl; for (nsections = 0; start < end; start = 1+ nextl) @@ -233,7 +233,7 @@ void ElfLinker::preprocessSections(char *start, char const *end) addSection("*UND*", NULL, 0, 0); } -void ElfLinker::preprocessSymbols(char *start, char const *end) +void ElfLinker::preprocessSymbols(char *start, char *end) { char *nextl; for (nsymbols = 0; start < end; start = 1+ nextl) @@ -273,7 +273,7 @@ void ElfLinker::preprocessSymbols(char *start, char const *end) } } -void ElfLinker::preprocessRelocations(char *start, char const *end) +void ElfLinker::preprocessRelocations(char *start, char *end) { Section *section = NULL; char *nextl; diff --git a/src/linker.h b/src/linker.h index 5c77aa82..59e5081a 100644 --- a/src/linker.h +++ b/src/linker.h @@ -66,9 +66,9 @@ protected: bool reloc_done; protected: - void preprocessSections(char *start, char const *end); - void preprocessSymbols(char *start, char const *end); - void preprocessRelocations(char *start, char const *end); + void preprocessSections(char *start, char *end); + void preprocessSymbols(char *start, char *end); + void preprocessRelocations(char *start, char *end); Section *findSection(const char *name, bool fatal=true) const; Symbol *findSymbol(const char *name, bool fatal=true) const; diff --git a/src/p_mach.cpp b/src/p_mach.cpp index 352ede77..f157a5ac 100644 --- a/src/p_mach.cpp +++ b/src/p_mach.cpp @@ -1666,7 +1666,7 @@ int PackMachBase::canUnpack() } if (!strcmp("__LINKEDIT", segptr->segname)) { offLINK = segptr->fileoff; - if (offLINK < pos_next) { + if (offLINK < (off_t) pos_next) { offLINK = pos_next; } }