switch source tree from k&r to c99

This commit is contained in:
nhmall
2021-01-26 21:06:16 -05:00
parent a2a9cb7b4f
commit f963c5aca7
232 changed files with 12099 additions and 17782 deletions
+17 -25
View File
@@ -18,16 +18,16 @@
#endif
#ifdef VMS
extern int FDECL(vms_creat, (const char *, unsigned));
extern int FDECL(vms_open, (const char *, int, unsigned));
extern int vms_creat(const char *, unsigned);
extern int vms_open(const char *, int, unsigned);
#endif /* VMS */
int FDECL(restore_savefile, (char *));
void FDECL(set_levelfile_name, (int));
int FDECL(open_levelfile, (int));
int NDECL(create_savefile);
void FDECL(copy_bytes, (int, int));
static void FDECL(store_formatindicator, (int));
int restore_savefile(char *);
void set_levelfile_name(int);
int open_levelfile(int);
int create_savefile(void);
void copy_bytes(int, int);
static void store_formatindicator(int);
#ifndef WIN_CE
#define Fprintf (void) fprintf
@@ -39,7 +39,7 @@ static void nhce_message(FILE *, const char *, ...);
#define Close (void) close
#if defined(EXEPATH)
char *FDECL(exepath, (char *));
char *exepath(char *);
#endif
#if defined(__BORLANDC__) && !defined(_WIN32)
@@ -50,9 +50,7 @@ extern unsigned _stklen = STKSIZ;
char savename[SAVESIZE]; /* holds relative path of save file from playground */
int
main(argc, argv)
int argc;
char *argv[];
main(int argc, char *argv[])
{
int argno;
const char *dir = (char *) 0;
@@ -141,8 +139,7 @@ char *argv[];
static char lock[256];
void
set_levelfile_name(lev)
int lev;
set_levelfile_name(int lev)
{
char *tf;
@@ -156,8 +153,7 @@ int lev;
}
int
open_levelfile(lev)
int lev;
open_levelfile(int lev)
{
int fd;
@@ -171,7 +167,7 @@ int lev;
}
int
create_savefile()
create_savefile(void)
{
int fd;
@@ -184,8 +180,7 @@ create_savefile()
}
void
copy_bytes(ifd, ofd)
int ifd, ofd;
copy_bytes(int ifd, int ofd)
{
char buf[BUFSIZ];
int nfrom, nto;
@@ -201,8 +196,7 @@ int ifd, ofd;
}
int
restore_savefile(basename)
char *basename;
restore_savefile(char *basename)
{
int gfd, lfd, sfd;
int res = 0, lev, savelev, hpid, pltmpsiz, filecmc;
@@ -390,8 +384,7 @@ char *basename;
}
static void
store_formatindicator(fd)
int fd;
store_formatindicator(int fd)
{
char indicate = 'h'; /* historical */
int cmc = 0;
@@ -413,8 +406,7 @@ int fd;
char exepathbuf[EXEPATHBUFSZ];
char *
exepath(str)
char *str;
exepath(char *str)
{
char *tmp, *tmp2;
int bsize;