summaryrefslogtreecommitdiffstats
path: root/games/grdc
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2011-11-05 07:18:53 +0000
committered <ed@FreeBSD.org>2011-11-05 07:18:53 +0000
commitaf1e42f3663dcd8159beaaa0859821132e24b852 (patch)
tree4242cd3dd5692991dfad5e1680032fdc0aff58b8 /games/grdc
parent8fee4feec438219b472e674081c93ff29359229f (diff)
downloadFreeBSD-src-af1e42f3663dcd8159beaaa0859821132e24b852.zip
FreeBSD-src-af1e42f3663dcd8159beaaa0859821132e24b852.tar.gz
Add static keywords to variables and functions where possible in games/.
This allows us to detect unused functions and variables and allows the compiler to do a better job at optimisation.
Diffstat (limited to 'games/grdc')
-rw-r--r--games/grdc/grdc.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/games/grdc/grdc.c b/games/grdc/grdc.c
index 6881cf1..4632c79 100644
--- a/games/grdc/grdc.c
+++ b/games/grdc/grdc.c
@@ -26,29 +26,30 @@
#define XLENGTH 58
#define YDEPTH 7
-struct timespec now;
-struct tm *tm;
+static struct timespec now;
+static struct tm *tm;
-short disp[11] = {
+static short disp[11] = {
075557, 011111, 071747, 071717, 055711,
074717, 074757, 071111, 075757, 075717, 002020
};
-long old[6], next[6], new[6], mask;
+static long old[6], next[6], new[6], mask;
-volatile sig_atomic_t sigtermed;
+static volatile sig_atomic_t sigtermed;
-int hascolor = 0;
+static int hascolor = 0;
-void set(int, int);
-void standt(int);
-void movto(int, int);
-void sighndl(int);
-void usage(void);
+static void set(int, int);
+static void standt(int);
+static void movto(int, int);
+static void sighndl(int);
+static void usage(void);
-void
+static void
sighndl(int signo)
{
- sigtermed=signo;
+
+ sigtermed = signo;
}
int
@@ -225,7 +226,7 @@ main(int argc, char *argv[])
return(0);
}
-void
+static void
set(int t, int n)
{
int i, m;
@@ -239,7 +240,7 @@ set(int t, int n)
mask |= m;
}
-void
+static void
standt(int on)
{
if (on) {
@@ -257,13 +258,13 @@ standt(int on)
}
}
-void
+static void
movto(int line, int col)
{
move(line, col);
}
-void
+static void
usage(void)
{
OpenPOWER on IntegriCloud