Use consistent syntax for boolean preprocessor expressions.
This commit is contained in:
@@ -48,7 +48,7 @@ binmode(INFILE);
|
||||
# check file size
|
||||
@st = stat($ifile);
|
||||
if (1 && $st[7] <= 0) {
|
||||
print STDERR "$ifile: ERROR: emtpy file\n";
|
||||
print STDERR "$ifile: ERROR: empty file\n";
|
||||
exit(1);
|
||||
}
|
||||
if (1 && $st[7] > 64*1024) {
|
||||
|
||||
@@ -284,7 +284,7 @@ def main(argv):
|
||||
# check file size
|
||||
st = os.stat(ifile)
|
||||
if 1 and st.st_size <= 0:
|
||||
print >> sys.stderr, "%s: ERROR: emtpy file" % (ifile)
|
||||
print >> sys.stderr, "%s: ERROR: empty file" % (ifile)
|
||||
sys.exit(1)
|
||||
if 1 and st.st_size > 128*1024:
|
||||
print >> sys.stderr, "%s: ERROR: file is too big (%d bytes)" % (ifile, st.st_size)
|
||||
|
||||
@@ -76,7 +76,7 @@ xread(Extent *x, void *buf, size_t count)
|
||||
#define ERR_LAB error: exit(127);
|
||||
#define err_exit(a) goto error
|
||||
#else //}{ save debugging time
|
||||
#define ERR_LAB
|
||||
#define ERR_LAB /*empty*/
|
||||
static void
|
||||
err_exit(int a)
|
||||
{
|
||||
|
||||
@@ -78,7 +78,7 @@ xread(Extent *x, char *buf, size_t count)
|
||||
#define ERR_LAB error: exit(127);
|
||||
#define err_exit(a) goto error
|
||||
#else //}{ save debugging time
|
||||
#define ERR_LAB
|
||||
#define ERR_LAB /*empty*/
|
||||
static void
|
||||
err_exit(int a)
|
||||
{
|
||||
|
||||
@@ -102,7 +102,7 @@ section LZMA_DEC00
|
||||
ignore_reloc_overflow lzma_properties
|
||||
|
||||
|
||||
#define ret
|
||||
#define ret /*empty*/
|
||||
section LZMA_DEC10
|
||||
.arch i8086, nojumps
|
||||
#define SMALL 1
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
#ifndef _MR3K_STD_CONF_
|
||||
#define _MR3K_STD_CONF_
|
||||
#define _MR3K_STD_CONF_ 1
|
||||
|
||||
#define JOHN 1
|
||||
#define ALT_SMALL 1
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
.endm
|
||||
|
||||
#ifndef DEBUG
|
||||
# define PRINT(str)
|
||||
# define PRINT(str) /*empty*/
|
||||
#else
|
||||
# define PRINT(str) .print str
|
||||
# define PRINT(str) .print str
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __PPC_REGS__ /*{*/
|
||||
#define __PPC_REGS__
|
||||
#define __PPC_REGS__ 1
|
||||
|
||||
#define r0 0
|
||||
#define r1 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef __PPC_REGS__ /*{*/
|
||||
#define __PPC_REGS__
|
||||
#define __PPC_REGS__ 1
|
||||
|
||||
#define r0 0
|
||||
#define r1 1
|
||||
|
||||
@@ -79,7 +79,7 @@ xread(Extent *x, void *buf, size_t count)
|
||||
#define ERR_LAB error: exit(127);
|
||||
#define err_exit(a) goto error
|
||||
#else //}{ save debugging time
|
||||
#define ERR_LAB
|
||||
#define ERR_LAB /*empty*/
|
||||
static void
|
||||
err_exit(int a)
|
||||
{
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
|
||||
#define DEBUG 0
|
||||
#if DEBUG == 0
|
||||
# define DINIT
|
||||
# define DDUMP(x)
|
||||
# define DDONE
|
||||
# define DINIT /*empty*/
|
||||
# define DDUMP(x) /*empty*/
|
||||
# define DDONE /*empty*/
|
||||
#else
|
||||
#define DDUMP(x) stmfd sp!, {r0 - r3}; mov r0, x; mov lr, pc; mov pc, r8; ldmia sp!, {r0 - r3}
|
||||
#if DEBUG == 1
|
||||
@@ -48,10 +48,10 @@
|
||||
#define DDONE mov pc, lr
|
||||
#elif DEBUG == 2
|
||||
#define DINIT adr r8, writefile
|
||||
#define DDONE
|
||||
#define DDONE /*empty*/
|
||||
#elif DEBUG == 3
|
||||
#define DINIT adr r8, DelFile
|
||||
#define DDONE
|
||||
#define DDONE /*empty*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ xread(struct Extent *x, char *buf, size_t count)
|
||||
#define ERR_LAB error: exit(127);
|
||||
#define err_exit(a) goto error
|
||||
#else //}{ save debugging time
|
||||
#define ERR_LAB
|
||||
#define ERR_LAB /*empty*/
|
||||
static void
|
||||
err_exit(int a) __attribute__ ((__noreturn__));
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
**************************************************************************/
|
||||
|
||||
// mmap() the temporary output file
|
||||
#define USE_MMAP_FO
|
||||
#define USE_MMAP_FO 1
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
@@ -50,7 +50,7 @@ struct Extent {
|
||||
};
|
||||
|
||||
|
||||
#if !defined(USE_MMAP_FO)
|
||||
#if !(USE_MMAP_FO)
|
||||
#if 1
|
||||
static __inline__ int xwrite(int fd, const void *buf, int count)
|
||||
{
|
||||
@@ -322,7 +322,7 @@ void upx_main(
|
||||
}
|
||||
|
||||
// Create the temporary output file.
|
||||
#if defined(USE_MMAP_FO)
|
||||
#if (USE_MMAP_FO)
|
||||
fdo = open(tmpname, O_RDWR | O_CREAT | O_EXCL, 0700);
|
||||
#else
|
||||
fdo = open(tmpname, O_WRONLY | O_CREAT | O_EXCL, 0700);
|
||||
@@ -342,7 +342,7 @@ void upx_main(
|
||||
// ----- Step 3: setup memory -----
|
||||
//
|
||||
|
||||
#if defined(USE_MMAP_FO)
|
||||
#if (USE_MMAP_FO)
|
||||
// FIXME: packer could set length
|
||||
buf = (unsigned char *)mmap(0, header.p_filesize,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, fdo, 0);
|
||||
@@ -413,7 +413,7 @@ void upx_main(
|
||||
else
|
||||
{
|
||||
// Incompressible block
|
||||
#if defined(USE_MMAP_FO)
|
||||
#if (USE_MMAP_FO)
|
||||
//memcpy(buf, xi.buf, h.sz_unc);
|
||||
register unsigned long int __d0, __d1, __d2;
|
||||
__asm__ __volatile__( "rep; movsb"
|
||||
@@ -423,7 +423,7 @@ void upx_main(
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(USE_MMAP_FO)
|
||||
#if (USE_MMAP_FO)
|
||||
// unmap part of the output
|
||||
munmap(buf, h.sz_unc);
|
||||
buf += h.sz_unc;
|
||||
@@ -455,7 +455,7 @@ void upx_main(
|
||||
//
|
||||
|
||||
|
||||
#if !defined(USE_MMAP_FO)
|
||||
#if !(USE_MMAP_FO)
|
||||
// Free our temporary decompression buffer.
|
||||
munmap(buf, malloc_args.ma_length);
|
||||
#endif
|
||||
|
||||
@@ -76,7 +76,7 @@ xread(Extent *x, char *buf, size_t count)
|
||||
#define ERR_LAB error: exit(127);
|
||||
#define err_exit(a) goto error
|
||||
#else //}{ save debugging time
|
||||
#define ERR_LAB
|
||||
#define ERR_LAB /*empty*/
|
||||
static void
|
||||
err_exit(int a)
|
||||
{
|
||||
|
||||
@@ -177,7 +177,7 @@ xread(Extent *x, char *buf, size_t count)
|
||||
#define ERR_LAB error: exit(127);
|
||||
#define err_exit(a) goto error
|
||||
#else //}{ save debugging time
|
||||
#define ERR_LAB
|
||||
#define ERR_LAB /*empty*/
|
||||
static void __attribute__ ((__noreturn__))
|
||||
err_exit(int a)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
**************************************************************************/
|
||||
|
||||
// mmap() the temporary output file
|
||||
#define USE_MMAP_FO
|
||||
#define USE_MMAP_FO 1
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
@@ -50,7 +50,7 @@ struct Extent {
|
||||
};
|
||||
|
||||
|
||||
#if !defined(USE_MMAP_FO)
|
||||
#if !(USE_MMAP_FO)
|
||||
#if 1
|
||||
static __inline__ int xwrite(int fd, const void *buf, int count)
|
||||
{
|
||||
@@ -345,7 +345,7 @@ void upx_main(
|
||||
}
|
||||
|
||||
// Create the temporary output file.
|
||||
#if defined(USE_MMAP_FO)
|
||||
#if (USE_MMAP_FO)
|
||||
fdo = open(tmpname, O_RDWR | O_CREAT | O_EXCL, 0700);
|
||||
#else
|
||||
fdo = open(tmpname, O_WRONLY | O_CREAT | O_EXCL, 0700);
|
||||
@@ -365,7 +365,7 @@ void upx_main(
|
||||
// ----- Step 3: setup memory -----
|
||||
//
|
||||
|
||||
#if defined(USE_MMAP_FO)
|
||||
#if (USE_MMAP_FO)
|
||||
// FIXME: packer could set length
|
||||
buf = (unsigned char *)mmap(0, header.p_filesize,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED, fdo, 0);
|
||||
@@ -436,7 +436,7 @@ void upx_main(
|
||||
else
|
||||
{
|
||||
// Incompressible block
|
||||
#if defined(USE_MMAP_FO)
|
||||
#if (USE_MMAP_FO)
|
||||
//memcpy(buf, xi.buf, h.sz_unc);
|
||||
register unsigned long int __d0, __d1, __d2;
|
||||
__asm__ __volatile__( "rep; movsb"
|
||||
@@ -446,7 +446,7 @@ void upx_main(
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(USE_MMAP_FO)
|
||||
#if (USE_MMAP_FO)
|
||||
// unmap part of the output
|
||||
munmap(buf, h.sz_unc);
|
||||
buf += h.sz_unc;
|
||||
@@ -478,7 +478,7 @@ void upx_main(
|
||||
//
|
||||
|
||||
|
||||
#if !defined(USE_MMAP_FO)
|
||||
#if !(USE_MMAP_FO)
|
||||
// Free our temporary decompression buffer.
|
||||
munmap(buf, malloc_args.ma_length);
|
||||
#endif
|
||||
|
||||
@@ -81,7 +81,7 @@ xread(struct Extent *x, char *buf, size_t count)
|
||||
#define ERR_LAB error: exit(127);
|
||||
#define err_exit(a) goto error
|
||||
#else //}{ save debugging time
|
||||
#define ERR_LAB
|
||||
#define ERR_LAB /*empty*/
|
||||
static void
|
||||
err_exit(int a)
|
||||
{
|
||||
|
||||
@@ -78,7 +78,7 @@ xread(struct Extent *x, char *buf, size_t count)
|
||||
#define ERR_LAB error: exit(127);
|
||||
#define err_exit(a) goto error
|
||||
#else //}{ save debugging time
|
||||
#define ERR_LAB
|
||||
#define ERR_LAB /*empty*/
|
||||
static void
|
||||
err_exit(int a)
|
||||
{
|
||||
|
||||
@@ -167,7 +167,7 @@ xread(struct Extent *x, char *buf, size_t count)
|
||||
#define ERR_LAB error: exit(127);
|
||||
#define err_exit(a) goto error
|
||||
#else //}{ save debugging time
|
||||
#define ERR_LAB
|
||||
#define ERR_LAB /*empty*/
|
||||
static void
|
||||
err_exit(int a) __attribute__ ((__noreturn__));
|
||||
{
|
||||
|
||||
@@ -359,7 +359,7 @@ struct p_info // 12-byte packed program header follows stub loader
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(__attribute_cdecl)
|
||||
# define __attribute_cdecl
|
||||
# define __attribute_cdecl /*empty*/
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ typedef unsigned int nrv_uint;
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(__attribute_cdecl)
|
||||
# define __attribute_cdecl
|
||||
# define __attribute_cdecl /*empty*/
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -745,7 +745,7 @@ struct p_info // 12-byte packed program header follows stub loader
|
||||
#endif
|
||||
#endif
|
||||
#if !defined(__attribute_cdecl)
|
||||
# define __attribute_cdecl
|
||||
# define __attribute_cdecl /*empty*/
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ xread(Extent *x, char *buf, size_t count)
|
||||
#define ERR_LAB error: exit(127);
|
||||
#define err_exit(a) goto error
|
||||
#else //}{ save debugging time
|
||||
#define ERR_LAB
|
||||
#define ERR_LAB /*empty*/
|
||||
static void
|
||||
err_exit(int a)
|
||||
{
|
||||
|
||||
@@ -78,7 +78,7 @@ xread(Extent *x, char *buf, size_t count)
|
||||
#define ERR_LAB error: exit(127);
|
||||
#define err_exit(a) goto error
|
||||
#else //}{ save debugging time
|
||||
#define ERR_LAB
|
||||
#define ERR_LAB /*empty*/
|
||||
static void
|
||||
err_exit(int a)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user