From cbb2d987e8c23c6c25bd441fdef5401d5a89289e Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 28 Sep 2006 10:52:08 +0000 Subject: [PATCH] Clean up ugly FORTRANISH names. It's been years since C public names had a 6-character significance limit. --- src/ai.c | 13 ++++++------- src/battle.c | 8 ++++---- src/events.c | 14 +++++++------- src/moving.c | 10 +++++----- src/planets.c | 2 +- src/reports.c | 8 ++++---- src/setup.c | 4 ++-- src/sst.c | 10 +++++----- src/sst.h | 20 ++++++++++---------- 9 files changed, 44 insertions(+), 45 deletions(-) diff --git a/src/ai.c b/src/ai.c index d222f70..4d9e7cc 100644 --- a/src/ai.c +++ b/src/ai.c @@ -273,7 +273,7 @@ static void movebaddy(coord com, int loccom, feature ienm) } void moveklings(void) -/* move a commander */ +/* Klingon tactical movement */ { coord w; int i; @@ -309,7 +309,7 @@ void moveklings(void) movebaddy(w, i, game.quad[w.x][w.y]); } - sortkl(); + sortklings(); } static bool movescom(coord iq, bool flag) @@ -352,7 +352,7 @@ static bool movescom(coord iq, bool flag) game.nenhere--; if (game.condition!=docked) newcnd(); - sortkl(); + sortklings(); } /* check for a helpful planet */ for (i = 0; i < game.inplan; i++) { @@ -375,7 +375,7 @@ static bool movescom(coord iq, bool flag) return false; /* looks good! */ } -void scom(void) +void supercommander(void) /* move the Super Commander */ { int i, i2, j, ideltax, ideltay, ifindit, iwhichb; @@ -385,7 +385,7 @@ void scom(void) bool flag; if (idebug) - prout("== SCOM"); + prout("== SUPERCOMMANDER"); /* Decide on being active or passive */ flag = ((NKILLC+NKILLK)/(game.state.date+0.01-game.indate) < 0.1*game.skill*(game.skill+1.0) || @@ -555,11 +555,10 @@ void scom(void) return; } -void movetho(void) +void movetholian(void) /* move the Tholian */ { int idx, idy, im, i; - /* Move the Tholian */ if (!game.ithere || game.justin) return; diff --git a/src/battle.c b/src/battle.c index 836f1e7..a1e1377 100644 --- a/src/battle.c +++ b/src/battle.c @@ -241,7 +241,7 @@ void ram(bool ibumpd, feature ienm, coord w) prout(_("***Shields are down.")); if (KLINGREM) { pause_game(true); - dreprt(); + damagereport(); } else finish(FWON); @@ -503,7 +503,7 @@ void torpedo(double course, double r, coord in, double *hit, int i, int n) prout(_(" displaced by blast to %s "), cramlc(sector, jw)); for_local_enemies(ll) game.kdist[ll] = game.kavgd[ll] = distance(game.sector,game.ks[ll]); - sortkl(); + sortklings(); return; } skip(1); @@ -570,7 +570,7 @@ void attack(bool torps_ok) /* Tholian gewts to move before attacking */ if (game.ithere) - movetho(); + movetholian(); /* if you have just entered the RNZ, you'll get a warning */ if (game.neutz) { /* The one chance not to be attacked */ @@ -724,7 +724,7 @@ void attack(bool torps_ok) /* After attack, reset average distance to enemies */ for_local_enemies(loop) game.kavgd[loop] = game.kdist[loop]; - sortkl(); + sortklings(); return; } diff --git a/src/events.c b/src/events.c index 13ceea0..072c2e6 100644 --- a/src/events.c +++ b/src/events.c @@ -147,7 +147,7 @@ void events(void) prout(_(" surveillance reports are coming in.")); skip(1); if (!game.iseenit) { - attakreport(false); + attackreport(false); game.iseenit = true; } rechart(); @@ -159,7 +159,7 @@ void events(void) switch (evcode) { case FSNOVA: /* Supernova */ pause_game(true); - snova(false, NULL); + supernova(false, NULL); schedule(FSNOVA, expran(0.5*game.intime)); if (game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova) return; @@ -374,7 +374,7 @@ void events(void) schedule(FSCMOVE, 0.2777); if (!game.ientesc && !istract && game.isatb != 1 && (!game.iscate || !game.justin)) - scom(); + supercommander(); break; case FDSPROB: /* Move deep space probe */ schedule(FDSPROB, 0.01); @@ -423,7 +423,7 @@ void events(void) game.proben--; // One less to travel if (game.proben == 0 && game.isarmed && pdest->stars) { /* lets blow the sucker! */ - snova(true, &game.probec); + supernova(true, &game.probec); unschedule(FDSPROB); if (game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova) return; @@ -635,7 +635,7 @@ void nova(coord nov) if (Rand() < 0.05) { /* Wow! We've supernova'ed */ - snova(false, &nov); + supernova(false, &nov); return; } @@ -674,7 +674,7 @@ void nova(coord nov) case IHSTAR: /* Affect another star */ if (Rand() < 0.05) { /* This star supernovas */ - snova(false, &scratch); + supernova(false, &scratch); return; } top2++; @@ -814,7 +814,7 @@ void nova(coord nov) } -void snova(bool induced, coord *w) +void supernova(bool induced, coord *w) /* star goes supernova */ { int num = 0, nrmdead, npdead, kldead; diff --git a/src/moving.c b/src/moving.c index 0be93c7..2ee4436 100644 --- a/src/moving.c +++ b/src/moving.c @@ -200,7 +200,7 @@ no_quad_change: game.kavgd[m] = 0.5 * (finald+game.kdist[m]); game.kdist[m] = finald; } - sortkl(); + sortklings(); if (!game.state.galaxy[game.quadrant.x][game.quadrant.y].supernova) attack(false); for_local_enemies(m) game.kavgd[m] = game.kdist[m]; @@ -242,7 +242,7 @@ void dock(bool verbose) (is_scheduled(FCDBAS) || game.isatb == 1) && !game.iseenit) { /* get attack report from base */ prout(_("Lt. Uhura- \"Captain, an important message from the starbase:\"")); - attakreport(false); + attackreport(false); game.iseenit = true; } } @@ -438,7 +438,7 @@ static void getcd(bool isprobe, int akey) -void impuls(void) +void impulse(void) /* move under impulse power */ { double power; @@ -646,7 +646,7 @@ void warp(bool timewarp) -void setwrp(void) +void setwarp(void) /* change the warp factor */ { int key; @@ -1086,7 +1086,7 @@ void mayday(void) ** */ -void abandn(void) +void abandon(void) /* abandon ship */ { int nb, l; diff --git a/src/planets.c b/src/planets.c index 215a50c..e9cfcc2 100644 --- a/src/planets.c +++ b/src/planets.c @@ -12,7 +12,7 @@ static bool consumeTime(void) return false; } -void preport(void) +void survey(void) /* report on (uninhabited) planets in the galaxy */ { bool iknow = false; diff --git a/src/reports.c b/src/reports.c index e7c433f..ff19ae1 100644 --- a/src/reports.c +++ b/src/reports.c @@ -3,7 +3,7 @@ #include #include -void attakreport(bool curt) +void attackreport(bool curt) /* report status of bases under attack */ { if (!curt) { @@ -84,7 +84,7 @@ void report(void) if (!damaged(DRADIO) || game.condition == docked || game.iseenit) { /* Don't report this if not seen and either the radio is dead or not at base! */ - attakreport(false); + attackreport(false); game.iseenit = true; } if (game.casual) @@ -166,7 +166,7 @@ void lrscan(void) } } -void dreprt(void) +void damagereport(void) /* damage report */ { bool jdam = false; @@ -358,7 +358,7 @@ void status(int req) ); RQ(11, - attakreport(!req); + attackreport(!req); ); #undef RQ diff --git a/src/setup.c b/src/setup.c index 852212b..8365576 100644 --- a/src/setup.c +++ b/src/setup.c @@ -731,7 +731,7 @@ void newqad(bool shutup) } } - sortkl(); + sortklings(); // Put in a few black holes for (i = 1; i <= 3; i++) @@ -751,7 +751,7 @@ void newqad(bool shutup) } } -void sortkl(void) +void sortklings(void) /* sort Klingons by distance from us */ { double t; diff --git a/src/sst.c b/src/sst.c index ae82984..7989238 100644 --- a/src/sst.c +++ b/src/sst.c @@ -472,13 +472,13 @@ static void makemoves(void) attack(false); break; case DAMAGES: // damages - dreprt(); + damagereport(); break; case CHART: // chart makechart(); break; case IMPULSE: // impulse - impuls(); + impulse(); break; case REST: // rest wait(); @@ -486,7 +486,7 @@ static void makemoves(void) hitme = true; break; case WARP: // warp - setwrp(); + setwarp(); break; case SCORE: // score score(); @@ -518,7 +518,7 @@ static void makemoves(void) hitme = true; break; case PLANETS: // Planet list - preport(); + survey(); break; case REPORT: // Game Report report(); @@ -540,7 +540,7 @@ static void makemoves(void) hitme = true; break; case ABANDON: // Abandon Ship - abandn(); + abandon(); break; case DESTRUCT: // Self Destruct selfdestruct(); diff --git a/src/sst.h b/src/sst.h index daf97ac..5ea29e9 100644 --- a/src/sst.h +++ b/src/sst.h @@ -354,17 +354,17 @@ extern void photon(void); extern void warp(bool); extern void doshield(bool); extern void dock(bool); -extern void dreprt(void); +extern void damagereport(void); extern void chart(void); extern void rechart(void); -extern void impuls(void); +extern void impulse(void); extern void wait(void); -extern void setwrp(void); +extern void setwarp(void); extern void events(void); extern void report(void); extern void eta(void); extern void mayday(void); -extern void abandn(void); +extern void abandon(void); extern void finish(FINTYPE); extern void selfdestruct(void); extern void kaboom(void); @@ -396,7 +396,7 @@ extern double Rand(void); extern coord randplace(int); extern coord dropin(feature); extern void newcnd(void); -extern void sortkl(void); +extern void sortklings(void); extern void imove(bool); extern void ram(bool, feature, coord); extern void crmena(bool, feature, enum loctype, coord w); @@ -408,11 +408,11 @@ extern void huh(void); extern void pause_reset(void); extern void pause_game(bool); extern void nova(coord); -extern void snova(bool, coord *); -extern void scom(void); +extern void supernova(bool, coord *); +extern void supercommander(void); extern void hittem(double *); extern bool isit(char *); -extern void preport(void); +extern void survey(void); extern void orbit(void); extern void sensor(void); extern void drawmaps(int); @@ -422,8 +422,8 @@ extern void usecrystals(void); extern void shuttle(void); extern void deathray(void); extern void debugme(void); -extern void attakreport(bool); -extern void movetho(void); +extern void attackreport(bool); +extern void movetholian(void); extern void probe(void); extern void iostart(void); extern void setwnd(WINDOW *); -- 2.31.1