diff --git a/src/conf.h b/src/conf.h index f3a1d0cb..a67e7c0a 100644 --- a/src/conf.h +++ b/src/conf.h @@ -287,7 +287,7 @@ inline const T& UPX_MIN(const T& a, const T& b) { if (a < b) return a; return b; // gets destructed when leaving scope or on exceptions. #define Array(type, var, size) \ MemBuffer var ## _membuf(mem_size(sizeof(type), size)); \ - type * const var = ((type *) var ## _membuf.getVoidPtr()) + type * const var = ACC_STATIC_CAST(type *, var ## _membuf.getVoidPtr()) #define ByteArray(var, size) Array(unsigned char, var, size) diff --git a/src/packer.cpp b/src/packer.cpp index 28d8d3c9..980f398a 100644 --- a/src/packer.cpp +++ b/src/packer.cpp @@ -540,14 +540,14 @@ unsigned Packer::findOverlapOverhead(const upx_bytep buf, // file i/o utils **************************************************************************/ -void Packer::handleStub(InputFile *fif, OutputFile *fo, long size) +void Packer::handleStub(InputFile *fif, OutputFile *fo, unsigned size) { if (fo) { if (size > 0) { // copy stub from exe - info("Copying original stub: %ld bytes", size); + info("Copying original stub: %u bytes", size); ByteArray(stub, size); fif->seek(0,SEEK_SET); fif->readx(stub,size); @@ -661,7 +661,7 @@ void Packer::initPackHeader() ph.method = M_NONE; ph.level = -1; ph.u_adler = ph.c_adler = ph.saved_u_adler = ph.saved_c_adler = upx_adler32(NULL,0); - ph.buf_offset = -1; + ph.buf_offset = 0; ph.u_file_size = file_size; } diff --git a/src/packer.h b/src/packer.h index 2423a411..6a38d720 100644 --- a/src/packer.h +++ b/src/packer.h @@ -80,7 +80,7 @@ public: unsigned saved_c_adler; // info fields set by fillPackHeader() - long buf_offset; + unsigned buf_offset; // info fields set by Packer::compress() upx_compress_result_t compress_result; @@ -264,7 +264,7 @@ protected: virtual void defineFilterSymbols(const Filter *ft); // stub and overlay util - static void handleStub(InputFile *fi, OutputFile *fo, long size); + static void handleStub(InputFile *fi, OutputFile *fo, unsigned size); virtual void checkOverlay(unsigned overlay); virtual void copyOverlay(OutputFile *fo, unsigned overlay, MemBuffer *buf, bool do_seek=true); diff --git a/src/ui.cpp b/src/ui.cpp index 85308bba..37e628b4 100644 --- a/src/ui.cpp +++ b/src/ui.cpp @@ -241,11 +241,7 @@ void UiPacker::startCallback(unsigned u_len, unsigned step, int pass, int total_ return; } -#if (ACC_CC_MSC && (_MSC_VER == 1300)) - cb.nprogress = &UiPacker::progress_callback; -#else cb.nprogress = progress_callback; -#endif cb.user = this; // parameter for static function UiPacker::progress_callback() if (s->mode == M_CB_TERM) {