diff --git a/src/Makefile.bld b/src/Makefile.bld index aaaaf134..48386c2d 100644 --- a/src/Makefile.bld +++ b/src/Makefile.bld @@ -419,7 +419,7 @@ ifeq ($(DEBUG),1) CFLAGS += -Od -ZI LINK_EXE_LDFLAGS += /debug else - CFLAGS += -O1 -GF -Gy + CFLAGS += -O1 -GF LINK_EXE_LDFLAGS += /release endif RESOURCES := $(subst .rc,.res,$(notdir $(wildcard $(srcdir)/*.rc))) @@ -491,7 +491,7 @@ ifeq ($(DEBUG),1) CFLAGS += -Od -ZI LINK_EXE_LDFLAGS += /debug else - CFLAGS += -O1 -GF -Gy + CFLAGS += -O1 -GF LINK_EXE_LDFLAGS += /release ##LINK_EXE_LDFLAGS += /opt:nowin98 endif diff --git a/src/conf.h b/src/conf.h index 5c84cca5..29afb1b0 100644 --- a/src/conf.h +++ b/src/conf.h @@ -282,7 +282,7 @@ #undef __attribute_packed #if defined(__GNUC__) || defined(__INTEL_COMPILER) -# if (1 && ACC_ARCH_IA32) +# if (1 && (ACC_ARCH_IA32 || ACC_ARCH_IA64)) # define __attribute_packed # else # define __attribute_packed __attribute__((__packed__,__aligned__(1))) diff --git a/src/mem.cpp b/src/mem.cpp index 46170431..b9758329 100644 --- a/src/mem.cpp +++ b/src/mem.cpp @@ -139,7 +139,7 @@ void MemBuffer::fill(unsigned off, unsigned len, int value) // **************************************************************************/ -#define PTR(p) ((unsigned)(p) & 0xffffffff) +#define PTR(p) ((unsigned) ((acc_uintptr_t)(p) & 0xffffffff)) #define MAGIC1(p) (PTR(p) ^ 0xfefdbeeb) #define MAGIC2(p) (PTR(p) ^ 0xfefdbeeb ^ 0x80024001) diff --git a/src/p_ps1.cpp b/src/p_ps1.cpp index bf10ef0f..3a55ede7 100644 --- a/src/p_ps1.cpp +++ b/src/p_ps1.cpp @@ -76,8 +76,11 @@ PackPs1::PackPs1(InputFile *f) : COMPILE_TIME_ASSERT(sizeof(ps1_exe_t) == 188); COMPILE_TIME_ASSERT(PS_HDR_SIZE > sizeof(ps1_exe_t)); COMPILE_TIME_ASSERT(SZ_IH_BKUP == 40); +#if defined(WITH_NRV) + COMPILE_TIME_ASSERT(NRV_LOADER_CRC32 == 0xd78b1eb4); +#endif - fdata_size = file_size-PS_HDR_SIZE; + fdata_size = file_size - PS_HDR_SIZE; } diff --git a/src/snprintf.cpp b/src/snprintf.cpp index ce7bf5e9..38e672f7 100644 --- a/src/snprintf.cpp +++ b/src/snprintf.cpp @@ -703,7 +703,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args strvalue = va_arg (args, const char *); if (!strvalue) strvalue = "(NULL)"; if (max == -1) { - max = strlen(strvalue); + max = (int) strlen(strvalue); } if (min > 0 && max >= 0 && min > max) max = min; fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max); @@ -728,7 +728,7 @@ static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args } else { int *num; num = va_arg (args, int *); - *num = currlen; + *num = (int) currlen; } break; case '%': diff --git a/src/stub/Makefile b/src/stub/Makefile index 1cc2e8cf..68e94c20 100644 --- a/src/stub/Makefile +++ b/src/stub/Makefile @@ -71,8 +71,8 @@ vpath %.ash $(UCL_MR3K) # // tools # ************************************************************************/ -NASM = nasm -O2 -w+macro-params -w+orphan-labels -NASM += -i$(srcdir)/ +NASM = nasm -O2 -w+macro-params -w+macro-selfref -w+number-overflow -w+orphan-labels +NASM += -I$(srcdir)/ APP_I386 = perl -w $(srcdir)/scripts/app_i386.pl BIN2H = perl -w $(srcdir)/scripts/bin2h.pl diff --git a/src/ui.cpp b/src/ui.cpp index c161ff43..79effb2a 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -454,7 +454,7 @@ void UiPacker::doCallback(unsigned isize, unsigned osize) if (osize > 0) ratio = get_ratio(isize, osize); - int buflen = &s->msg_buf[sizeof(s->msg_buf)] - m; + int buflen = (int) (&s->msg_buf[sizeof(s->msg_buf)] - m); upx_snprintf(m, buflen, " %3d.%1d%% %c ", ratio / 10000, (ratio % 10000) / 1000, spinner[s->spin_counter & 3]); diff --git a/src/util.cpp b/src/util.cpp index 350bfdc4..bf869959 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -35,7 +35,12 @@ /* avoid -W4 warnings in */ # pragma warning(disable: 4201 4214 4514) #endif -#include "acc/acc_lib.ch" +#if 0 +# include "acc/acc_lib.ch" +#else +# include "acc/acc_inci.h" +# include "acc/acclib/misc.ch" +#endif /************************************************************************* @@ -246,7 +251,7 @@ int upx_tolower(int c) // filename util **************************************************************************/ -#if (ACC_OS_CYGWIN || ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_TOS || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64) +#if (ACC_OS_CYGWIN || ACC_OS_DOS16 || ACC_OS_DOS32 || ACC_OS_EMX || ACC_OS_OS2 || ACC_OS_OS16 || ACC_OS_TOS || ACC_OS_WIN16 || ACC_OS_WIN32 || ACC_OS_WIN64) static const char dir_sep[] = "/\\"; #define fn_is_drive(s) (s[0] && s[1] == ':')