jam rules for profiling, warnings fixed

This commit is contained in:
Enno Rehling 2004-01-12 16:22:14 +00:00
parent 9fef5c651f
commit 32659cddb6
6 changed files with 19 additions and 14 deletions

View File

@ -12,6 +12,12 @@ if ! $(CCACHE_DIR) {
Echo Compiling with ccache ;
}
if $(PROFILE) = 1 {
Echo Compiling with profiler ;
CCFLAGS += -pg ;
LINKFLAGS += -pg ;
}
CCFLAGS += -Wall ;
CCFLAGS += -Wwrite-strings

View File

@ -157,7 +157,7 @@ const troop no_troop = {0, 0};
region *
fleeregion(const unit * u)
{
const region *r = u->region;
region *r = u->region;
region *neighbours[MAXDIRECTIONS];
int c = 0;
direction_t i;

View File

@ -285,10 +285,11 @@ r_connect(const region * r, direction_t dir)
static region * buffer[MAXDIRECTIONS];
static const region * last = NULL;
assert(dir<MAXDIRECTIONS);
#ifdef FAST_CONNECT
region * rmodify = (region*)r;
if (r->connect[dir]) return r->connect[dir];
#endif
assert(dir<MAXDIRECTIONS);
if (r != last) {
set = 0;
last = r;
@ -298,7 +299,7 @@ r_connect(const region * r, direction_t dir)
buffer[dir] = rfindhash(r->x + delta_x[dir], r->y + delta_y[dir]);
set |= (1<<dir);
#ifdef FAST_CONNECT
r->connect[dir] = buffer[dir];
rmodify->connect[dir] = buffer[dir];
#endif
return buffer[dir];
}

View File

@ -889,20 +889,18 @@ readgame(const char * filename, int backup)
#endif
if(global.data_version >= SAVEXMLNAME_VERSION) {
char basefile[1024];
char *basearg;
const char *basearg = "(null)";
rs(F, basefile);
if (xmlfile != NULL) {
basearg = strrchr(xmlfile, '/');
if(!basearg) {
if (basearg==NULL) {
basearg = xmlfile;
} else {
basearg++;
++basearg;
}
} else {
basearg = "(null)";
}
if(strcmp(basearg, basefile)) {
if (strcmp(basearg, basefile)!=0) {
printf("WARNING: xmlfile mismatch:\n");
printf("WARNING: datafile contains %s\n", basefile);
printf("WARNING: argument/default is %s\n", basearg);

View File

@ -14,7 +14,7 @@ SOURCES =
gmcmd.c
infocmd.c
museum.c
oceannames.c
# oceannames.c
score.c
victoryconditions.c
weather.c

View File

@ -38,7 +38,7 @@ namehash names[NMAXHASH];
void nhash(const char * name);
typedef struct oceanname {
struct name * next;
struct oceanname * next;
struct faction_list * factions;
const char * name;
} oceanname;