From 895567ca47a9fbf5ec66d7d691983a4f94a2a13c Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Wed, 8 May 2002 20:39:10 +0000 Subject: It is not clear if "#endif FOO" is allowed by ANSI. Gcc 3.1 complains loudly, so don't do it. --- games/larn/global.c | 2 +- games/larn/header.h | 9 +++++---- games/larn/help.c | 12 ++++++------ games/larn/io.c | 44 ++++++++++++++++++++++---------------------- games/larn/main.c | 14 +++++++------- games/larn/nap.c | 14 +++++++------- games/larn/object.c | 2 +- games/larn/scores.c | 4 ++-- games/larn/signal.c | 11 +++++++---- games/larn/tok.c | 8 ++++---- 10 files changed, 62 insertions(+), 58 deletions(-) diff --git a/games/larn/global.c b/games/larn/global.c index 4f7f29a561f5..c595053f9f7c 100644 --- a/games/larn/global.c +++ b/games/larn/global.c @@ -619,4 +619,4 @@ rund(x) { return(random()%x); } -#endif MACRORND +#endif /* MACRORND */ diff --git a/games/larn/header.h b/games/larn/header.h index 72eab138e30b..07f866001ce6 100644 --- a/games/larn/header.h +++ b/games/larn/header.h @@ -1,4 +1,5 @@ /* header.h Larn is copyrighted 1986 by Noah Morgan. */ +/* $FreeBSD$ */ #include #include @@ -393,7 +394,7 @@ unsigned long readnum(); /* macro to clear the screen and home the cursor */ #define clear() (lprcat("\33[2J\33[f"), cbak[SPELLS]= -50) #define cltoeoln() lprcat("\33[K") -#else VT100 +#else /* VT100 */ /* defines below are for use in the termcap mode only */ #define ST_START 1 #define ST_END 2 @@ -415,7 +416,7 @@ unsigned long readnum(); #define clear() (*lpnt++ =CLEAR, cbak[SPELLS]= -50) /* macro to clear to end of line */ #define cltoeoln() (*lpnt++ = CL_LINE) -#endif VT100 +#endif /* VT100 */ /* macro to output one byte to the output buffer */ #define lprc(ch) ((lpnt>=lpend)?(*lpnt++ =(ch), lflush()):(*lpnt++ =(ch))) @@ -427,7 +428,7 @@ extern unsigned long randx; /* macros to generate random numbers 1<=rnd(N)<=N 0<=rund(N)<=N-1 */ #define rnd(x) ((((randx=randx*1103515245+12345)>>7)%(x))+1) #define rund(x) ((((randx=randx*1103515245+12345)>>7)%(x)) ) -#endif MACRORND +#endif /* MACRORND */ /* macros for miscellaneous data conversion */ #define min(x,y) (((x)>(y))?(y):(x)) #define max(x,y) (((x)>(y))?(x):(y)) @@ -437,5 +438,5 @@ extern unsigned long randx; #define toupper(x) (to_upper[x]) #define lcc(x) (to_lower[x]) #define ucc(x) (to_upper[x]) -#endif NODEFS +#endif /* NODEFS */ diff --git a/games/larn/help.c b/games/larn/help.c index fa31c82c8960..5bb04bbdf123 100644 --- a/games/larn/help.c +++ b/games/larn/help.c @@ -16,7 +16,7 @@ help() int i,j; #ifndef VT100 char tmbuf[128]; /* intermediate translation buffer when not a VT100 */ -#endif VT100 +#endif /* VT100 */ if ((j=openhelp()) < 0) return; /* open the help file and get # pages */ for (i=0; i<23; i++) lgetl(); /* skip over intro message */ for (; j>0; j--) @@ -25,9 +25,9 @@ help() for (i=0; i<23; i++) #ifdef VT100 lprcat(lgetl()); /* print out each line that we read in */ -#else VT100 +#else /* VT100 */ { tmcapcnv(tmbuf,lgetl()); lprcat(tmbuf); } /* intercept \33's */ -#endif VT100 +#endif /* VT100 */ if (j>1) { lprcat(" ---- Press "); standout("return"); @@ -51,15 +51,15 @@ welcome() int i; #ifndef VT100 char tmbuf[128]; /* intermediate translation buffer when not a VT100 */ -#endif VT100 +#endif /* VT100 */ if (openhelp() < 0) return; /* open the help file */ clear(); for(i=0; i<23; i++) #ifdef VT100 lprcat(lgetl()); /* print out each line that we read in */ -#else VT100 +#else /* VT100 */ { tmcapcnv(tmbuf,lgetl()); lprcat(tmbuf); } /* intercept \33's */ -#endif VT100 +#endif /* VT100 */ lrclose(); retcont(); /* press return to continue */ } diff --git a/games/larn/io.c b/games/larn/io.c index 112268b210d9..0a130b462c20 100644 --- a/games/larn/io.c +++ b/games/larn/io.c @@ -69,7 +69,7 @@ static char saveeof,saveeol; _a.c_cc[VMIN]=1;_a.c_cc[VTIME]=1;_a.c_lflag &= ~(ICANON|ECHO|ECHOE|ECHOK|ECHONL) #define unraw(_a) _a.c_cc[VMIN]=saveeof;_a.c_cc[VTIME]=saveeol;_a.c_lflag |= ICANON|ECHO|ECHOE|ECHOK|ECHONL -#else not SYSV +#else /* not SYSV */ #ifndef BSD #define CBREAK RAW /* V7 has no CBREAK */ @@ -78,17 +78,17 @@ static char saveeof,saveeol; #define doraw(_a) (_a.sg_flags |= CBREAK,_a.sg_flags &= ~ECHO) #define unraw(_a) (_a.sg_flags &= ~CBREAK,_a.sg_flags |= ECHO) #include -#endif not SYSV +#endif /* not SYSV */ #ifndef NOVARARGS /* if we have varargs */ #include -#else NOVARARGS /* if we don't have varargs */ +#else /* NOVARARGS *//* if we don't have varargs */ typedef char *va_list; #define va_dcl int va_alist; #define va_start(plist) plist = (char *) &va_alist #define va_end(plist) #define va_arg(plist,mode) ((mode *)(plist += sizeof(mode)))[-1] -#endif NOVARARGS +#endif /* NOVARARGS */ #define LINBUFSIZE 128 /* size of the lgetw() and lgetl() buffer */ int lfd; /* output file numbers */ @@ -192,7 +192,7 @@ sprintf(str) str2 = str; str = str2; /* to make lint happy */ } -#else lint +#else /* lint */ /*VARARGS*/ lprintf(va_alist) va_dcl @@ -261,7 +261,7 @@ va_dcl } va_end(ap); } -#endif lint +#endif /* lint */ /* * lprint(long-integer) send binary integer to output buffer @@ -310,10 +310,10 @@ lwrite(buf,len) #ifndef VT100 for (str=buf; len>0; --len) lprc(*str++); -#else VT100 +#else /* VT100 */ lflush(); write(lfd,buf,len); -#endif VT100 +#endif /* VT100 */ } else while (len) { @@ -566,7 +566,7 @@ cursor(x,y) p = x_num[x]; /* get the string to print */ while (*p) *lpnt++ = *p++; /* print the string */ } -#else VT100 +#else /* VT100 */ /* * cursor(x,y) Put cursor at specified coordinates staring at [1,1] (termcap) */ @@ -577,7 +577,7 @@ cursor (x,y) *lpnt++ = CURSOR; *lpnt++ = x; *lpnt++ = y; } -#endif VT100 +#endif /* VT100 */ /* * Routine to position cursor at beginning of 24th line @@ -660,7 +660,7 @@ init_term() died(-285); /* malloc() failure */ } } -#endif VT100 +#endif /* VT100 */ /* * cl_line(x,y) Clear the whole line indicated by 'y' and leave cursor at [x,y] @@ -670,9 +670,9 @@ cl_line(x,y) { #ifdef VT100 cursor(x,y); lprcat("\33[2K"); -#else VT100 +#else /* VT100 */ cursor(1,y); *lpnt++ = CL_LINE; cursor(x,y); -#endif VT100 +#endif /* VT100 */ } /* @@ -683,12 +683,12 @@ cl_up(x,y) { #ifdef VT100 cursor(x,y); lprcat("\33[1J\33[2K"); -#else VT100 +#else /* VT100 */ int i; cursor(1,1); for (i=1; i<=y; i++) { *lpnt++ = CL_LINE; *lpnt++ = '\n'; } cursor(x,y); -#endif VT100 +#endif /* VT100 */ } /* @@ -699,7 +699,7 @@ cl_dn(x,y) { #ifdef VT100 cursor(x,y); lprcat("\33[J\33[2K"); -#else VT100 +#else /* VT100 */ int i; cursor(1,y); if (!CD) @@ -711,7 +711,7 @@ cl_dn(x,y) else *lpnt++ = CL_DOWN; cursor(x,y); -#endif VT100 +#endif /* VT100 */ } /* @@ -725,12 +725,12 @@ standout(str) while (*str) *lpnt++ = *str++; resetbold(); -#else VT100 +#else /* VT100 */ *lpnt++ = ST_START; while (*str) *lpnt++ = *str++; *lpnt++ = ST_END; -#endif VT100 +#endif /* VT100 */ } /* @@ -830,7 +830,7 @@ lflush () lpnt = lpbuf; flush_buf(); /* flush real output buffer now */ } -#else VT100 +#else /* VT100 */ /* * lflush() flush the output buffer * @@ -849,7 +849,7 @@ lflush() } lpnt = lpbuf; /* point back to beginning of buffer */ } -#endif VT100 +#endif /* VT100 */ #ifndef VT100 static int pindex=0; @@ -909,7 +909,7 @@ char *tmcapcnv(sd,ss) *sd=0; /* NULL terminator */ return(sd); } -#endif VT100 +#endif /* VT100 */ /* * beep() Routine to emit a beep if enabled (see no-beep in .larnopts) diff --git a/games/larn/main.c b/games/larn/main.c index cb500d3bc72d..aae3c0340a84 100644 --- a/games/larn/main.c +++ b/games/larn/main.c @@ -29,7 +29,7 @@ Cmd line format: larn [-slicnh] [-o] [-##] [++]\n\ static char *termtypes[] = { "vt100", "vt101", "vt102", "vt103", "vt125", "vt131", "vt140", "vt180", "vt220", "vt240", "vt241", "vt320", "vt340", "vt341" }; -#endif VT100 +#endif /* VT100 */ /* ************ MAIN PROGRAM @@ -50,7 +50,7 @@ main(argc,argv) */ #ifndef VT100 init_term(); /* setup the terminal (find out what type) for termcap */ -#endif VT100 +#endif /* VT100 */ if (((ptr = getlogin()) == 0) || (*ptr==0)) { /* try to get login name */ if (pwe=getpwuid(getuid())) /* can we get it from /etc/passwd? */ ptr = pwe->pw_name; @@ -97,7 +97,7 @@ main(argc,argv) lprcat("Sorry, Larn needs a VT100 family terminal for all it's features.\n"); lflush(); exit(1); } -#endif VT100 +#endif /* VT100 */ /* * now make scoreboard if it is not there (don't clear) @@ -160,9 +160,9 @@ main(argc,argv) #ifdef UIDSCORE userid = geteuid(); /* obtain the user's effective id number */ -#else UIDSCORE +#else /* UIDSCORE */ userid = getplid(logname); /* obtain the players id number */ -#endif UIDSCORE +#endif /* UIDSCORE */ if (userid < 0) { write(2,"Can't obtain playerid\n",22); exit(1); } #ifdef HIDEBYLINK @@ -186,7 +186,7 @@ main(argc,argv) { szero(argv[i]); /* zero the argument to avoid ps snooping */ } -#endif HIDEBYLINK +#endif /* HIDEBYLINK */ if (access(savefilename,0)==0) /* restore game if need to */ { @@ -880,4 +880,4 @@ szero(str) while (*str) *str++ = 0; } -#endif HIDEBYLINK +#endif /* HIDEBYLINK */ diff --git a/games/larn/nap.c b/games/larn/nap.c index fbe4f61ab9ac..f297604c25b0 100644 --- a/games/larn/nap.c +++ b/games/larn/nap.c @@ -7,8 +7,8 @@ #else #ifdef BSD #include -#endif BSD -#endif SYSV +#endif /* BSD */ +#endif /* SYSV */ /* * routine to take a nap for n milliseconds @@ -30,7 +30,7 @@ napms(x) /* do nothing */ int x; { } -#else NONAP +#else /* NONAP */ #ifdef SYSV /* napms - sleep for time milliseconds - uses times() */ /* this assumes that times returns a relative time in 60ths of a second */ @@ -114,8 +114,8 @@ static napms(time) } } #endif -#else not BSD +#else /* not BSD */ static napms(time) int time; {} /* do nothing, forget it */ -#endif BSD -#endif SYSV -#endif NONAP +#endif /* BSD */ +#endif /* SYSV */ +#endif /* NONAP */ diff --git a/games/larn/object.c b/games/larn/object.c index cb5c21625e72..76b16ae12d1b 100644 --- a/games/larn/object.c +++ b/games/larn/object.c @@ -671,7 +671,7 @@ oelevator(dir) int x; x=dir; dir=x; -#endif lint +#endif /* lint */ } ostatue() diff --git a/games/larn/scores.c b/games/larn/scores.c index b932beb6d6cc..85a4932cdc90 100644 --- a/games/larn/scores.c +++ b/games/larn/scores.c @@ -535,7 +535,7 @@ invalid: logg.killed=c[MONSTKILLED]; #endif lwrite((char*)&logg,sizeof(struct log_fmt)); lwclose(); -#endif NOLOG +#endif /* NOLOG */ /* now for the scoreboard maintenance -- not for a suspended game */ if (x != 257) @@ -650,5 +650,5 @@ addone: lcreat((char*)0); /* re-open terminal channel */ return(high); } -#endif UIDSCORE +#endif /* UIDSCORE */ diff --git a/games/larn/signal.c b/games/larn/signal.c index b4c0a2072ef4..44e8468a698c 100644 --- a/games/larn/signal.c +++ b/games/larn/signal.c @@ -1,5 +1,8 @@ +/* $FreeBSD$ */ + #include #include "header.h" /* "Larn is copyrighted 1986 by Noah Morgan.\n" */ + #define BIT(a) (1<<((a)-1)) extern char savefilename[],wizard,predostuff,nosignal; static s2choose() /* text to be displayed if ^C during intro screen */ @@ -43,7 +46,7 @@ tstop() /* control Y */ if (predostuff==1) s2choose(); else drawscreen(); showplayer(); lflush(); } -#endif SIGTSTP +#endif /* SIGTSTP */ /* * subroutine to issue the needed signal traps called from main() @@ -70,7 +73,7 @@ sigsetup() signal(SIGPIPE, sigpipe); signal(SIGTERM, sigterm); #ifdef SIGTSTP signal(SIGTSTP,tstop); signal(SIGSTOP,tstop); -#endif SIGTSTP +#endif /* SIGTSTP */ } #ifdef BSD /* for BSD UNIX? */ @@ -105,7 +108,7 @@ static char *signame[NSIG] = { "", "SIGPROF", /* 27 profiling time alarm */ "","","","" }; -#else BSD /* for system V? */ +#else /* BSD */ /* for system V? */ static char *signame[NSIG] = { "", "SIGHUP", /* 1 hangup */ @@ -129,7 +132,7 @@ static char *signame[NSIG] = { "", "SIGPWR", /* 19 power fail */ "","","","","","","","","","","","" }; -#endif BSD +#endif /* BSD */ /* * routine to process a fatal error signal diff --git a/games/larn/tok.c b/games/larn/tok.c index 9406dc0b8373..19991ec5d5e9 100644 --- a/games/larn/tok.c +++ b/games/larn/tok.c @@ -4,16 +4,16 @@ #ifdef SYSV #include #include -#else SYSV +#else /* SYSV */ #include -#endif SYSV +#endif /* SYSV */ #include "header.h" static char lastok=0; int yrepcount=0,dayplay=0; #ifndef FLUSHNO #define FLUSHNO 5 -#endif FLUSHNO +#endif /* FLUSHNO */ static int flushno=FLUSHNO; /* input queue flushing threshold */ #define MAXUM 52 /* maximum number of user re-named monsters */ #define MAXMNAME 40 /* max length of a monster re-name */ @@ -54,7 +54,7 @@ yylex() lflush(); savegame(savefilename); wizard=nomove=1; sleep(4); died(-257); } -#endif TIMECHECK +#endif /* TIMECHECK */ } -- cgit v1.2.3