summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-01-16 00:13:20 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-01-16 00:13:20 +0000
commit09d5eda8e33e493360cf12b383226bd3eee21154 (patch)
tree993e0153b4862c320209cbac10ee88d83f58de9a /games
parented1ec3296e69a786bdb096bda64760f5b0a6fa54 (diff)
ISO C police: log and expl are reserved for the C library.
expl -> expl_string log -> logit
Diffstat (limited to 'games')
-rw-r--r--games/cribbage/cribbage.h4
-rw-r--r--games/cribbage/extern.c4
-rw-r--r--games/cribbage/score.c32
-rw-r--r--games/cribbage/support.c6
-rw-r--r--games/gomoku/gomoku.h4
-rw-r--r--games/gomoku/main.c14
-rw-r--r--games/hunt/huntd/answer.c12
-rw-r--r--games/hunt/huntd/conf.c4
-rw-r--r--games/hunt/huntd/driver.c34
-rw-r--r--games/hunt/huntd/execute.c4
-rw-r--r--games/hunt/huntd/expl.c6
-rw-r--r--games/hunt/huntd/server.h4
-rw-r--r--games/hunt/huntd/shots.c4
-rw-r--r--games/hunt/huntd/terminal.c4
14 files changed, 68 insertions, 68 deletions
diff --git a/games/cribbage/cribbage.h b/games/cribbage/cribbage.h
index 26fe764e942..88eb40f63ff 100644
--- a/games/cribbage/cribbage.h
+++ b/games/cribbage/cribbage.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cribbage.h,v 1.6 2003/06/03 03:01:39 millert Exp $ */
+/* $OpenBSD: cribbage.h,v 1.7 2004/01/16 00:13:18 espie Exp $ */
/* $NetBSD: cribbage.h,v 1.3 1995/03/21 15:08:46 cgd Exp $ */
/*
@@ -57,7 +57,7 @@ extern bool rflag; /* if all cuts random */
extern bool quiet; /* if suppress random mess */
extern bool playing; /* currently playing game */
-extern char expl[128]; /* string for explanation */
+extern char expl_string[128]; /* string for explanation */
void addmsg(const char *, ...);
int adjust(CARD [], CARD);
diff --git a/games/cribbage/extern.c b/games/cribbage/extern.c
index b0d51f56fbc..bf820c62d0f 100644
--- a/games/cribbage/extern.c
+++ b/games/cribbage/extern.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: extern.c,v 1.5 2003/06/03 03:01:39 millert Exp $ */
+/* $OpenBSD: extern.c,v 1.6 2004/01/16 00:13:18 espie Exp $ */
/* $NetBSD: extern.c,v 1.3 1995/03/21 15:08:50 cgd Exp $ */
/*-
@@ -49,7 +49,7 @@ bool muggins = FALSE; /* player mistakes exploited */
bool quiet = FALSE; /* if suppress random mess */
bool rflag = FALSE; /* if all cuts random */
-char expl[128]; /* explanation */
+char expl_string[128]; /* explanation */
int cgames = 0; /* number games comp won */
int cscore = 0; /* comp score in this game */
diff --git a/games/cribbage/score.c b/games/cribbage/score.c
index a63e48afe08..cb10f19533b 100644
--- a/games/cribbage/score.c
+++ b/games/cribbage/score.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: score.c,v 1.6 2003/06/03 03:01:39 millert Exp $ */
+/* $OpenBSD: score.c,v 1.7 2004/01/16 00:13:18 espie Exp $ */
/* $NetBSD: score.c,v 1.3 1995/03/21 15:08:57 cgd Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: score.c,v 1.6 2003/06/03 03:01:39 millert Exp $";
+static char rcsid[] = "$OpenBSD: score.c,v 1.7 2004/01/16 00:13:18 espie Exp $";
#endif
#endif /* not lint */
@@ -118,7 +118,7 @@ scorehand(hand, starter, n, crb, do_explain)
CARD h[(CINHAND + 1)];
char buf[32];
- expl[0] = '\0'; /* initialize explanation */
+ expl_string[0] = '\0'; /* initialize explanation */
score = 0;
flag = TRUE;
k = hand[0].suit;
@@ -128,29 +128,29 @@ scorehand(hand, starter, n, crb, do_explain)
if (hand[i].suit == starter.suit) {
score++;
if (do_explain)
- strlcat(expl, "His Nobs", sizeof expl);
+ strlcat(expl_string, "His Nobs", sizeof expl_string);
}
h[i] = hand[i];
}
if (flag && n >= CINHAND) {
- if (do_explain && expl[0] != '\0')
- strlcat(expl, ", ", sizeof expl);
+ if (do_explain && expl_string[0] != '\0')
+ strlcat(expl_string, ", ", sizeof expl_string);
if (starter.suit == k) {
score += 5;
if (do_explain)
- strlcat(expl, "Five-flush", sizeof expl);
+ strlcat(expl_string, "Five-flush", sizeof expl_string);
} else
if (!crb) {
score += 4;
- if (do_explain && expl[0] != '\0')
- strlcat(expl, ", Four-flush", sizeof expl);
+ if (do_explain && expl_string[0] != '\0')
+ strlcat(expl_string, ", Four-flush", sizeof expl_string);
else
- strlcpy(expl, "Four-flush", sizeof expl);
+ strlcpy(expl_string, "Four-flush", sizeof expl_string);
}
}
- if (do_explain && expl[0] != '\0')
- strlcat(expl, ", ", sizeof expl);
+ if (do_explain && expl_string[0] != '\0')
+ strlcat(expl_string, ", ", sizeof expl_string);
h[n] = starter;
sorthand(h, n + 1); /* sort by rank */
i = 2 * fifteens(h, n + 1);
@@ -159,9 +159,9 @@ scorehand(hand, starter, n, crb, do_explain)
if (i > 0) {
(void) snprintf(buf, sizeof buf,
"%d points in fifteens", i);
- strlcat(expl, buf, sizeof expl);
+ strlcat(expl_string, buf, sizeof expl_string);
} else
- strlcat(expl, "No fifteens", sizeof expl);
+ strlcat(expl_string, "No fifteens", sizeof expl_string);
}
i = pairuns(h, n + 1);
score += i;
@@ -170,9 +170,9 @@ scorehand(hand, starter, n, crb, do_explain)
(void) snprintf(buf, sizeof buf,
", %d points in pairs, %d in runs",
pairpoints, runpoints);
- strlcat(expl, buf, sizeof expl);
+ strlcat(expl_string, buf, sizeof expl_string);
} else
- strlcat(expl, ", No pairs/runs", sizeof expl);
+ strlcat(expl_string, ", No pairs/runs", sizeof expl_string);
}
return (score);
}
diff --git a/games/cribbage/support.c b/games/cribbage/support.c
index 8b26bfc2d4c..30e977c9365 100644
--- a/games/cribbage/support.c
+++ b/games/cribbage/support.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: support.c,v 1.7 2003/06/03 03:01:39 millert Exp $ */
+/* $OpenBSD: support.c,v 1.8 2004/01/16 00:13:18 espie Exp $ */
/* $NetBSD: support.c,v 1.3 1995/03/21 15:08:59 cgd Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)support.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: support.c,v 1.7 2003/06/03 03:01:39 millert Exp $";
+static char rcsid[] = "$OpenBSD: support.c,v 1.8 2004/01/16 00:13:18 espie Exp $";
#endif
#endif /* not lint */
@@ -154,7 +154,7 @@ plyrhand(hand, s)
}
}
if (explain)
- msg("Explanation: %s", expl);
+ msg("Explanation: %s", expl_string);
do_wait();
} else
win = chkscr(&pscore, i);
diff --git a/games/gomoku/gomoku.h b/games/gomoku/gomoku.h
index 787394dc19a..e5d6b5360e4 100644
--- a/games/gomoku/gomoku.h
+++ b/games/gomoku/gomoku.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: gomoku.h,v 1.8 2003/06/03 03:01:39 millert Exp $ */
+/* $OpenBSD: gomoku.h,v 1.9 2004/01/16 00:13:19 espie Exp $ */
/*
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
@@ -290,7 +290,7 @@ void init_overlap(void);
#ifdef DEBUG
int list_eq(struct combostr **, struct combostr **, int);
#endif
-void log(char *);
+void logit(char *);
int lton(int);
void makecombo(struct combostr *, struct spotstr *, int, int);
void makecombo2(struct combostr *, struct spotstr *, int, int);
diff --git a/games/gomoku/main.c b/games/gomoku/main.c
index c05109c8ca4..4089c14cad8 100644
--- a/games/gomoku/main.c
+++ b/games/gomoku/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.16 2003/06/03 03:01:39 millert Exp $ */
+/* $OpenBSD: main.c,v 1.17 2004/01/16 00:13:19 espie Exp $ */
/*
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
@@ -41,7 +41,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 5/4/95";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.16 2003/06/03 03:01:39 millert Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.17 2004/01/16 00:13:19 espie Exp $";
#endif
#endif /* not lint */
@@ -262,7 +262,7 @@ again:
ask("save file name? ");
(void)getline(fname, sizeof(fname));
if ((fp = fopen(fname, "w")) == NULL) {
- log("cannot create save file");
+ logit("cannot create save file");
goto getinput;
}
for (i = 0; i < movenum - 1; i++)
@@ -273,7 +273,7 @@ again:
}
if (curmove != RESIGN &&
board[curmove].s_occ != EMPTY) {
- /* log("Illegal move"); */
+ /* logit("Illegal move"); */
beep();
goto getinput;
}
@@ -297,7 +297,7 @@ again:
if (interactive) {
snprintf(fmtbuf, sizeof fmtbuf,
fmt[color], movenum, stoc(curmove));
- log(fmtbuf);
+ logit(fmtbuf);
}
if ((i = makemove(color, curmove)) != MOVEOK)
break;
@@ -337,7 +337,7 @@ again:
ask("save file name? ");
(void)getline(buf, sizeof(buf));
if ((fp = fopen(buf, "w")) == NULL) {
- log("cannot create save file");
+ logit("cannot create save file");
goto replay;
}
for (i = 0; i < movenum - 1; i++)
@@ -533,7 +533,7 @@ dlog(str)
}
void
-log(str)
+logit(str)
char *str;
{
diff --git a/games/hunt/huntd/answer.c b/games/hunt/huntd/answer.c
index 61ed07a3b9a..ef959ba0c68 100644
--- a/games/hunt/huntd/answer.c
+++ b/games/hunt/huntd/answer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: answer.c,v 1.9 2003/06/11 08:45:33 pjanzen Exp $ */
+/* $OpenBSD: answer.c,v 1.10 2004/01/16 00:13:19 espie Exp $ */
/* $NetBSD: answer.c,v 1.3 1997/10/10 16:32:50 lukem Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
@@ -74,7 +74,7 @@ answer_first()
socklen = sizeof sockstruct;
newsock = accept(Socket, (struct sockaddr *) &sockstruct, &socklen);
if (newsock < 0) {
- log(LOG_ERR, "accept");
+ logit(LOG_ERR, "accept");
return;
}
@@ -90,7 +90,7 @@ answer_first()
/* Remember this spawning connection: */
sp = (struct spawn *)malloc(sizeof *sp);
if (sp == NULL) {
- log(LOG_ERR, "malloc");
+ logit(LOG_ERR, "malloc");
close(newsock);
return;
}
@@ -271,7 +271,7 @@ answer_next(sp)
error:
if (len < 0)
- log(LOG_WARNING, "read");
+ logit(LOG_WARNING, "read");
else
logx(LOG_WARNING, "lost connection to new client");
@@ -499,7 +499,7 @@ get_ident(sa, salen, uid, name, team)
/* Alloc new entry -- it is released in clear_scores() */
ip = (IDENT *) malloc(sizeof (IDENT));
if (ip == NULL) {
- log(LOG_ERR, "malloc");
+ logit(LOG_ERR, "malloc");
/* Fourth down, time to punt */
ip = &punt;
}
@@ -548,7 +548,7 @@ answer_info(fp)
sa = (struct sockaddr_in *)&sp->source;
bf = inet_ntop(AF_INET, &sa->sin_addr, buf, sizeof buf);
if (!bf) {
- log(LOG_WARNING, "inet_ntop");
+ logit(LOG_WARNING, "inet_ntop");
bf = "?";
}
fprintf(fp, "fd %d: state %d, from %s:%d\n",
diff --git a/games/hunt/huntd/conf.c b/games/hunt/huntd/conf.c
index 20f98854850..84f83c547af 100644
--- a/games/hunt/huntd/conf.c
+++ b/games/hunt/huntd/conf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.c,v 1.5 2001/02/13 11:55:09 pjanzen Exp $ */
+/* $OpenBSD: conf.c,v 1.6 2004/01/16 00:13:19 espie Exp $ */
/* David Leonard <d@openbsd.org>, 1999. Public domain. */
#include <stdio.h>
@@ -309,7 +309,7 @@ config()
fclose(f);
}
else if (errno != ENOENT)
- log(LOG_WARNING, "%s", nm);
+ logit(LOG_WARNING, "%s", nm);
}
}
diff --git a/games/hunt/huntd/driver.c b/games/hunt/huntd/driver.c
index 6f98d6b1350..1a0bdf9601e 100644
--- a/games/hunt/huntd/driver.c
+++ b/games/hunt/huntd/driver.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: driver.c,v 1.15 2003/06/11 08:45:33 pjanzen Exp $ */
+/* $OpenBSD: driver.c,v 1.16 2004/01/16 00:13:19 espie Exp $ */
/* $NetBSD: driver.c,v 1.5 1997/10/20 00:37:16 lukem Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
@@ -144,7 +144,7 @@ again:
nready = select(Num_fds, &read_fds, NULL, NULL,
&timeout);
if (nready < 0 && errno != EINTR) {
- log(LOG_ERR, "select");
+ logit(LOG_ERR, "select");
cleanup(1);
}
} while (nready < 0);
@@ -177,7 +177,7 @@ again:
nready = select(Num_fds, &read_fds, NULL, NULL,
to);
if (nready < 0 && errno != EINTR) {
- log(LOG_ERR, "select");
+ logit(LOG_ERR, "select");
cleanup(1);
}
} while (nready < 0);
@@ -282,7 +282,7 @@ again:
linger.tv_sec = conf_linger;
while ((ret = select(Num_fds, &read_fds, NULL, NULL, &linger)) < 0) {
if (errno != EINTR) {
- log(LOG_WARNING, "select");
+ logit(LOG_WARNING, "select");
break;
}
read_fds = Fds_mask;
@@ -367,17 +367,17 @@ init()
Status = socket(AF_INET, SOCK_STREAM, 0);
if (bind(Status, (struct sockaddr *) &addr, sizeof addr) < 0) {
- log(LOG_ERR, "bind");
+ logit(LOG_ERR, "bind");
cleanup(1);
}
if (listen(Status, 5) == -1) {
- log(LOG_ERR, "listen");
+ logit(LOG_ERR, "listen");
cleanup(1);
}
len = sizeof (struct sockaddr_in);
if (getsockname(Status, (struct sockaddr *) &addr, &len) < 0) {
- log(LOG_ERR, "getsockname");
+ logit(LOG_ERR, "getsockname");
cleanup(1);
}
stat_port = ntohs(addr.sin_port);
@@ -390,17 +390,17 @@ init()
Socket = socket(AF_INET, SOCK_STREAM, 0);
if (bind(Socket, (struct sockaddr *) &addr, sizeof addr) < 0) {
- log(LOG_ERR, "bind");
+ logit(LOG_ERR, "bind");
cleanup(1);
}
if (listen(Socket, 5) == -1) {
- log(LOG_ERR, "listen");
+ logit(LOG_ERR, "listen");
cleanup(1);
}
len = sizeof (struct sockaddr_in);
if (getsockname(Socket, (struct sockaddr *) &addr, &len) < 0) {
- log(LOG_ERR, "getsockname");
+ logit(LOG_ERR, "getsockname");
cleanup(1);
}
sock_port = ntohs(addr.sin_port);
@@ -442,11 +442,11 @@ init()
/* Permit multiple huntd's on the same port. */
if (setsockopt(Server_socket, SOL_SOCKET, SO_REUSEPORT, &true,
sizeof true) < 0)
- log(LOG_ERR, "setsockopt SO_REUSEADDR");
+ logit(LOG_ERR, "setsockopt SO_REUSEADDR");
if (bind(Server_socket, (struct sockaddr *) &test_port,
sizeof test_port) < 0) {
- log(LOG_ERR, "bind port %d", Server_port);
+ logit(LOG_ERR, "bind port %d", Server_port);
cleanup(1);
}
@@ -947,7 +947,7 @@ check_again:
#endif
return FALSE;
}
- log(LOG_INFO, "read");
+ logit(LOG_INFO, "read");
}
if (ret > 0) {
/* Got some data */
@@ -1033,7 +1033,7 @@ send_stats()
fp = fdopen(s, "w");
if (fp == NULL) {
- log(LOG_ERR, "fdopen");
+ logit(LOG_ERR, "fdopen");
(void) close(s);
return;
}
@@ -1156,7 +1156,7 @@ handle_wkport(fd)
fromlen = sizeof fromaddr;
if (recvfrom(fd, &query, sizeof query, 0, &fromaddr, &fromlen) == -1)
{
- log(LOG_WARNING, "recvfrom");
+ logit(LOG_WARNING, "recvfrom");
return;
}
@@ -1200,12 +1200,12 @@ handle_wkport(fd)
response = sock_port;
break;
default:
- log(LOG_INFO, "unknown udp query %d", query);
+ logit(LOG_INFO, "unknown udp query %d", query);
return;
}
response = ntohs(response);
if (sendto(fd, &response, sizeof response, 0,
&fromaddr, sizeof fromaddr) == -1)
- log(LOG_WARNING, "sendto");
+ logit(LOG_WARNING, "sendto");
}
diff --git a/games/hunt/huntd/execute.c b/games/hunt/huntd/execute.c
index ea1807f7890..c5ad00eba31 100644
--- a/games/hunt/huntd/execute.c
+++ b/games/hunt/huntd/execute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: execute.c,v 1.7 2003/06/11 08:45:33 pjanzen Exp $ */
+/* $OpenBSD: execute.c,v 1.8 2004/01/16 00:13:19 espie Exp $ */
/* $NetBSD: execute.c,v 1.2 1997/10/10 16:33:13 lukem Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
@@ -518,7 +518,7 @@ create_shot(type, y, x, face, charge, size, owner, score, expl, over)
bp = (BULLET *) malloc(sizeof (BULLET)); /* NOSTRICT */
if (bp == NULL) {
- log(LOG_ERR, "malloc");
+ logit(LOG_ERR, "malloc");
if (owner != NULL)
message(owner, "Out of memory");
return NULL;
diff --git a/games/hunt/huntd/expl.c b/games/hunt/huntd/expl.c
index f46cf170e6c..cb8890d9799 100644
--- a/games/hunt/huntd/expl.c
+++ b/games/hunt/huntd/expl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expl.c,v 1.7 2003/06/11 08:45:33 pjanzen Exp $ */
+/* $OpenBSD: expl.c,v 1.8 2004/01/16 00:13:19 espie Exp $ */
/* $NetBSD: expl.c,v 1.2 1997/10/10 16:33:18 lukem Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
@@ -60,7 +60,7 @@ showexpl(y, x, type)
return;
ep = (EXPL *) malloc(sizeof (EXPL)); /* NOSTRICT */
if (ep == NULL) {
- log(LOG_ERR, "malloc");
+ logit(LOG_ERR, "malloc");
return;
}
ep->e_y = y;
@@ -156,7 +156,7 @@ init_removed()
{
rem_index = removed = malloc(conf_maxremove * sizeof(REGEN));
if (rem_index == NULL) {
- log(LOG_ERR, "malloc");
+ logit(LOG_ERR, "malloc");
cleanup(1);
}
}
diff --git a/games/hunt/huntd/server.h b/games/hunt/huntd/server.h
index e70bce43144..001e01fa4d6 100644
--- a/games/hunt/huntd/server.h
+++ b/games/hunt/huntd/server.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.h,v 1.8 2003/06/11 08:45:33 pjanzen Exp $ */
+/* $OpenBSD: server.h,v 1.9 2004/01/16 00:13:19 espie Exp $ */
/* $NetBSD: hunt.h,v 1.5 1998/09/13 15:27:28 hubertf Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
@@ -268,7 +268,7 @@ void clrscr(PLAYER *);
void ce(PLAYER *);
void sendcom(PLAYER *, int, ...);
void flush(PLAYER *);
-void log(int, const char *, ...)
+void logit(int, const char *, ...)
__attribute__((format (printf, 2, 3)));
void logx(int, const char *, ...)
__attribute__((format (printf, 2, 3)));
diff --git a/games/hunt/huntd/shots.c b/games/hunt/huntd/shots.c
index 14f3e170829..03ffa8991e6 100644
--- a/games/hunt/huntd/shots.c
+++ b/games/hunt/huntd/shots.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: shots.c,v 1.7 2003/06/11 08:45:33 pjanzen Exp $ */
+/* $OpenBSD: shots.c,v 1.8 2004/01/16 00:13:19 espie Exp $ */
/* $NetBSD: shots.c,v 1.3 1997/10/11 08:13:50 lukem Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
@@ -877,7 +877,7 @@ chkslime(bp, next)
/* Duplicate the unit of slime: */
nbp = (BULLET *) malloc(sizeof (BULLET));
if (nbp == NULL) {
- log(LOG_ERR, "malloc");
+ logit(LOG_ERR, "malloc");
return;
}
*nbp = *bp;
diff --git a/games/hunt/huntd/terminal.c b/games/hunt/huntd/terminal.c
index fccd219e36d..1dc69b807ea 100644
--- a/games/hunt/huntd/terminal.c
+++ b/games/hunt/huntd/terminal.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: terminal.c,v 1.7 2003/12/28 01:09:49 espie Exp $ */
+/* $OpenBSD: terminal.c,v 1.8 2004/01/16 00:13:19 espie Exp $ */
/* $NetBSD: terminal.c,v 1.2 1997/10/10 16:34:05 lukem Exp $ */
/*
* Copyright (c) 1983-2003, Regents of the University of California.
@@ -251,7 +251,7 @@ logx(prio, fmt)
}
void
-log(prio, fmt)
+logit(prio, fmt)
int prio;
const char *fmt;
{