CLeanups.

committer: mfx <mfx> 1042480204 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2003-01-13 17:50:04 +00:00
parent 2162a01848
commit 992ceee52b
7 changed files with 19 additions and 9 deletions

View File

@ -1,9 +1,14 @@
ifeq ($(USE_GCC_DEPS),1)
ifeq ($(DEPS_DONE),)
DEPS_DONE = 1
# /***********************************************************************
# // automated dependencies
# // gcc automated dependencies
# ************************************************************************/
CFLAGS += -Wp,-MMD,.deps/$(*F).pp
EXTRA_CFLAGS += -Wp,-MMD,.deps/$(*F).pp
EXTRA_CXXFLAGS += -Wp,-MMD,.deps/$(*F).pp
ifeq ($(strip $(wildcard .deps)),)
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
@ -14,3 +19,6 @@ else
endif
endif
endif
endif

View File

@ -1,3 +1,5 @@
USE_GCC_DEPS := 1
# /***********************************************************************
# // defaults for gcc

View File

@ -212,7 +212,7 @@ endif # linux
ifeq ($(target),cross-m68k-linux)
include $(srcdir)/Makedefs.gcc
CC = m68k-linux-gcc
CC = m68k-linux-g++
CXX = m68k-linux-g++
DEFS += '-DUPX_CONFIG_H="config_h/linux.h"'
##LDLIBS += -lmcheck
endif # cross-m68k-linux
@ -568,6 +568,6 @@ endif
# // dependencies
# ************************************************************************/
include $(srcdir)/Makedefs.dep
-include $(srcdir)/Makedefs.dep
# vi:nowrap

View File

@ -411,7 +411,7 @@ typedef RETSIGTYPE (SIGTYPEENTRY *sig_type)(int);
# define UNUSED(parm) (parm = parm)
#endif
#define HIGH(array) ((unsigned) (sizeof(array)/sizeof((array)[0])))
#define TABLESIZE(table) ((sizeof(table)/sizeof((table)[0])))
#define ALIGN_DOWN(a,b) (((a) / (b)) * (b))
#define ALIGN_UP(a,b) ALIGN_DOWN((a) + ((b) - 1), b)

View File

@ -232,7 +232,7 @@ const FilterImp::FilterEntry FilterImp::filters[] = {
{ 0xb3,99, 0, f_sub32_4, u_sub32_4, s_sub32_4 },
};
const int FilterImp::n_filters = HIGH(filters);
const int FilterImp::n_filters = TABLESIZE(filters);
/*

View File

@ -66,7 +66,7 @@ void init_options(struct options_t *o)
o->w32pe.compress_exports = 1;
o->w32pe.compress_icons = 2;
o->w32pe.compress_resources = -1;
for (unsigned i = 0; i < HIGH(opt->w32pe.compress_rt); i++)
for (unsigned i = 0; i < TABLESIZE(opt->w32pe.compress_rt); i++)
opt->w32pe.compress_rt[i] = -1;
opt->w32pe.compress_rt[24] = false; // 24 == RT_MANIFEST
o->w32pe.strip_relocs = -1;

View File

@ -88,7 +88,7 @@ PackW32Pe::PackW32Pe(InputFile *f) : super(f)
//printf("pe_section_t %d\n", (int) sizeof(pe_section_t));
COMPILE_TIME_ASSERT(sizeof(pe_header_t) == 248);
COMPILE_TIME_ASSERT(sizeof(pe_section_t) == 40);
COMPILE_TIME_ASSERT(RT_LAST == HIGH(opt->w32pe.compress_rt));
COMPILE_TIME_ASSERT(RT_LAST == TABLESIZE(opt->w32pe.compress_rt));
isection = NULL;
oimport = NULL;
@ -1831,7 +1831,7 @@ void PackW32Pe::pack(OutputFile *fo)
memset(osection,0,sizeof(osection));
oh.entry = upxsection;
oh.objects = HIGH(osection);
oh.objects = 3;
oh.chksum = 0;
// fill the data directory