]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - hack/hack.topl.c
introduce some common variables for use in GCC warning disables:
[bsdgames-darwin.git] / hack / hack.topl.c
index 138a1db2e7684a882a10e570e5b431d0e93c0f89..d99b76f881ad76043fdbe0668651c8a3874767ee 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: hack.topl.c,v 1.11 2009/06/29 23:05:33 dholland Exp $  */
+/*     $NetBSD: hack.topl.c,v 1.14 2011/08/06 20:29:37 dholland Exp $  */
 
 /*
  * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: hack.topl.c,v 1.11 2009/06/29 23:05:33 dholland Exp $");
+__RCSID("$NetBSD: hack.topl.c,v 1.14 2011/08/06 20:29:37 dholland Exp $");
 #endif                         /* not lint */
 
 #include <stdlib.h>
 #include "hack.h"
 #include "extern.h"
 
-char            toplines[BUFSZ];
-xchar           tlx, tly;      /* set by pline; used by addtopl */
+static char toplines[BUFSZ];
+static xchar tlx, tly;         /* set by pline; used by addtopl */
 
-struct topl {
+static struct topl {
        struct topl    *next_topl;
        char           *topl_text;
 }              *old_toplines, *last_redone_topl;
 #define        OTLMAX  20              /* max nr of old toplines remembered */
 
+static void redotoplin(void);
+static void xmore(const char *);
+
 int
 doredotopl(void)
 {
@@ -93,7 +96,7 @@ doredotopl(void)
        return (0);
 }
 
-void
+static void
 redotoplin(void)
 {
        home();
@@ -120,8 +123,7 @@ remember_topl(void)
            !strcmp(toplines, old_toplines->topl_text))
                return;
        last_redone_topl = 0;
-       tl = (struct topl *)
-               alloc((unsigned) (strlen(toplines) + sizeof(struct topl) + 1));
+       tl = alloc(strlen(toplines) + sizeof(*tl) + 1);
        tl->next_topl = old_toplines;
        tl->topl_text = (char *) (tl + 1);
        (void) strcpy(tl->topl_text, toplines);
@@ -131,7 +133,7 @@ remember_topl(void)
                tl = tl->next_topl;
        }
        if (tl && tl->next_topl) {
-               free((char *) tl->next_topl);
+               free(tl->next_topl);
                tl->next_topl = 0;
        }
 }
@@ -149,7 +151,7 @@ addtopl(const char *s)
 }
 
 /* s = allowed chars besides space/return */
-void
+static void
 xmore(const char *s)
 {
        if (flags.toplin) {