forked from github/server
jam rules for profiling, warnings fixed
This commit is contained in:
parent
9fef5c651f
commit
32659cddb6
|
@ -12,6 +12,12 @@ if ! $(CCACHE_DIR) {
|
||||||
Echo Compiling with ccache ;
|
Echo Compiling with ccache ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $(PROFILE) = 1 {
|
||||||
|
Echo Compiling with profiler ;
|
||||||
|
CCFLAGS += -pg ;
|
||||||
|
LINKFLAGS += -pg ;
|
||||||
|
}
|
||||||
|
|
||||||
CCFLAGS += -Wall ;
|
CCFLAGS += -Wall ;
|
||||||
|
|
||||||
CCFLAGS += -Wwrite-strings
|
CCFLAGS += -Wwrite-strings
|
||||||
|
|
|
@ -157,7 +157,7 @@ const troop no_troop = {0, 0};
|
||||||
region *
|
region *
|
||||||
fleeregion(const unit * u)
|
fleeregion(const unit * u)
|
||||||
{
|
{
|
||||||
const region *r = u->region;
|
region *r = u->region;
|
||||||
region *neighbours[MAXDIRECTIONS];
|
region *neighbours[MAXDIRECTIONS];
|
||||||
int c = 0;
|
int c = 0;
|
||||||
direction_t i;
|
direction_t i;
|
||||||
|
|
|
@ -285,10 +285,11 @@ r_connect(const region * r, direction_t dir)
|
||||||
static region * buffer[MAXDIRECTIONS];
|
static region * buffer[MAXDIRECTIONS];
|
||||||
static const region * last = NULL;
|
static const region * last = NULL;
|
||||||
|
|
||||||
assert(dir<MAXDIRECTIONS);
|
|
||||||
#ifdef FAST_CONNECT
|
#ifdef FAST_CONNECT
|
||||||
|
region * rmodify = (region*)r;
|
||||||
if (r->connect[dir]) return r->connect[dir];
|
if (r->connect[dir]) return r->connect[dir];
|
||||||
#endif
|
#endif
|
||||||
|
assert(dir<MAXDIRECTIONS);
|
||||||
if (r != last) {
|
if (r != last) {
|
||||||
set = 0;
|
set = 0;
|
||||||
last = r;
|
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]);
|
buffer[dir] = rfindhash(r->x + delta_x[dir], r->y + delta_y[dir]);
|
||||||
set |= (1<<dir);
|
set |= (1<<dir);
|
||||||
#ifdef FAST_CONNECT
|
#ifdef FAST_CONNECT
|
||||||
r->connect[dir] = buffer[dir];
|
rmodify->connect[dir] = buffer[dir];
|
||||||
#endif
|
#endif
|
||||||
return buffer[dir];
|
return buffer[dir];
|
||||||
}
|
}
|
||||||
|
|
|
@ -889,20 +889,18 @@ readgame(const char * filename, int backup)
|
||||||
#endif
|
#endif
|
||||||
if(global.data_version >= SAVEXMLNAME_VERSION) {
|
if(global.data_version >= SAVEXMLNAME_VERSION) {
|
||||||
char basefile[1024];
|
char basefile[1024];
|
||||||
char *basearg;
|
const char *basearg = "(null)";
|
||||||
|
|
||||||
rs(F, basefile);
|
rs(F, basefile);
|
||||||
if (xmlfile != NULL) {
|
if (xmlfile != NULL) {
|
||||||
basearg = strrchr(xmlfile, '/');
|
basearg = strrchr(xmlfile, '/');
|
||||||
if(!basearg) {
|
if (basearg==NULL) {
|
||||||
basearg = xmlfile;
|
basearg = xmlfile;
|
||||||
} else {
|
} else {
|
||||||
basearg++;
|
++basearg;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
basearg = "(null)";
|
|
||||||
}
|
}
|
||||||
if(strcmp(basearg, basefile)) {
|
if (strcmp(basearg, basefile)!=0) {
|
||||||
printf("WARNING: xmlfile mismatch:\n");
|
printf("WARNING: xmlfile mismatch:\n");
|
||||||
printf("WARNING: datafile contains %s\n", basefile);
|
printf("WARNING: datafile contains %s\n", basefile);
|
||||||
printf("WARNING: argument/default is %s\n", basearg);
|
printf("WARNING: argument/default is %s\n", basearg);
|
||||||
|
|
|
@ -14,7 +14,7 @@ SOURCES =
|
||||||
gmcmd.c
|
gmcmd.c
|
||||||
infocmd.c
|
infocmd.c
|
||||||
museum.c
|
museum.c
|
||||||
oceannames.c
|
# oceannames.c
|
||||||
score.c
|
score.c
|
||||||
victoryconditions.c
|
victoryconditions.c
|
||||||
weather.c
|
weather.c
|
||||||
|
|
|
@ -38,7 +38,7 @@ namehash names[NMAXHASH];
|
||||||
void nhash(const char * name);
|
void nhash(const char * name);
|
||||||
|
|
||||||
typedef struct oceanname {
|
typedef struct oceanname {
|
||||||
struct name * next;
|
struct oceanname * next;
|
||||||
struct faction_list * factions;
|
struct faction_list * factions;
|
||||||
const char * name;
|
const char * name;
|
||||||
} oceanname;
|
} oceanname;
|
||||||
|
|
Loading…
Reference in New Issue