From f78ce3db72db40b1f4d51158a436c4711b486833 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Thu, 16 Feb 2006 07:29:09 +0000 Subject: [PATCH] Added return from main as warning suppression. Of course, this _adds_ a warning under Borland. (sigh) --- demos/rain.c | 16 +++------------- demos/worm.c | 12 +++--------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/demos/rain.c b/demos/rain.c index 1be66d05..1009f400 100644 --- a/demos/rain.c +++ b/demos/rain.c @@ -1,18 +1,10 @@ -/* $Id: rain.c,v 1.1 2006/02/16 06:11:39 wmcbrine Exp $ */ +/* $Id: rain.c,v 1.2 2006/02/16 07:29:09 wmcbrine Exp $ */ #include -#include #include /* rain 11/3/1980 EPS/CITHEP */ -static void onsig(int n) -{ - curs_set(1); - endwin(); - exit(EXIT_FAILURE); -} - static float ranf(void) { long r = (rand() & 077777); @@ -47,10 +39,6 @@ int main(int argc, char *argv[]) float r; float c; - for (j = SIGHUP; j <= SIGTERM; j++) - if (signal(j, SIG_IGN) != SIG_IGN) - signal(j, onsig); - #ifdef XCURSES Xinitscr(argc, argv); #else @@ -140,4 +128,6 @@ int main(int argc, char *argv[]) } napms(50); } + + return EXIT_SUCCESS; /* unreachable */ } diff --git a/demos/worm.c b/demos/worm.c index f862bfcf..21056e63 100644 --- a/demos/worm.c +++ b/demos/worm.c @@ -34,11 +34,10 @@ Options: traces will be dumped. The program stops and waits for one character of input at the beginning and end of the interval. - $Id: worm.c,v 1.1 2006/02/16 06:11:39 wmcbrine Exp $ + $Id: worm.c,v 1.2 2006/02/16 07:29:09 wmcbrine Exp $ */ #include -#include #include static chtype flavor[] = { @@ -115,12 +114,6 @@ static void cleanup(void) endwin(); } -static void onsig(int sig) -{ - cleanup(); - exit(EXIT_FAILURE); -} - static float ranf(void) { long r = (rand() & 077777); @@ -189,7 +182,6 @@ int main(int argc, char *argv[]) } } - signal(SIGINT, onsig); #ifdef XCURSES Xinitscr(argc, argv); #else @@ -437,4 +429,6 @@ int main(int argc, char *argv[]) napms(10); refresh(); } + + return EXIT_SUCCESS; /* unreachable */ }