Get rid of some unneeded conditionalizations.
authorEric S. Raymond <esr@thyrsus.com>
Thu, 3 Feb 2005 18:30:44 +0000 (18:30 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Thu, 3 Feb 2005 18:30:44 +0000 (18:30 +0000)
battle.c
finish.c
io.c
sst.h

index 455801b9e2b43bc4b6366fcb4aa9fdbeec9f68c3..f6c485f5e1566a142c192a4044747a223c8278d8 100644 (file)
--- a/battle.c
+++ b/battle.c
@@ -260,9 +260,7 @@ void torpedo(double course, double r, int inx, int iny, double *hit, int wait) {
                                           1000.0*sqrt(square(ix-inx)+square(iy-iny))*
                                           fabs(sin(bullseye-angle));
                                *hit = fabs(*hit);
-#ifndef SERGEEV
-                               newcnd(); /* undock */
-#endif /* SERGEEV */
+                               newcnd(); /* we're blown out of dock */
                                /* We may be displaced. */
                                if (landed==1 || condit==IHDOCKED) return; /* Cheat if on a planet */
                                ang = angle + 2.5*(Rand()-0.5);
@@ -654,9 +652,7 @@ void deadkl(int ix, int iy, int type, int ixx, int iyy) {
 
        int i,j;
 
-#ifdef SERGEEV 
         skip(1);
-#endif /* SERGEEV */
        crmena(1, type, 2, ixx, iyy);
        /* Decide what kind of enemy it is and update approriately */
        if (type == IHR) {
index 33694697902e2516af30ab8f519741f7cd202da7..7ae6c87780ec8f6e4b22fdb5505a4c0abefabc0a 100644 (file)
--- a/finish.c
+++ b/finish.c
@@ -1,6 +1,3 @@
-#ifdef SERGEEV
-#include <conio.h>
-#endif /* SERGEEV */
 #include "sst.h"
 #include <string.h>
 #include <time.h>
@@ -19,21 +16,13 @@ void dstrct() {
        prouts("          8"); skip(1);
        prouts("             7"); skip(1);
        prouts("                6"); skip(1);
-#ifdef SERGEEV
        skip(1);
-#endif /* SERGEEV */
        prout("ENTER-CORRECT-PASSWORD-TO-CONTINUE-");
-#ifdef SERGEEV
        skip(1);
-#endif /* SERGEEV */
        prout("SELF-DESTRUCT-SEQUENCE-OTHERWISE-");
-#ifdef SERGEEV
        skip(1);
-#endif /* SERGEEV */
        prout("SELF-DESTRUCT-SEQUENCE-WILL-BE-ABORTED");
-#ifdef SERGEEV
        skip(1);
-#endif /* SERGEEV */
        scan();
        chew();
        if (strcmp(game.passwd, citem) != 0) {
@@ -404,12 +393,7 @@ void plaque(void) {
        
        while (fp == NULL) {
                 proutn("File or device name for your plaque: ");
-#ifdef SERGEEV
                 getline(winner, sizeof(winner));
-#else
-               fgets(winner, 128, stdin);
-               winner[strlen(winner)-1] = '\0';
-#endif /* SERGEEV */
                fp = fopen(winner, "w");
                if (fp==NULL) {
                         prout("Invalid name.");
diff --git a/io.c b/io.c
index 258da5513f9bd5eeaf7e14d169925e5bebcd7d15..2e66d36f10ec197929d3fbcdd47fd3478de4aacf 100644 (file)
--- a/io.c
+++ b/io.c
@@ -286,11 +286,7 @@ void prouts(char *fmt, ...) {
 #endif /* SERGEEV */
 }
 
-#ifndef SERGEEV
 void getline(char *line, int max) {
-#else /* SERGEEV */
-void cgetline(char *line, int max) {
-#endif /* SERGEEV */
     if (curses) {
 #ifndef SERGEEV
        wgetnstr(stdscr, line, max);
diff --git a/sst.h b/sst.h
index b82a66bdb16bb43f7b5505c7750d55dcce379000..5ba700490ccf20799d3e7435ca7a059dc91fe61b 100644 (file)
--- a/sst.h
+++ b/sst.h
@@ -439,7 +439,6 @@ void clearscreen(void);
 void iostart(int);
 void ioend(void);
 #ifdef SERGEEV
-#define getline cgetline
 void setwnd(short);
 #endif /* SERGEEV */
 void getline(char *, int);