Fix compiler warnings in macos build.
This commit is contained in:
+2
-1
@@ -366,7 +366,8 @@ struct savefile_info {
|
|||||||
|
|
||||||
/* Supply nhassert macro if not supplied by port */
|
/* Supply nhassert macro if not supplied by port */
|
||||||
#ifndef nhassert
|
#ifndef nhassert
|
||||||
#define nhassert(expression) ((void)0)
|
#define nhassert(e) ((void)0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif /* GLOBAL_H */
|
#endif /* GLOBAL_H */
|
||||||
|
|||||||
+1
-1
@@ -414,6 +414,6 @@ instance_globals_init()
|
|||||||
sfcap = default_sfinfo;
|
sfcap = default_sfinfo;
|
||||||
sfrestinfo = default_sfinfo;
|
sfrestinfo = default_sfinfo;
|
||||||
sfsaveinfo = default_sfinfo;
|
sfsaveinfo = default_sfinfo;
|
||||||
};
|
}
|
||||||
|
|
||||||
/*decl.c*/
|
/*decl.c*/
|
||||||
|
|||||||
+2
-2
@@ -1156,10 +1156,10 @@ int x,y;
|
|||||||
int tx = u.tx;
|
int tx = u.tx;
|
||||||
int ty = u.ty;
|
int ty = u.ty;
|
||||||
boolean ret;
|
boolean ret;
|
||||||
int g = glyph_at(x,y);
|
int glyph = glyph_at(x,y);
|
||||||
if (x == u.ux && y == u.uy)
|
if (x == u.ux && y == u.uy)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
if (isok(x,y) && glyph_is_cmap(g) && S_stone == glyph_to_cmap(g)
|
if (isok(x,y) && glyph_is_cmap(glyph) && S_stone == glyph_to_cmap(glyph)
|
||||||
&& !levl[x][y].seenv)
|
&& !levl[x][y].seenv)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
u.tx = x;
|
u.tx = x;
|
||||||
|
|||||||
+8
-8
@@ -1008,33 +1008,33 @@ char *buf;
|
|||||||
int k;
|
int k;
|
||||||
time_t timeresult = (time_t) 0;
|
time_t timeresult = (time_t) 0;
|
||||||
struct tm t, *lt;
|
struct tm t, *lt;
|
||||||
char *g, *p, y[5], mo[3], md[3], h[3], mi[3], s[3];
|
char *d, *p, y[5], mo[3], md[3], h[3], mi[3], s[3];
|
||||||
|
|
||||||
if (buf && strlen(buf) == 14) {
|
if (buf && strlen(buf) == 14) {
|
||||||
g = buf;
|
d = buf;
|
||||||
p = y; /* year */
|
p = y; /* year */
|
||||||
for (k = 0; k < 4; ++k)
|
for (k = 0; k < 4; ++k)
|
||||||
*p++ = *g++;
|
*p++ = *d++;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
p = mo; /* month */
|
p = mo; /* month */
|
||||||
for (k = 0; k < 2; ++k)
|
for (k = 0; k < 2; ++k)
|
||||||
*p++ = *g++;
|
*p++ = *d++;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
p = md; /* day */
|
p = md; /* day */
|
||||||
for (k = 0; k < 2; ++k)
|
for (k = 0; k < 2; ++k)
|
||||||
*p++ = *g++;
|
*p++ = *d++;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
p = h; /* hour */
|
p = h; /* hour */
|
||||||
for (k = 0; k < 2; ++k)
|
for (k = 0; k < 2; ++k)
|
||||||
*p++ = *g++;
|
*p++ = *d++;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
p = mi; /* minutes */
|
p = mi; /* minutes */
|
||||||
for (k = 0; k < 2; ++k)
|
for (k = 0; k < 2; ++k)
|
||||||
*p++ = *g++;
|
*p++ = *d++;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
p = s; /* seconds */
|
p = s; /* seconds */
|
||||||
for (k = 0; k < 2; ++k)
|
for (k = 0; k < 2; ++k)
|
||||||
*p++ = *g++;
|
*p++ = *d++;
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
lt = getlt();
|
lt = getlt();
|
||||||
if (lt) {
|
if (lt) {
|
||||||
|
|||||||
+12
-12
@@ -3359,21 +3359,21 @@ retry:
|
|||||||
} else if (!strcmpi(bp, "looking glass")) {
|
} else if (!strcmpi(bp, "looking glass")) {
|
||||||
; /* avoid false hit on "* glass" */
|
; /* avoid false hit on "* glass" */
|
||||||
} else if (!BSTRCMPI(bp, p - 6, " glass") || !strcmpi(bp, "glass")) {
|
} else if (!BSTRCMPI(bp, p - 6, " glass") || !strcmpi(bp, "glass")) {
|
||||||
register char *g = bp;
|
register char *s = bp;
|
||||||
|
|
||||||
/* treat "broken glass" as a non-existent item; since "broken" is
|
/* treat "broken glass" as a non-existent item; since "broken" is
|
||||||
also a chest/box prefix it might have been stripped off above */
|
also a chest/box prefix it might have been stripped off above */
|
||||||
if (broken || strstri(g, "broken"))
|
if (broken || strstri(s, "broken"))
|
||||||
return (struct obj *) 0;
|
return (struct obj *) 0;
|
||||||
if (!strncmpi(g, "worthless ", 10))
|
if (!strncmpi(s, "worthless ", 10))
|
||||||
g += 10;
|
s += 10;
|
||||||
if (!strncmpi(g, "piece of ", 9))
|
if (!strncmpi(s, "piece of ", 9))
|
||||||
g += 9;
|
s += 9;
|
||||||
if (!strncmpi(g, "colored ", 8))
|
if (!strncmpi(s, "colored ", 8))
|
||||||
g += 8;
|
s += 8;
|
||||||
else if (!strncmpi(g, "coloured ", 9))
|
else if (!strncmpi(s, "coloured ", 9))
|
||||||
g += 9;
|
s += 9;
|
||||||
if (!strcmpi(g, "glass")) { /* choose random color */
|
if (!strcmpi(s, "glass")) { /* choose random color */
|
||||||
/* 9 different kinds */
|
/* 9 different kinds */
|
||||||
typ = LAST_GEM + rnd(9);
|
typ = LAST_GEM + rnd(9);
|
||||||
if (objects[typ].oc_class == GEM_CLASS)
|
if (objects[typ].oc_class == GEM_CLASS)
|
||||||
@@ -3384,7 +3384,7 @@ retry:
|
|||||||
char tbuf[BUFSZ];
|
char tbuf[BUFSZ];
|
||||||
|
|
||||||
Strcpy(tbuf, "worthless piece of ");
|
Strcpy(tbuf, "worthless piece of ");
|
||||||
Strcat(tbuf, g); /* assume it starts with the color */
|
Strcat(tbuf, s); /* assume it starts with the color */
|
||||||
Strcpy(bp, tbuf);
|
Strcpy(bp, tbuf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -282,7 +282,7 @@ char who, /* 'd' => deity, 'l' => leader, 'n' => nemesis, 'o' => artifact */
|
|||||||
which; /* 'h'|'H'|'i'|'I'|'j'|'J' */
|
which; /* 'h'|'H'|'i'|'I'|'j'|'J' */
|
||||||
{
|
{
|
||||||
const char *pnoun;
|
const char *pnoun;
|
||||||
int g;
|
int godgend;
|
||||||
char lwhich = lowc(which); /* H,I,J -> h,i,j */
|
char lwhich = lowc(which); /* H,I,J -> h,i,j */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -298,13 +298,13 @@ char who, /* 'd' => deity, 'l' => leader, 'n' => nemesis, 'o' => artifact */
|
|||||||
: (lwhich == 'i') ? "them"
|
: (lwhich == 'i') ? "them"
|
||||||
: (lwhich == 'j') ? "their" : "?";
|
: (lwhich == 'j') ? "their" : "?";
|
||||||
} else {
|
} else {
|
||||||
g = (who == 'd') ? quest_status.godgend
|
godgend = (who == 'd') ? quest_status.godgend
|
||||||
: (who == 'l') ? quest_status.ldrgend
|
: (who == 'l') ? quest_status.ldrgend
|
||||||
: (who == 'n') ? quest_status.nemgend
|
: (who == 'n') ? quest_status.nemgend
|
||||||
: 2; /* default to neuter */
|
: 2; /* default to neuter */
|
||||||
pnoun = (lwhich == 'h') ? genders[g].he
|
pnoun = (lwhich == 'h') ? genders[godgend].he
|
||||||
: (lwhich == 'i') ? genders[g].him
|
: (lwhich == 'i') ? genders[godgend].him
|
||||||
: (lwhich == 'j') ? genders[g].his : "?";
|
: (lwhich == 'j') ? genders[godgend].his : "?";
|
||||||
}
|
}
|
||||||
Strcpy(cvt_buf, pnoun);
|
Strcpy(cvt_buf, pnoun);
|
||||||
/* capitalize for H,I,J */
|
/* capitalize for H,I,J */
|
||||||
|
|||||||
+16
-16
@@ -769,7 +769,7 @@ const struct Align aligns[] = {
|
|||||||
static struct {
|
static struct {
|
||||||
boolean roles[SIZE(roles)];
|
boolean roles[SIZE(roles)];
|
||||||
short mask;
|
short mask;
|
||||||
} rfilter = UNDEFINED_VALUES;
|
} rfilter = { UNDEFINED_VALUES, UNDEFINED_VALUE};
|
||||||
|
|
||||||
STATIC_DCL int NDECL(randrole_filtered);
|
STATIC_DCL int NDECL(randrole_filtered);
|
||||||
STATIC_DCL char *FDECL(promptsep, (char *, int));
|
STATIC_DCL char *FDECL(promptsep, (char *, int));
|
||||||
@@ -1757,11 +1757,11 @@ winid where;
|
|||||||
not_yet[] = " not yet specified",
|
not_yet[] = " not yet specified",
|
||||||
rand_choice[] = " random";
|
rand_choice[] = " random";
|
||||||
char buf[BUFSZ];
|
char buf[BUFSZ];
|
||||||
int r, c, g, a, allowmask;
|
int r, c, gend, a, allowmask;
|
||||||
|
|
||||||
r = flags.initrole;
|
r = flags.initrole;
|
||||||
c = flags.initrace;
|
c = flags.initrace;
|
||||||
g = flags.initgend;
|
gend = flags.initgend;
|
||||||
a = flags.initalign;
|
a = flags.initalign;
|
||||||
if (r >= 0) {
|
if (r >= 0) {
|
||||||
allowmask = roles[r].allow;
|
allowmask = roles[r].allow;
|
||||||
@@ -1770,9 +1770,9 @@ winid where;
|
|||||||
else if (c >= 0 && !(allowmask & ROLE_RACEMASK & races[c].allow))
|
else if (c >= 0 && !(allowmask & ROLE_RACEMASK & races[c].allow))
|
||||||
c = ROLE_RANDOM;
|
c = ROLE_RANDOM;
|
||||||
if ((allowmask & ROLE_GENDMASK) == ROLE_MALE)
|
if ((allowmask & ROLE_GENDMASK) == ROLE_MALE)
|
||||||
g = 0; /* role forces male (hypothetical) */
|
gend = 0; /* role forces male (hypothetical) */
|
||||||
else if ((allowmask & ROLE_GENDMASK) == ROLE_FEMALE)
|
else if ((allowmask & ROLE_GENDMASK) == ROLE_FEMALE)
|
||||||
g = 1; /* role forces female (valkyrie) */
|
gend = 1; /* role forces female (valkyrie) */
|
||||||
if ((allowmask & ROLE_ALIGNMASK) == AM_LAWFUL)
|
if ((allowmask & ROLE_ALIGNMASK) == AM_LAWFUL)
|
||||||
a = 0; /* aligns[lawful] */
|
a = 0; /* aligns[lawful] */
|
||||||
else if ((allowmask & ROLE_ALIGNMASK) == AM_NEUTRAL)
|
else if ((allowmask & ROLE_ALIGNMASK) == AM_NEUTRAL)
|
||||||
@@ -1804,10 +1804,10 @@ winid where;
|
|||||||
: roles[r].name.m);
|
: roles[r].name.m);
|
||||||
if (r >= 0 && roles[r].name.f) {
|
if (r >= 0 && roles[r].name.f) {
|
||||||
/* distinct female name [caveman/cavewoman, priest/priestess] */
|
/* distinct female name [caveman/cavewoman, priest/priestess] */
|
||||||
if (g == 1)
|
if (gend == 1)
|
||||||
/* female specified; replace male role name with female one */
|
/* female specified; replace male role name with female one */
|
||||||
Sprintf(index(buf, ':'), ": %s", roles[r].name.f);
|
Sprintf(index(buf, ':'), ": %s", roles[r].name.f);
|
||||||
else if (g < 0)
|
else if (gend < 0)
|
||||||
/* gender unspecified; append slash and female role name */
|
/* gender unspecified; append slash and female role name */
|
||||||
Sprintf(eos(buf), "/%s", roles[r].name.f);
|
Sprintf(eos(buf), "/%s", roles[r].name.f);
|
||||||
}
|
}
|
||||||
@@ -1820,11 +1820,11 @@ winid where;
|
|||||||
: races[c].noun);
|
: races[c].noun);
|
||||||
putstr(where, 0, buf);
|
putstr(where, 0, buf);
|
||||||
Sprintf(buf, "%12s ", "gender:");
|
Sprintf(buf, "%12s ", "gender:");
|
||||||
Strcat(buf, (which == RS_GENDER) ? choosing : (g == ROLE_NONE)
|
Strcat(buf, (which == RS_GENDER) ? choosing : (gend == ROLE_NONE)
|
||||||
? not_yet
|
? not_yet
|
||||||
: (g == ROLE_RANDOM)
|
: (gend == ROLE_RANDOM)
|
||||||
? rand_choice
|
? rand_choice
|
||||||
: genders[g].adj);
|
: genders[gend].adj);
|
||||||
putstr(where, 0, buf);
|
putstr(where, 0, buf);
|
||||||
Sprintf(buf, "%12s ", "alignment:");
|
Sprintf(buf, "%12s ", "alignment:");
|
||||||
Strcat(buf, (which == RS_ALGNMNT) ? choosing : (a == ROLE_NONE)
|
Strcat(buf, (which == RS_ALGNMNT) ? choosing : (a == ROLE_NONE)
|
||||||
@@ -1852,7 +1852,7 @@ boolean preselect;
|
|||||||
anything any;
|
anything any;
|
||||||
char buf[BUFSZ];
|
char buf[BUFSZ];
|
||||||
const char *what = 0, *constrainer = 0, *forcedvalue = 0;
|
const char *what = 0, *constrainer = 0, *forcedvalue = 0;
|
||||||
int f = 0, r, c, g, a, i, allowmask;
|
int f = 0, r, c, gend, a, i, allowmask;
|
||||||
|
|
||||||
r = flags.initrole;
|
r = flags.initrole;
|
||||||
c = flags.initrace;
|
c = flags.initrace;
|
||||||
@@ -1894,16 +1894,16 @@ boolean preselect;
|
|||||||
case RS_GENDER:
|
case RS_GENDER:
|
||||||
what = "gender";
|
what = "gender";
|
||||||
f = flags.initgend;
|
f = flags.initgend;
|
||||||
g = ROLE_NONE;
|
gend = ROLE_NONE;
|
||||||
if (r >= 0) {
|
if (r >= 0) {
|
||||||
allowmask = roles[r].allow & ROLE_GENDMASK;
|
allowmask = roles[r].allow & ROLE_GENDMASK;
|
||||||
if (allowmask == ROLE_MALE)
|
if (allowmask == ROLE_MALE)
|
||||||
g = 0; /* genders[male] */
|
gend = 0; /* genders[male] */
|
||||||
else if (allowmask == ROLE_FEMALE)
|
else if (allowmask == ROLE_FEMALE)
|
||||||
g = 1; /* genders[female] */
|
gend = 1; /* genders[female] */
|
||||||
if (g >= 0) {
|
if (gend >= 0) {
|
||||||
constrainer = "role";
|
constrainer = "role";
|
||||||
forcedvalue = genders[g].adj;
|
forcedvalue = genders[gend].adj;
|
||||||
} else if (f >= 0
|
} else if (f >= 0
|
||||||
&& (allowmask & ~rfilter.mask) == genders[f].allow) {
|
&& (allowmask & ~rfilter.mask) == genders[f].allow) {
|
||||||
/* if there is only one gender choice available due to user
|
/* if there is only one gender choice available due to user
|
||||||
|
|||||||
@@ -810,6 +810,7 @@
|
|||||||
3186A3B121A4B0FD0052BF02 /* bitmfile.h */,
|
3186A3B121A4B0FD0052BF02 /* bitmfile.h */,
|
||||||
3186A36E21A4B0FA0052BF02 /* botl.h */,
|
3186A36E21A4B0FA0052BF02 /* botl.h */,
|
||||||
3186A38721A4B0FB0052BF02 /* color.h */,
|
3186A38721A4B0FB0052BF02 /* color.h */,
|
||||||
|
31B8A30A21A20D730055BD01 /* config.h */,
|
||||||
3186A3C621A4B0FE0052BF02 /* config1.h */,
|
3186A3C621A4B0FE0052BF02 /* config1.h */,
|
||||||
3186A37121A4B0FA0052BF02 /* context.h */,
|
3186A37121A4B0FA0052BF02 /* context.h */,
|
||||||
3186A3C521A4B0FE0052BF02 /* coord.h */,
|
3186A3C521A4B0FE0052BF02 /* coord.h */,
|
||||||
@@ -901,7 +902,6 @@
|
|||||||
3186A36D21A4B0F90052BF02 /* xwindowp.h */,
|
3186A36D21A4B0F90052BF02 /* xwindowp.h */,
|
||||||
3186A3BF21A4B0FD0052BF02 /* you.h */,
|
3186A3BF21A4B0FD0052BF02 /* you.h */,
|
||||||
3186A3A721A4B0FD0052BF02 /* youprop.h */,
|
3186A3A721A4B0FD0052BF02 /* youprop.h */,
|
||||||
31B8A30A21A20D730055BD01 /* config.h */,
|
|
||||||
);
|
);
|
||||||
name = include;
|
name = include;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
|
|||||||
Reference in New Issue
Block a user