lint suppression
botl.c - unused argument in #if STATUS_HILITES code. mkmaze.c - "clang version 7.3.0 (clang-703.0.31)", or whatever version of gcc it's based on, warns that ''#define register /*empty*/'' hides a keyword. '-Wkeyword-macro' isn't mentioned in the recent gcc manual I checked, but it is being enabled by specifying '-pedantic' (rather than -Wall or -W) to the preprocessor. It could be turned off via '-Wno-keyword-macro' but this removes all mkmaze.c's register references instead. (Sean wanted that, and this might be why....)
This commit is contained in:
13
src/botl.c
13
src/botl.c
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 botl.c $NHDT-Date: 1452660188 2016/01/13 04:43:08 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.70 $ */
|
/* NetHack 3.6 botl.c $NHDT-Date: 1469930895 2016/07/31 02:08:15 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.75 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -1311,17 +1311,18 @@ boolean from_configfile;
|
|||||||
/* Now finally, we notify the window port */
|
/* Now finally, we notify the window port */
|
||||||
if (!from_configfile)
|
if (!from_configfile)
|
||||||
status_threshold(idx, status_hilites[idx].anytype,
|
status_threshold(idx, status_hilites[idx].anytype,
|
||||||
status_hilites[idx].threshold,
|
status_hilites[idx].threshold,
|
||||||
status_hilites[idx].behavior,
|
status_hilites[idx].behavior,
|
||||||
status_hilites[idx].coloridx[0],
|
status_hilites[idx].coloridx[0],
|
||||||
status_hilites[idx].coloridx[1]);
|
status_hilites[idx].coloridx[1]);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*ARGUSED*/
|
||||||
void
|
void
|
||||||
status_notify_windowport(all)
|
status_notify_windowport(all)
|
||||||
boolean all;
|
boolean all UNUSED;
|
||||||
{
|
{
|
||||||
int idx;
|
int idx;
|
||||||
anything it;
|
anything it;
|
||||||
|
|||||||
82
src/mkmaze.c
82
src/mkmaze.c
@@ -1,4 +1,4 @@
|
|||||||
/* NetHack 3.6 mkmaze.c $NHDT-Date: 1461571093 2016/04/25 07:58:13 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.47 $ */
|
/* NetHack 3.6 mkmaze.c $NHDT-Date: 1469930897 2016/07/31 02:08:17 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.50 $ */
|
||||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||||
/* NetHack may be freely redistributed. See license for details. */
|
/* NetHack may be freely redistributed. See license for details. */
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ STATIC_OVL int
|
|||||||
iswall(x, y)
|
iswall(x, y)
|
||||||
int x, y;
|
int x, y;
|
||||||
{
|
{
|
||||||
register int type;
|
int type;
|
||||||
|
|
||||||
if (!isok(x, y))
|
if (!isok(x, y))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -126,7 +126,7 @@ wall_cleanup(x1, y1, x2, y2)
|
|||||||
int x1, y1, x2, y2;
|
int x1, y1, x2, y2;
|
||||||
{
|
{
|
||||||
uchar type;
|
uchar type;
|
||||||
register int x, y;
|
int x, y;
|
||||||
struct rm *lev;
|
struct rm *lev;
|
||||||
|
|
||||||
/* sanity check on incoming variables */
|
/* sanity check on incoming variables */
|
||||||
@@ -158,7 +158,7 @@ fix_wall_spines(x1, y1, x2, y2)
|
|||||||
int x1, y1, x2, y2;
|
int x1, y1, x2, y2;
|
||||||
{
|
{
|
||||||
uchar type;
|
uchar type;
|
||||||
register int x,y;
|
int x, y;
|
||||||
struct rm *lev;
|
struct rm *lev;
|
||||||
int FDECL((*loc_f), (int, int));
|
int FDECL((*loc_f), (int, int));
|
||||||
int bits;
|
int bits;
|
||||||
@@ -226,7 +226,7 @@ int x1, y1, x2, y2;
|
|||||||
STATIC_OVL boolean
|
STATIC_OVL boolean
|
||||||
okay(x, y, dir)
|
okay(x, y, dir)
|
||||||
int x, y;
|
int x, y;
|
||||||
register int dir;
|
int dir;
|
||||||
{
|
{
|
||||||
mz_move(x, y, dir);
|
mz_move(x, y, dir);
|
||||||
mz_move(x, y, dir);
|
mz_move(x, y, dir);
|
||||||
@@ -460,9 +460,9 @@ static boolean was_waterlevel; /* ugh... this shouldn't be needed */
|
|||||||
void
|
void
|
||||||
fixup_special()
|
fixup_special()
|
||||||
{
|
{
|
||||||
register lev_region *r = lregions;
|
lev_region *r = lregions;
|
||||||
struct d_level lev;
|
struct d_level lev;
|
||||||
register int x, y;
|
int x, y;
|
||||||
struct mkroom *croom;
|
struct mkroom *croom;
|
||||||
boolean added_branch = FALSE;
|
boolean added_branch = FALSE;
|
||||||
|
|
||||||
@@ -600,7 +600,7 @@ fixup_special()
|
|||||||
|
|
||||||
create_secret_door(croom, W_ANY);
|
create_secret_door(croom, W_ANY);
|
||||||
} else if (on_level(&u.uz, &orcus_level)) {
|
} else if (on_level(&u.uz, &orcus_level)) {
|
||||||
register struct monst *mtmp, *mtmp2;
|
struct monst *mtmp, *mtmp2;
|
||||||
|
|
||||||
/* it's a ghost town, get rid of shopkeepers */
|
/* it's a ghost town, get rid of shopkeepers */
|
||||||
for (mtmp = fmon; mtmp; mtmp = mtmp2) {
|
for (mtmp = fmon; mtmp; mtmp = mtmp2) {
|
||||||
@@ -620,7 +620,7 @@ fixup_special()
|
|||||||
|
|
||||||
void
|
void
|
||||||
makemaz(s)
|
makemaz(s)
|
||||||
register const char *s;
|
const char *s;
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
char protofile[20];
|
char protofile[20];
|
||||||
@@ -839,7 +839,7 @@ walkfrom(x, y, typ)
|
|||||||
int x, y;
|
int x, y;
|
||||||
schar typ;
|
schar typ;
|
||||||
{
|
{
|
||||||
register int q, a, dir;
|
int q, a, dir;
|
||||||
int dirs[4];
|
int dirs[4];
|
||||||
|
|
||||||
if (!typ) {
|
if (!typ) {
|
||||||
@@ -887,7 +887,8 @@ coord *cc;
|
|||||||
&& levl[cc->x][cc->y].typ
|
&& levl[cc->x][cc->y].typ
|
||||||
!= (level.flags.corrmaze ? CORR : ROOM));
|
!= (level.flags.corrmaze ? CORR : ROOM));
|
||||||
if (cpt >= 100) {
|
if (cpt >= 100) {
|
||||||
register int x, y;
|
int x, y;
|
||||||
|
|
||||||
/* last try */
|
/* last try */
|
||||||
for (x = 0; x < (x_maze_max >> 1) - 1; x++)
|
for (x = 0; x < (x_maze_max >> 1) - 1; x++)
|
||||||
for (y = 0; y < (y_maze_max >> 1) - 1; y++) {
|
for (y = 0; y < (y_maze_max >> 1) - 1; y++) {
|
||||||
@@ -915,9 +916,9 @@ coord *cc;
|
|||||||
void
|
void
|
||||||
bound_digging()
|
bound_digging()
|
||||||
{
|
{
|
||||||
register int x, y;
|
int x, y;
|
||||||
register unsigned typ;
|
unsigned typ;
|
||||||
register struct rm *lev;
|
struct rm *lev;
|
||||||
boolean found, nonwall;
|
boolean found, nonwall;
|
||||||
int xmin, xmax, ymin, ymax;
|
int xmin, xmax, ymin, ymax;
|
||||||
|
|
||||||
@@ -1024,8 +1025,10 @@ fumaroles()
|
|||||||
for (n = rn2(3) + 2; n; n--) {
|
for (n = rn2(3) + 2; n; n--) {
|
||||||
xchar x = rn1(COLNO - 4, 3);
|
xchar x = rn1(COLNO - 4, 3);
|
||||||
xchar y = rn1(ROWNO - 4, 3);
|
xchar y = rn1(ROWNO - 4, 3);
|
||||||
|
|
||||||
if (levl[x][y].typ == LAVAPOOL) {
|
if (levl[x][y].typ == LAVAPOOL) {
|
||||||
NhRegion *r = create_gas_cloud(x, y, 4 + rn2(5), rn1(10, 5));
|
NhRegion *r = create_gas_cloud(x, y, 4 + rn2(5), rn1(10, 5));
|
||||||
|
|
||||||
clear_heros_fault(r);
|
clear_heros_fault(r);
|
||||||
snd = TRUE;
|
snd = TRUE;
|
||||||
if (distu(x, y) < 15)
|
if (distu(x, y) < 15)
|
||||||
@@ -1043,11 +1046,6 @@ fumaroles()
|
|||||||
* other source files, but they are all so nicely encapsulated here.
|
* other source files, but they are all so nicely encapsulated here.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
/* to ease the work of debuggers at this stage */
|
|
||||||
#define register
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define CONS_OBJ 0
|
#define CONS_OBJ 0
|
||||||
#define CONS_MON 1
|
#define CONS_MON 1
|
||||||
#define CONS_HERO 2
|
#define CONS_HERO 2
|
||||||
@@ -1071,8 +1069,8 @@ void
|
|||||||
movebubbles()
|
movebubbles()
|
||||||
{
|
{
|
||||||
static boolean up;
|
static boolean up;
|
||||||
register struct bubble *b;
|
struct bubble *b;
|
||||||
register int x, y, i, j;
|
int x, y, i, j;
|
||||||
struct trap *btrap;
|
struct trap *btrap;
|
||||||
static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0,
|
static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0 };
|
0, 0, 0, 0, 0, 0 };
|
||||||
@@ -1194,7 +1192,7 @@ movebubbles()
|
|||||||
*/
|
*/
|
||||||
up = !up;
|
up = !up;
|
||||||
for (b = up ? bbubbles : ebubbles; b; b = up ? b->next : b->prev) {
|
for (b = up ? bbubbles : ebubbles; b; b = up ? b->next : b->prev) {
|
||||||
register int rx = rn2(3), ry = rn2(3);
|
int rx = rn2(3), ry = rn2(3);
|
||||||
|
|
||||||
mv_bubble(b, b->dx + 1 - (!b->dx ? rx : (rx ? 1 : 0)),
|
mv_bubble(b, b->dx + 1 - (!b->dx ? rx : (rx ? 1 : 0)),
|
||||||
b->dy + 1 - (!b->dy ? ry : (ry ? 1 : 0)), FALSE);
|
b->dy + 1 - (!b->dy ? ry : (ry ? 1 : 0)), FALSE);
|
||||||
@@ -1210,8 +1208,8 @@ movebubbles()
|
|||||||
void
|
void
|
||||||
water_friction()
|
water_friction()
|
||||||
{
|
{
|
||||||
register int x, y, dx, dy;
|
int x, y, dx, dy;
|
||||||
register boolean eff = FALSE;
|
boolean eff = FALSE;
|
||||||
|
|
||||||
if (Swimming && rn2(4))
|
if (Swimming && rn2(4))
|
||||||
return; /* natural swimmers have advantage */
|
return; /* natural swimmers have advantage */
|
||||||
@@ -1245,7 +1243,7 @@ void
|
|||||||
save_waterlevel(fd, mode)
|
save_waterlevel(fd, mode)
|
||||||
int fd, mode;
|
int fd, mode;
|
||||||
{
|
{
|
||||||
register struct bubble *b;
|
struct bubble *b;
|
||||||
|
|
||||||
if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz))
|
if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz))
|
||||||
return;
|
return;
|
||||||
@@ -1268,11 +1266,10 @@ int fd, mode;
|
|||||||
|
|
||||||
void
|
void
|
||||||
restore_waterlevel(fd)
|
restore_waterlevel(fd)
|
||||||
register int fd;
|
int fd;
|
||||||
{
|
{
|
||||||
register struct bubble *b = (struct bubble *) 0, *btmp;
|
struct bubble *b = (struct bubble *) 0, *btmp;
|
||||||
register int i;
|
int i, n;
|
||||||
int n;
|
|
||||||
|
|
||||||
if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz))
|
if (!Is_waterlevel(&u.uz) && !Is_airlevel(&u.uz))
|
||||||
return;
|
return;
|
||||||
@@ -1305,7 +1302,7 @@ const char *
|
|||||||
waterbody_name(x, y)
|
waterbody_name(x, y)
|
||||||
xchar x, y;
|
xchar x, y;
|
||||||
{
|
{
|
||||||
register struct rm *lev;
|
struct rm *lev;
|
||||||
schar ltyp;
|
schar ltyp;
|
||||||
|
|
||||||
if (!isok(x, y))
|
if (!isok(x, y))
|
||||||
@@ -1344,10 +1341,10 @@ set_wportal()
|
|||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
setup_waterlevel()
|
setup_waterlevel()
|
||||||
{
|
{
|
||||||
register int x, y;
|
int x, y;
|
||||||
register int xskip, yskip;
|
int xskip, yskip;
|
||||||
register int water_glyph = cmap_to_glyph(S_water);
|
int water_glyph = cmap_to_glyph(S_water),
|
||||||
register int air_glyph = cmap_to_glyph(S_air);
|
air_glyph = cmap_to_glyph(S_air);
|
||||||
|
|
||||||
/* ouch, hardcoded... */
|
/* ouch, hardcoded... */
|
||||||
|
|
||||||
@@ -1380,7 +1377,7 @@ setup_waterlevel()
|
|||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
unsetup_waterlevel()
|
unsetup_waterlevel()
|
||||||
{
|
{
|
||||||
register struct bubble *b, *bb;
|
struct bubble *b, *bb;
|
||||||
|
|
||||||
/* free bubbles */
|
/* free bubbles */
|
||||||
|
|
||||||
@@ -1393,7 +1390,7 @@ unsetup_waterlevel()
|
|||||||
|
|
||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
mk_bubble(x, y, n)
|
mk_bubble(x, y, n)
|
||||||
register int x, y, n;
|
int x, y, n;
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* These bit masks make visually pleasing bubbles on a normal aspect
|
* These bit masks make visually pleasing bubbles on a normal aspect
|
||||||
@@ -1402,14 +1399,15 @@ register int x, y, n;
|
|||||||
* in situ, either. The first two elements tell the dimensions of
|
* in situ, either. The first two elements tell the dimensions of
|
||||||
* the bubble's bounding box.
|
* the bubble's bounding box.
|
||||||
*/
|
*/
|
||||||
static uchar bm2[] = { 2, 1, 0x3 }, bm3[] = { 3, 2, 0x7, 0x7 },
|
static uchar bm2[] = { 2, 1, 0x3 },
|
||||||
|
bm3[] = { 3, 2, 0x7, 0x7 },
|
||||||
bm4[] = { 4, 3, 0x6, 0xf, 0x6 },
|
bm4[] = { 4, 3, 0x6, 0xf, 0x6 },
|
||||||
bm5[] = { 5, 3, 0xe, 0x1f, 0xe },
|
bm5[] = { 5, 3, 0xe, 0x1f, 0xe },
|
||||||
bm6[] = { 6, 4, 0x1e, 0x3f, 0x3f, 0x1e },
|
bm6[] = { 6, 4, 0x1e, 0x3f, 0x3f, 0x1e },
|
||||||
bm7[] = { 7, 4, 0x3e, 0x7f, 0x7f, 0x3e },
|
bm7[] = { 7, 4, 0x3e, 0x7f, 0x7f, 0x3e },
|
||||||
bm8[] = { 8, 4, 0x7e, 0xff, 0xff, 0x7e },
|
bm8[] = { 8, 4, 0x7e, 0xff, 0xff, 0x7e },
|
||||||
*bmask[] = { bm2, bm3, bm4, bm5, bm6, bm7, bm8 };
|
*bmask[] = { bm2, bm3, bm4, bm5, bm6, bm7, bm8 };
|
||||||
register struct bubble *b;
|
struct bubble *b;
|
||||||
|
|
||||||
if (x >= bxmax || y >= bymax)
|
if (x >= bxmax || y >= bymax)
|
||||||
return;
|
return;
|
||||||
@@ -1455,11 +1453,11 @@ register int x, y, n;
|
|||||||
*/
|
*/
|
||||||
STATIC_OVL void
|
STATIC_OVL void
|
||||||
mv_bubble(b, dx, dy, ini)
|
mv_bubble(b, dx, dy, ini)
|
||||||
register struct bubble *b;
|
struct bubble *b;
|
||||||
register int dx, dy;
|
int dx, dy;
|
||||||
register boolean ini;
|
boolean ini;
|
||||||
{
|
{
|
||||||
register int x, y, i, j, colli = 0;
|
int x, y, i, j, colli = 0;
|
||||||
struct container *cons, *ctemp;
|
struct container *cons, *ctemp;
|
||||||
|
|
||||||
/* clouds move slowly */
|
/* clouds move slowly */
|
||||||
|
|||||||
Reference in New Issue
Block a user