From 30ef9631c5eac7f8254bd3d7ad274d34d9f518b8 Mon Sep 17 00:00:00 2001 From: rgrimes Date: Tue, 30 May 1995 03:37:36 +0000 Subject: Remove trailing whitespace. --- games/atc/Makefile | 2 +- games/atc/graphics.c | 4 +- games/atc/input.c | 34 ++++++------ games/atc/list.c | 2 +- games/atc/log.c | 18 +++--- games/atc/main.c | 8 +-- games/atc/update.c | 14 ++--- games/backgammon/common_source/backgammon.c | 12 ++-- games/backgammon/common_source/fancy.c | 10 ++-- games/backgammon/common_source/odds.c | 2 +- games/backgammon/common_source/one.c | 2 +- games/backgammon/common_source/subs.c | 2 +- games/backgammon/teachgammon/teach.c | 20 +++---- games/battlestar/com1.c | 4 +- games/battlestar/com2.c | 10 ++-- games/battlestar/com3.c | 4 +- games/battlestar/com4.c | 14 ++--- games/battlestar/com5.c | 2 +- games/battlestar/com7.c | 4 +- games/battlestar/cypher.c | 34 ++++++------ games/battlestar/externs.h | 6 +- games/battlestar/getcom.c | 2 +- games/battlestar/globals.c | 4 +- games/battlestar/room.c | 4 +- games/bs/bs.c | 14 ++--- games/canfield/canfield/canfield.c | 40 +++++++------- games/cribbage/Makefile | 2 +- games/dm/dm.c | 2 +- games/factor/factor.c | 2 +- games/fish/Makefile | 2 +- games/fish/fish.c | 8 +-- games/fortune/strfile/strfile.c | 2 +- games/grdc/grdc.c | 12 ++-- games/hack/Makefile | 2 +- games/hack/config.h | 2 +- games/hack/hack.engrave.c | 2 +- games/hack/hack.fight.c | 2 +- games/hack/hack.h | 2 +- games/hack/hack.mklev.c | 2 +- games/hack/hack.mkobj.c | 2 +- games/hack/hack.o_init.c | 2 +- games/hack/hack.options.c | 2 +- games/hack/hack.potion.c | 6 +- games/hack/hack.read.c | 2 +- games/hack/hack.shk.c | 4 +- games/hack/hack.termcap.c | 2 +- games/hack/hack.unix.c | 4 +- games/larn/create.c | 8 +-- games/larn/data.c | 6 +- games/larn/diag.c | 2 +- games/larn/display.c | 12 ++-- games/larn/global.c | 12 ++-- games/larn/header.h | 80 +++++++++++++-------------- games/larn/help.c | 2 +- games/larn/io.c | 30 +++++----- games/larn/main.c | 24 ++++---- games/larn/monster.c | 40 +++++++------- games/larn/moreobj.c | 4 +- games/larn/movem.c | 2 +- games/larn/object.c | 12 ++-- games/larn/regen.c | 8 +-- games/larn/scores.c | 16 +++--- games/larn/signal.c | 6 +- games/larn/store.c | 24 ++++---- games/larn/tok.c | 14 ++--- games/mille/extern.c | 2 +- games/mille/mille.h | 2 +- games/mille/misc.c | 2 +- games/number/number.c | 2 +- games/phantasia/Makefile | 4 +- games/phantasia/convert.c | 2 +- games/phantasia/fight.c | 40 +++++++------- games/phantasia/gamesupport.c | 14 ++--- games/phantasia/interplayer.c | 38 ++++++------- games/phantasia/io.c | 12 ++-- games/phantasia/main.c | 56 +++++++++---------- games/phantasia/misc.c | 34 ++++++------ games/phantasia/setup.c | 8 +-- games/piano/piano.c | 4 +- games/primes/pattern.c | 4 +- games/primes/pr_tbl.c | 2 +- games/primes/primes.c | 6 +- games/random/random.c | 4 +- games/rogue/machdep.c | 10 ++-- games/rogue/main.c | 2 +- games/rogue/move.c | 2 +- games/rogue/pack.c | 2 +- games/rogue/random.c | 6 +- games/rogue/use.c | 2 +- games/sail/assorted.c | 2 +- games/sail/dr_3.c | 4 +- games/sail/game.c | 2 +- games/sail/globals.c | 2 +- games/sail/pl_5.c | 4 +- games/snake/snake/move.c | 8 +-- games/snake/snake/snake.c | 16 +++--- games/trek/torped.c | 8 +-- games/wump/wump.c | 4 +- games/x11/Makefile | 2 +- games/x11/xneko/xneko.c | 4 +- games/x11/xroach/xroach.c | 86 ++++++++++++++--------------- 101 files changed, 521 insertions(+), 521 deletions(-) (limited to 'games') diff --git a/games/atc/Makefile b/games/atc/Makefile index 4df0b3f..e6433c4 100644 --- a/games/atc/Makefile +++ b/games/atc/Makefile @@ -11,7 +11,7 @@ GAMES= ATC_scores Game_List Killer crossover default easy game_2 CLEANFILES=grammar.c y.tab.h lex.c HIDEGAME=hidegame -beforeinstall: +beforeinstall: (cd ${.CURDIR}/games; install -c -o ${BINOWN} -g ${BINGRP} -m 400 \ ${GAMES} ${DESTDIR}/usr/share/games/atc) diff --git a/games/atc/graphics.c b/games/atc/graphics.c index 49604f4..7503b26 100644 --- a/games/atc/graphics.c +++ b/games/atc/graphics.c @@ -115,7 +115,7 @@ init_gr() initscr(); setbuf(stdout, buffer); input = newwin(INPUT_LINES, COLS - PLANE_COLS, LINES - INPUT_LINES, 0); - credit = newwin(INPUT_LINES, PLANE_COLS, LINES - INPUT_LINES, + credit = newwin(INPUT_LINES, PLANE_COLS, LINES - INPUT_LINES, COLS - PLANE_COLS); planes = newwin(LINES - INPUT_LINES, PLANE_COLS, 0, COLS - PLANE_COLS); } @@ -204,7 +204,7 @@ setup_screen(scp) wmove(radar, scp->airport[i].y, scp->airport[i].x * 2); waddstr(radar, str); } - + overwrite(radar, cleanradar); wrefresh(radar); wrefresh(credit); diff --git a/games/atc/input.c b/games/atc/input.c index b73ab69..0d1a0f7 100644 --- a/games/atc/input.c +++ b/games/atc/input.c @@ -93,8 +93,8 @@ typedef struct { #define NUMSTATES NUMELS(st) -char *setplane(), *circle(), *left(), *right(), *Left(), *Right(), - *beacon(), *ex_it(), *climb(), *descend(), *setalt(), *setrelalt(), +char *setplane(), *circle(), *left(), *right(), *Left(), *Right(), + *beacon(), *ex_it(), *climb(), *descend(), *setalt(), *setrelalt(), *benum(), *to_dir(), *rel_dir(), *delayb(), *mark(), *unmark(), *airport(), *turn(), *ignore(); @@ -104,17 +104,17 @@ RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane}, { CRTOKEN, -1, "", NULL }, #endif { HELPTOKEN, 12, " [a-z]", NULL }}, - state1[] = { { 't', 2, " turn", turn }, - { 'a', 3, " altitude:", NULL }, + state1[] = { { 't', 2, " turn", turn }, + { 'a', 3, " altitude:", NULL }, { 'c', 4, " circle", circle }, { 'm', 7, " mark", mark }, { 'u', 7, " unmark", unmark }, { 'i', 7, " ignore", ignore }, { HELPTOKEN, 12, " tacmui", NULL }}, - state2[] = { { 'l', 6, " left", left }, - { 'r', 6, " right", right }, + state2[] = { { 'l', 6, " left", left }, + { 'r', 6, " right", right }, { 'L', 4, " left 90", Left }, - { 'R', 4, " right 90", Right }, + { 'R', 4, " right 90", Right }, { 't', 11, " towards", NULL }, { 'w', 4, " to 0", to_dir }, { 'e', 4, " to 45", to_dir }, @@ -125,14 +125,14 @@ RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane}, { 'a', 4, " to 270", to_dir }, { 'q', 4, " to 315", to_dir }, { HELPTOKEN, 12, " lrLRt", NULL }}, - state3[] = { { '+', 10, " climb", climb }, - { 'c', 10, " climb", climb }, - { '-', 10, " descend", descend }, - { 'd', 10, " descend", descend }, + state3[] = { { '+', 10, " climb", climb }, + { 'c', 10, " climb", climb }, + { '-', 10, " descend", descend }, + { 'd', 10, " descend", descend }, { NUMTOKEN, 7, " %c000 feet", setalt }, { HELPTOKEN, 12, " +-cd[0-9]", NULL }}, - state4[] = { { '@', 9, " at", NULL }, - { 'a', 9, " at", NULL }, + state4[] = { { '@', 9, " at", NULL }, + { 'a', 9, " at", NULL }, { RETTOKEN, -1, "", NULL }, #ifdef SYSV { CRTOKEN, -1, "", NULL }, @@ -150,9 +150,9 @@ RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane}, { 'z', 4, " 225", rel_dir }, { 'a', 4, " 270", rel_dir }, { 'q', 4, " 315", rel_dir }, - { RETTOKEN, -1, "", NULL }, + { RETTOKEN, -1, "", NULL }, #ifdef SYSV - { CRTOKEN, -1, "", NULL }, + { CRTOKEN, -1, "", NULL }, #endif { HELPTOKEN, 12, " @a",NULL }}, state7[] = { { RETTOKEN, -1, "", NULL }, @@ -167,7 +167,7 @@ RULE state0[] = { { ALPHATOKEN, 1, "%c:", setplane}, { HELPTOKEN, 12, " b*", NULL }}, state10[] = { { NUMTOKEN, 7, " %c000 ft", setrelalt}, { HELPTOKEN, 12, " [0-9]", NULL }}, - state11[] = { { 'b', 8, " beacon #", beacon }, + state11[] = { { 'b', 8, " beacon #", beacon }, { '*', 8, " beacon #", beacon }, { 'e', 8, " exit #", ex_it }, { 'a', 8, " airport #", airport }, @@ -272,7 +272,7 @@ getcommand() return (1); /* forced update */ dest_type = T_NODEST; - + for (i = 0; i < level; i++) { func = st[stack[i].state].rule[stack[i].rule].func; if (func != NULL) diff --git a/games/atc/list.c b/games/atc/list.c index 16c019a..be2bbd0 100644 --- a/games/atc/list.c +++ b/games/atc/list.c @@ -99,7 +99,7 @@ delete(l, p) { if (l->head == NULL) loser(p, "deleted a non-existant plane! Get help!"); - + if (l->head == p && l->tail == p) l->head = l->tail = NULL; else if (l->head == p) { diff --git a/games/atc/log.c b/games/atc/log.c index 8868a60..71f0167 100644 --- a/games/atc/log.c +++ b/games/atc/log.c @@ -106,7 +106,7 @@ log_score(list_em) return (-1); } /* - * This is done to take advantage of stdio, while still + * This is done to take advantage of stdio, while still * allowing a O_CREAT during the open(2) of the log file. */ fp = fdopen(fd, "r+"); @@ -126,10 +126,10 @@ log_score(list_em) } for (;;) { good = fscanf(fp, "%s %s %s %d %d %d", - score[num_scores].name, - score[num_scores].host, + score[num_scores].name, + score[num_scores].host, score[num_scores].game, - &score[num_scores].planes, + &score[num_scores].planes, &score[num_scores].time, &score[num_scores].real_time); if (good != 6 || ++num_scores >= NUM_SCORES) @@ -137,7 +137,7 @@ log_score(list_em) } if (!test_mode && !list_em) { if ((pw = (struct passwd *) getpwuid(getuid())) == NULL) { - fprintf(stderr, + fprintf(stderr, "getpwuid failed for uid %d. Who are you?\n", getuid()); return (-1); @@ -187,7 +187,7 @@ log_score(list_em) if (num_scores < NUM_SCORES) num_scores++; bcopy(&score[i], - &score[num_scores - 1], + &score[num_scores - 1], sizeof (score[i])); bcopy(&thisscore, &score[i], sizeof (score[i])); @@ -197,7 +197,7 @@ log_score(list_em) } } if (!found && !changed && num_scores < NUM_SCORES) { - bcopy(&thisscore, &score[num_scores], + bcopy(&thisscore, &score[num_scores], sizeof (score[num_scores])); num_scores++; changed++; @@ -212,7 +212,7 @@ log_score(list_em) rewind(fp); for (i = 0; i < num_scores; i++) fprintf(fp, "%s %s %s %d %d %d\n", - score[i].name, score[i].host, + score[i].name, score[i].host, score[i].game, score[i].planes, score[i].time, score[i].real_time); } else { @@ -230,7 +230,7 @@ log_score(list_em) /* lock will evaporate upon close */ #endif fclose(fp); - printf("%2s: %-8s %-8s %-18s %4s %9s %4s\n", "#", "name", "host", + printf("%2s: %-8s %-8s %-18s %4s %9s %4s\n", "#", "name", "host", "game", "time", "real time", "planes safe"); puts("-------------------------------------------------------------------------------"); for (i = 0; i < num_scores; i++) { diff --git a/games/atc/main.c b/games/atc/main.c index f33d118..762c2bc 100644 --- a/games/atc/main.c +++ b/games/atc/main.c @@ -75,7 +75,7 @@ main(ac, av) name = *av++; while (*av) { #ifndef SAVEDASH - if (**av == '-') + if (**av == '-') *++*av; else break; @@ -106,7 +106,7 @@ main(ac, av) file = *av; av++; break; - default: + default: fprintf(stderr, "Unknown option '%c'\n", *ptr, name); f_usage++; @@ -118,7 +118,7 @@ main(ac, av) srandom(seed); if (f_usage) - fprintf(stderr, + fprintf(stderr, "Usage: %s -[u?lstp] [-[gf] game_name] [-r random seed]\n", name); if (f_showscore) @@ -132,7 +132,7 @@ main(ac, av) buf[strlen(buf) - 1] = '\0'; puts(buf); } - + if (f_usage || f_showscore || f_list || f_printpath) exit(0); diff --git a/games/atc/update.c b/games/atc/update.c index 1b94e8a..79bc601 100644 --- a/games/atc/update.c +++ b/games/atc/update.c @@ -157,10 +157,10 @@ update() if (pp->xpos == sp->airport[i].x && pp->ypos == sp->airport[i].y) { if (pp->dest_type == T_AIRPORT) - loser(pp, + loser(pp, "landed at the wrong airport."); else - loser(pp, + loser(pp, "landed instead of exited."); } loser(pp, "crashed on the ground."); @@ -171,10 +171,10 @@ update() if (pp->xpos == sp->exit[i].x && pp->ypos == sp->exit[i].y) { if (pp->dest_type == T_EXIT) - loser(pp, + loser(pp, "exited via the wrong exit."); else - loser(pp, + loser(pp, "exited instead of landed."); } loser(pp, "illegally left the flight arena."); @@ -228,7 +228,7 @@ command(pp) buf[0] = '\0'; bp = buf; - (void)sprintf(bp, "%c%d%c%c%d: ", name(pp), pp->altitude, + (void)sprintf(bp, "%c%d%c%c%d: ", name(pp), pp->altitude, (pp->fuel < LOWFUEL) ? '*' : ' ', (pp->dest_type == T_AIRPORT) ? 'A' : 'E', pp->dest_no); @@ -245,7 +245,7 @@ command(pp) (void)sprintf(bp, " @ B%d", pp->delayd_no); bp = index(buf, '\0'); - if (*comm_start == '\0' && + if (*comm_start == '\0' && (pp->status == S_UNMARKED || pp->status == S_IGNORED)) strcpy(bp, "---------"); return (buf); @@ -267,7 +267,7 @@ number(l) return (-1); else if (l >= 'a' && l <= 'z') return (l - 'a'); - else + else return (l - 'A'); } diff --git a/games/backgammon/common_source/backgammon.c b/games/backgammon/common_source/backgammon.c index 4da7797..1385fa7 100644 --- a/games/backgammon/common_source/backgammon.c +++ b/games/backgammon/common_source/backgammon.c @@ -64,19 +64,19 @@ int goodmoves[MAXGMOV]; int probmoves[MAXGMOV]; int brown[] = { /* brown position table */ - 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, - 0, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, 0, + 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, + 0, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int white[] = { /* white position table */ - 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, - 0, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, 0, + 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, + 0, 0, 0, 0, 3, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int probability[] = { - 0, 11, 12, 13, 14, 15, 16, + 0, 11, 12, 13, 14, 15, 16, 06, 05, 04, 03, 02, 01 }; @@ -688,7 +688,7 @@ prtbrd() fprintf(stdout, "%4d",k); fprintf(stdout, " "); for(k = 7; k <= 12; k++) - fprintf(stdout, "%4d",k); + fprintf(stdout, "%4d",k); putchar('\n'); numline(brown, white, 1, 6); fprintf(stdout, " "); diff --git a/games/backgammon/common_source/fancy.c b/games/backgammon/common_source/fancy.c index 2a82bca..ec9173f 100644 --- a/games/backgammon/common_source/fancy.c +++ b/games/backgammon/common_source/fancy.c @@ -512,7 +512,7 @@ newpos () { for (i = 0; i < c; i++) tputs (ND,1,addbuf); break; - + /* down and over */ case 3: for (i = 0; i < r-curr; i++) @@ -520,7 +520,7 @@ newpos () { for (i = 0; i < c-curc; i++) tputs (ND,1,addbuf); break; - + /* down and back */ case 4: for (i = 0; i < r-curr; i++) @@ -528,7 +528,7 @@ newpos () { for (i = 0; i < curc-c; i++) addbuf ('\010'); break; - + /* CR and up and over */ case 5: addbuf ('\015'); @@ -537,7 +537,7 @@ newpos () { for (i = 0; i < c; i++) tputs (ND,1,addbuf); break; - + /* up and over */ case 6: for (i = 0; i < curr-r; i++) @@ -545,7 +545,7 @@ newpos () { for (i = 0; i < c-curc; i++) tputs (ND,1,addbuf); break; - + /* up and back */ case 7: for (i = 0; i < curr-r; i++) diff --git a/games/backgammon/common_source/odds.c b/games/backgammon/common_source/odds.c index 9daf3af..67c3f12 100644 --- a/games/backgammon/common_source/odds.c +++ b/games/backgammon/common_source/odds.c @@ -44,7 +44,7 @@ int r2, val; register int i, j; if (r1 == 0) { - for (i = 0; i < 6; i++) + for (i = 0; i < 6; i++) for (j = 0; j < 6; j++) table[i][j] = 0; return; diff --git a/games/backgammon/common_source/one.c b/games/backgammon/common_source/one.c index 30ec866..36d9a27 100644 --- a/games/backgammon/common_source/one.c +++ b/games/backgammon/common_source/one.c @@ -39,7 +39,7 @@ static char sccsid[] = "@(#)one.c 8.1 (Berkeley) 5/31/93"; makmove (i) register int i; - + { register int n, d; int max; diff --git a/games/backgammon/common_source/subs.c b/games/backgammon/common_source/subs.c index 7016b54..827e3e0 100644 --- a/games/backgammon/common_source/subs.c +++ b/games/backgammon/common_source/subs.c @@ -136,7 +136,7 @@ register char *l; if (trace == NULL) trace = fopen ("bgtrace","w"); - + fprintf (trace,"writel: \""); for (s = l; *s; s++) { if (*s < ' ' || *s == '\177') diff --git a/games/backgammon/teachgammon/teach.c b/games/backgammon/teachgammon/teach.c index 44e5edb..9a97452 100644 --- a/games/backgammon/teachgammon/teach.c +++ b/games/backgammon/teachgammon/teach.c @@ -108,45 +108,45 @@ char **argv; init(); while (i) switch (i) { - + case 1: leave(); - + case 2: if (i = text(intro1)) break; wrboard(); if (i = text(intro2)) break; - + case 3: if (i = text(moves)) break; - + case 4: if (i = text(remove)) break; - + case 5: if (i = text(hits)) break; - + case 6: if (i = text(endgame)) break; - + case 7: if (i = text(doubl)) break; - + case 8: if (i = text(stragy)) break; - + case 9: if (i = text(prog)) break; - + case 10: if (i = text(lastch)) break; diff --git a/games/battlestar/com1.c b/games/battlestar/com1.c index 2e50639..d74f862 100644 --- a/games/battlestar/com1.c +++ b/games/battlestar/com1.c @@ -140,7 +140,7 @@ news() fight(WOODSMAN,50); } switch(position){ - + case 267: case 257: /* entering a cave */ case 274: @@ -225,7 +225,7 @@ crash() if (!location[position].flyhere || (testbit(location[position].objects,LAND) && fuel <= 0)){ if (!location[position].flyhere) puts("You're flying too low. We're going to crash!"); - else{ + else{ puts("You're out of fuel. We'll have to crash land!"); if (!location[position].down){ puts("Your viper strikes the ground and explodes into firey fragments."); diff --git a/games/battlestar/com2.c b/games/battlestar/com2.c index 614155c..39148fc 100644 --- a/games/battlestar/com2.c +++ b/games/battlestar/com2.c @@ -48,7 +48,7 @@ wearit() /* synonyms = {sheathe, sheath} */ value = wordvalue[wordnumber]; for (n=0; objsht[value][n]; n++); switch(value){ - + case -1: puts("Wear what?"); return(firstnumber); @@ -86,11 +86,11 @@ wearit() /* synonyms = {sheathe, sheath} */ } else if (testbit(wear,value)) printf("You are already wearing the %s.\n", objsht[value]); - else + else printf("You aren't holding the %s.\n", objsht[value]); if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND) wordnumber++; - else + else return(firstnumber); } /* end switch */ } /* end while */ @@ -166,7 +166,7 @@ murder() printf("Your %s should do the trick.\n",objsht[n]); while (wordtype[++wordnumber] == ADJS); switch(wordvalue[wordnumber]){ - + case NORMGOD: if (testbit(location[position].objects,BATHGOD)){ puts("The goddess's head slices off. Her corpse floats in the water."); @@ -290,7 +290,7 @@ follow() notes[CANTSEE] = 1; return(0); } - else + else puts("There is no one to follow."); return(-1); } diff --git a/games/battlestar/com3.c b/games/battlestar/com3.c index cfee80f..bc4ec9f 100644 --- a/games/battlestar/com3.c +++ b/games/battlestar/com3.c @@ -57,7 +57,7 @@ dig() puts("Nothing happens."); } } - else + else puts("You don't have a shovel."); } @@ -216,7 +216,7 @@ shoot() if (wordnumber <= wordcount && wordtype[wordnumber] == NOUNS){ time++; switch(wordvalue[wordnumber]){ - + case DOOR: switch(position){ case 189: diff --git a/games/battlestar/com4.c b/games/battlestar/com4.c index 016b648..fe1d96b 100644 --- a/games/battlestar/com4.c +++ b/games/battlestar/com4.c @@ -88,7 +88,7 @@ unsigned int from[]; if (wordnumber <= wordcount && wordtype[wordnumber] == NOUNS) switch(wordvalue[wordnumber]){ - + case SWORD: if (testbit(from, SWORD)){ wordtype[wordnumber--] = OBJECT; @@ -169,7 +169,7 @@ unsigned int from[]; clearbit(location[position].objects,BATHGOD); } else if (!testbit(location[position].objects,BATHGOD)) puts("You're in no position to take her."); - else + else puts("She moves away from you."); break; @@ -191,7 +191,7 @@ throw(name) first = wordnumber; if (drop(name) != -1){ switch(wordvalue[wordnumber]){ - + case AHEAD: deposit = ahead; break; @@ -253,7 +253,7 @@ throw(name) } if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND) wordnumber++; - else + else return(first); } return(first); @@ -264,7 +264,7 @@ throw(name) drop(name) char *name; { - + int firstnumber, value; firstnumber = wordnumber; @@ -333,7 +333,7 @@ eat() while(wordnumber <= wordcount){ value = wordvalue[wordnumber]; switch(value){ - + case -1: puts("Eat what?"); return(firstnumber); @@ -371,7 +371,7 @@ eat() printf("You aren't holding the %s.\n", objsht[value]); if (wordnumber < wordcount - 1 && wordvalue[++wordnumber] == AND) wordnumber++; - else + else return(firstnumber); } /* end switch */ } /* end while */ diff --git a/games/battlestar/com5.c b/games/battlestar/com5.c index 7c050eb..04e9cfe 100644 --- a/games/battlestar/com5.c +++ b/games/battlestar/com5.c @@ -57,7 +57,7 @@ kiss() break; default: puts("She's gone limp."); - + } break; case NATIVE: diff --git a/games/battlestar/com7.c b/games/battlestar/com7.c index d91c4be..ca86de8 100644 --- a/games/battlestar/com7.c +++ b/games/battlestar/com7.c @@ -72,7 +72,7 @@ fighton: hurt = rnd(50)%(WEIGHT-carrying)-card(injuries,NUMOFINJURIES)-encumber - exhaustion; else if (testbit(inven,KNIFE) || testbit(inven,MALLET) || testbit(inven,CHAIN) || testbit(inven,MACE) || testbit(inven,HALBERD)) hurt = rnd(15) - card(injuries,NUMOFINJURIES) - exhaustion; - else + else hurt = rnd(7) - encumber; if (hurt < 5) switch(rnd(3)){ @@ -233,7 +233,7 @@ fighton: cypher(); time--; break; - + default: puts("You don't have a chance, he is too quick."); break; diff --git a/games/battlestar/cypher.c b/games/battlestar/cypher.c index 59ea6cc..ec02a79 100644 --- a/games/battlestar/cypher.c +++ b/games/battlestar/cypher.c @@ -79,19 +79,19 @@ cypher() return(-1); lflag = 0; break; - + case AHEAD: if (!move(ahead, AHEAD)) return(-1); lflag = 0; break; - + case BACK: if (!move(back, BACK)) return(-1); lflag = 0; break; - + case SHOOT: if (wordnumber < wordcount && wordvalue[wordnumber+1] == EVERYTHING){ for (n=0; n < NUMOFOBJECTS; n++) @@ -102,7 +102,7 @@ cypher() wordnumber++; wordnumber++; } - else + else shoot(); break; @@ -116,7 +116,7 @@ cypher() wordnumber++; wordnumber++; } - else + else take(location[position].objects); break; @@ -131,7 +131,7 @@ cypher() wordnumber++; wordnumber++; } - else + else drop("Dropped"); break; @@ -146,7 +146,7 @@ cypher() wordnumber = throw(wordvalue[wordnumber] == KICK ? "Kicked" : "Thrown"); } wordnumber += 2; - } else + } else throw(wordvalue[wordnumber] == KICK ? "Kicked" : "Thrown"); break; @@ -159,7 +159,7 @@ cypher() } wordnumber += 2; } - else + else takeoff(); break; @@ -174,7 +174,7 @@ cypher() } wordnumber += 2; } - else + else draw(); break; @@ -189,7 +189,7 @@ cypher() } wordnumber += 2; } - else + else puton(); break; @@ -203,7 +203,7 @@ cypher() } wordnumber += 2; } - else + else wearit(); break; @@ -218,7 +218,7 @@ cypher() } wordnumber += 2; } - else + else eat(); break; @@ -239,7 +239,7 @@ cypher() } else puts("You aren't carrying anything."); - + if (ucard(wear)){ puts("\nYou are wearing:\n"); for (n=0; n < NUMOFOBJECTS; n++) @@ -272,7 +272,7 @@ cypher() puts("\nYour match splutters out."); matchlight = 0; } - } else + } else puts("I can't see anything."); return(-1); break; @@ -320,7 +320,7 @@ cypher() else puts("You aren't a wizard."); break; - + case SCORE: printf("\tPLEASURE\tPOWER\t\tEGO\n"); printf("\t%3d\t\t%3d\t\t%3d\n\n",pleasure,power,ego); @@ -373,7 +373,7 @@ cypher() case LAUNCH: if (!launch()) return(-1); - else + else lflag = 0; break; @@ -420,7 +420,7 @@ cypher() return(-1); break; - + } if (wordnumber < wordcount && *words[wordnumber++] == ',') continue; diff --git a/games/battlestar/externs.h b/games/battlestar/externs.h index 76cf14a..ef66948 100644 --- a/games/battlestar/externs.h +++ b/games/battlestar/externs.h @@ -60,7 +60,7 @@ #define CONJ 5 /* words numbers */ -#define KNIFE 0 +#define KNIFE 0 #define SWORD 1 #define LAND 2 #define WOODSMAN 3 @@ -175,7 +175,7 @@ #define RIDE 1047 #define DRIVE 1048 #define SCORE 1049 -#define BURY 1050 +#define BURY 1050 #define JUMP 1051 #define KICK 1052 @@ -192,7 +192,7 @@ #define CANTLAUNCH 0 #define LAUNCHED 1 #define CANTSEE 2 -#define CANTMOVE 3 +#define CANTMOVE 3 #define JINXED 4 #define DUG 5 #define NUMOFNOTES 6 diff --git a/games/battlestar/getcom.c b/games/battlestar/getcom.c index d852910..d441921 100644 --- a/games/battlestar/getcom.c +++ b/games/battlestar/getcom.c @@ -45,7 +45,7 @@ getcom(buf, size, prompt, error) char *prompt, *error; { for (;;) { - fputs(prompt, stdout); + fputs(prompt, stdout); if (fgets(buf, size, stdin) == 0) { clearerr(stdin); continue; diff --git a/games/battlestar/globals.c b/games/battlestar/globals.c index c25b1c5..1e079aa 100644 --- a/games/battlestar/globals.c +++ b/games/battlestar/globals.c @@ -186,14 +186,14 @@ char *ouch[NUMOFINJURIES] = { "a few broken ribs", "a broken leg and torn ligaments", "a broken back and ruptured spleen", - "some deep incisions and a loss of blood", + "some deep incisions and a loss of blood", "a fractured skull and mashed face", "a broken neck" }; int objwt[NUMOFOBJECTS] = { 1, 5, 0, 10, 15, 2, 10, 10, - 3, 5, 50, 2500, 2, 1, 100, 1, + 3, 5, 50, 2500, 2, 1, 100, 1, 2, 1, 1, 1, 60, 10, 5, 0, 50, 5, 15, 5, 1, 20, 10, 10, 0, 0, 0, 0, 1, 0, 0, 1, diff --git a/games/battlestar/room.c b/games/battlestar/room.c index 6b33ebb..80fc2b2 100644 --- a/games/battlestar/room.c +++ b/games/battlestar/room.c @@ -79,7 +79,7 @@ struct room here; ahead = here.north; back = here.south; break; - + case SOUTH: left = here.east; right = here.west; @@ -143,7 +143,7 @@ char option; return("left"); case EAST: return("ahead"); - case WEST: + case WEST: return(option == '+' ? "behind you" : "back"); } diff --git a/games/bs/bs.c b/games/bs/bs.c index 3785fcd..f28d4c7 100644 --- a/games/bs/bs.c +++ b/games/bs/bs.c @@ -1,4 +1,4 @@ -/* +/* * bs.c - original author: Bruce Holloway * salvo option by: Chuck A DeGaul * with improved user interface, autoconfiguration and code cleanup @@ -260,7 +260,7 @@ static void intro() init_pair(COLOR_YELLOW, COLOR_YELLOW, COLOR_BLACK); #endif /* A_COLOR */ -} +} /* VARARGS1 */ static void prompt(n, f, s) @@ -468,7 +468,7 @@ static void initgame() placeship(PLAYER, ss, TRUE); error((char *)NULL); ss->placed = TRUE; - } + } else if (c == 'R') { prompt(1, "Placing the rest of your fleet at random..."); @@ -480,7 +480,7 @@ static void initgame() ss->placed = TRUE; } error((char *)NULL); - } + } else if (strchr("hjkl8462", c)) { ss->x = curx; @@ -492,7 +492,7 @@ static void initgame() case 'j': case '2': ss->dir = S; break; case 'h': case '4': ss->dir = W; break; case 'l': case '6': ss->dir = E; break; - } + } if (checkplace(PLAYER, ss, TRUE)) { @@ -744,7 +744,7 @@ int x, y; for (i = -1; i <= ss->length; ++i) { int x, y; - + x = bx + i * xincr[ss->dir]; y = by + i * yincr[ss->dir]; if (ONBOARD(x, y)) @@ -1236,7 +1236,7 @@ char *argv[]; i = 0; } } - } + } } else while(turn ? cputurn() : plyturn()) diff --git a/games/canfield/canfield/canfield.c b/games/canfield/canfield/canfield.c index 492f04a..aec376d 100644 --- a/games/canfield/canfield/canfield.c +++ b/games/canfield/canfield/canfield.c @@ -174,7 +174,7 @@ int uid; #define maxtimecharge 3 #define valuepercardup 5 /* - * Variables associated with betting + * Variables associated with betting */ struct betinfo { long hand; /* cost of dealing hand */ @@ -560,7 +560,7 @@ printcard(a, b, cp) } /* - * procedure to move the top card from one location to the top + * procedure to move the top card from one location to the top * of another location. The pointers always point to the top * of the piles. */ @@ -568,7 +568,7 @@ transit(source, dest) struct cardtype **source, **dest; { struct cardtype *temp; - + temp = *source; *source = (*source)->next; temp->next = *dest; @@ -616,7 +616,7 @@ fndbase(cp, column, row) game.wins += valuepercardup; total.wins += valuepercardup; } - } else + } else nomore = TRUE; } while (nomore == FALSE); } @@ -754,7 +754,7 @@ struct cardtype *cp; move(msgrow, msgcol); printw("Error: no cards to move"); return (FALSE); - } else + } else return (TRUE); } @@ -765,14 +765,14 @@ bool ranklower(cp1, cp2) struct cardtype *cp1, *cp2; { - if (cp2->rank == Ace) + if (cp2->rank == Ace) if (cp1->rank == King) return (TRUE); - else + else return (FALSE); else if (cp1->rank + 1 == cp2->rank) return (TRUE); - else + else return (FALSE); } @@ -785,7 +785,7 @@ diffcolor(cp1, cp2) { if (cp1->color == cp2->color) return (FALSE); - else + else return (TRUE); } @@ -799,15 +799,15 @@ tabok(cp, des) if ((cp == stock) && (tableau[des] == NIL)) return (TRUE); else if (tableau[des] == NIL) - if (stock == NIL && - cp != bottom[0] && cp != bottom[1] && + if (stock == NIL && + cp != bottom[0] && cp != bottom[1] && cp != bottom[2] && cp != bottom[3]) return (TRUE); - else + else return (FALSE); else if (ranklower(cp, tableau[des]) && diffcolor(cp, tableau[des])) return (TRUE); - else + else return (FALSE); } @@ -1123,7 +1123,7 @@ struct cardtype **cp; usedtalon(); printcard(taloncol, talonrow, talon); } - } else + } else destinerror(); } } @@ -1142,7 +1142,7 @@ tabprint(sour, des) slength = length[sour]; if (slength == tabrow) printcard(pilemap[des], dlength, tableau[sour]); - else + else while (slength != tabrow - 1) { tempcard = tableau[sour]; for (i=1; i<=slength-tabrow; i++) @@ -1174,7 +1174,7 @@ tabtotab(sour, des) length[des] = length[des] + (length[sour] - (tabrow - 1)); length[sour] = tabrow - 1; timesthru = 0; - } else + } else destinerror(); } } @@ -1189,11 +1189,11 @@ rankhigher(cp, let) if (found[let]->rank == King) if (cp->rank == Ace) return(TRUE); - else + else return(FALSE); else if (cp->rank - 1 == found[let]->rank) return(TRUE); - else + else return(FALSE); } @@ -1205,7 +1205,7 @@ samesuit(cp, let) { if (cp->suit == found[let]->suit) return (TRUE); - else + else return (FALSE); } @@ -1251,7 +1251,7 @@ movetofound(cp, source) mtfdone = TRUE; } else tempbase++; - else + else tempbase++; } while ((tempbase != 4) && !mtfdone); if (!mtfdone) diff --git a/games/cribbage/Makefile b/games/cribbage/Makefile index 9a619b9..bb5ab6a 100644 --- a/games/cribbage/Makefile +++ b/games/cribbage/Makefile @@ -7,7 +7,7 @@ SRCS= extern.c crib.c cards.c instr.c io.c score.c support.c MAN6= cribbage.6 HIDEGAME=hidegame -beforeinstall: +beforeinstall: install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/cribbage.n \ ${DESTDIR}/usr/share/games/cribbage.instr diff --git a/games/dm/dm.c b/games/dm/dm.c index b268a5c..7e8d6dc 100644 --- a/games/dm/dm.c +++ b/games/dm/dm.c @@ -243,7 +243,7 @@ load() */ users() { - + register int nusers, utmp; struct utmp buf; diff --git a/games/factor/factor.c b/games/factor/factor.c index 562e4b2..8edb2c1 100644 --- a/games/factor/factor.c +++ b/games/factor/factor.c @@ -75,7 +75,7 @@ static char sccsid[] = "@(#)factor.c 8.3 (Berkeley) 3/30/94"; /* * prime[i] is the (i-1)th prime. * - * We are able to sieve 2^32-1 because this byte table yields all primes + * We are able to sieve 2^32-1 because this byte table yields all primes * up to 65537 and 65537^2 > 2^32-1. */ extern ubig prime[]; diff --git a/games/fish/Makefile b/games/fish/Makefile index b8cad1a..a57454f 100644 --- a/games/fish/Makefile +++ b/games/fish/Makefile @@ -4,7 +4,7 @@ PROG= fish MAN6= fish.6 HIDEGAME=hidegame -beforeinstall: +beforeinstall: install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${.CURDIR}/fish.instr \ ${DESTDIR}/usr/share/games/fish.instr diff --git a/games/fish/fish.c b/games/fish/fish.c index 79cdb51..3adf8fb 100644 --- a/games/fish/fish.c +++ b/games/fish/fish.c @@ -98,7 +98,7 @@ main(argc, argv) } printplayer(USER); (void)printf("get to start.\n"); - + for (;;) { move = usermove(); if (!comphand[move]) { @@ -208,12 +208,12 @@ promove() max = i; break; } - while (++i < RANKS) + while (++i < RANKS) if (comphand[i] != CARDS && comphand[i] > comphand[max]) max = i; return(max); - } + } if (nrandom(1024) == 0723) { for (i = 0; i < RANKS; ++i) if (userhand[i] && comphand[i]) @@ -340,7 +340,7 @@ printhand(hand) for (book = i = 0; i < RANKS; i++) if (hand[i] < CARDS) - for (j = hand[i]; --j >= 0;) + for (j = hand[i]; --j >= 0;) PRC(i); else ++book; diff --git a/games/fortune/strfile/strfile.c b/games/fortune/strfile/strfile.c index 2401caa..729cb5c 100644 --- a/games/fortune/strfile/strfile.c +++ b/games/fortune/strfile/strfile.c @@ -68,7 +68,7 @@ static char sccsid[] = "@(#)strfile.c 8.1 (Berkeley) 5/31/93"; * s - Silent. Give no summary of data processed at the end of * the run. * o - order the strings in alphabetic order - * i - if ordering, ignore case + * i - if ordering, ignore case * r - randomize the order of the strings * x - set rotated bit * diff --git a/games/grdc/grdc.c b/games/grdc/grdc.c index 55e579f..ebb3293 100644 --- a/games/grdc/grdc.c +++ b/games/grdc/grdc.c @@ -62,17 +62,17 @@ int n = 0; cbreak(); noecho(); - + hascolor = has_colors(); - if(hascolor) { + if(hascolor) { start_color(); init_pair(1, COLOR_BLACK, COLOR_RED); init_pair(2, COLOR_RED, COLOR_BLACK); init_pair(3, COLOR_WHITE, COLOR_BLACK); attrset(COLOR_PAIR(2)); } - + clear(); refresh(); while(--argc > 0) { @@ -82,7 +82,7 @@ int n = 0; n = atoi(*argv); } - if(hascolor) { + if(hascolor) { attrset(COLOR_PAIR(3)); mvaddch(YBASE - 2, XBASE - 3, ACS_ULCORNER); @@ -183,8 +183,8 @@ standt(int on) if(hascolor) { attron(COLOR_PAIR(1)); } else { - attron(A_STANDOUT); - } + attron(A_STANDOUT); + } } else { if(hascolor) { attron(COLOR_PAIR(2)); diff --git a/games/hack/Makefile b/games/hack/Makefile index b5affcf..6e9511c 100644 --- a/games/hack/Makefile +++ b/games/hack/Makefile @@ -24,7 +24,7 @@ hack.onames.h: makedefs def.objects.h makedefs: makedefs.c ${CC} ${CFLAGS} -o ${.TARGET} ${.CURDIR}/${.PREFIX}.c -beforeinstall: +beforeinstall: install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \ ${DESTDIR}/var/games/hackdir/perm install -c -o ${BINOWN} -g ${BINGRP} -m 666 /dev/null \ diff --git a/games/hack/config.h b/games/hack/config.h index f382937..c4b78a7 100644 --- a/games/hack/config.h +++ b/games/hack/config.h @@ -57,7 +57,7 @@ */ /* #define MAIL */ #define DEF_MAILREADER _PATH_MAIL /* or e.g. /bin/mail */ -#define MAILCKFREQ 100 +#define MAILCKFREQ 100 #define SHELL /* do not delete the '!' command */ diff --git a/games/hack/hack.engrave.c b/games/hack/hack.engrave.c index dc16c39..d5ea219 100644 --- a/games/hack/hack.engrave.c +++ b/games/hack/hack.engrave.c @@ -207,7 +207,7 @@ register struct obj *otmp; if(type == BURN) otmp->spe++; return(0); } - + switch(type) { case DUST: case BURN: diff --git a/games/hack/hack.fight.c b/games/hack/hack.fight.c index ede886d..9e07ece 100644 --- a/games/hack/hack.fight.c +++ b/games/hack/hack.fight.c @@ -93,7 +93,7 @@ monstone(mdef) register struct monst *mdef; { } mondead(mdef); } - + fightm(mtmp) register struct monst *mtmp; { register struct monst *mon; diff --git a/games/hack/hack.h b/games/hack/hack.h index 58c0283..090ef2f 100644 --- a/games/hack/hack.h +++ b/games/hack/hack.h @@ -42,7 +42,7 @@ extern xchar dlevel; #define ON 1 #define OFF 0 -extern struct obj *invent, *uwep, *uarm, *uarm2, *uarmh, *uarms, *uarmg, +extern struct obj *invent, *uwep, *uarm, *uarm2, *uarmh, *uarms, *uarmg, *uleft, *uright, *fcobj; extern struct obj *uchain; /* defined iff PUNISHED */ extern struct obj *uball; /* defined if PUNISHED */ diff --git a/games/hack/hack.mklev.c b/games/hack/hack.mklev.c index 8904021..236f832 100644 --- a/games/hack/hack.mklev.c +++ b/games/hack/hack.mklev.c @@ -221,7 +221,7 @@ register int lowx,lowy,hix,hiy; /* walk down since rscnt and rsmax change */ for(rsp = &rs[rsmax-1]; rsp >= rs; rsp--) { - + if((lx = rsp->rlx) > hix || (ly = rsp->rly) > hiy || (hx = rsp->rhx) < lowx || (hy = rsp->rhy) < lowy) continue; diff --git a/games/hack/hack.mkobj.c b/games/hack/hack.mkobj.c index 18a6914..6fe23ac 100644 --- a/games/hack/hack.mkobj.c +++ b/games/hack/hack.mkobj.c @@ -40,7 +40,7 @@ mkobj(let) { ) ); } - + struct obj zeroobj; diff --git a/games/hack/hack.o_init.c b/games/hack/hack.o_init.c index 37b33ae..25c6405 100644 --- a/games/hack/hack.o_init.c +++ b/games/hack/hack.o_init.c @@ -18,7 +18,7 @@ register char ch; init_objects(){ register int i, j, first, last, sum, end; register char let, *tmp; - /* init base; if probs given check that they add up to 100, + /* init base; if probs given check that they add up to 100, otherwise compute probs; shuffle descriptions */ end = SIZE(objects); first = 0; diff --git a/games/hack/hack.options.c b/games/hack/hack.options.c index ed95de3..477d08b 100644 --- a/games/hack/hack.options.c +++ b/games/hack/hack.options.c @@ -45,7 +45,7 @@ boolean from_env; if(*opts == '!') opts++; else opts += 2; negated = !negated; } - + if(!strncmp(opts,"standout",8)) { flags.standout = !negated; return; diff --git a/games/hack/hack.potion.c b/games/hack/hack.potion.c index c860299..08593ab 100644 --- a/games/hack/hack.potion.c +++ b/games/hack/hack.potion.c @@ -148,7 +148,7 @@ dodrink() { Blind += rn1(100,250); seeoff(0); break; - case POT_GAIN_LEVEL: + case POT_GAIN_LEVEL: pluslvl(); break; case POT_EXTRA_HEALING: @@ -280,7 +280,7 @@ register struct obj *obj; case POT_BLINDNESS: mon->mblinded |= 64 + rn2(64); break; -/* +/* case POT_GAIN_LEVEL: case POT_LEVITATION: case POT_FRUIT_JUICE: @@ -332,7 +332,7 @@ register struct obj *obj; Blind += rnd(5); seeoff(0); break; -/* +/* case POT_GAIN_LEVEL: case POT_LEVITATION: case POT_FRUIT_JUICE: diff --git a/games/hack/hack.read.c b/games/hack/hack.read.c index 5c0de3a..0ea1c4f 100644 --- a/games/hack/hack.read.c +++ b/games/hack/hack.read.c @@ -295,7 +295,7 @@ doread() { known = TRUE; pline("You smell %s close nearby.", confused ? "something" : "food"); - + } else { known = TRUE; cls(); diff --git a/games/hack/hack.shk.c b/games/hack/hack.shk.c index 1478b1d..340a9b7 100644 --- a/games/hack/hack.shk.c +++ b/games/hack/hack.shk.c @@ -140,7 +140,7 @@ register roomno = inroom(u.ux,u.uy); (u.uinshop != roomno + 1 || shlevel != dlevel || !shopkeeper)) { if(shopkeeper) { if(ESHK(shopkeeper)->billct) { - if(inroom(shopkeeper->mx, shopkeeper->my) + if(inroom(shopkeeper->mx, shopkeeper->my) == u.uinshop - 1) /* ab@unido */ pline("Somehow you escaped the shop without paying!"); addupbill(); @@ -361,7 +361,7 @@ int pass, tmp; } return(1); } - + if(!ESHK(shkp)->billct){ pline("You do not owe %s anything.", monnam(shkp)); if(!u.ugold){ diff --git a/games/hack/hack.termcap.c b/games/hack/hack.termcap.c index e94d672..190996d 100644 --- a/games/hack/hack.termcap.c +++ b/games/hack/hack.termcap.c @@ -36,7 +36,7 @@ startup() error("Unknown terminal type: %s.", term); if(pc = tgetstr("pc", &tbufptr)) PC = *pc; - if(!(BC = tgetstr("bc", &tbufptr))) { + if(!(BC = tgetstr("bc", &tbufptr))) { if(!tgetflag("bs")) error("Terminal must backspace."); BC = tbufptr; diff --git a/games/hack/hack.unix.c b/games/hack/hack.unix.c index 7e84c0c..88e743f 100644 --- a/games/hack/hack.unix.c +++ b/games/hack/hack.unix.c @@ -245,7 +245,7 @@ gotlock: error("cannot close lock"); } } -} +} #ifdef MAIL @@ -393,7 +393,7 @@ boolean away; md->my = fy; } break; - } + } } tmp_at(-1,-1); /* close call */ } diff --git a/games/larn/create.c b/games/larn/create.c index 46c09c9..ba0802c 100644 --- a/games/larn/create.c +++ b/games/larn/create.c @@ -223,7 +223,7 @@ treasureroom(lv) for (tx=1+rnd(10); tx= 0) + if (c[WEAR] >= 0) switch(iven[c[WEAR]]) { case OSHIELD: c[AC] += 2 + ivenarg[c[WEAR]]; break; @@ -324,7 +324,7 @@ quit() if ((i == 'n') || (i == '\33')) { lprcat(" no"); lflush(); return; } lprcat("\n"); setbold(); lprcat("Yes"); resetbold(); lprcat(" or "); setbold(); lprcat("No"); resetbold(); lprcat(" please? Do you want to quit? "); - } + } } /* @@ -387,7 +387,7 @@ drop_object(k) item[playerx][playery] = itm; iarg[playerx][playery] = ivenarg[k]; srcount=0; lprcat("\n You drop:"); show3(k); /* show what item you dropped*/ - know[playerx][playery] = 0; iven[k]=0; + know[playerx][playery] = 0; iven[k]=0; if (c[WIELD]==k) c[WIELD]= -1; if (c[WEAR]==k) c[WEAR] = -1; if (c[SHIELD]==k) c[SHIELD]= -1; adjustcvalues(itm,ivenarg[k]); @@ -430,7 +430,7 @@ enchweapon() */ pocketfull() { - register int i,limit; + register int i,limit; if ((limit = 15+(c[LEVEL]>>1)) > 26) limit=26; for (i=0; i= lpend) lflush(); + if (lpnt >= lpend) lflush(); outb = lpnt; for ( ; ; ) { @@ -229,7 +229,7 @@ va_dcl cont=0; break; case 's': tmpb = va_arg(ap, char *); - if (wide==0) { while (*outb++ = *tmpb++); --outb; } + if (wide==0) { while (*outb++ = *tmpb++); --outb; } else { n = wide - strlen(tmpb); @@ -290,7 +290,7 @@ lprint(x) * lwrite(buf,len) write a buffer to the output buffer * char *buf; * int len; - * + * * Enter with the address and number of bytes to write out * Returns nothing of value */ @@ -313,7 +313,7 @@ lwrite(buf,len) lflush(); write(lfd,buf,len); #endif VT100 - } + } else while (len) { if (lpnt >= lpend) lflush(); /* if buffer is full flush it */ @@ -451,7 +451,7 @@ lcreat(str) { lpnt = lpbuf; lpend = lpbuf+BUFBIG; if (str==NULL) return(lfd=1); - if ((lfd=creat(str,0644)) < 0) + if ((lfd=creat(str,0644)) < 0) { lfd=1; lprintf("error creating file <%s>\n",str); lflush(); return(-1); } @@ -525,7 +525,7 @@ lprcat(str) register char *str; { register char *str2; - if (lpnt >= lpend) lflush(); + if (lpnt >= lpend) lflush(); str2 = lpnt; while (*str2++ = *str++); lpnt = str2 - 1; @@ -536,7 +536,7 @@ lprcat(str) * cursor(x,y) Subroutine to set the cursor position * * x and y are the cursor coordinates, and lpbuff is the output buffer where - * escape sequence will be placed. + * escape sequence will be placed. */ static char *y_num[]= { "\33[","\33[","\33[2","\33[3","\33[4","\33[5","\33[6", "\33[7","\33[8","\33[9","\33[10","\33[11","\33[12","\33[13","\33[14", @@ -611,9 +611,9 @@ init_term() switch (tgetent(termbuf, term = getenv("TERM"))) { - case -1: + case -1: write(2, "Cannot open termcap file.\n", 26); exit(); - case 0: + case 0: write(2, "Cannot find entry of ", 21); write(2, term, strlen (term)); write(2, " in termcap\n", 12); @@ -870,9 +870,9 @@ flush_buf() /* * char *tmcapcnv(sd,ss) Routine to convert VT100 escapes to termcap format * - * Processes only the \33[#m sequence (converts . files for termcap use + * Processes only the \33[#m sequence (converts . files for termcap use */ -char *tmcapcnv(sd,ss) +char *tmcapcnv(sd,ss) register char *sd,*ss; { register int tmstate=0; /* 0=normal, 1=\33 2=[ 3=# */ diff --git a/games/larn/main.c b/games/larn/main.c index 36c1665..d75ee9b 100644 --- a/games/larn/main.c +++ b/games/larn/main.c @@ -71,7 +71,7 @@ main(argc,argv) sprintf(optsfile, "%s/.larnopts",ptr); /* the .larnopts filename */ /* - * now malloc the memory for the dungeon + * now malloc the memory for the dungeon */ cell = (struct cel *)malloc(sizeof(struct cel)*(MAXLEVEL+MAXVLEVEL)*MAXX*MAXY); if (cell == 0) died(-285); /* malloc failure */ @@ -96,13 +96,13 @@ main(argc,argv) #endif VT100 /* - * now make scoreboard if it is not there (don't clear) + * now make scoreboard if it is not there (don't clear) */ if (access(scorefile,0) == -1) /* not there */ makeboard(); /* - * now process the command line arguments + * now process the command line arguments */ for (i=1; i9) { oteleport(1); return; } @@ -622,7 +622,7 @@ parse() return; #endif #endif - case 'P': cursors(); + case 'P': cursors(); if (outstanding_taxes>0) lprintf("\nYou presently owe %d gp in taxes.",(long)outstanding_taxes); else @@ -654,7 +654,7 @@ run(dir) /* function to wield a weapon */ -wield() +wield() { register int i; while (1) @@ -722,7 +722,7 @@ dropobj() while (1) { if ((i = whatitem("drop"))=='\33') return; - if (i=='*') showstr(); else + if (i=='*') showstr(); else { if (i=='.') /* drop some gold */ { @@ -743,7 +743,7 @@ dropobj() { *p=OKGOLD; i=amt/1000; amt = 1000*i; } else { *p=OKGOLD; i=32767; amt = 32767000L; } - c[GOLD] -= amt; + c[GOLD] -= amt; lprintf("You drop %d gold pieces",(long)amt); iarg[playerx][playery]=i; bottomgold(); know[playerx][playery]=0; dropflag=1; return; diff --git a/games/larn/monster.c b/games/larn/monster.c index 6ec0865..649f925 100644 --- a/games/larn/monster.c +++ b/games/larn/monster.c @@ -1,5 +1,5 @@ /* - * monster.c Larn is copyrighted 1986 by Noah Morgan. + * monster.c Larn is copyrighted 1986 by Noah Morgan. * * This file contains the following functions: * ---------------------------------------------------------------------------- @@ -324,7 +324,7 @@ speldamage(x) *p=OBOOK; iarg[i][j]=level; *kn=0; } break; - + case OTHRONE: *pm=GNOMEKING; *kn=0; *p= OTHRONE2; hitp[i][j]=monster[GNOMEKING].hitpoints; break; @@ -409,12 +409,12 @@ speldamage(x) for (i=0; i20) return(0); /* fullhits are out of range */ if (c[LANCEDEATH]) return(10000); /* lance of death */ - i = xx * ((c[WCLASS]>>1)+c[STRENGTH]+c[STREXTRA]-c[HARDGAME]-12+c[MOREDAM]); + i = xx * ((c[WCLASS]>>1)+c[STRENGTH]+c[STREXTRA]-c[HARDGAME]-12+c[MOREDAM]); return( (i>=1) ? i : xx ); } @@ -546,7 +546,7 @@ direct(spnum,dam,str,arg) } else { - lastnum=278; + lastnum=278; lprintf(str,"spell caster (thats you)",(long)arg); beep(); losehp(dam); return; } @@ -566,7 +566,7 @@ direct(spnum,dam,str,arg) * Function to hit in a direction from a missile weapon and have it keep * on going in that direction until its power is exhausted * Enter with the spell number in spnum, the power of the weapon in hp, - * lprintf format string in str, the # of milliseconds to delay between + * lprintf format string in str, the # of milliseconds to delay between * locations in delay, and the character to represent the weapon in cshow. * Returns no value. */ @@ -741,12 +741,12 @@ dirsub(x,y) switch(getchar()) { case 'b': i++; - case 'n': i++; - case 'y': i++; + case 'n': i++; + case 'y': i++; case 'u': i++; - case 'h': i++; + case 'h': i++; case 'k': i++; - case 'l': i++; + case 'l': i++; case 'j': i++; goto out; }; out: @@ -820,7 +820,7 @@ hitmonster(x,y) if ((rnd(20) < tmp-c[HARDGAME]) || (rnd(71) < 5)) /* need at least random chance to hit */ { lprcat("\nYou hit"); flag=1; - damag = fullhit(1); + damag = fullhit(1); if (damag<9999) damag=rnd(damag)+1; } else @@ -910,7 +910,7 @@ hitplayer(x,y) hitflag = hit2flag = hit3flag = 1; yrepcount=0; cursors(); ifblind(x,y); - if (c[INVISIBILITY]) if (rnd(33)<20) + if (c[INVISIBILITY]) if (rnd(33)<20) { lprintf("\nThe %s misses wildly",lastmonst); return; } @@ -1002,7 +1002,7 @@ something(level) * Enter with the cave level and a pointer to the items arg */ static char nobjtab[] = { 0, OSCROLL, OSCROLL, OSCROLL, OSCROLL, OPOTION, - OPOTION, OPOTION, OPOTION, OGOLDPILE, OGOLDPILE, OGOLDPILE, OGOLDPILE, + OPOTION, OPOTION, OPOTION, OGOLDPILE, OGOLDPILE, OGOLDPILE, OGOLDPILE, OBOOK, OBOOK, OBOOK, OBOOK, ODAGGER, ODAGGER, ODAGGER, OLEATHER, OLEATHER, OLEATHER, OREGENRING, OPROTRING, OENERGYRING, ODEXRING, OSTRRING, OSPEAR, OBELT, ORING, OSTUDLEATHER, OSHIELD, OFLAIL, OCHAIN, O2SWORD, OPLATE, @@ -1013,7 +1013,7 @@ newobject(lev,i) { register int tmp=32,j; if (level<0 || level>MAXLEVEL+MAXVLEVEL) return(0); /* correct level? */ - if (lev>6) tmp=37; else if (lev>4) tmp=35; + if (lev>6) tmp=37; else if (lev>4) tmp=35; j = nobjtab[tmp=rnd(tmp)]; /* the object type */ switch(tmp) { @@ -1032,7 +1032,7 @@ newobject(lev,i) case 29: case 31: *i=rund(lev/2+1); if (*i==0) return(0); break; case 34: *i=newchain(); break; case 36: *i=newplate(); break; - case 37: *i=newsword(); break; + case 37: *i=newsword(); break; } return(j); } @@ -1067,7 +1067,7 @@ newobject(lev,i) * * char rustarm[ARMORTYPES][2]; * special array for maximum rust damage to armor from rustmonster - * format is: { armor type , minimum attribute + * format is: { armor type , minimum attribute */ #define ARMORTYPES 6 static char rustarm[ARMORTYPES][2] = { OSTUDLEATHER,-2, ORING,-4, OCHAIN,-5, @@ -1093,7 +1093,7 @@ spattack(x,xx,yy) if (m == rustarm[i][0]) /* find his armor in table */ { if (--ivenarg[k]< rustarm[i][1]) - ivenarg[k]= rustarm[i][1]; else j=1; + ivenarg[k]= rustarm[i][1]; else j=1; break; } } @@ -1162,7 +1162,7 @@ spattack(x,xx,yy) p="\nThe %s nearly misses"; break; } break; - } + } break; case 10: p="\nThe %s hit you with his barbed tail"; @@ -1326,7 +1326,7 @@ rmsphere(x,y) { item[x][y]=mitem[x][y]=0; know[x][y]=1; show1cell(x,y); /* show the now missing sphere */ - --c[SPHCAST]; + --c[SPHCAST]; if (sp==spheres) { sp2=sp; spheres=sp->p; free((char*)sp2); } else { sp2->p = sp->p; free((char*)sp); } diff --git a/games/larn/moreobj.c b/games/larn/moreobj.c index f834b1a..343773e 100644 --- a/games/larn/moreobj.c +++ b/games/larn/moreobj.c @@ -30,7 +30,7 @@ oaltar() case 'p': lprcat(" pray\nDo you (m) give money or (j) just pray? "); while (1) switch(getchar()) { - case 'j': if (rnd(100)<75) + case 'j': if (rnd(100)<75) lprcat("\nnothing happens"); else if (rnd(13)<4) ohear(); else if (rnd(43) == 10) @@ -212,7 +212,7 @@ ochest() lprcat("\nYou begin to lose hand to eye coordination!"); beep(); break; - + case 3: c[HALFDAM]+= rnd(1600)+200; beep(); lprcat("\nA sickness engulfs you!"); break; diff --git a/games/larn/movem.c b/games/larn/movem.c index 7239a06..d50d3ac 100644 --- a/games/larn/movem.c +++ b/games/larn/movem.c @@ -245,7 +245,7 @@ mmove(aa,bb,cc,dd) if (i==OTELEPORTER) /* monster hits teleport trap */ { flag=3; fillmonst(mitem[cc][dd]); mitem[cc][dd]=0; } if (c[BLINDCOUNT]) return; /* if blind don't show where monsters are */ - if (know[cc][dd] & 1) + if (know[cc][dd] & 1) { p=0; if (flag) cursors(); diff --git a/games/larn/object.c b/games/larn/object.c index 9bf7c3c..769bf20 100644 --- a/games/larn/object.c +++ b/games/larn/object.c @@ -67,7 +67,7 @@ switch(i) case OTELEPORTER: lprcat("\nZaaaappp! You've been teleported!\n"); beep(); nap(3000); oteleport(0); - break; + break; case OSCHOOL: if (nearbymonst()) return; lprcat("\n\nYou have found the College of Larn."); @@ -133,7 +133,7 @@ switch(i) { case 6: c[AGGRAVATE] += rnd(400); break; - case 7: lprcat("\nYou are jolted by an electric shock "); + case 7: lprcat("\nYou are jolted by an electric shock "); lastnum=274; losehp(rnd(20)); bottomline(); break; case 8: loselevel(); break; @@ -172,7 +172,7 @@ switch(i) if (level!=0) { lprcat("\nThe shaft only extends 5 feet downward!"); return; } if (packweight() > 45+3*(c[STRENGTH]+c[STREXTRA])) { lprcat("\nYou slip and fall down the shaft"); beep(); lastnum=275; losehp(30+rnd(20)); bottomhp(); } - + else lprcat("climb down"); nap(3000); newcavelevel(MAXLEVEL); for (i=0; i=0) lprintf("\nYou went forward in time by %d mobuls",(long)((i+99)/100)); else lprintf("\nYou went backward in time by %d mobuls",(long)(-(i+99)/100)); adjtime((long)i); /* adjust time for time warping */ diff --git a/games/larn/regen.c b/games/larn/regen.c index b9f7a0f..993cc8b 100644 --- a/games/larn/regen.c +++ b/games/larn/regen.c @@ -51,9 +51,9 @@ regen() if (d[CANCELLATION]) if ((--d[CANCELLATION]) <= 0) flag=1; if (d[WTW]) if ((--d[WTW]) <= 0) flag=1; if (d[HASTESELF]) if ((--d[HASTESELF]) <= 0) flag=1; - if (d[AGGRAVATE]) --d[AGGRAVATE]; - if (d[SCAREMONST]) if ((--d[SCAREMONST]) <= 0) flag=1; - if (d[STEALTH]) if ((--d[STEALTH]) <= 0) flag=1; + if (d[AGGRAVATE]) --d[AGGRAVATE]; + if (d[SCAREMONST]) if ((--d[SCAREMONST]) <= 0) flag=1; + if (d[STEALTH]) if ((--d[STEALTH]) <= 0) flag=1; if (d[AWARENESS]) --d[AWARENESS]; if (d[HOLDMONST]) if ((--d[HOLDMONST]) <= 0) flag=1; if (d[HASTEMONST]) --d[HASTEMONST]; @@ -73,7 +73,7 @@ regen() if (rnd(100)<50) { d[WEAR]=d[SHIELD]= -1; cursors(); - lprcat("\nThe hysteria of itching forces you to remove your armor!"); + lprcat("\nThe hysteria of itching forces you to remove your armor!"); beep(); recalc(); bottomline(); } if (--d[ITCHING]<=0) { cursors(); lprcat("\nYou now feel the irritation subside!"); beep(); } diff --git a/games/larn/scores.c b/games/larn/scores.c index f6cf15c..e7771a6 100644 --- a/games/larn/scores.c +++ b/games/larn/scores.c @@ -13,8 +13,8 @@ * showallscores() Function to show scores and the iven lists that go with them * sortboard() Function to sort the scoreboard * newscore(score, whoo, whyded, winner) Function to add entry to scoreboard - * new1sub(score,i,whoo,taxes) Subroutine to put player into a - * new2sub(score,i,whoo,whyded) Subroutine to put player into a + * new1sub(score,i,whoo,taxes) Subroutine to put player into a + * new2sub(score,i,whoo,whyded) Subroutine to put player into a * died(x) Subroutine to record who played larn, and what the score was * diedsub(x) Subroutine to print out a line showing player when he is killed * diedlog() Subroutine to read a log file and print it out in ascii format @@ -187,7 +187,7 @@ long paytaxes(x) /* * winshou() Subroutine to print out the winning scoreboard * - * Returns the number of players on scoreboard that were shown + * Returns the number of players on scoreboard that were shown */ winshou() { @@ -224,7 +224,7 @@ winshou() * int x; * * Enter with 0 to list the scores, enter with 1 to list inventories too - * Returns the number of players on scoreboard that were shown + * Returns the number of players on scoreboard that were shown */ shou(x) int x; @@ -275,7 +275,7 @@ showscores() { register int i,j; lflush(); lcreat((char*)0); if (readboard()<0) return; - i=winshou(); j=shou(0); + i=winshou(); j=shou(0); if (i+j == 0) lprcat(esb); else lprc('\n'); lflush(); } @@ -369,7 +369,7 @@ newscore(score, whoo, whyded, winner) } /* - * new1sub(score,i,whoo,taxes) Subroutine to put player into a + * new1sub(score,i,whoo,taxes) Subroutine to put player into a * int score,i,whyded,taxes; winning scoreboard entry if his score * char *whoo; is high enough * @@ -395,7 +395,7 @@ new1sub(score,i,whoo,taxes) } /* - * new2sub(score,i,whoo,whyded) Subroutine to put player into a + * new2sub(score,i,whoo,whyded) Subroutine to put player into a * int score,i,whyded,taxes; non-winning scoreboard entry if his * char *whoo; score is high enough * @@ -611,7 +611,7 @@ diedlog() * it will try to make a new entry in the file. Only returns -1 if can't * find him in the file, and can't make a new entry in the file. * Format of playerids file: - * Id # in ascii \n character name \n + * Id # in ascii \n character name \n */ static int havepid= -1; /* playerid # if previously done */ getplid(nam) diff --git a/games/larn/signal.c b/games/larn/signal.c index 60bd6ce..b4c0a20 100644 --- a/games/larn/signal.c +++ b/games/larn/signal.c @@ -5,7 +5,7 @@ extern char savefilename[],wizard,predostuff,nosignal; static s2choose() /* text to be displayed if ^C during intro screen */ { cursor(1,24); lprcat("Press "); setbold(); lprcat("return"); resetbold(); - lprcat(" to continue: "); lflush(); + lprcat(" to continue: "); lflush(); } static void @@ -61,7 +61,7 @@ static void sigpipe() { sigpanic(SIGPIPE); } static void sigterm() { sigpanic(SIGTERM); } sigsetup() { - signal(SIGQUIT, cntlc); signal(SIGINT, cntlc); + signal(SIGQUIT, cntlc); signal(SIGINT, cntlc); signal(SIGKILL, SIG_IGN); signal(SIGHUP, sgam); signal(SIGILL, sigill); signal(SIGTRAP, sigtrap); signal(SIGIOT, sigiot); signal(SIGEMT, sigemt); @@ -143,6 +143,6 @@ sigpanic(sig) sprintf(buf,"\nLarn - Panic! Signal %d received [%s]",sig,signame[sig]); write(2,buf,strlen(buf)); sleep(2); sncbr(); - savegame(savefilename); + savegame(savefilename); kill(getpid(),sig); /* this will terminate us */ } diff --git a/games/larn/store.c b/games/larn/store.c index 904cfad..70d4779 100644 --- a/games/larn/store.c +++ b/games/larn/store.c @@ -211,7 +211,7 @@ dndstore() lprcat("\n\nThe Larn Revenue Service has ordered us to not do business with tax evaders.\n"); beep(); lprintf("They have also told us that you owe %d gp in back taxes, and as we must\n",(long)outstanding_taxes); lprcat("comply with the law, we cannot serve you at this time. Soo Sorry.\n"); - cursors(); + cursors(); lprcat("\nPress "); standout("escape"); lprcat(" to leave: "); lflush(); i=0; while (i!='\33') i=getchar(); @@ -353,7 +353,7 @@ oschool() cl_line(16,8); c[STRENGTH] += 2; c[CONSTITUTION] += 2; break; - case 'c': c[INTELLIGENCE] += 2; + case 'c': c[INTELLIGENCE] += 2; lprcat("\nThe task before you now seems more attainable!"); cl_line(16,9); break; @@ -366,15 +366,15 @@ oschool() cl_line(16,10); c[INTELLIGENCE] += 2; break; - case 'e': c[CHARISMA] += 3; + case 'e': c[CHARISMA] += 3; lprcat("\nYou now feel like a born leader!"); cl_line(16,11); break; - case 'f': c[WISDOM] += 2; + case 'f': c[WISDOM] += 2; lprcat("\nYou now feel more confident that you can find the potion in time!"); cl_line(16,12); break; - case 'g': c[DEXTERITY] += 3; + case 'g': c[DEXTERITY] += 3; lprcat("\nYou feel like dancing!"); cl_line(16,13); break; @@ -388,7 +388,7 @@ oschool() { gtime += time_used; course[i-'a']++; /* remember that he has taken that course */ - c[HP] = c[HPMAX]; c[SPELLS] = c[SPELLMAX]; /* he regenerated */ + c[HP] = c[HPMAX]; c[SPELLS] = c[SPELLMAX]; /* he regenerated */ if (c[BLINDCOUNT]) c[BLINDCOUNT]=1; /* cure blindness too! */ if (c[CONFUSE]) c[CONFUSE]=1; /* end confusion */ @@ -426,7 +426,7 @@ banktitle(str) lprintf("levied taxes have been paid. They have also told us that you owe %d gp in\n",(long)outstanding_taxes); lprcat("taxes, and we must comply with them. We cannot serve you at this time. Sorry.\n"); lprcat("We suggest you go to the LRS office and pay your taxes.\n"); - cursors(); + cursors(); lprcat("\nPress "); standout("escape"); lprcat(" to leave: "); lflush(); i=0; while (i!='\33') i=getchar(); @@ -465,7 +465,7 @@ obanksub() for (k=i=0; i<26; i++) switch(iven[i]) { - case OLARNEYE: case ODIAMOND: case OEMERALD: + case OLARNEYE: case ODIAMOND: case OEMERALD: case ORUBY: case OSAPPHIRE: if (iven[i]==OLARNEYE) @@ -505,7 +505,7 @@ obanksub() if (amt<0) { lprcat("\nSorry, but we don't have any negative gold!"); nap(2000); amt=0; } else if (amt > c[BANKACCOUNT]) { lprcat("\nYou don't have that much in the bank!"); nap(2000); } - else { c[GOLD] += amt; c[BANKACCOUNT] -= amt; } + else { c[GOLD] += amt; c[BANKACCOUNT] -= amt; } break; case 's': lprcat("\nWhich stone would you like to sell? "); @@ -513,7 +513,7 @@ obanksub() if (i=='*') for (i=0; i<26; i++) { - if (gemvalue[i]) + if (gemvalue[i]) { c[GOLD]+=gemvalue[i]; iven[i]=0; gemvalue[i]=0; k = gemorder[i]; @@ -523,7 +523,7 @@ obanksub() } else { - if (gemvalue[i=i-'a']==0) + if (gemvalue[i=i-'a']==0) { lprintf("\nItem %c is not a gemstone!",i+'a'); nap(2000); break; @@ -567,7 +567,7 @@ appraise(gemstone) lprcat("\nWould you like to sell it to us? "); yrepcount=0; if (getyn()=='y') { lprcat("yes\n"); c[GOLD]+=amt; iven[j]=0; } else lprcat("no thank you.\n"); - if (gemstone==OLARNEYE) lprcat("It is, of course, your privilege to keep the stone\n"); + if (gemstone==OLARNEYE) lprcat("It is, of course, your privilege to keep the stone\n"); } else lprcat("no\nO. K.\n"); } diff --git a/games/larn/tok.c b/games/larn/tok.c index ee4039b..d21848d 100644 --- a/games/larn/tok.c +++ b/games/larn/tok.c @@ -29,7 +29,7 @@ yylex() if (hit2flag) { hit2flag=0; yrepcount=0; return(' '); } if (yrepcount>0) { --yrepcount; return(lastok); } else yrepcount=0; if (yrepcount==0) { bottomdo(); showplayer(); } /* show where the player is */ - lflush(); + lflush(); while (1) { c[BYTESIN]++; @@ -82,7 +82,7 @@ yylex() setscroll(); return(lastok = 'L'-64); /* redisplay screen */ } - + if ((cc <= '9') && (cc >= '0')) { yrepcount = yrepcount*10 + cc - '0'; } else { if (yrepcount>0) --yrepcount; return(lastok = cc); } @@ -105,14 +105,14 @@ flushall() } /* - function to set the desired hardness + function to set the desired hardness enter with hard= -1 for default hardness, else any desired hardness */ sethard(hard) int hard; { register int j,k,i; - j=c[HARDGAME]; hashewon(); + j=c[HARDGAME]; hashewon(); if (restorflag==0) /* don't set c[HARDGAME] if restoring game */ { if (hard >= 0) c[HARDGAME]= hard; @@ -132,7 +132,7 @@ sethard(hard) monster[j].armorclass = (i< -127) ? -127 : i; i = (7*monster[j].experience)/(7+k) + 1; monster[j].experience = (i<=0) ? 1 : i; - } + } } /* @@ -171,7 +171,7 @@ readopts() { if ((i=lgetw())==0) break; if (strlen(i)>=MAXMNAME) i[MAXMNAME-1]=0; - strcpy(usermonster[usermpoint],i); + strcpy(usermonster[usermpoint],i); if (usermpoint >= MAXUM) break; /* defined all of em */ if (isalpha(j=usermonster[usermpoint][0])) { @@ -196,7 +196,7 @@ readopts() else if (strcmp(i,"no-beep") == 0) nobeep=1; break; - case 'p': if (strcmp(i,"process-name:")== 0) + case 'p': if (strcmp(i,"process-name:")== 0) { if ((i=lgetw())==0) break; if (strlen(i)>=PSNAMESIZE) i[PSNAMESIZE-1]=0; diff --git a/games/mille/extern.c b/games/mille/extern.c index 2b5ad30..1f82bc6 100644 --- a/games/mille/extern.c +++ b/games/mille/extern.c @@ -62,7 +62,7 @@ char *C_fmt = "%-18.18s", /* format for printing cards */ "Flat Tire", "Accident", "Stop", - "Speed Limit", + "Speed Limit", "Gasoline", "Spare Tire", "Repairs", diff --git a/games/mille/mille.h b/games/mille/mille.h index f91163d..7d146b2 100644 --- a/games/mille/mille.h +++ b/games/mille/mille.h @@ -119,7 +119,7 @@ # define C_100 3 # define C_200 4 # define C_EMPTY 5 -# define C_FLAT 6 +# define C_FLAT 6 # define C_CRASH 7 # define C_STOP 8 # define C_LIMIT 9 diff --git a/games/mille/misc.c b/games/mille/misc.c index 40a1bc9..28e175e 100644 --- a/games/mille/misc.c +++ b/games/mille/misc.c @@ -158,7 +158,7 @@ done: goto extend; for (miles = 0, i = 0; i < HAND_SZ; i++) if ((safe = pp->hand[i]) <= C_200) - miles += Value[safe]; + miles += Value[safe]; if (miles + (Topcard - Deck) * 3 > 1000) goto extend; goto done; diff --git a/games/number/number.c b/games/number/number.c index 13d139b..44cae3c 100644 --- a/games/number/number.c +++ b/games/number/number.c @@ -68,7 +68,7 @@ static char *name1[] = { "trillion", "quadrillion", "quintillion", "sextillion", "septillion", "octillion", "nonillion", "decillion", "undecillion", "duodecillion", "tredecillion", "quattuordecillion", - "quindecillion", "sexdecillion", + "quindecillion", "sexdecillion", "septendecillion", "octodecillion", "novemdecillion", "vigintillion", }; diff --git a/games/phantasia/Makefile b/games/phantasia/Makefile index 7727006..7c61916 100644 --- a/games/phantasia/Makefile +++ b/games/phantasia/Makefile @@ -11,10 +11,10 @@ CLEANFILES+= characs gold lastdead mess monsters motd scoreboard void all: setup phantasia ${MAN6} -setup: phantglobs.o setup.o monsters.asc ${LIBM} +setup: phantglobs.o setup.o monsters.asc ${LIBM} ${CC} phantglobs.o setup.o -o ${.TARGET} -lm -beforeinstall: +beforeinstall: ./setup -m ${.CURDIR}/monsters.asc install -c -m 660 -o games -g bin gold ${DESTDIR}/var/games/phantasia install -c -m 660 -o games -g bin lastdead ${DESTDIR}/var/games/phantasia diff --git a/games/phantasia/convert.c b/games/phantasia/convert.c index f46343f..b18c5e9 100644 --- a/games/phantasia/convert.c +++ b/games/phantasia/convert.c @@ -24,7 +24,7 @@ char Newpfile[] = DEST/newcharacs"; /* new format file */ / / RETURN VALUE: none / -/ MODULES CALLED: time(), exit(), fread(), fopen(), srandom(), floor(), +/ MODULES CALLED: time(), exit(), fread(), fopen(), srandom(), floor(), / random(), strcmp(), fwrite(), strcpy(), fclose(), fprintf() / / GLOBAL INPUTS: _iob[], Oldplayer, Newplayer diff --git a/games/phantasia/fight.c b/games/phantasia/fight.c index 39858c9..93b2d18 100644 --- a/games/phantasia/fight.c +++ b/games/phantasia/fight.c @@ -17,12 +17,12 @@ / / RETURN VALUE: none / -/ MODULES CALLED: monsthits(), playerhits(), readmessage(), callmonster(), -/ writerecord(), pickmonster(), displaystats(), pow(), cancelmonster(), -/ awardtreasure(), more(), death(), wmove(), setjmp(), drandom(), printw(), +/ MODULES CALLED: monsthits(), playerhits(), readmessage(), callmonster(), +/ writerecord(), pickmonster(), displaystats(), pow(), cancelmonster(), +/ awardtreasure(), more(), death(), wmove(), setjmp(), drandom(), printw(), / longjmp(), wrefresh(), mvprintw(), wclrtobot() / -/ GLOBAL INPUTS: Curmonster, Whichmonster, LINES, Lines, Circle, Shield, +/ GLOBAL INPUTS: Curmonster, Whichmonster, LINES, Lines, Circle, Shield, / Player, *stdscr, Fileloc, Fightenv[], *Enemyname / / GLOBAL OUTPUTS: Curmonster, Whichmonster, Lines, Shield, Player, Luckout @@ -237,7 +237,7 @@ pickmonster() /* even chance of some tamer non-water monsters */ return((int) ROLL(14.0, 50.0)); - else + else /* even chance of some of the tamest non-water monsters */ return((int) ROLL(14.0, 25.0)); } @@ -254,8 +254,8 @@ pickmonster() / / RETURN VALUE: none / -/ MODULES CALLED: hitmonster(), throwspell(), inputoption(), cancelmonster(), -/ floor(), wmove(), drandom(), altercoordinates(), waddstr(), mvprintw(), +/ MODULES CALLED: hitmonster(), throwspell(), inputoption(), cancelmonster(), +/ floor(), wmove(), drandom(), altercoordinates(), waddstr(), mvprintw(), / wclrtoeol(), wclrtobot() / / GLOBAL INPUTS: Curmonster, Lines, Player, *stdscr, Luckout, *Enemyname @@ -429,14 +429,14 @@ int ch; /* input */ / / RETURN VALUE: none / -/ MODULES CALLED: cancelmonster(), scramblestats(), more(), floor(), wmove(), -/ drandom(), altercoordinates(), longjmp(), waddstr(), mvprintw(), +/ MODULES CALLED: cancelmonster(), scramblestats(), more(), floor(), wmove(), +/ drandom(), altercoordinates(), longjmp(), waddstr(), mvprintw(), / getanswer() / -/ GLOBAL INPUTS: Curmonster, Lines, Circle, Shield, Player, *stdscr, +/ GLOBAL INPUTS: Curmonster, Lines, Circle, Shield, Player, *stdscr, / Fightenv[], *Enemyname / -/ GLOBAL OUTPUTS: Curmonster, Whichmonster, Lines, Shield, Player, +/ GLOBAL OUTPUTS: Curmonster, Whichmonster, Lines, Shield, Player, / *Enemyname / / DESCRIPTION: @@ -471,7 +471,7 @@ int ch; /* input */ /* take experience away */ inflict = ROLL(10.0, Curmonster.m_strength); inflict = MIN(Player.p_experience, inflict); - mvprintw(Lines++, 0, + mvprintw(Lines++, 0, "%s took away %.0f experience points.", Enemyname, inflict); Player.p_experience -= inflict; return; @@ -796,11 +796,11 @@ double inflict; / / RETURN VALUE: none / -/ MODULES CALLED: hitmonster(), cancelmonster(), sqrt(), floor(), wmove(), -/ drandom(), altercoordinates(), longjmp(), infloat(), waddstr(), mvprintw(), +/ MODULES CALLED: hitmonster(), cancelmonster(), sqrt(), floor(), wmove(), +/ drandom(), altercoordinates(), longjmp(), infloat(), waddstr(), mvprintw(), / getanswer() / -/ GLOBAL INPUTS: Curmonster, Whichmonster, Nomana[], Player, *stdscr, +/ GLOBAL INPUTS: Curmonster, Whichmonster, Nomana[], Player, *stdscr, / Fightenv[], Illspell[], *Enemyname / / GLOBAL OUTPUTS: Curmonster, Whichmonster, Shield, Player @@ -1035,7 +1035,7 @@ int ch; /* input */ / / RETURN VALUE: none / -/ MODULES CALLED: truncstring(), fread(), fseek(), floor(), drandom(), +/ MODULES CALLED: truncstring(), fread(), fseek(), floor(), drandom(), / strcpy() / / GLOBAL INPUTS: Curmonster, Circle, Player, *Monstfp @@ -1144,11 +1144,11 @@ struct monster Othermonster; /* to find a name for mimics */ / / RETURN VALUE: none / -/ MODULES CALLED: pickmonster(), collecttaxes(), more(), cursedtreasure(), -/ floor(), wmove(), drandom(), sscanf(), printw(), altercoordinates(), +/ MODULES CALLED: pickmonster(), collecttaxes(), more(), cursedtreasure(), +/ floor(), wmove(), drandom(), sscanf(), printw(), altercoordinates(), / longjmp(), infloat(), waddstr(), getanswer(), getstring(), wclrtobot() / -/ GLOBAL INPUTS: Somebetter[], Curmonster, Whichmonster, Circle, Player, +/ GLOBAL INPUTS: Somebetter[], Curmonster, Whichmonster, Circle, Player, / *stdscr, Databuf[], *Statptr, Fightenv[] / / GLOBAL OUTPUTS: Whichmonster, Shield, Player @@ -1211,7 +1211,7 @@ double dtemp; /* for temporary calculations */ return; } - else + else /* other treasures */ { addstr("You have found some treasure. Do you want to inspect it ? "); diff --git a/games/phantasia/gamesupport.c b/games/phantasia/gamesupport.c index db103a1..bea933a 100644 --- a/games/phantasia/gamesupport.c +++ b/games/phantasia/gamesupport.c @@ -17,12 +17,12 @@ / / RETURN VALUE: none / -/ MODULES CALLED: freerecord(), writerecord(), descrstatus(), truncstring(), -/ time(), more(), wmove(), wclear(), strcmp(), printw(), strcpy(), -/ infloat(), waddstr(), cleanup(), findname(), userlist(), mvprintw(), +/ MODULES CALLED: freerecord(), writerecord(), descrstatus(), truncstring(), +/ time(), more(), wmove(), wclear(), strcmp(), printw(), strcpy(), +/ infloat(), waddstr(), cleanup(), findname(), userlist(), mvprintw(), / localtime(), getanswer(), descrtype(), getstring() / -/ GLOBAL INPUTS: LINES, *Login, Other, Wizard, Player, *stdscr, Databuf[], +/ GLOBAL INPUTS: LINES, *Login, Other, Wizard, Player, *stdscr, Databuf[], / Fileloc / / GLOBAL OUTPUTS: Echo @@ -226,7 +226,7 @@ short *sptr; /* pointer to short item to change */ if (strcmp(Databuf, playerp->p_password) != 0) continue; } - + if (c == 'A') /* get new name */ { @@ -537,7 +537,7 @@ register int count = 0; /* count in file */ / / MODULES CALLED: fread(), fopen(), printf(), fclose() / -/ GLOBAL INPUTS: +/ GLOBAL INPUTS: / / GLOBAL OUTPUTS: none / @@ -660,7 +660,7 @@ long loc = 0L; /* location in file */ / / RETURN VALUE: none / -/ MODULES CALLED: fread(), fseek(), fopen(), error(), strcmp(), fclose(), +/ MODULES CALLED: fread(), fseek(), fopen(), error(), strcmp(), fclose(), / strcpy(), fwrite(), descrtype() / / GLOBAL INPUTS: Player diff --git a/games/phantasia/interplayer.c b/games/phantasia/interplayer.c index adc7e1b..7c023d9 100644 --- a/games/phantasia/interplayer.c +++ b/games/phantasia/interplayer.c @@ -79,12 +79,12 @@ long foeloc = 0L; /* location in file of person to fight */ / / RETURN VALUE: none / -/ MODULES CALLED: readrecord(), readmessage(), writerecord(), collecttaxes(), -/ displaystats(), fabs(), more(), death(), sleep(), wmove(), waddch(), printw(), -/ myturn(), altercoordinates(), waddstr(), wrefresh(), mvprintw(), +/ MODULES CALLED: readrecord(), readmessage(), writerecord(), collecttaxes(), +/ displaystats(), fabs(), more(), death(), sleep(), wmove(), waddch(), printw(), +/ myturn(), altercoordinates(), waddstr(), wrefresh(), mvprintw(), / getanswer(), wclrtoeol(), wclrtobot() / -/ GLOBAL INPUTS: Foestrikes, LINES, Lines, Other, Shield, Player, *stdscr, +/ GLOBAL INPUTS: Foestrikes, LINES, Lines, Other, Shield, Player, *stdscr, / Fileloc, *Enemyname / / GLOBAL OUTPUTS: Foestrikes, Lines, Shield, Player, Luckout, *Enemyname @@ -347,10 +347,10 @@ LEAVE: / / RETURN VALUE: none / -/ MODULES CALLED: writerecord(), inputoption(), floor(), wmove(), drandom(), +/ MODULES CALLED: writerecord(), inputoption(), floor(), wmove(), drandom(), / waddstr(), wrefresh(), mvprintw(), wclrtoeol(), wclrtobot() / -/ GLOBAL INPUTS: Lines, Other, Player, *stdscr, Fileloc, Luckout, +/ GLOBAL INPUTS: Lines, Other, Player, *stdscr, Fileloc, Luckout, / *Enemyname / / GLOBAL OUTPUTS: Foestrikes, Lines, Player, Luckout @@ -380,7 +380,7 @@ int ch; /* input */ { default: /* fight */ dtemp = ROLL(2.0, Player.p_might); -HIT: +HIT: mvprintw(Lines++, 0, "You hit %s %.0f times!", Enemyname, dtemp); Player.p_sin += 0.5; Player.p_1scratch += dtemp; @@ -516,8 +516,8 @@ long loc = 0L; /* location in energy void file */ / / RETURN VALUE: none / -/ MODULES CALLED: writerecord(), more(), fread(), death(), fseek(), sleep(), -/ floor(), wmove(), waddch(), drandom(), printw(), altercoordinates(), +/ MODULES CALLED: writerecord(), more(), fread(), death(), fseek(), sleep(), +/ floor(), wmove(), waddch(), drandom(), printw(), altercoordinates(), / waddstr(), wrefresh(), encounter(), writevoid() / / GLOBAL INPUTS: Other, Player, *stdscr, Enrgyvoid, *Playersfp @@ -654,7 +654,7 @@ long loc; /* location in file of other players */ Player.p_mana = Player.p_energy = Player.p_maxenergy = - Player.p_magiclvl = + Player.p_magiclvl = Player.p_brains = Player.p_experience = Player.p_quickness = 1.0; @@ -708,8 +708,8 @@ long loc; /* location in file of other players */ / / RETURN VALUE: none / -/ MODULES CALLED: descrstatus(), descrlocation(), more(), fread(), fseek(), -/ floor(), wmove(), printw(), waddstr(), distance(), wrefresh(), +/ MODULES CALLED: descrstatus(), descrlocation(), more(), fread(), fseek(), +/ floor(), wmove(), printw(), waddstr(), distance(), wrefresh(), / descrtype(), wclrtobot() / / GLOBAL INPUTS: LINES, Other, Circle, Wizard, Player, *stdscr, *Playersfp @@ -766,7 +766,7 @@ register int numusers = 0; /* number of users on file */ /* those nearer the origin can be seen */ || Player.p_palantir) /* palantir enables one to see others */ - && (Other.p_status != S_CLOAKED + && (Other.p_status != S_CLOAKED || (Player.p_specialtype == SC_VALAR && Player.p_palantir)) /* not cloaked; valar can see through cloak with a palantir */ && Other.p_specialtype != SC_VALAR) @@ -778,7 +778,7 @@ register int numusers = 0; /* number of users on file */ /* cannot see player's coordinates */ printw("%-20s %19.19s ", Other.p_name, descrlocation(&Other, TRUE)); - + printw("%6.0f %s %-9.9s%s\n", Other.p_level, descrtype(&Other, TRUE), Other.p_login, descrstatus(&Other)); @@ -806,7 +806,7 @@ register int numusers = 0; /* number of users on file */ / / RETURN VALUE: none / -/ MODULES CALLED: writerecord(), fread(), fseek(), fopen(), wmove(), fclose(), +/ MODULES CALLED: writerecord(), fread(), fseek(), fopen(), wmove(), fclose(), / fwrite(), altercoordinates(), waddstr(), fprintf() / / GLOBAL INPUTS: *Energyvoidfp, Other, Player, *stdscr, @@ -889,12 +889,12 @@ long loc = 0L; /* location of old king in player file */ / / RETURN VALUE: none / -/ MODULES CALLED: writerecord(), truncstring(), fread(), fseek(), fopen(), -/ floor(), wmove(), drandom(), fclose(), fwrite(), sscanf(), strcmp(), -/ infloat(), waddstr(), findname(), distance(), userlist(), mvprintw(), +/ MODULES CALLED: writerecord(), truncstring(), fread(), fseek(), fopen(), +/ floor(), wmove(), drandom(), fclose(), fwrite(), sscanf(), strcmp(), +/ infloat(), waddstr(), findname(), distance(), userlist(), mvprintw(), / allocvoid(), getanswer(), getstring(), wclrtoeol(), writevoid() / -/ GLOBAL INPUTS: *Energyvoidfp, Other, Illcmd[], Wizard, Player, *stdscr, +/ GLOBAL INPUTS: *Energyvoidfp, Other, Illcmd[], Wizard, Player, *stdscr, / Databuf[], Enrgyvoid / / GLOBAL OUTPUTS: Other, Player, Enrgyvoid diff --git a/games/phantasia/io.c b/games/phantasia/io.c index 8a0a614..7736531 100644 --- a/games/phantasia/io.c +++ b/games/phantasia/io.c @@ -18,7 +18,7 @@ / / RETURN VALUE: none / -/ MODULES CALLED: wmove(), _filbuf(), clearok(), waddstr(), wrefresh(), +/ MODULES CALLED: wmove(), _filbuf(), clearok(), waddstr(), wrefresh(), / wclrtoeol() / / GLOBAL INPUTS: Echo, _iob[], Wizard, *stdscr @@ -212,9 +212,9 @@ inputoption() / / RETURN VALUE: none / -/ MODULES CALLED: fork(), exit(), wait(), death(), alarm(), execl(), wmove(), -/ getgid(), signal(), getenv(), wclear(), setuid(), getuid(), setgid(), -/ crmode(), clearok(), waddstr(), cleanup(), wrefresh(), leavegame(), +/ MODULES CALLED: fork(), exit(), wait(), death(), alarm(), execl(), wmove(), +/ getgid(), signal(), getenv(), wclear(), setuid(), getuid(), setgid(), +/ crmode(), clearok(), waddstr(), cleanup(), wrefresh(), leavegame(), / getanswer() / / GLOBAL INPUTS: Player, *stdscr @@ -300,10 +300,10 @@ unsigned savealarm; /* to save alarm value */ / / RETURN VALUE: none / -/ MODULES CALLED: alarm(), wmove(), waddch(), signal(), setjmp(), strchr(), +/ MODULES CALLED: alarm(), wmove(), waddch(), signal(), setjmp(), strchr(), / _filbuf(), clearok(), toupper(), wrefresh(), mvprintw(), wclrtoeol() / -/ GLOBAL INPUTS: catchalarm(), Echo, _iob[], _ctype[], *stdscr, Timeout, +/ GLOBAL INPUTS: catchalarm(), Echo, _iob[], _ctype[], *stdscr, Timeout, / Timeoenv[] / / GLOBAL OUTPUTS: _iob[] diff --git a/games/phantasia/main.c b/games/phantasia/main.c index 84e6ce1..90ddcba 100644 --- a/games/phantasia/main.c +++ b/games/phantasia/main.c @@ -49,7 +49,7 @@ */ /* - * All source files are set up for 'vi' with shiftwidth=4, tabstop=8. + * All source files are set up for 'vi' with shiftwidth=4, tabstop=8. */ /* */ @@ -73,16 +73,16 @@ / / RETURN VALUE: none / -/ MODULES CALLED: monstlist(), checkenemy(), activelist(), -/ throneroom(), checkbattle(), readmessage(), changestats(), writerecord(), -/ tradingpost(), adjuststats(), recallplayer(), displaystats(), checktampered(), -/ fabs(), rollnewplayer(), time(), exit(), sqrt(), floor(), wmove(), -/ signal(), strcat(), purgeoldplayers(), getuid(), isatty(), wclear(), -/ strcpy(), system(), altercoordinates(), cleanup(), waddstr(), procmain(), -/ playinit(), leavegame(), localtime(), getanswer(), neatstuff(), initialstate(), +/ MODULES CALLED: monstlist(), checkenemy(), activelist(), +/ throneroom(), checkbattle(), readmessage(), changestats(), writerecord(), +/ tradingpost(), adjuststats(), recallplayer(), displaystats(), checktampered(), +/ fabs(), rollnewplayer(), time(), exit(), sqrt(), floor(), wmove(), +/ signal(), strcat(), purgeoldplayers(), getuid(), isatty(), wclear(), +/ strcpy(), system(), altercoordinates(), cleanup(), waddstr(), procmain(), +/ playinit(), leavegame(), localtime(), getanswer(), neatstuff(), initialstate(), / scorelist(), titlelist() / -/ GLOBAL INPUTS: *Login, Throne, Wizard, Player, *stdscr, Changed, Databuf[], +/ GLOBAL INPUTS: *Login, Throne, Wizard, Player, *stdscr, Changed, Databuf[], / Fileloc, Stattable[] / / GLOBAL OUTPUTS: Wizard, Player, Changed, Fileloc, Timeout, *Statptr @@ -320,13 +320,13 @@ double dtemp; /* for temporary calculations */ / / RETURN VALUE: none / -/ MODULES CALLED: time(), fopen(), srandom(), error(), getuid(), getlogin(), +/ MODULES CALLED: time(), fopen(), srandom(), error(), getuid(), getlogin(), / getpwuid() / -/ GLOBAL INPUTS: +/ GLOBAL INPUTS: / -/ GLOBAL OUTPUTS: *Energyvoidfp, Echo, Marsh, *Login, Users, Beyond, -/ Throne, Wizard, Changed, Okcount, Timeout, Windows, *Monstfp, *Messagefp, +/ GLOBAL OUTPUTS: *Energyvoidfp, Echo, Marsh, *Login, Users, Beyond, +/ Throne, Wizard, Changed, Okcount, Timeout, Windows, *Monstfp, *Messagefp, / *Playersfp / / DESCRIPTION: @@ -349,7 +349,7 @@ initialstate() /* setup login name */ if ((Login = getlogin()) == NULL) Login = getpwuid(getuid())->pw_name; - + /* open some files */ if ((Playersfp = fopen(_PATH_PEOPLE, "r+")) == NULL) error(_PATH_PEOPLE); @@ -382,8 +382,8 @@ initialstate() / / RETURN VALUE: none / -/ MODULES CALLED: initplayer(), allocrecord(), truncstring(), fabs(), wmove(), -/ wclear(), sscanf(), strcmp(), genchar(), waddstr(), findname(), mvprintw(), +/ MODULES CALLED: initplayer(), allocrecord(), truncstring(), fabs(), wmove(), +/ wclear(), sscanf(), strcmp(), genchar(), waddstr(), findname(), mvprintw(), / getanswer(), getstring() / / GLOBAL INPUTS: Other, Wizard, Player, *stdscr, Databuf[] @@ -499,12 +499,12 @@ int ch; /* input */ / / RETURN VALUE: none / -/ MODULES CALLED: dotampered(), changestats(), inputoption(), allstatslist(), -/ fopen(), wmove(), drandom(), sscanf(), fclose(), altercoordinates(), -/ waddstr(), fprintf(), distance(), userlist(), leavegame(), encounter(), +/ MODULES CALLED: dotampered(), changestats(), inputoption(), allstatslist(), +/ fopen(), wmove(), drandom(), sscanf(), fclose(), altercoordinates(), +/ waddstr(), fprintf(), distance(), userlist(), leavegame(), encounter(), / getstring(), wclrtobot() / -/ GLOBAL INPUTS: Circle, Illcmd[], Throne, Wizard, Player, *stdscr, +/ GLOBAL INPUTS: Circle, Illcmd[], Throne, Wizard, Player, *stdscr, / Databuf[], Illmove[] / / GLOBAL OUTPUTS: Player, Changed @@ -650,7 +650,7 @@ bool hasmoved = FALSE; /* set if player has moved */ */ if (Player.p_level < MEL_TELEPORT || Player.p_magiclvl < ML_TELEPORT) ILLCMD(); - else + else for (loop = 3; loop; --loop) { mvaddstr(4, 0, "X Y Coordinates ? "); @@ -735,7 +735,7 @@ bool hasmoved = FALSE; /* set if player has moved */ / / RETURN VALUE: none / -/ MODULES CALLED: fread(), fseek(), fopen(), fgets(), wmove(), strcpy(), +/ MODULES CALLED: fread(), fseek(), fopen(), fgets(), wmove(), strcpy(), / fclose(), strlen(), waddstr(), sprintf(), wrefresh() / / GLOBAL INPUTS: Lines, Other, *stdscr, Databuf[], *Playersfp @@ -867,8 +867,8 @@ char hiname[21], nxtname[21];/* used for finding the two highest players */ / / RETURN VALUE: none / -/ MODULES CALLED: writerecord(), truncstring(), more(), death(), wmove(), -/ wclear(), strcmp(), printw(), cleanup(), waddstr(), findname(), mvprintw(), +/ MODULES CALLED: writerecord(), truncstring(), more(), death(), wmove(), +/ wclear(), strcmp(), printw(), cleanup(), waddstr(), findname(), mvprintw(), / getanswer(), getstring() / / GLOBAL INPUTS: Player, *stdscr, Databuf[] @@ -954,7 +954,7 @@ int ch; /* input */ / / RETURN VALUE: none / -/ MODULES CALLED: collecttaxes(), floor(), wmove(), drandom(), infloat(), +/ MODULES CALLED: collecttaxes(), floor(), wmove(), drandom(), infloat(), / waddstr(), mvprintw(), getanswer() / / GLOBAL INPUTS: Player, *stdscr, *Statptr @@ -1112,7 +1112,7 @@ register struct charstats *statptr;/* for pointing into Stattable */ if (subscript != C_SUPER || !Wizard) /* fighter is default */ subscript = C_FIGHTER; - + statptr = &Stattable[subscript]; Player.p_quickness = @@ -1148,7 +1148,7 @@ register struct charstats *statptr;/* for pointing into Stattable */ / / RETURN VALUE: none / -/ MODULES CALLED: signal(), wclear(), noecho(), crmode(), initscr(), +/ MODULES CALLED: signal(), wclear(), noecho(), crmode(), initscr(), / wrefresh() / / GLOBAL INPUTS: *stdscr, ill_sig() @@ -1255,7 +1255,7 @@ playinit() / / MODULES CALLED: exit(), wmove(), fclose(), endwin(), nocrmode(), wrefresh() / -/ GLOBAL INPUTS: *Energyvoidfp, LINES, *stdscr, Windows, *Monstfp, +/ GLOBAL INPUTS: *Energyvoidfp, LINES, *stdscr, Windows, *Monstfp, / *Messagefp, *Playersfp / / GLOBAL OUTPUTS: none diff --git a/games/phantasia/misc.c b/games/phantasia/misc.c index 48b518e..133bdfb 100644 --- a/games/phantasia/misc.c +++ b/games/phantasia/misc.c @@ -180,9 +180,9 @@ static char *nametable[4][4] = /* names of places */ / / RETURN VALUE: none / -/ MODULES CALLED: writerecord(), adjuststats(), fabs(), more(), sqrt(), -/ sleep(), floor(), wmove(), drandom(), wclear(), printw(), -/ altercoordinates(), infloat(), waddstr(), wrefresh(), mvprintw(), getanswer(), +/ MODULES CALLED: writerecord(), adjuststats(), fabs(), more(), sqrt(), +/ sleep(), floor(), wmove(), drandom(), wclear(), printw(), +/ altercoordinates(), infloat(), waddstr(), wrefresh(), mvprintw(), getanswer(), / wclrtoeol(), wclrtobot() / / GLOBAL INPUTS: Menu[], Circle, Player, *stdscr, Fileloc, Nobetter[] @@ -539,7 +539,7 @@ allstatslist() { static char *flags[] = /* to print value of some bools */ { - "False", + "False", " True" }; @@ -560,8 +560,8 @@ static char *flags[] = /* to print value of some bools */ mvprintw(15, 40, "Sword : %9.0f", Player.p_sword); mvprintw(16, 40, "Quickslver: %9.0f", Player.p_quksilver); - mvprintw(18, 0, "Blessing: %s Ring: %s Virgin: %s Palantir: %s", - flags[Player.p_blessing], flags[Player.p_ring.ring_type != R_NONE], + mvprintw(18, 0, "Blessing: %s Ring: %s Virgin: %s Palantir: %s", + flags[Player.p_blessing], flags[Player.p_ring.ring_type != R_NONE], flags[Player.p_virgin], flags[Player.p_palantir]); } /* */ @@ -843,9 +843,9 @@ leavegame() / / RETURN VALUE: none / -/ MODULES CALLED: freerecord(), enterscore(), more(), exit(), fread(), -/ fseek(), execl(), fopen(), floor(), wmove(), drandom(), wclear(), strcmp(), -/ fwrite(), fflush(), printw(), strcpy(), fclose(), waddstr(), cleanup(), +/ MODULES CALLED: freerecord(), enterscore(), more(), exit(), fread(), +/ fseek(), execl(), fopen(), floor(), wmove(), drandom(), wclear(), strcmp(), +/ fwrite(), fflush(), printw(), strcpy(), fclose(), waddstr(), cleanup(), / fprintf(), wrefresh(), getanswer(), descrtype() / / GLOBAL INPUTS: Curmonster, Wizard, Player, *stdscr, Fileloc, *Monstfp @@ -1019,7 +1019,7 @@ long place; / / GLOBAL OUTPUTS: none / -/ DESCRIPTION: +/ DESCRIPTION: / Experience level is a geometric progression. This has been finely / tuned over the years, and probably should not be changed. / @@ -1043,7 +1043,7 @@ double experience; / / AUTHOR: E. A. Estes, 12/4/85 / -/ ARGUMENTS: +/ ARGUMENTS: / char *string - pointer to null terminated string / / RETURN VALUE: none @@ -1054,7 +1054,7 @@ double experience; / / GLOBAL OUTPUTS: none / -/ DESCRIPTION: +/ DESCRIPTION: / Put nul characters in place of spaces at the end of the string. / *************************************************************************/ @@ -1077,7 +1077,7 @@ register int length; /* length of string */ / / AUTHOR: E. A. Estes, 12/16/85 / -/ ARGUMENTS: +/ ARGUMENTS: / double xnew, ynew - new x, y coordinates / int operation - operation to perform with coordinates / @@ -1089,7 +1089,7 @@ register int length; /* length of string */ / / GLOBAL OUTPUTS: Marsh, Circle, Beyond, Throne, Player, Changed / -/ DESCRIPTION: +/ DESCRIPTION: / This module is called whenever the player's coordinates are altered. / If the player is beyond the point of no return, he/she is forced / to stay there. @@ -1130,7 +1130,7 @@ int operation; ynew = Player.p_y + SGN(Player.p_y) * ROLL(50 * Circle, 250 * Circle); break; } - + /* now set location flags and adjust coordinates */ Circle = CIRCLE(Player.p_x = floor(xnew), Player.p_y = floor(ynew)); @@ -1361,7 +1361,7 @@ register struct player *playerp; playerp->p_type = C_FIGHTER; /* default */ playerp->p_specialtype = SC_NONE; playerp->p_lives = - playerp->p_crowns = + playerp->p_crowns = playerp->p_charms = playerp->p_amulets = playerp->p_holywater = @@ -1463,7 +1463,7 @@ error(whichfile) / / AUTHOR: E. A. Estes, 12/4/85 / -/ ARGUMENTS: +/ ARGUMENTS: / double x1, y1 - x, y coordinates of first point / double x2, y2 - x, y coordinates of second point / diff --git a/games/phantasia/setup.c b/games/phantasia/setup.c index 1d6587b..83d8b44 100644 --- a/games/phantasia/setup.c +++ b/games/phantasia/setup.c @@ -18,15 +18,15 @@ / / RETURN VALUE: none / -/ MODULES CALLED: time(), exit(), stat(), Error(), creat(), close(), fopen(), -/ fgets(), floor(), srandom(), umask(), drandom(), strcpy(), getuid(), +/ MODULES CALLED: time(), exit(), stat(), Error(), creat(), close(), fopen(), +/ fgets(), floor(), srandom(), umask(), drandom(), strcpy(), getuid(), / unlink(), fwrite(), fclose(), sscanf(), printf(), strlen(), fprintf() / / GLOBAL INPUTS: Curmonster, _iob[], Databuf[], *Monstfp, Enrgyvoid / / GLOBAL OUTPUTS: Curmonster, Databuf[], *Monstfp, Enrgyvoid / -/ DESCRIPTION: +/ DESCRIPTION: / / This program tries to verify the parameters specified in / the Makefile. @@ -247,7 +247,7 @@ char *str, *file; / / GLOBAL OUTPUTS: none / -/ DESCRIPTION: +/ DESCRIPTION: / *************************************************************************/ diff --git a/games/piano/piano.c b/games/piano/piano.c index cb60405..69b3476 100644 --- a/games/piano/piano.c +++ b/games/piano/piano.c @@ -1,7 +1,7 @@ /* * piano.c - a piano emulator */ -static char rcsid[] = "$Id$"; +static char rcsid[] = "$Id: piano.c,v 1.1.1.1 1995/04/28 17:38:07 jkh Exp $"; #include #include #include @@ -90,7 +90,7 @@ fdputs(const char *s, int fd, int echo) return err; }/* fdputs */ -static int +static int outspkr(const char *s) { int err = -1, fd = open("/dev/speaker", O_WRONLY); diff --git a/games/primes/pattern.c b/games/primes/pattern.c index 5d65dab..14eb721 100644 --- a/games/primes/pattern.c +++ b/games/primes/pattern.c @@ -45,8 +45,8 @@ static char sccsid[] = "@(#)pattern.c 8.1 (Berkeley) 5/31/93"; * * chongo /\oo/\ * - * To avoid excessive sieves for small factors, we use the table below to - * setup our sieve blocks. Each element represents a odd number starting + * To avoid excessive sieves for small factors, we use the table below to + * setup our sieve blocks. Each element represents a odd number starting * with 1. All non-zero elements are factors of 3, 5, 7, 11 and 13. */ diff --git a/games/primes/pr_tbl.c b/games/primes/pr_tbl.c index b7b8d04..dcad3aa 100644 --- a/games/primes/pr_tbl.c +++ b/games/primes/pr_tbl.c @@ -45,7 +45,7 @@ static char sccsid[] = "@(#)pr_tbl.c 8.1 (Berkeley) 5/31/93"; * * chongo /\oo/\ * - * We are able to sieve 2^32-1 because this table has primes up to 65537 + * We are able to sieve 2^32-1 because this table has primes up to 65537 * and 65537^2 > 2^32-1. */ diff --git a/games/primes/primes.c b/games/primes/primes.c index 706576b..a402be2 100644 --- a/games/primes/primes.c +++ b/games/primes/primes.c @@ -86,15 +86,15 @@ char table[TABSIZE]; /* Eratosthenes sieve of odd numbers */ /* * prime[i] is the (i-1)th prime. * - * We are able to sieve 2^32-1 because this byte table yields all primes + * We are able to sieve 2^32-1 because this byte table yields all primes * up to 65537 and 65537^2 > 2^32-1. */ extern ubig prime[]; extern ubig *pr_limit; /* largest prime in the prime array */ /* - * To avoid excessive sieves for small factors, we use the table below to - * setup our sieve blocks. Each element represents a odd number starting + * To avoid excessive sieves for small factors, we use the table below to + * setup our sieve blocks. Each element represents a odd number starting * with 1. All non-zero elements are factors of 3, 5, 7, 11 and 13. */ extern char pattern[]; diff --git a/games/random/random.c b/games/random/random.c index 87e1b18..b62eb24 100644 --- a/games/random/random.c +++ b/games/random/random.c @@ -98,7 +98,7 @@ main(argc, argv) errx(1, "denominator is not valid."); break; default: - usage(); + usage(); /* NOTREACHED */ } @@ -115,7 +115,7 @@ main(argc, argv) */ if (unbuffer_output) setbuf(stdout, NULL); - + /* * Select whether to print the first line. (Prime the pump.) * We find a random number between 0 and denom - 1 and, if it's diff --git a/games/rogue/machdep.c b/games/rogue/machdep.c index d539eaa..87266b1 100644 --- a/games/rogue/machdep.c +++ b/games/rogue/machdep.c @@ -60,7 +60,7 @@ static char sccsid[] = "@(#)machdep.c 8.1 (Berkeley) 5/31/93"; * * All UNIX code should be included between the single "#ifdef UNIX" at the * top of this file, and the "#endif" at the bottom. - * + * * To change a routine to include a new UNIX system, simply #ifdef the * existing routine, as in the following example: * @@ -291,7 +291,7 @@ char *fname; * system doesn't provide all of the time units requested here, then you * can provide only those that it does, and return zeros for the others. * If you cannot provide good time values, then users may be able to copy - * saved-game files and play them. + * saved-game files and play them. */ md_gct(rt_buf) @@ -322,7 +322,7 @@ struct rogue_time *rt_buf; * exactly the same here. * Or if md_gct() is implemented correctly, but your system does not provide * file modification dates, you may return some date far in the past so - * that the program will never know that a saved-game file being modified. + * that the program will never know that a saved-game file being modified. * You may also do this if you wish to be able to restore games from * saved-games that have been modified. */ @@ -481,7 +481,7 @@ int n; * You need to find some single random integer, such as: * process id. * current time (minutes + seconds) returned from md_gct(), if implemented. - * + * * It will not help to return "get_rand()" or "rand()" or the return value of * any pseudo-RNG. If you don't have a random number, you can just return 1, * but this means your games will ALWAYS start the same way, and will play @@ -591,7 +591,7 @@ char *shell; * program is compiled with CURSES defined to use the enclosed curses * emulation package. If you are not using this, then this routine is * totally unnecessary. - * + * * Notice that information is saved between calls. This is used to * restore the terminal to an initial saved state. * diff --git a/games/rogue/main.c b/games/rogue/main.c index 97e492c..2687e34 100644 --- a/games/rogue/main.c +++ b/games/rogue/main.c @@ -77,7 +77,7 @@ char *argv[]; put_mons(); put_player(party_room); print_stats(STAT_ALL); -PL: +PL: play_level(); free_stuff(&level_objects); free_stuff(&level_monsters); diff --git a/games/rogue/move.c b/games/rogue/move.c index d35d5ad..dc05700 100644 --- a/games/rogue/move.c +++ b/games/rogue/move.c @@ -297,7 +297,7 @@ register drow, dcol; return(0); } -can_move(row1, col1, row2, col2) +can_move(row1, col1, row2, col2) { if (!is_passable(row2, col2)) { return(0); diff --git a/games/rogue/pack.c b/games/rogue/pack.c index 7e26b6e..7e9c4fc 100644 --- a/games/rogue/pack.c +++ b/games/rogue/pack.c @@ -221,7 +221,7 @@ object *obj, *pack; op = pack->next_object; while (op) { - if ((op->what_is == obj->what_is) && + if ((op->what_is == obj->what_is) && (op->which_kind == obj->which_kind)) { if ((obj->what_is != WEAPON) || diff --git a/games/rogue/random.c b/games/rogue/random.c index 39eb1dd..a721b16 100644 --- a/games/rogue/random.c +++ b/games/rogue/random.c @@ -51,11 +51,11 @@ static char sccsid[] = "@(#)random.c 8.1 (Berkeley) 5/31/93"; */ static long rntb[32] = { - 3, 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, + 3, 0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, 0xde3b81e0, 0xdf0a6fb5, 0xf103bc02, 0x48f340fb, 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd, 0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88, 0xe369735d, - 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc, + 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc, 0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e, 0x8999220b, 0x27fb47b9 }; @@ -91,7 +91,7 @@ long rrandom() { long i; - + if (rand_type == 0) { i = state[0] = (state[0]*1103515245 + 12345) & 0x7fffffff; } else { diff --git a/games/rogue/use.c b/games/rogue/use.c index 2588cff..b340fe2 100644 --- a/games/rogue/use.c +++ b/games/rogue/use.c @@ -587,7 +587,7 @@ get_ench_color() return(id_potions[get_rand(0, POTIONS-1)].title); } else if (con_mon) { return("red "); - } + } return("blue "); } diff --git a/games/sail/assorted.c b/games/sail/assorted.c index 2fb12ac..0700be2 100644 --- a/games/sail/assorted.c +++ b/games/sail/assorted.c @@ -213,7 +213,7 @@ int rig, shot, hittable, roll; makesignal(on, "crew mutinying!", (struct ship *)0); on->specs->qual = 5; Write(W_CAPTURED, on, 0, on->file->index, 0, 0, 0); - } else + } else makesignal(on, "crew demoralized", (struct ship *)0); Write(W_QUAL, on, 0, on->specs->qual, 0, 0, 0); } diff --git a/games/sail/dr_3.c b/games/sail/dr_3.c index a0ceb72..027c1b1 100644 --- a/games/sail/dr_3.c +++ b/games/sail/dr_3.c @@ -320,7 +320,7 @@ reload() checksails() { register struct ship *sp; - register int rig, full; + register int rig, full; struct ship *close; foreachship(sp) { @@ -336,7 +336,7 @@ checksails() full = 1; else full = 0; - } else + } else full = 0; } else full = 0; diff --git a/games/sail/game.c b/games/sail/game.c index bc8a32a..46a3420 100644 --- a/games/sail/game.c +++ b/games/sail/game.c @@ -79,7 +79,7 @@ int dir, fs; Move = (flank ? 2 : 1) - WET[windspeed][ship->specs->class-1].D; else if (dir == winddir + 4 || dir == winddir - 4) Move = 0; - else + else Move -= WET[windspeed][ship->specs->class-1].A; Move -= riggone; Move = Move < 0 ? 0 : Move; diff --git a/games/sail/globals.c b/games/sail/globals.c index 1a7acbe..61ac18a 100644 --- a/games/sail/globals.c +++ b/games/sail/globals.c @@ -415,7 +415,7 @@ char AMMO[9][4] = { { -3, 2, 0, 3 }, { -3, 2, 0, 3 } }; - + char HDT[9][10] = { { 1, 0,-1,-2,-3,-3,-4,-4,-4,-4 }, { 1, 1, 0,-1,-2,-2,-3,-3,-3,-3 }, diff --git a/games/sail/pl_5.c b/games/sail/pl_5.c index 7be6e79..85e3a2e 100644 --- a/games/sail/pl_5.c +++ b/games/sail/pl_5.c @@ -201,14 +201,14 @@ int crew[3]; char isdefense; char buf; { - register int k, j, men; + register int k, j, men; struct BP *ptr; int temp[3]; for (k = 0; k < 3; k++) temp[k] = crew[k]; if (isdigit(buf)) { - ptr = isdefense ? to->file->DBP : to->file->OBP; + ptr = isdefense ? to->file->DBP : to->file->OBP; for (j = 0; j < NBP && ptr[j].turnsent; j++) ; if (!ptr[j].turnsent && buf > '0') { diff --git a/games/snake/snake/move.c b/games/snake/snake/move.c index ceaf3e8..4e143f1 100644 --- a/games/snake/snake/move.c +++ b/games/snake/snake/move.c @@ -200,7 +200,7 @@ struct point *sp; if (sp->col > cursor.col)right(sp); else{ distance = (cursor.col -sp->col)*BSlength; - if (((TA) && + if (((TA) && (distance > tfield+((sp->col)&7)*NDlength) ) || (((cursor.col)*NDlength) < distance) @@ -232,7 +232,7 @@ struct point *sp; } if (((sp->line << 1) > cursor.line + LINES+1 + f) && (LL != 0)){ /* home,rlf quicker than lf - * (LINES+1 - sp->line + f < sp->line - cursor.line) + * (LINES+1 - sp->line + f < sp->line - cursor.line) */ if (cursor.line > f + 1){ /* is home faster than wraparound lf? @@ -271,7 +271,7 @@ struct point *sp; if (BW && (CM == 0) && ((sp->col << 1) - field > (COLUMNS - 8) << 1 ) ){ - if (cursor.line == 0){ + if (cursor.line == 0){ outch('\n'); } outch('\r'); @@ -493,7 +493,7 @@ char ch;{ } } - + outch(c) { putchar(c); diff --git a/games/snake/snake/snake.c b/games/snake/snake/snake.c index b99da10..c41ee05 100644 --- a/games/snake/snake/snake.c +++ b/games/snake/snake/snake.c @@ -195,7 +195,7 @@ mainloop() if (c == '.') { c = lastc; } - if ((Klength > 0) && + if ((Klength > 0) && (c == *KL || c == *KR || c == *KU || c == *KD)) { savec = c; match = 0; @@ -225,7 +225,7 @@ mainloop() if (match == 0) { ungetc(c,stdin); ch = savec; - /* Oops! + /* Oops! * This works if we figure it out on second character. */ break; @@ -355,7 +355,7 @@ mainloop() if (same(&you,&money)) { - char xp[20]; + char xp[20]; struct point z; loot += 25; if(k < repeat) @@ -524,11 +524,11 @@ flushi() { stty(0, &new); } -int mx [8] = { +int mx [8] = { 0, 1, 1, 1, 0,-1,-1,-1}; int my [8] = { -1,-1, 0, 1, 1, 1, 0,-1}; -float absv[8]= { +float absv[8]= { 1, 1.4, 1, 1.4, 1, 1.4, 1, 1.4 }; int oldw=0; @@ -542,7 +542,7 @@ struct point *sp, *np; double v1, v2, vp, max; point(&d,you.col-sp->col,you.line-sp->line); v1 = sqrt( (double) (d.col*d.col + d.line*d.line) ); - w=0; + w=0; max=0; for(i=0; i<8; i++) { @@ -584,7 +584,7 @@ struct point *sp, *np; else vp -= wt[i]; if (i==8) { - pr("failure\n"); + pr("failure\n"); i=0; while (wt[i]==0) i++; } @@ -803,7 +803,7 @@ pushsnake() } return(0); } - + chk(sp) struct point *sp; { diff --git a/games/trek/torped.c b/games/trek/torped.c index e62c64b..be5c0da 100644 --- a/games/trek/torped.c +++ b/games/trek/torped.c @@ -157,7 +157,7 @@ torped() { case EMPTY: continue; - + case HOLE: printf("Torpedo disappears into a black hole\n"); break; @@ -178,15 +178,15 @@ torped() break; } break; - + case STAR: nova(ix, iy); break; - + case INHABIT: kills(ix, iy, -1); break; - + case BASE: killb(Ship.quadx, Ship.quady); Game.killb += 1; diff --git a/games/wump/wump.c b/games/wump/wump.c index ef60857..ee53dc9 100644 --- a/games/wump/wump.c +++ b/games/wump/wump.c @@ -625,7 +625,7 @@ getans(prompt) } bats_nearby() -{ +{ register int i; /* check for bats in the immediate vicinity */ @@ -636,7 +636,7 @@ bats_nearby() } pit_nearby() -{ +{ register int i; /* check for pits in the immediate vicinity */ diff --git a/games/x11/Makefile b/games/x11/Makefile index b24b535..38183ec 100644 --- a/games/x11/Makefile +++ b/games/x11/Makefile @@ -1,5 +1,5 @@ # @(#)Makefile 8.2 (Berkeley) 3/31/94 -SUBDIR= xneko xroach +SUBDIR= xneko xroach .include diff --git a/games/x11/xneko/xneko.c b/games/x11/xneko/xneko.c index 731e6c8..563f641 100644 --- a/games/x11/xneko/xneko.c +++ b/games/x11/xneko/xneko.c @@ -146,7 +146,7 @@ static char sccsid[] = "@(#)xneko.c 8.1 (Berkeley) 5/31/93"; #ifndef lint static char - rcsid[] = "$Header: /afs/athena.mit.edu/user/j/jik/sipbsrc/src/xneko/RCS/xneko.c,v 1.2 90/09/01 23:40:01 jik Exp $"; + rcsid[] = "$Header: /home/ncvs/src/games/x11/xneko/xneko.c,v 1.1.1.1 1994/09/04 04:02:16 jkh Exp $"; static char WriterMessage[] = "xneko: Programmed by Masayuki Koba, 1990"; #endif @@ -975,7 +975,7 @@ IsNekoMoveStart() #ifndef DEBUG if ( ( PrevMouseX >= MouseX - IDLE_SPACE && PrevMouseX <= MouseX + IDLE_SPACE ) && - ( PrevMouseY >= MouseY - IDLE_SPACE + ( PrevMouseY >= MouseY - IDLE_SPACE && PrevMouseY <= MouseY + IDLE_SPACE ) ) { return( False ); } else { diff --git a/games/x11/xroach/xroach.c b/games/x11/xroach/xroach.c index 854167f..971e90f 100644 --- a/games/x11/xroach/xroach.c +++ b/games/x11/xroach/xroach.c @@ -1,10 +1,10 @@ /* Xroach - A game of skill. Try to find the roaches under your windows. - + Copyright 1991 by J.T. Anderson jta@locus.com - + This program may be freely distributed provided that all copyright notices are retained. @@ -92,7 +92,7 @@ char *av[]; char *roachColor = "black"; int nVis; int needCalc; - + /* Process command line options. */ @@ -116,7 +116,7 @@ char *av[]; } srand((int)time((long *)NULL)); - + /* Catch some signals so we can erase any visible roaches. */ @@ -142,7 +142,7 @@ char *av[]; display_height = DisplayHeight(display, screen); center_x = display_width / 2; center_y = display_height / 2; - + /* Create roach pixmaps at several orientations. */ @@ -161,12 +161,12 @@ char *av[]; gc = XCreateGC(display, rootWin, 0L, &xgcv); XSetForeground(display, gc, AllocNamedColor(roachColor, black)); XSetFillStyle(display, gc, FillStippled); - + while (curRoaches < maxRoaches) AddRoach(); - + XSelectInput(display, rootWin, ExposureMask | SubstructureNotifyMask); - + needCalc = 1; while (!done) { if (XPending(display)) { @@ -187,9 +187,9 @@ char *av[]; eventBlock = 0; } } - + switch (ev.type) { - + case SCAMPER_EVENT: for (rx=0; rxrp->width) > (x + width)) return 0; if (ry < y) return 0; if ((ry + roach->rp->height) > (y + height)) return 0; - + return 1; } @@ -295,7 +295,7 @@ unsigned int height; if ((rx + roach->rp->width) <= x) return 0; if (ry >= (y + height)) return 0; if ((ry + roach->rp->height) <= y) return 0; - + return 1; } @@ -306,7 +306,7 @@ void AddRoach() { Roach *r; - + if (curRoaches < maxRoaches) { r = &roaches[curRoaches++]; r->index = RandInt(ROACH_HEADINGS); @@ -354,14 +354,14 @@ int rx; float newX; float newY; int ii; - + roach = &roaches[rx]; newX = roach->x + (roachSpeed * roach->rp->cosine); newY = roach->y - (roachSpeed * roach->rp->sine); - - if (RoachInRect(roach, (int)newX, (int)newY, + + if (RoachInRect(roach, (int)newX, (int)newY, 0, 0, display_width, display_height)) { - + roach->x = newX; roach->y = newY; @@ -374,7 +374,7 @@ int rx; r2 = &roaches[ii]; if (RoachOverRect(roach, (int)newX, (int)newY, r2->intX, r2->intY, r2->rp->width, r2->rp->height)) { - + TurnRoach(roach); } } @@ -383,7 +383,7 @@ int rx; TurnRoach(roach); } } - + /* Draw all roaches. */ @@ -392,24 +392,24 @@ DrawRoaches() { Roach *roach; int rx; - + for (rx=0; rxintX >= 0) { XClearArea(display, rootWin, roach->intX, roach->intY, roach->rp->width, roach->rp->height, False); } } - + for (rx=0; rxhidden) { roach->intX = roach->x; roach->intY = roach->y; roach->rp = &roachPix[roach->index]; - + XSetStipple(display, gc, roach->rp->pixmap); XSetTSOrigin(display, gc, roach->intX, roach->intY); XFillRectangle(display, rootWin, gc, @@ -430,7 +430,7 @@ CoverRoot() XSetWindowAttributes xswa; long wamask; Window roachWin; - + xswa.background_pixmap = ParentRelative; xswa.override_redirect = True; wamask = CWBackPixmap | CWOverrideRedirect; @@ -440,7 +440,7 @@ CoverRoot() XLowerWindow(display, roachWin); XMapWindow(display, roachWin); XFlush(display); -} +} #if !GRAB_SERVER @@ -450,7 +450,7 @@ Display *dpy; XErrorEvent *err; { errorVal = err->error_code; - + return 0; } @@ -474,7 +474,7 @@ CalcRootVisible() unsigned int winHeight, winWidth; unsigned int borderWidth; unsigned int depth; - + /* If we don't grab the server, the XGetWindowAttribute or XGetGeometry calls can abort us. On the other hand, the server grabs can make for @@ -490,7 +490,7 @@ CalcRootVisible() Get children of root. */ XQueryTree(display, rootWin, &dummy, &dummy, &children, &nChildren); - + /* For each mapped child, add the window rectangle to the covered region. @@ -519,7 +519,7 @@ CalcRootVisible() #else XSetErrorHandler((ErrorHandler *)NULL); #endif - + /* Subtract the covered region from the root window region. */ @@ -531,19 +531,19 @@ CalcRootVisible() XUnionRectWithRegion(&rect, visible, visible); XSubtractRegion(visible, covered, visible); XDestroyRegion(covered); - + /* Save visible region globally. */ if (rootVisible) XDestroyRegion(rootVisible); rootVisible = visible; - - + + /* Mark all roaches visible. */ - for (wx=0; wxhidden) { if (r->intX > 0 && XRectInRegion(rootVisible, r->intX, r->intY, r->rp->width, r->rp->height) == RectangleOut) { @@ -573,7 +573,7 @@ MarkHiddenRoaches() } } } - + return nVisible; } -- cgit v1.1