From a0afd227763655ee0ecd7ef5faea92d63d5c5ba6 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 19 Sep 2006 19:35:24 +0000 Subject: [PATCH] More boolean cleanups. --- src/events.c | 4 ++-- src/io.c | 8 ++++---- src/moving.c | 4 ++-- src/reports.c | 16 ++++++++-------- src/setup.c | 4 ++-- src/sst.c | 10 +++++----- src/sst.h | 14 +++++++------- 7 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/events.c b/src/events.c index 5f1c600..3281291 100644 --- a/src/events.c +++ b/src/events.c @@ -139,7 +139,7 @@ void events(void) prout(_(" surveillance reports are coming in.")); skip(1); if (game.iseenit==0) { - attakreport(0); + attakreport(false); game.iseenit = 1; } rechart(); @@ -198,7 +198,7 @@ void events(void) crmshp(); prout(_(" caught in long range tractor beam--")); /* If Kirk & Co. screwing around on planet, handle */ - atover(1); /* atover(1) is Grab */ + atover(true); /* atover(true) is Grab */ if (game.alldone) return; if (game.icraft == 1) { /* Caught in Galileo? */ finish(FSTRACTOR); diff --git a/src/io.c b/src/io.c index 559a93d..3db1c45 100644 --- a/src/io.c +++ b/src/io.c @@ -316,17 +316,17 @@ void commandhook(char *cmd, bool before) { * Things past this point have policy implications. */ -void drawmaps(short l) +void drawmaps(int mode) /* hook to be called after moving to redraw maps */ { if (game.options & OPTION_CURSES) { - if (l == 1) + if (mode == 1) sensor(); setwnd(srscan_window); wmove(curwnd, 0, 0); enqueue("no"); srscan(SCAN_FULL); - if (l != 2) { + if (mode != 2) { setwnd(report_window); wclear(report_window); wmove(report_window, 0, 0); @@ -429,6 +429,6 @@ void makechart(void) if (game.options & OPTION_CURSES) { setwnd(message_window); wclear(message_window); - chart(0); + chart(false); } } diff --git a/src/moving.c b/src/moving.c index 4908236..4621a1d 100644 --- a/src/moving.c +++ b/src/moving.c @@ -242,7 +242,7 @@ void dock(bool verbose) (is_scheduled(FCDBAS) || game.isatb == 1) && game.iseenit == 0) { /* get attack report from base */ prout(_("Lt. Uhura- \"Captain, an important message from the starbase:\"")); - attakreport(0); + attakreport(false); game.iseenit = 1; } } @@ -675,7 +675,7 @@ void setwrp(void) return; } -void atover(int igrab) +void atover(bool igrab) { double power, distreq; diff --git a/src/reports.c b/src/reports.c index 7f4a13e..b36f56c 100644 --- a/src/reports.c +++ b/src/reports.c @@ -3,7 +3,7 @@ #include #include -void attakreport(int curt) +void attakreport(bool curt) { if (!curt) { if (is_scheduled(FCDBAS)) { @@ -72,7 +72,7 @@ void report(void) if (!damaged(DRADIO) || game.condit == IHDOCKED || game.iseenit) { /* Don't report this if not seen and either the radio is dead or not at base! */ - attakreport(0); + attakreport(false); game.iseenit = 1; } if (game.casual) prout(_("%d casualt%s suffered so far."), @@ -185,7 +185,7 @@ void rechart(void) } } -void chart(int nn) +void chart(bool title) { int i,j; chew(); @@ -198,7 +198,7 @@ void chart(int nn) rechart(); } - if (nn == 0) prout(_(" STAR CHART FOR THE KNOWN GALAXY")); + if (!title) prout(_(" STAR CHART FOR THE KNOWN GALAXY")); if (game.state.date > game.lastchart) prout(_("(Last surveillance update %d stardates ago)."), (int)(game.state.date-game.lastchart)); @@ -325,7 +325,7 @@ static void status(int req) break; case 11: - attakreport(1); + attakreport(true); break; } } @@ -337,7 +337,7 @@ int srscan(int l) {"","da","co","po","ls","wa","en","to","sh","kl","sy", "ti"}; int i, j, jj, req=0; - int goodScan=true, leftside=true, rightside=true, nn=false; + int goodScan=true, leftside=true, rightside=true, title=false; switch (l) { case SCAN_FULL: // SRSCAN if (damaged(DSRSENS)) { @@ -357,7 +357,7 @@ int srscan(int l) game.state.galaxy[game.quadrant.x][game.quadrant.y].charted = true; } scan(); - if (isit("chart")) nn = true; + if (isit("chart")) title = true; if (isit("no")) rightside = false; chew(); prout(" 1 2 3 4 5 6 7 8 9 10"); @@ -400,7 +400,7 @@ int srscan(int l) if (req!=0) return(goodScan); } prout(""); - if (nn) chart(1); + if (title) chart(true); return(goodScan); } diff --git a/src/setup.c b/src/setup.c index e56e1e3..3eba6fe 100644 --- a/src/setup.c +++ b/src/setup.c @@ -225,14 +225,14 @@ void abandn(void) return; } -void setup(int needprompt) +void setup(bool needprompt) { int i,j, krem, klumper; int ix, iy; // Decide how many of everything if (choose(needprompt)) return; // frozen game // Prepare the Enterprise - game.alldone = game.gamewon = 0; + game.alldone = game.gamewon = false; game.ship = IHE; game.state.crew = FULLCREW; game.energy = game.inenrg = 5000.0; diff --git a/src/sst.c b/src/sst.c index 95ab355..96e5edb 100644 --- a/src/sst.c +++ b/src/sst.c @@ -469,7 +469,7 @@ static void makemoves(void) dreprt(); break; case CHART: // chart - chart(0); + chart(false); break; case IMPULSE: // impulse impuls(); @@ -570,14 +570,14 @@ static void makemoves(void) if (game.alldone) break; // Events did us in } if (game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova) { // Galaxy went Nova! - atover(0); + atover(false); continue; } - if (hitme && game.justin==0) { + if (hitme && !game.justin) { attack(2); if (game.alldone) break; if (game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova) { // went NOVA! - atover(0); + atover(false); hitme = true; continue; } @@ -940,6 +940,6 @@ void debugme(void) proutn("Induce supernova here? "); if (ja()) { game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova = true; - atover(1); + atover(true); } } diff --git a/src/sst.h b/src/sst.h index 27040e8..bccb6c2 100644 --- a/src/sst.h +++ b/src/sst.h @@ -330,9 +330,9 @@ enum loctype {neither, quadrant, sector}; void prelim(void); void attack(int); bool choose(bool); -void setup(int); +void setup(bool); void score(void); -void atover(int); +void atover(bool); int srscan(int); void lrscan(void); void phasers(void); @@ -341,7 +341,7 @@ void warp(bool); void doshield(int); void dock(bool); void dreprt(void); -void chart(int); +void chart(bool); void rechart(void); void impuls(void); void wait(void); @@ -397,21 +397,21 @@ int isit(char *); void preport(void); void orbit(void); void sensor(void); -void drawmaps(short); +void drawmaps(int); void beam(void); void mine(void); void usecrystals(void); void shuttle(void); void deathray(void); void debugme(void); -void attakreport(int); +void attakreport(bool); void movetho(void); void probe(void); void iostart(void); void setwnd(WINDOW *); void warble(void); -void boom(int ii, int jj); -void tracktorpedo(int ix, int iy, int l, int i, int n, int iquad); +void boom(int, int); +void tracktorpedo(int, int, int, int, int, int); void cgetline(char *, int); void waitfor(void); void setpassword(void); -- 2.31.1