From c531be973954a83f99c6b9c50b2773614891c6d9 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 25 Jul 2006 15:20:30 +0000 Subject: [PATCH] Banish some compiler errors with a different core-dump mechanism. --- util.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/util.c b/util.c index 38d52b8..30a7f59 100644 --- a/util.c +++ b/util.c @@ -1,4 +1,4 @@ -/* $Id: util.c,v 1.2 1990/03/29 23:21:50 eric Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */ +/* $Id: util.c,v 1.3 2000/07/28 05:12:54 esr Exp esr $ - (c) Copyright 1987, 1988 Chuck Simmons */ /* * Copyright (C) 1987, 1988 Chuck Simmons @@ -13,6 +13,7 @@ util.c -- various utility routines. #include #include +#include #include "empire.h" #include "extern.h" @@ -110,11 +111,21 @@ the screen and pause for a few milliseconds. void delay () { + int t = delay_time; + int i = 500; (void) refresh (); - (void) napms (delay_time); /* pause a bit */ + if (t > i) { + (void) move (LINES - 1, 0); + } + for (; t > 0; t -= i) { + (void) napms ((t > i) ? i : t); /* pause a bit */ + if (t > i) { + addstr ("*"); + refresh (); + } + } } - /* Clean up the display. This routine gets called as we leave the game. */ @@ -198,7 +209,6 @@ char *file; int line; { char buf[STRSIZE]; - int a; (void) move (lines, 0); close_disp (); @@ -206,9 +216,7 @@ int line; (void) sprintf (buf, "assert failed: file %s line %d: %s", file, line, expression); - a = 1; /* keep lint quiet */ - a /= 0; /* force a core dump */ - a = a; /* keep lint quiet */ + kill(getpid(), SIGSEGV); /* core dump */ } /* -- 2.43.0