]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - larn/global.c
Larn now builds with WARNS=4.
[bsdgames-darwin.git] / larn / global.c
index c4e75bfb5f5db6ac7cccfe1566cce8de36df0fbe..28d24b5a2f2a633bab56eea7d8b1fa3055d46816 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: global.c,v 1.7 2001/02/05 00:57:33 christos Exp $      */
+/*     $NetBSD: global.c,v 1.9 2008/01/28 05:38:53 dholland Exp $      */
 
 /*
  * global.c            Larn is copyrighted 1986 by Noah Morgan.
@@ -23,7 +23,7 @@
  */
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: global.c,v 1.7 2001/02/05 00:57:33 christos Exp $");
+__RCSID("$NetBSD: global.c,v 1.9 2008/01/28 05:38:53 dholland Exp $");
 #endif /* not lint */
 
 #include <string.h>
@@ -31,7 +31,6 @@ __RCSID("$NetBSD: global.c,v 1.7 2001/02/05 00:57:33 christos Exp $");
 #include "header.h"
 #include "extern.h"
 extern int      score[], dropflag;
-extern int      random;                /* the random number seed               */
 extern char     *what[], *who[];
 extern char     winner[];
 extern char     sciv[SCORESIZE + 1][26][2];
@@ -95,7 +94,7 @@ raiseexperience(x)
        if (c[LEVEL] != i) {
                cursors();
                beep();
-               lprintf("\nWelcome to level %d", (long) c[LEVEL]);      /* if we changed levels  */
+               lprintf("\nWelcome to level %ld", (long) c[LEVEL]);     /* if we changed levels  */
        }
        bottomline();
 }
@@ -129,7 +128,7 @@ loseexperience(x)
        if (i != c[LEVEL]) {
                cursors();
                beep();
-               lprintf("\nYou went down to level %d!", (long) c[LEVEL]);
+               lprintf("\nYou went down to level %ld!", (long) c[LEVEL]);
        }
        bottomline();
 }
@@ -472,8 +471,7 @@ more()
        returns 0 if success, 1 if a failure
  */
 int
-take(itm, arg)
-       int             itm, arg;
+take(int theitem, int arg)
 {
        int    i, limit;
        /* cursors(); */
@@ -481,10 +479,10 @@ take(itm, arg)
                limit = 26;
        for (i = 0; i < limit; i++)
                if (iven[i] == 0) {
-                       iven[i] = itm;
+                       iven[i] = theitem;
                        ivenarg[i] = arg;
                        limit = 0;
-                       switch (itm) {
+                       switch (theitem) {
                        case OPROTRING:
                        case ODAMRING:
                        case OBELT:
@@ -545,12 +543,12 @@ int
 drop_object(k)
        int             k;
 {
-       int             itm;
+       int             theitem;
        if ((k < 0) || (k > 25))
                return (0);
-       itm = iven[k];
+       theitem = iven[k];
        cursors();
-       if (itm == 0) {
+       if (theitem == 0) {
                lprintf("\nYou don't have item %c! ", k + 'a');
                return (1);
        }
@@ -561,7 +559,7 @@ drop_object(k)
        }
        if (playery == MAXY - 1 && playerx == 33)
                return (1);     /* not in entrance */
-       item[playerx][playery] = itm;
+       item[playerx][playery] = theitem;
        iarg[playerx][playery] = ivenarg[k];
        srcount = 0;
        lprcat("\n  You drop:");
@@ -574,7 +572,7 @@ drop_object(k)
                c[WEAR] = -1;
        if (c[SHIELD] == k)
                c[SHIELD] = -1;
-       adjustcvalues(itm, ivenarg[k]);
+       adjustcvalues(theitem, ivenarg[k]);
        dropflag = 1;           /* say dropped an item so wont ask to pick it
                                 * up right away */
        return (0);
@@ -742,12 +740,11 @@ creategem()
        that affects these characteristics
  */
 void
-adjustcvalues(itm, arg)
-       int             itm, arg;
+adjustcvalues(int theitem, int arg)
 {
        int    flag;
        flag = 0;
-       switch (itm) {
+       switch (theitem) {
        case ODEXRING:
                c[DEXTERITY] -= arg + 1;
                flag = 1;