Skip to content

Commit

Permalink
Remove __P
Browse files Browse the repository at this point in the history
Remove __STDC__ (which means we now use stdarg rather than vararg)
Remove register
Remove main prototype
  • Loading branch information
bsdimp committed Feb 18, 2002
1 parent d533053 commit 24cd0a3
Show file tree
Hide file tree
Showing 35 changed files with 267 additions and 300 deletions.
14 changes: 7 additions & 7 deletions games/arithmetic/arithmetic.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,13 @@ int nright, nwrong;
time_t qtime;
#define NQUESTS 20

static void usage __P((void));
int getrandom __P((int, int, int));
void intr __P((int));
int opnum __P((int));
void penalise __P((int, int, int));
int problem __P((void));
void showstats __P((void));
static void usage(void);
int getrandom(int, int, int);
void intr(int);
int opnum(int);
void penalise(int, int, int);
int problem(void);
void showstats(void);

/*
* Select keys from +-x/ to be asked addition, subtraction, multiplication,
Expand Down
2 changes: 1 addition & 1 deletion games/battlestar/com1.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static const char rcsid[] =

#include "externs.h"

void convert __P((int));
void convert(int);

int
battlestar_move(thataway, token)
Expand Down
2 changes: 1 addition & 1 deletion games/battlestar/com6.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static const char rcsid[] =
#include "externs.h"
#include "pathnames.h"

static void post __P((unsigned int ch));
static void post(unsigned int ch);

int
launch()
Expand Down
102 changes: 51 additions & 51 deletions games/battlestar/externs.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,58 +254,58 @@ int wordtype[NWORD];
int wordcount, wordnumber;


int battlestar_move __P((int, int));
void bury __P((void));
int card __P((const char *, int));
void chime __P((void));
void crash __P((void));
int cypher __P((void));
void die __P((int));
void dig __P((void));
int draw __P((void));
void drink __P((void));
int drive __P((void));
int drop __P((const char *name));
int eat __P((void));
int fight __P((int, int));
int follow __P((void));
char *getcom __P((char *, int, const char *, const char *));
char *getword __P((char *, char *, int));
int give __P((void));
void initialize __P((int));
int jump __P((void));
void kiss __P((void));
int land __P((void));
int launch __P((void));
void light __P((void));
void live __P((void));
void love __P((void));
void murder __P((void));
void news __P((void));
void newway __P((int));
void open_score_file __P((void));
void parse __P((void));
void printobjs __P((void));
int put __P((void));
int puton __P((void));
void ravage __P((void));
const char *rate __P((void));
void restore __P((void));
int ride __P((void));
void save __P((void));
int shoot __P((void));
int take __P((unsigned int from[]));
int battlestar_move(int, int);
void bury(void);
int card(const char *, int);
void chime(void);
void crash(void);
int cypher(void);
void die(int);
void dig(void);
int draw(void);
void drink(void);
int drive(void);
int drop(const char *name);
int eat(void);
int fight(int, int);
int follow(void);
char *getcom(char *, int, const char *, const char *);
char *getword(char *, char *, int);
int give(void);
void initialize(int);
int jump(void);
void kiss(void);
int land(void);
int launch(void);
void light(void);
void live(void);
void love(void);
void murder(void);
void news(void);
void newway (int);
void open_score_file(void);
void parse(void);
void printobjs(void);
int put(void);
int puton(void);
void ravage(void);
const char *rate(void);
void restore(void);
int ride(void);
void save(void);
int shoot(void);
int take(unsigned int from[]);
int takeoff(void);
int throw __P((const char *name));
const char *truedirec __P((int, unsigned int));
int ucard __P((const unsigned int *));
int use __P((void));
int visual __P((void));
int wearit __P((void));
void whichway __P((struct room));
void wordinit __P((void));
void writedes __P((void));
int zzz __P((void));
int throw(const char *name);
const char *truedirec(int, unsigned int);
int ucard(const unsigned int *);
int use(void);
int visual(void);
int wearit(void);
void whichway(struct room);
void wordinit(void);
void writedes(void);
int zzz(void);

/* state of the game */
extern int gclock;
Expand Down
14 changes: 7 additions & 7 deletions games/battlestar/fly.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ int gclock = 120; /* gtime for all the flights in the game */
char cross = 0;
sig_t oldsig;

static void blast __P((void));
static void endfly __P((void));
static void moveenemy __P((int));
static void notarget __P((void));
static void succumb __P((int));
static void screen __P((void));
static void target __P((void));
static void blast(void);
static void endfly(void);
static void moveenemy(int);
static void notarget(void);
static void succumb(int);
static void screen(void);
static void target(void);

void
succumb(sig)
Expand Down
6 changes: 3 additions & 3 deletions games/battlestar/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ static const char rcsid[] =
#include <string.h>
#include "externs.h"

static int checkout __P((const char *));
static void getutmp __P((char *));
static int wizard __P((const char *));
static int checkout(const char *);
static void getutmp(char *);
static int wizard(const char *);

void
initialize(startup)
Expand Down
6 changes: 3 additions & 3 deletions games/battlestar/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ static const char rcsid[] =

#include "externs.h"

static int hash __P((const char *));
static void install __P((struct wlist *));
struct wlist *lookup __P((const char *));
static int hash (const char *);
static void install(struct wlist *);
struct wlist *lookup(const char *);

void
wordinit()
Expand Down
6 changes: 3 additions & 3 deletions games/bs/bs.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ static int salvo, blitz, closepack;

#define PR (void)addstr

static bool checkplace __P((int, ship_t *, int));
static int getcoord __P((int));
int playagain __P((void));
static bool checkplace(int, ship_t *, int);
static int getcoord(int);
int playagain(void);

static void uninitgame(sig)
/* end the game, either normally or due to signal */
Expand Down
3 changes: 1 addition & 2 deletions games/caesar/caesar.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ double stdf[26] = {
2.62, 0.81, 1.88, 0.23, 2.07, 0.06,
};

int main __P((int, char **));
void printit __P((char *));
void printit(char *);

int
main(argc, argv)
Expand Down
106 changes: 55 additions & 51 deletions games/cribbage/cribbage.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
* @(#)cribbage.h 8.1 (Berkeley) 5/31/93
*/

#include <sys/defs.h>

__FBSDID("$FreeBSD$");

extern CARD deck[ CARDS ]; /* a deck */
extern CARD phand[ FULLHAND ]; /* player's hand */
extern CARD chand[ FULLHAND ]; /* computer's hand */
Expand All @@ -59,54 +63,54 @@ extern BOOLEAN playing; /* currently playing game */

extern char expl[]; /* string for explanation */

void addmsg __P((const char *, ...));
int adjust __P((CARD [], CARD));
int anymove __P((CARD [], int, int));
int anysumto __P((CARD [], int, int, int));
void bye __P((void));
int cchose __P((CARD [], int, int));
void cdiscard __P((BOOLEAN));
int chkscr __P((int *, int));
int comphand __P((CARD [], char *));
void cremove __P((CARD, CARD [], int));
int cut __P((BOOLEAN, int));
int deal __P((int));
void discard __P((BOOLEAN));
void do_wait __P((void));
void endmsg __P((void));
int eq __P((CARD, CARD));
int fifteens __P((CARD [], int));
void game __P((void));
void gamescore __P((void));
char *getline __P((void));
int getuchar __P((void));
int incard __P((CARD *));
int infrom __P((CARD [], int, char *));
void instructions __P((void));
int isone __P((CARD, CARD [], int));
void makeboard __P((void));
void makedeck __P((CARD []));
void makeknown __P((CARD [], int));
void msg __P((const char *, ...));
int msgcard __P((CARD, BOOLEAN));
int msgcrd __P((CARD, BOOLEAN, char *, BOOLEAN));
int number __P((int, int, char *));
int numofval __P((CARD [], int, int));
int pairuns __P((CARD [], int));
int peg __P((BOOLEAN));
int pegscore __P((CARD, CARD [], int, int));
int playhand __P((BOOLEAN));
int plyrhand __P((CARD [], char *));
void prcard __P((WINDOW *, int, int, CARD, BOOLEAN));
void prcrib __P((BOOLEAN, BOOLEAN));
void prhand __P((CARD [], int, WINDOW *, BOOLEAN));
void printcard __P((WINDOW *, int, CARD, BOOLEAN));
void prpeg __P((int, int, BOOLEAN));
void prtable __P((int));
int readchar __P((void));
void rint __P((int));
int score __P((BOOLEAN));
int scorehand __P((CARD [], CARD, int, BOOLEAN, BOOLEAN));
void shuffle __P((CARD []));
void sorthand __P((CARD [], int));
void wait_for __P((int));
void addmsg(const char *, ...);
int adjust(CARD [], CARD);
int anymove(CARD [], int, int);
int anysumto(CARD [], int, int, int);
void bye(void);
int cchose(CARD [], int, int);
void cdiscard(BOOLEAN);
int chkscr(int *, int);
int comphand(CARD [], char *);
void cremove(CARD, CARD [], int);
int cut(BOOLEAN, int);
int deal(int);
void discard(BOOLEAN);
void do_wait(void);
void endmsg(void);
int eq(CARD, CARD);
int fifteens(CARD [], int);
void game(void);
void gamescore(void);
char *getline(void);
int getuchar(void);
int incard(CARD *);
int infrom(CARD [], int, char *);
void instructions(void);
int isone(CARD, CARD [], int);
void makeboard(void);
void makedeck(CARD []);
void makeknown(CARD [], int);
void msg(const char *, ...);
int msgcard(CARD, BOOLEAN);
int msgcrd(CARD, BOOLEAN, char *, BOOLEAN);
int number(int, int, char *);
int numofval(CARD [], int, int);
int pairuns(CARD [], int);
int peg(BOOLEAN);
int pegscore(CARD, CARD [], int, int);
int playhand(BOOLEAN);
int plyrhand(CARD [], char *);
void prcard(WINDOW *, int, int, CARD, BOOLEAN);
void prcrib(BOOLEAN, BOOLEAN);
void prhand(CARD [], int, WINDOW *, BOOLEAN);
void printcard(WINDOW *, int, CARD, BOOLEAN);
void prpeg(int, int, BOOLEAN);
void prtable(int);
int readchar(void);
void rint(int);
int score(BOOLEAN);
int scorehand(CARD [], CARD, int, BOOLEAN, BOOLEAN);
void shuffle(CARD []);
void sorthand(CARD [], int);
void wait_for(int);
26 changes: 1 addition & 25 deletions games/cribbage/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,12 @@ static const char rcsid[] =
#include <ctype.h>
#include <curses.h>
#include <signal.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>

#if __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif

#include "deck.h"
#include "cribbage.h"
Expand Down Expand Up @@ -389,21 +385,11 @@ int Mpos = 0;
static int Newpos = 0;

void
#if __STDC__
msg(const char *fmt, ...)
#else
msg(fmt, va_alist)
char *fmt;
va_dcl
#endif
{
va_list ap;

#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
(void)vsprintf(&Msgbuf[Newpos], fmt, ap);
va_end(ap);
endmsg();
Expand All @@ -414,21 +400,11 @@ msg(fmt, va_alist)
* Add things to the current message
*/
void
#if __STDC__
addmsg(const char *fmt, ...)
#else
addmsg(fmt, va_alist)
char *fmt;
va_dcl
#endif
{
va_list ap;

#if __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
(void)vsprintf(&Msgbuf[Newpos], fmt, ap);
va_end(ap);
}
Expand Down
Loading

0 comments on commit 24cd0a3

Please sign in to comment.