-/* NetHack 3.6 end.c $NHDT-Date: 1447576343 2015/11/15 08:32:23 $ $NHDT-Branch: master $:$NHDT-Revision: 1.103 $ */
+/* NetHack 3.6 end.c $NHDT-Date: 1448094339 2015/11/21 08:25:39 $ $NHDT-Branch: master $:$NHDT-Revision: 1.105 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
char *defquery;
{
int idx;
- char *dop = index(disclosure_options, category);
+ char *dop;
- if (dop && defquery) {
+ *defquery = 'n';
+ if ((dop = index(disclosure_options, category)) != 0) {
idx = (int) (dop - disclosure_options);
- if (idx < 0 || idx > (NUM_DISCLOSURE_OPTIONS - 1)) {
+ if (idx < 0 || idx >= NUM_DISCLOSURE_OPTIONS) {
impossible(
- "should_query_disclose_option: bad disclosure index %d %c",
- idx, category);
+ "should_query_disclose_option: bad disclosure index %d %c",
+ idx, category);
*defquery = DISCLOSE_PROMPT_DEFAULT_YES;
return TRUE;
}
return TRUE;
}
}
- if (defquery)
- impossible("should_query_disclose_option: bad category %c", category);
- else
- impossible("should_query_disclose_option: null defquery");
+ impossible("should_query_disclose_option: bad category %c", category);
return TRUE;
}
int how;
boolean taken;
{
- char c = 0, defquery;
+ char c = '\0', defquery;
char qbuf[QBUFSZ];
boolean ask = FALSE;
*/
if (ntypes != 0) {
c = ask ? yn_function(
- "Do you want an account of creatures vanquished?",
- ynqchars, defquery)
+ "Do you want an account of creatures vanquished?",
+ ynqchars, defquery)
: defquery;
if (c == 'q')
done_stopprint++;
if (k->id == id)
break;
}
-
return k;
}
-/* NetHack 3.6 options.c $NHDT-Date: 1447234076 2015/11/11 09:27:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.240 $ */
+/* NetHack 3.6 options.c $NHDT-Date: 1448094341 2015/11/21 08:25:41 $ $NHDT-Branch: master $:$NHDT-Revision: 1.241 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
register char *opts;
const char *optype;
{
- uchar translate[MAXPCHARS + 1];
+ uchar translate[WARNCOUNT];
int length, i;
if (!(opts = string_for_env_opt(optype, opts, FALSE)))
return;
escapes(opts, opts);
- length = strlen(opts);
- if (length > WARNCOUNT)
- length = WARNCOUNT;
+ length = (int) strlen(opts);
/* match the form obtained from PC configuration files */
- for (i = 0; i < length; i++)
- translate[i] = (((i < WARNCOUNT) && opts[i]) ? (uchar) opts[i]
- : def_warnsyms[i].sym);
+ for (i = 0; i < WARNCOUNT; i++)
+ translate[i] = (i >= length) ? 0
+ : opts[i] ? (uchar) opts[i]
+ : def_warnsyms[i].sym;
assign_warnings(translate);
}
-/* NetHack 3.6 shknam.c $NHDT-Date: 1446887533 2015/11/07 09:12:13 $ $NHDT-Branch: master $:$NHDT-Revision: 1.37 $ */
+/* NetHack 3.6 shknam.c $NHDT-Date: 1448094342 2015/11/21 08:25:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.38 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
/*
* To add new shop types, all that is necessary is to edit the shtypes[]
- * array.
- * See mkroom.h for the structure definition. Typically, you'll have to lower
- * some or all of the probability fields in old entries to free up some
- * percentage for the new type.
+ * array. See mkroom.h for the structure definition. Typically, you'll
+ * have to lower some or all of the probability fields in old entries to
+ * free up some percentage for the new type.
*
* The placement type field is not yet used but will be in the near future.
*
* In the latter case, prepend it with a unary minus so the code can know
* (by testing the sign) whether to use mkobj() or mksobj().
*/
-
const struct shclass shtypes[] = {
{ "general store",
RANDOM_CLASS,
int ok[NUM_OBJECTS];
j = maxprob = 0;
+ ok[0] = 0; /* lint suppression */
for (i = bases[(int) oclass]; i < NUM_OBJECTS; ++i) {
if (objects[i].oc_class != oclass)
break;
for (sx = sroom->lx; sx <= sroom->hx; sx++)
for (sy = sroom->ly; sy <= sroom->hy; sy++) {
if (sroom->irregular) {
- if (levl[sx][sy].edge || (int) levl[sx][sy].roomno != rmno
+ if (levl[sx][sy].edge
+ || (int) levl[sx][sy].roomno != rmno
|| distmin(sx, sy, doors[sh].x, doors[sh].y) <= 1)
continue;
} else if ((sx == sroom->lx && doors[sh].x == sx - 1)
for (sx = sroom->lx; sx <= sroom->hx; sx++)
for (sy = sroom->ly; sy <= sroom->hy; sy++) {
if (sroom->irregular) {
- if (levl[sx][sy].edge || (int) levl[sx][sy].roomno != rmno
+ if (levl[sx][sy].edge
+ || (int) levl[sx][sy].roomno != rmno
|| distmin(sx, sy, doors[sh].x, doors[sh].y) <= 1)
continue;
} else if ((sx == sroom->lx && doors[sh].x == sx - 1)
-/* NetHack 3.6 sp_lev.c $NHDT-Date: 1447836300 2015/11/18 08:45:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.73 $ */
+/* NetHack 3.6 sp_lev.c $NHDT-Date: 1448094343 2015/11/21 08:25:43 $ $NHDT-Branch: master $:$NHDT-Revision: 1.75 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
extern void FDECL(mkmap, (lev_init *));
STATIC_DCL void FDECL(get_room_loc, (schar *, schar *, struct mkroom *));
-STATIC_DCL void FDECL(get_free_room_loc,
- (schar *, schar *, struct mkroom *, packed_coord));
+STATIC_DCL void FDECL(get_free_room_loc, (schar *, schar *,
+ struct mkroom *, packed_coord));
STATIC_DCL void FDECL(create_trap, (trap *, struct mkroom *));
STATIC_DCL int FDECL(noncoalignment, (ALIGNTYP_P));
STATIC_DCL boolean FDECL(m_bad_boulder_spot, (int, int));
schar try_x, try_y;
register int trycnt = 0;
- if (!x || !y)
- panic("get_free_room_loc: x or y is null");
-
get_location_coord(&try_x, &try_y, DRY, croom, pos);
if (levl[try_x][try_y].typ != ROOM) {
do {
-/* NetHack 3.6 trap.c $NHDT-Date: 1448073071 2015/11/21 02:31:11 $ $NHDT-Branch: master $:$NHDT-Revision: 1.247 $ */
+/* NetHack 3.6 trap.c $NHDT-Date: 1448094344 2015/11/21 08:25:44 $ $NHDT-Branch: master $:$NHDT-Revision: 1.248 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
xchar x = ttmp->tx, y = ttmp->ty, bx, by, cx, cy;
boolean unused;
+ bx = by = cx = cy = 0; /* lint suppression */
/* we know there's no monster in the way, and we're not trapped */
if (!Punished
|| drag_ball(x, y, &bc, &bx, &by, &cx, &cy, &unused, TRUE)) {