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

Avoid some compiler warnings.

committer: mfx <mfx> 968567027 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2000-09-10 06:23:47 +00:00
parent a4522627e0
commit 65601b5c26
9 changed files with 24 additions and 9 deletions

View File

@ -1,4 +1,6 @@
*.0??
*.idb
*.pdb
*.upx
.gdbinit
upx

View File

@ -16,7 +16,7 @@ ifeq ($(strip $(UCLDIR)),)
UCLDIR = $(HOME)/local/src/ucl-0.91
endif
DEBUG = 1
DEBUG = 0
# -------------------------------------------------------
@ -242,7 +242,7 @@ o = .obj
a = .lib
CC = cl -nologo
CFLAGS = -W4
CXXFLAGS1 = $(CFLAGS) -GX -GR
CXXFLAGS1 = $(CFLAGS) -GR -GX -EHa
CXXFLAGS2 = $(CFLAGS)
LDFLAGS =
LINK_LDFLAGS = /link /map:$(basename $@).map
@ -253,7 +253,7 @@ endif
export LIB
ifeq (1,2)
# statically link libc
# statically link libc.lib
CC += -ML
##LDLIBS = $(u)_s.lib zlib_s.lib setargv.obj
LDLIBS = $(u)_s.lib setargv.obj
@ -267,7 +267,7 @@ ifeq ($(DEBUG),1)
CFLAGS += -Od -ZI
LINK_LDFLAGS += /debug
else
CFLAGS += -O2 -Gs -GF
CFLAGS += -O2 -GF
LINK_LDFLAGS += /release
endif
@ -321,7 +321,8 @@ CXXFLAGS1 = $(CFLAGS)
CXXFLAGS2 = $(CFLAGS)
CFLAGS_OUTPUT = -o$@
LDFLAGS =
LDLIBS = $(u).lib zlib.lib
##LDLIBS = $(u).lib zlib.lib
LDLIBS = $(u).lib
ifneq ($(strip $(wildcard $(UDIR))),)
LIB := $(UDIR);$(LIB)
@ -389,6 +390,7 @@ mostlyclean:
clean: mostlyclean
-rm -f *.a *.lib *.o *.obj tags TAGS ID
-rm -f *.idb *.pdb
-rm -f upx upx.exe upx_nrv upx_nrv.exe upx_ucl upx_ucl.exe
distclean: clean

View File

@ -211,6 +211,11 @@ protected:
unsigned sononres_names;
unsigned soimage;
unsigned soentries;
private:
// disable copy and assignment
LeFile(LeFile const &); // {}
LeFile& operator= (LeFile const &); // { return *this; }
};

View File

@ -33,7 +33,7 @@
//
**************************************************************************/
MemBuffer::MemBuffer(unsigned size=0) :
MemBuffer::MemBuffer(unsigned size) :
ptr(NULL), alloc_ptr(NULL), alloc_size(0)
{
if (size > 0)

View File

@ -446,7 +446,7 @@ void PackLinuxI386elf::unpack(OutputFile *fo)
off_t ptload0hi=0, ptload1lo=0;
// decompress PT_LOAD
fi->seek(-(2*4 + ph.c_len), SEEK_CUR);
fi->seek(- (off_t) (2*4 + ph.c_len), SEEK_CUR);
for (unsigned j=0; j < ehdr->e_phnum; ++phdr, ++j) {
if (PT_LOAD==phdr->p_type) {
if (0==ptload0hi) {

View File

@ -471,7 +471,7 @@ void PackLinuxI386::patchLoaderChecksum()
// checksum for loader + p_info
lp->l_checksum = 0; // (this checksum is currently unused)
lp->l_magic = UPX_ELF_MAGIC;
lp->l_lsize = lsize;
lp->l_lsize = (unsigned short) lsize;
lp->l_version = (unsigned char) ph.version;
lp->l_format = (unsigned char) ph.format;
unsigned adler = upx_adler32(0,NULL,0);

View File

@ -434,7 +434,7 @@ void PackWcle::pack(OutputFile *fo)
const unsigned calltrickoffset = ft.cto << 24;
// attach some useful data at the end of preprocessed fixups
ifixups[sofixups++] = ih.automatic_data_object;
ifixups[sofixups++] = (unsigned char) ih.automatic_data_object;
unsigned ic = objects*sizeof(*iobject_table);
memcpy(ifixups+sofixups,iobject_desc,ic);
iobject_desc.free();

View File

@ -243,6 +243,11 @@ private:
// private to checkPatch()
void *last_patch;
long last_patch_offset;
private:
// disable copy and assignment
Packer(Packer const &); // {}
Packer& operator= (Packer const &); // { return *this; }
};

View File

@ -154,6 +154,7 @@
# define vsnprintf _vsnprintf
//# pragma warning(once: 4097 4710)
# pragma warning(disable: 4097 4710)
# pragma warning(disable: 4511 4512)
# endif
#elif defined(__WATCOMC__)
# define __UPX_CDECL __cdecl