mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
Misc cleanups.
committer: mfx <mfx> 1088804669 +0000
This commit is contained in:
parent
f412b5e0cd
commit
61594f7873
|
@ -1,6 +1,7 @@
|
||||||
_darcs
|
_darcs
|
||||||
B
|
B
|
||||||
ChangeLog.cvs*
|
ChangeLog.cvs*
|
||||||
|
TODO.*
|
||||||
build
|
build
|
||||||
doxygen
|
doxygen
|
||||||
maint
|
maint
|
||||||
|
|
|
@ -440,14 +440,14 @@ LINK_EXE_OUTPUT = -Fe$@
|
||||||
LINK_EXE_LDFLAGS = /link /map:$T.map
|
LINK_EXE_LDFLAGS = /link /map:$T.map
|
||||||
##LINK_EXE_LDFLAGS += /verbose
|
##LINK_EXE_LDFLAGS += /verbose
|
||||||
ifeq (1,2)
|
ifeq (1,2)
|
||||||
# statically link libc.lib
|
# statically link libcmt.lib
|
||||||
CC += -ML
|
CC += -MT
|
||||||
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
||||||
else
|
else
|
||||||
# link against msvcrt.dll
|
# link against msvcrt.dll
|
||||||
CC += -MD
|
CC += -MD
|
||||||
endif
|
endif
|
||||||
LDLIBS = $(DOS_LDLIBS) setargv.obj
|
LDLIBS = $(DOS_LDLIBS)
|
||||||
ifeq ($(DEBUG),1)
|
ifeq ($(DEBUG),1)
|
||||||
CFLAGS += -Od -ZI
|
CFLAGS += -Od -ZI
|
||||||
LINK_EXE_LDFLAGS += /debug
|
LINK_EXE_LDFLAGS += /debug
|
||||||
|
@ -521,14 +521,14 @@ LINK_EXE_OUTPUT = -Fe$@
|
||||||
LINK_EXE_LDFLAGS = /link /map:$T.map
|
LINK_EXE_LDFLAGS = /link /map:$T.map
|
||||||
##LINK_EXE_LDFLAGS += /verbose
|
##LINK_EXE_LDFLAGS += /verbose
|
||||||
ifeq (1,1)
|
ifeq (1,1)
|
||||||
# statically link libc.lib
|
# statically link libcmt.lib
|
||||||
CC += -ML
|
CC += -MT
|
||||||
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
||||||
else
|
else
|
||||||
# link against msvcrt.dll
|
# link against msvcrt.dll
|
||||||
CC += -MD
|
CC += -MD
|
||||||
endif
|
endif
|
||||||
LDLIBS = $(DOS_LDLIBS) setargv.obj
|
LDLIBS = $(DOS_LDLIBS)
|
||||||
ifeq ($(DEBUG),1)
|
ifeq ($(DEBUG),1)
|
||||||
CFLAGS += -Od -ZI
|
CFLAGS += -Od -ZI
|
||||||
LINK_EXE_LDFLAGS += /debug
|
LINK_EXE_LDFLAGS += /debug
|
||||||
|
@ -590,14 +590,14 @@ LINK_EXE_OUTPUT = -Fe$@
|
||||||
LINK_EXE_LDFLAGS = /link /map:$T.map
|
LINK_EXE_LDFLAGS = /link /map:$T.map
|
||||||
##LINK_EXE_LDFLAGS += /verbose
|
##LINK_EXE_LDFLAGS += /verbose
|
||||||
ifeq (1,2)
|
ifeq (1,2)
|
||||||
# statically link libc.lib
|
# statically link libcmt.lib
|
||||||
CC += -ML
|
CC += -MT
|
||||||
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
||||||
else
|
else
|
||||||
# link against msvcrt.dll
|
# link against msvcrt.dll
|
||||||
CC += -MD
|
CC += -MD
|
||||||
endif
|
endif
|
||||||
LDLIBS = $(DOS_LDLIBS) setargv.obj
|
LDLIBS = $(DOS_LDLIBS)
|
||||||
ifeq ($(DEBUG),1)
|
ifeq ($(DEBUG),1)
|
||||||
CFLAGS += -Od -ZI
|
CFLAGS += -Od -ZI
|
||||||
LINK_EXE_LDFLAGS += /debug
|
LINK_EXE_LDFLAGS += /debug
|
||||||
|
@ -625,14 +625,14 @@ LINK_EXE_OUTPUT = -Fe$@
|
||||||
LINK_EXE_LDFLAGS = /link /map:$T.map
|
LINK_EXE_LDFLAGS = /link /map:$T.map
|
||||||
##LINK_EXE_LDFLAGS += /verbose
|
##LINK_EXE_LDFLAGS += /verbose
|
||||||
ifeq (1,1)
|
ifeq (1,1)
|
||||||
# statically link libc.lib
|
# statically link libcmt.lib
|
||||||
CC += -ML
|
CC += -MT
|
||||||
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
## DOS_LDLIBS := $(DOS_LDLIBS:.lib=_ml.lib)
|
||||||
else
|
else
|
||||||
# link against msvcrt.dll
|
# link against msvcrt.dll
|
||||||
CC += -MD
|
CC += -MD
|
||||||
endif
|
endif
|
||||||
LDLIBS = $(DOS_LDLIBS) setargv.obj
|
LDLIBS = $(DOS_LDLIBS)
|
||||||
ifeq ($(DEBUG),1)
|
ifeq ($(DEBUG),1)
|
||||||
CFLAGS += -Od -ZI
|
CFLAGS += -Od -ZI
|
||||||
LINK_EXE_LDFLAGS += /debug
|
LINK_EXE_LDFLAGS += /debug
|
||||||
|
|
|
@ -95,6 +95,9 @@
|
||||||
# pragma warning(disable: 4512) // W4: 'class': assignment operator could not be generated
|
# pragma warning(disable: 4512) // W4: 'class': assignment operator could not be generated
|
||||||
# pragma warning(disable: 4514) // W4: 'function': unreferenced inline function has been removed
|
# pragma warning(disable: 4514) // W4: 'function': unreferenced inline function has been removed
|
||||||
# pragma warning(disable: 4710) // W4: 'function': function not inlined
|
# pragma warning(disable: 4710) // W4: 'function': function not inlined
|
||||||
|
# if (_MSC_VER >= 1400)
|
||||||
|
# pragma warning(disable: 4996) // W1: 'function': was declared deprecated
|
||||||
|
# endif
|
||||||
#elif (ACC_CC_WATCOMC)
|
#elif (ACC_CC_WATCOMC)
|
||||||
# if (__WATCOMC__ < 1100)
|
# if (__WATCOMC__ < 1100)
|
||||||
# error "need Watcom C++ 11.0c or newer"
|
# error "need Watcom C++ 11.0c or newer"
|
||||||
|
|
|
@ -48,7 +48,7 @@ void show_head(void)
|
||||||
fg = con_fg(f,FG_GREEN);
|
fg = con_fg(f,FG_GREEN);
|
||||||
con_fprintf(f,
|
con_fprintf(f,
|
||||||
" Ultimate Packer for eXecutables\n"
|
" Ultimate Packer for eXecutables\n"
|
||||||
" Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004\n"
|
" Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004\n"
|
||||||
"UPX %-12s Markus F.X.J. Oberhumer & Laszlo Molnar %20s\n\n",
|
"UPX %-12s Markus F.X.J. Oberhumer & Laszlo Molnar %20s\n\n",
|
||||||
#if (ACC_OS_DOS16 || ACC_OS_DOS32)
|
#if (ACC_OS_DOS16 || ACC_OS_DOS32)
|
||||||
V("d"),
|
V("d"),
|
||||||
|
|
|
@ -1088,15 +1088,12 @@ int __acc_cdecl_main main(int argc, char *argv[])
|
||||||
// LFN=n may cause problems with 2.03's _rename and mkdir under WinME
|
// LFN=n may cause problems with 2.03's _rename and mkdir under WinME
|
||||||
putenv("LFN=y");
|
putenv("LFN=y");
|
||||||
#endif
|
#endif
|
||||||
#if defined(__EMX__)
|
|
||||||
_response(&argc,&argv);
|
|
||||||
_wildcard(&argc,&argv);
|
|
||||||
#endif
|
|
||||||
#if defined(__MINT__)
|
#if defined(__MINT__)
|
||||||
__binmode(1);
|
__binmode(1);
|
||||||
__set_binmode(stdout, 0);
|
__set_binmode(stdout, 0);
|
||||||
__set_binmode(stderr, 0);
|
__set_binmode(stderr, 0);
|
||||||
#endif
|
#endif
|
||||||
|
acc_wildargv(&argc, &argv);
|
||||||
|
|
||||||
upx_sanity_check();
|
upx_sanity_check();
|
||||||
init_options(opt);
|
init_options(opt);
|
||||||
|
|
15
src/ui.cpp
15
src/ui.cpp
|
@ -219,13 +219,14 @@ UiPacker::~UiPacker()
|
||||||
|
|
||||||
void UiPacker::printInfo(int nl)
|
void UiPacker::printInfo(int nl)
|
||||||
{
|
{
|
||||||
#if 1
|
if (opt->all_methods && s->total_passes > 1)
|
||||||
char method_name[32+1];
|
con_fprintf(stdout, "Compressing %s [%s]%s", p->fi->getName(), p->getName(), nl ? "\n" : "");
|
||||||
set_method_name(method_name, sizeof(method_name), p->ph.method, p->ph.level);
|
else
|
||||||
con_fprintf(stdout, "Compressing %s [%s, %s]%s", p->fi->getName(), p->getName(), method_name, nl ? "\n" : "");
|
{
|
||||||
#else
|
char method_name[32+1];
|
||||||
con_fprintf(stdout, "Compressing %s [%s]%s", p->fi->getName(), p->getName(), nl ? "\n" : "");
|
set_method_name(method_name, sizeof(method_name), p->ph.method, p->ph.level);
|
||||||
#endif
|
con_fprintf(stdout, "Compressing %s [%s, %s]%s", p->fi->getName(), p->getName(), method_name, nl ? "\n" : "");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
11
src/util.cpp
11
src/util.cpp
|
@ -35,13 +35,10 @@
|
||||||
/* avoid -W4 warnings in <windows.h> */
|
/* avoid -W4 warnings in <windows.h> */
|
||||||
# pragma warning(disable: 4201 4214 4514)
|
# pragma warning(disable: 4201 4214 4514)
|
||||||
#endif
|
#endif
|
||||||
#if 0
|
#include "acc/acc_inci.h"
|
||||||
# include "acc/acc_lib.ch"
|
#include "acc/acclib/misc.ch"
|
||||||
#else
|
#include "acc/acclib/hsread.ch"
|
||||||
# include "acc/acc_inci.h"
|
#include "acc/acclib/wildargv.ch"
|
||||||
# include "acc/acclib/misc.ch"
|
|
||||||
# include "acc/acclib/hsread.ch"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
|
19
src/util.h
19
src/util.h
|
@ -65,9 +65,24 @@ upx_bytep pfind_le32(const void *b, int blen, unsigned what);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
inline ptrdiff_t ptr_diff(const void *p1, const void *p2)
|
#if (ACC_CC_BORLANDC && (__BORLANDC__ < 0x0530))
|
||||||
|
#elif (ACC_CC_DMC && (__DMC__ < 0x830))
|
||||||
|
#elif (ACC_CC_MSC && (_MSC_VER < 1310))
|
||||||
|
#else
|
||||||
|
template <class T>
|
||||||
|
inline int ptr_diff(const T *p1, const T *p2)
|
||||||
{
|
{
|
||||||
return (const char*) p1 - (const char*) p2;
|
COMPILE_TIME_ASSERT(sizeof(T) == 1)
|
||||||
|
ptrdiff_t d = (const char*) p1 - (const char*) p2;
|
||||||
|
assert((int)d == d);
|
||||||
|
return (int) d;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
inline int ptr_diff(const void *p1, const void *p2)
|
||||||
|
{
|
||||||
|
ptrdiff_t d = (const char*) p1 - (const char*) p2;
|
||||||
|
assert((int)d == d);
|
||||||
|
return (int) d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user