3.7 build cleanup

Unix Makefile.utl wasn't aware of the dependency of makedefs.o on
src/mdlib.c so didn't rebuild makedefs when it should have.

Eliminate several warnings:
mdlib.c  - #if inside the arguments to macro Sprintf();
nhlua.c  - nhl_error() ends with a call to lua_error() which doesn't
           return, but neither of them were declared that way;
nhlsel.c - because of the previous, the 'else error' case of
           l_selection_ellipse() led to complaints about uninitialized
	   variables;
sp_lev.c - missing 'const'.

I did minimal testing which went ok, but revisiting a couple of levels
gave me un-freed memory allocated by restore.c line 1337.  (I haven't
looked at that at all.)
This commit is contained in:
PatR
2019-11-24 17:56:01 -08:00
parent c70fa3dfba
commit 8f5cca8e3d
6 changed files with 84 additions and 98 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1567805254 2019/09/06 21:27:34 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.117 $ */
/* NetHack 3.6 sp_lev.c $NHDT-Date: 1574646949 2019/11/25 01:55:49 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.141 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
@@ -3336,8 +3336,10 @@ const char *name;
int defval;
{
char *trapstr = get_table_str_opt(L, name, emptystr);
if (trapstr && *trapstr) {
int i;
for (i = 0; trap_types[i].name; i++)
if (!strcmpi(trapstr, trap_types[i].name)) {
Free(trapstr);
@@ -3350,7 +3352,7 @@ int defval;
int
get_traptype_byname(trapname)
char *trapname;
const char *trapname;
{
int i;