From 1c9f538424b98e4d0e94460e1361828a01dd8bfa Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 1 Feb 2016 17:28:52 -0800 Subject: [PATCH 1/2] formatting bit for alloc.c --- src/alloc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index 2d51fc786..18a4d533a 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1,12 +1,11 @@ -/* NetHack 3.6 alloc.c $NHDT-Date: 1446975460 2015/11/08 09:37:40 $ $NHDT-Branch: master $:$NHDT-Revision: 1.14 $ */ +/* NetHack 3.6 alloc.c $NHDT-Date: 1454376505 2016/02/02 01:28:25 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.16 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ /* to get the malloc() prototype from system.h */ #define ALLOC_C /* comment line for pre-compiled headers */ /* since this file is also used in auxiliary programs, don't include all the - * function declarations for all of nethack - */ + function declarations for all of nethack */ #define EXTERN_H /* comment line for pre-compiled headers */ #include "config.h" @@ -23,9 +22,7 @@ static boolean tried_heaplog = FALSE; #endif long *FDECL(alloc, (unsigned int)); -extern void -VDECL(panic, (const char *, ...)) -PRINTF_F(1, 2); +extern void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2); long * alloc(lth) From 2e9a2002c40e4e11f17ca1d174961baee49d5f4c Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 1 Feb 2016 17:30:09 -0800 Subject: [PATCH 2/2] NH_HEAPLOG vs tile utilities I just tried to build with MONITOR_HEAP defined in unixconf.h plus WANT_WIN_X11=1 for make. tile2x11 wouldn't link. It doesn't use alloc() and free(), but it does link with drawing.o, and drawing.o has calls to free(), so MONITOR_HEAP makes it need nhfree() from alloc.o. All the miscellaneous tile utilities seem to link with drawing.o, so they all need alloc.o too, and that drags in util/panic.o as well. I've only changed it for Unix where I can actually test the change but other platforms probably should do this too. Or we need to redo drawing.c so that the small subset of stuff utilities want is separate from the code the core uses for that same stuff. --- sys/unix/Makefile.utl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl index d5d30426b..bdc5f09e8 100644 --- a/sys/unix/Makefile.utl +++ b/sys/unix/Makefile.utl @@ -1,5 +1,5 @@ # Makefile for NetHack's utility programs. -# NetHack 3.6 Makefile.utl $NHDT-Date: 1449386560 2015/12/06 07:22:40 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.27 $ +# NetHack 3.6 Makefile.utl $NHDT-Date: 1454376585 2016/02/02 01:29:45 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.28 $ # Root of source tree: NHSROOT=.. @@ -310,7 +310,7 @@ dlb_main.o: dlb_main.c $(CONFIG_H) ../include/dlb.h ../include/date.h # dependencies for tile utilities # -TEXT_IO = tiletext.o tiletxt.o $(ONAMING) +TEXT_IO = tiletext.o tiletxt.o $(OALLOC) $(ONAMING) GIFREADERS = gifread.o $(OALLOC) PPMWRITERS = ppmwrite.o $(OALLOC)