Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/warp Time warp forward 34 years so that it compiles (b...



details:   https://anonhg.NetBSD.org/src/rev/ef643f710659
branches:  trunk
changeset: 978158:ef643f710659
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Nov 10 22:42:19 2020 +0000

description:
Time warp forward 34 years so that it compiles (but not work)

diffstat:

 games/warp/bang.c      |   34 +++----
 games/warp/bang.h      |    8 +-
 games/warp/config.H    |   18 ++--
 games/warp/config.h    |   40 +--------
 games/warp/config.h.SH |   24 ++--
 games/warp/init.c      |   41 +++++----
 games/warp/init.h      |    2 +-
 games/warp/intrp.c     |  132 ++++++++++++++------------------
 games/warp/intrp.h     |   19 ++--
 games/warp/move.c      |  114 ++++++++++++---------------
 games/warp/move.h      |   13 +-
 games/warp/object.c    |   18 +--
 games/warp/object.h    |   15 +--
 games/warp/play.c      |   26 +++--
 games/warp/play.h      |    4 +-
 games/warp/score.c     |  200 +++++++++++++++++++++++-------------------------
 games/warp/score.h     |   12 +-
 games/warp/sig.c       |   14 +-
 games/warp/sig.h       |   13 +-
 games/warp/sm.c        |    8 +-
 games/warp/term.c      |  197 +++++++++++++++++++++--------------------------
 games/warp/term.h      |   84 ++++++++++----------
 games/warp/them.c      |   35 +++----
 games/warp/them.h      |    6 +-
 games/warp/us.c        |   66 +++++++--------
 games/warp/us.h        |   12 +-
 games/warp/util.c      |  184 ++++++++------------------------------------
 games/warp/util.h      |   29 +++---
 games/warp/version.c   |    2 +-
 games/warp/version.h   |    2 +-
 games/warp/warp.c      |   77 ++++++++----------
 games/warp/warp.h      |  100 +++++++++---------------
 games/warp/weapon.c    |  118 +++++++++++++---------------
 games/warp/weapon.h    |   10 +-
 34 files changed, 706 insertions(+), 971 deletions(-)

diffs (truncated from 3989 to 300 lines):

diff -r bbcdba8a0f44 -r ef643f710659 games/warp/bang.c
--- a/games/warp/bang.c Tue Nov 10 22:25:38 2020 +0000
+++ b/games/warp/bang.c Tue Nov 10 22:42:19 2020 +0000
@@ -26,17 +26,15 @@
 #include "bang.h"
 
 void
-bang_init()
+bang_init(void)
 {
     ;
 }
 
 void
-make_plink(y,x)
-Reg1 int x;
-Reg2 int y;
+make_plink(int x, int y)
 {
-    Reg3 OBJECT *obj;
+    OBJECT *obj;
 
     move(y+1,x*2,0);
     beg_qwrite();
@@ -57,11 +55,7 @@
 }
 
 void
-make_blast(y,x,mass,size)
-Reg1 int x;
-Reg2 int y;
-int size;
-long mass;
+make_blast(int x, int y, int size, long mass)
 {
     bangy[nxtbang] = y;
     bangx[nxtbang] = x;
@@ -77,7 +71,7 @@
        return;
     }
     else if (mass >= 0) {
-       Reg3 OBJECT *obj;
+       OBJECT *obj;
 
        move(y+1,x*2,0);
        beg_qwrite();
@@ -107,15 +101,15 @@
 }
 
 void
-do_bangs()
+do_bangs(void)
 {
-    Reg1 int x;
-    Reg2 int y;
-    Reg3 int i;
-    Reg4 int j;
-    Reg7 int k;
-    Reg5 int lastxy;
-    Reg6 OBJECT *obj;
+    int x;
+    int y;
+    int i;
+    int j;
+    int k;
+    int lastxy;
+    OBJECT *obj;
 
     /* read blast list and update blast array */
     assert(nxtbang >= 0 && nxtbang <= XSIZE * YSIZE);
@@ -131,7 +125,7 @@
            yblasted[yy[j] = (y+YSIZE00) % YSIZE] |= 1;
            xblasted[xx[j] = (x+XSIZE00) % XSIZE] |= 1;
        }
-       blasted = TRUE;
+       blasted = true;
        for (y=lastxy;y>=0;--y) {
            for (x=lastxy;x>=0;--x) {
                if (lastxy > 2) {
diff -r bbcdba8a0f44 -r ef643f710659 games/warp/bang.h
--- a/games/warp/bang.h Tue Nov 10 22:25:38 2020 +0000
+++ b/games/warp/bang.h Tue Nov 10 22:42:19 2020 +0000
@@ -24,7 +24,7 @@
 EXT int nxtbang;
 EXT bool banging;
 
-void make_plink();
-void make_blast();
-void do_bangs();
-void bang_init();
+void bang_init(void);
+void make_plink(int, int);
+void make_blast(int, int, int, long);
+void do_bangs(void);
diff -r bbcdba8a0f44 -r ef643f710659 games/warp/config.H
--- a/games/warp/config.H       Tue Nov 10 22:25:38 2020 +0000
+++ b/games/warp/config.H       Tue Nov 10 22:42:19 2020 +0000
@@ -67,15 +67,15 @@
 
 /* How many register declarations are paid attention to? */
 
-#define Reg1 register          /**/
-#define Reg2 register          /**/
-#define Reg3 register          /**/
-#define Reg4 register          /**/
-#define Reg5 register          /**/
-#define Reg6 register          /**/
-#define Reg7           /**/
-#define Reg8           /**/
-#define Reg9           /**/
+#define register               /**/
+#define register               /**/
+#define register               /**/
+#define register               /**/
+#define register               /**/
+#define register               /**/
+#define                /**/
+#define                /**/
+#define                /**/
 #define Reg10          /**/
 #define Reg11          /**/
 #define Reg12          /**/
diff -r bbcdba8a0f44 -r ef643f710659 games/warp/config.h
--- a/games/warp/config.h       Tue Nov 10 22:25:38 2020 +0000
+++ b/games/warp/config.h       Tue Nov 10 22:42:19 2020 +0000
@@ -3,7 +3,7 @@
  *     to find out if there is input pending on an IO channel.  Generally
  *     the routine is used only if FIONREAD and O_NDELAY aren't available.
  */
-#/*undef       RDCHK           /**/
+#undef RDCHK           /**/
 
 /* SCOREFULL:
  *     This symbol, if defined, indicates that any scoreboard kept by the
@@ -11,7 +11,7 @@
  *     to the user's login name.  If the user can change his full name he
  *     can enter multiple scores if this is defined.
  */
-#/*undef       SCOREFULL       /**/
+#undef SCOREFULL       /**/
 
 /* SIGNEDCHAR:
  *     This symbol, if defined, indicates that characters are a signed type.
@@ -25,7 +25,7 @@
  *     termio.h rather than sgtty.h.  There are also differences in the
  *     ioctl() calls that depend on the value of this symbol.
  */
-#/*undef       TERMIO          /**/
+#undef TERMIO          /**/
 
 /* USENDIR:
  *     This symbol, if defined, indicates that the program should compile
@@ -35,15 +35,15 @@
  *     This symbol, if defined, indicates that the program should include the
  *     system's version of ndir.h, rather than the one with this package.
  */
-#/*undef       USENDIR         /**/
-#/*undef       LIBNDIR         /**/
+#undef USENDIR         /**/
+#undef LIBNDIR         /**/
 #define LIBNDIR
 
 /* WHOAMI:
  *     This symbol, if defined, indicates that the program may include
  *     whoami.h.
  */
-#/*undef       WHOAMI          /**/
+#undef WHOAMI          /**/
 
 /* HOSTNAME:
  *     This symbol contains name of the host the program is going to run on.
@@ -77,7 +77,7 @@
  */
 #define        PASSNAMES /*  (undef to take name from ~/.fullname) */
 #define        BERKNAMES /* (that is, ":name,stuff:") */
-#/*undef       USGNAMES  /* (that is, ":stuff-name(stuff):") */
+#undef USGNAMES  /* (that is, ":stuff-name(stuff):") */
 
 /* PREFSHELL:
  *     This symbol contains the full name of the preferred user shell on this
@@ -91,32 +91,6 @@
  */
 #define RANDBITS 15            /**/
 
-/* Reg1:
- *     This symbol, along with Reg2, Reg3, etc. is either the word "register"
- *     or null, depending on whether the C compiler pays attention to this
- *     many register declarations.  The intent is that you don't have to
- *     order your register declarations in the order of importance, so you
- *     can freely declare register variables in sub-blocks of code and as
- *     function parameters.  Do not use Reg<n> more than once per routine.
- */
-
-#define Reg1 register          /**/
-#define Reg2 register          /**/
-#define Reg3 register          /**/
-#define Reg4           /**/
-#define Reg5           /**/
-#define Reg6           /**/
-#define Reg7           /**/
-#define Reg8           /**/
-#define Reg9           /**/
-#define Reg10          /**/
-#define Reg11          /**/
-#define Reg12          /**/
-#define Reg13          /**/
-#define Reg14          /**/
-#define Reg15          /**/
-#define Reg16          /**/
-
 /* ROOTID:
  *     This symbol contains the uid of root, normally 0.
  */
diff -r bbcdba8a0f44 -r ef643f710659 games/warp/config.h.SH
--- a/games/warp/config.h.SH    Tue Nov 10 22:25:38 2020 +0000
+++ b/games/warp/config.h.SH    Tue Nov 10 22:42:19 2020 +0000
@@ -38,9 +38,9 @@
 #$d_eunice     VMS             /**/
 
 /* CHARSPRINTF:
- *     This symbol is defined if this system declares "char *sprintf()" in
- *     stdio.h.  The trend seems to be to declare it as "int sprintf()".  It
- *     is up to the package author to declare sprintf correctly based on the
+ *     This symbol is defined if this system declares "char *snprintf()" in
+ *     stdio.h.  The trend seems to be to declare it as "int snprintf()".  It
+ *     is up to the package author to declare snprintf correctly based on the
  *     symbol.
  */
 #$d_charsprf   CHARSPRINTF     /**/
@@ -219,15 +219,15 @@
  *     function parameters.  Do not use Reg<n> more than once per routine.
  */
 
-#define Reg1 $reg1             /**/
-#define Reg2 $reg2             /**/
-#define Reg3 $reg3             /**/
-#define Reg4 $reg4             /**/
-#define Reg5 $reg5             /**/
-#define Reg6 $reg6             /**/
-#define Reg7 $reg7             /**/
-#define Reg8 $reg8             /**/
-#define Reg9 $reg9             /**/
+#define $reg1          /**/
+#define $reg2          /**/
+#define $reg3          /**/
+#define $reg4          /**/
+#define $reg5          /**/
+#define $reg6          /**/
+#define $reg7          /**/
+#define $reg8          /**/
+#define $reg9          /**/
 #define Reg10 $reg10           /**/
 #define Reg11 $reg11           /**/
 #define Reg12 $reg12           /**/
diff -r bbcdba8a0f44 -r ef643f710659 games/warp/init.c
--- a/games/warp/init.c Tue Nov 10 22:25:38 2020 +0000
+++ b/games/warp/init.c Tue Nov 10 22:42:19 2020 +0000
@@ -34,33 +34,33 @@
 #include "init.h"
 
 void
-initialize()
+initialize(void)
 {
-    Reg1 int i;
-    Reg2 int x;
-    Reg3 int y;
-    Reg4 int dist;
-    Reg5 int ydist;
-    Reg6 int xdist;
+    int i;
+    int x;
+    int y;
+    int dist;
+    int ydist = 0;
+    int xdist = 0;
     long e;
-    int yoff, xoff, ypred, xpred;
-    Reg7 OBJECT *obj;
+    int yoff = 0, xoff = 0, ypred, xpred;
+    OBJECT *obj = NULL;
     char ch;
     FILE *mapfp = NULL;
     bool tmptholspec;
     int inhabjackpot;
     long inhenergy;
     int walksplit = 200;
-    static char *distname[] =
+    static const char *distname[] =
        {" #"," -"," \\"," /",
         " |"," *"," `"," '"};
 
-    cloaking = madgorns = FALSE;
+    cloaking = madgorns = false;
     deados = madfriends = 0;
     curscore = possiblescore = 0L;
     yamblast = xamblast = ambsize = 0;
     if (smarts > 90)
-       massacre = TRUE;
+       massacre = true;



Home | Main Index | Thread Index | Old Index