1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

config/util: Change to ANSI function definitions

This commit is contained in:
Peter Howkins 2018-06-28 03:49:38 +01:00
parent bcb6aa9fa9
commit b286be89d0
2 changed files with 32 additions and 76 deletions

View file

@ -107,8 +107,7 @@ quit (
#if NeedVarargsPrototypes #if NeedVarargsPrototypes
int code, char * fmt, ...) int code, char * fmt, ...)
#else #else
code, fmt, a1, a2, a3) int code, char *fmt, int a1, int a2, int a3)
char *fmt;
#endif #endif
{ {
#if NeedVarargsPrototypes #if NeedVarargsPrototypes
@ -124,8 +123,7 @@ quit (
} }
void void
quiterr (code, s) quiterr (int code, char *s)
char *s;
{ {
perror (s); perror (s);
exit (code); exit (code);
@ -158,8 +156,7 @@ msg (
} }
void void
mperror (s) mperror (char *s)
char *s;
{ {
if (curdir) { if (curdir) {
fprintf (stderr, "%s:\n", curdir); fprintf (stderr, "%s:\n", curdir);
@ -169,9 +166,7 @@ mperror (s)
} }
int equivalent(lname, rname) int equivalent(char *lname, char *rname)
char *lname;
char *rname;
{ {
char *s; char *s;
@ -188,11 +183,10 @@ int equivalent(lname, rname)
/* Recursively create symbolic links from the current directory to the "from" /* Recursively create symbolic links from the current directory to the "from"
directory. Assumes that files described by fs and ts are directories. */ directory. Assumes that files described by fs and ts are directories. */
dodir (fn, fs, ts, rel) /* fn, name of "from" directory, either absolute or relative to cwd */
char *fn; /* name of "from" directory, either absolute or /* fs, ts, stats for the "from" directory and cwd */
relative to cwd */ /* rel, if true, prepend "../" to fn before using */
struct stat *fs, *ts; /* stats for the "from" directory and cwd */ int dodir (char *fn, struct stat *fs, struct stat *ts, int rel)
int rel; /* if true, prepend "../" to fn before using */
{ {
DIR *df; DIR *df;
struct dirent *dp; struct dirent *dp;
@ -316,9 +310,8 @@ int rel; /* if true, prepend "../" to fn before using */
} }
main (ac, av) int
int ac; main (int ac, char **av)
char **av;
{ {
char *prog_name = av[0]; char *prog_name = av[0];
char *fn, *tn; char *fn, *tn;

View file

@ -99,9 +99,7 @@ static char* externdefstr;
#define X_MAGIC_STRING "<<<STRING_TABLE_GOES_HERE>>>" #define X_MAGIC_STRING "<<<STRING_TABLE_GOES_HERE>>>"
static void WriteHeaderProlog (f, phile) static void WriteHeaderProlog (FILE* f, File* phile)
FILE* f;
File* phile;
{ {
Table* t; Table* t;
TableEnt* te; TableEnt* te;
@ -122,9 +120,7 @@ static void WriteHeaderProlog (f, phile)
(void) fprintf (f, "%s", "#else\n"); (void) fprintf (f, "%s", "#else\n");
} }
static void IntelABIWriteHeader (f, phile) static void IntelABIWriteHeader (FILE* f ,File* phile)
FILE* f;
File* phile;
{ {
Table* t; Table* t;
TableEnt* te; TableEnt* te;
@ -143,9 +139,7 @@ static void IntelABIWriteHeader (f, phile)
(void) fprintf (f, "#endif /* %s */\n", featurestr); (void) fprintf (f, "#endif /* %s */\n", featurestr);
} }
static void SPARCABIWriteHeader (f, phile) static void SPARCABIWriteHeader (FILE* f, File* phile)
FILE* f;
File* phile;
{ {
Table* t; Table* t;
TableEnt* te; TableEnt* te;
@ -156,9 +150,7 @@ static void SPARCABIWriteHeader (f, phile)
prefixstr, te->left, te->right); prefixstr, te->left, te->right);
} }
static void FunctionWriteHeader (f, phile) static void FunctionWriteHeader (FILE* f, File* phile)
FILE* f;
File* phile;
{ {
Table* t; Table* t;
TableEnt* te; TableEnt* te;
@ -179,9 +171,7 @@ static void FunctionWriteHeader (f, phile)
(void) fprintf (f, "#endif /* %s */\n", featurestr); (void) fprintf (f, "#endif /* %s */\n", featurestr);
} }
static void ArrayperWriteHeader (f, phile) static void ArrayperWriteHeader (FILE* f, File* phile)
FILE* f;
File* phile;
{ {
Table* t; Table* t;
TableEnt* te; TableEnt* te;
@ -199,9 +189,7 @@ static void ArrayperWriteHeader (f, phile)
(void) fprintf (f, "#endif /* %s */\n", featurestr); (void) fprintf (f, "#endif /* %s */\n", featurestr);
} }
static void DefaultWriteHeader (f, phile) static void DefaultWriteHeader (FILE* f, File* phile)
FILE* f;
File* phile;
{ {
Table* t; Table* t;
TableEnt* te; TableEnt* te;
@ -222,9 +210,7 @@ static void DefaultWriteHeader (f, phile)
(void) fprintf (f, "#endif /* %s */\n", featurestr); (void) fprintf (f, "#endif /* %s */\n", featurestr);
} }
static void CopyTmplProlog (tmpl, f) static void CopyTmplProlog (FILE* tmpl, FILE* f)
FILE* tmpl;
FILE* f;
{ {
char buf[1024]; char buf[1024];
static char* magic_string = X_MAGIC_STRING; static char* magic_string = X_MAGIC_STRING;
@ -238,9 +224,7 @@ static void CopyTmplProlog (tmpl, f)
} }
} }
static void CopyTmplEpilog (tmpl, f) static void CopyTmplEpilog (FILE* tmpl, FILE* f)
FILE* tmpl;
FILE* f;
{ {
char buf[1024]; char buf[1024];
@ -251,10 +235,7 @@ static void CopyTmplEpilog (tmpl, f)
static char* abistring[] = { static char* abistring[] = {
"Default", "Array per string", "Intel", "Intel BC", "SPARC", "Function" }; "Default", "Array per string", "Intel", "Intel BC", "SPARC", "Function" };
static void WriteHeader (tagline, phile, abi) static void WriteHeader (char* tagline, File* phile, int abi)
char* tagline;
File* phile;
int abi;
{ {
FILE* f; FILE* f;
char* tmp; char* tmp;
@ -304,10 +285,7 @@ static void WriteHeader (tagline, phile, abi)
(void) fclose (f); (void) fclose (f);
} }
static void WriteSourceLine (te, abi, fudge) static void WriteSourceLine (TableEnt* te, int abi, int fudge)
TableEnt* te;
int abi;
int fudge;
{ {
char* c; char* c;
@ -319,8 +297,7 @@ static void WriteSourceLine (te, abi, fudge)
static char* const_string = "%s %sConst char %s[] = {\n"; static char* const_string = "%s %sConst char %s[] = {\n";
static void IntelABIWriteSource (abi) static void IntelABIWriteSource (int abi)
int abi;
{ {
File* phile; File* phile;
@ -338,8 +315,7 @@ static void IntelABIWriteSource (abi)
} }
} }
static void IntelABIBCWriteSource (abi) static void IntelABIBCWriteSource (int abi)
int abi;
{ {
File* phile; File* phile;
@ -366,8 +342,7 @@ static void IntelABIBCWriteSource (abi)
} }
} }
static void FunctionWriteSource (abi) static void FunctionWriteSource (int abi)
int abi;
{ {
File* phile; File* phile;
@ -389,8 +364,7 @@ static void FunctionWriteSource (abi)
} }
} }
static void ArrayperWriteSource (abi) static void ArrayperWriteSource (int abi)
int abi;
{ {
File* phile; File* phile;
static int done_atom; static int done_atom;
@ -412,8 +386,7 @@ static void ArrayperWriteSource (abi)
} }
} }
static void DefaultWriteSource (abi) static void DefaultWriteSource (int abi)
int abi;
{ {
File* phile; File* phile;
@ -431,9 +404,7 @@ static void DefaultWriteSource (abi)
} }
} }
static void WriteSource(tagline, abi) static void WriteSource(char* tagline, int abi)
char* tagline;
int abi;
{ {
static void (*sourceproc[])() = { static void (*sourceproc[])() = {
DefaultWriteSource, ArrayperWriteSource, DefaultWriteSource, ArrayperWriteSource,
@ -470,8 +441,7 @@ static void WriteSource(tagline, abi)
} }
} }
static void DoLine(buf) static void DoLine(char* buf)
char* buf;
{ {
#define X_NO_TOKEN 0 #define X_NO_TOKEN 0
#define X_FILE_TOKEN 1 #define X_FILE_TOKEN 1
@ -642,8 +612,7 @@ static void DoLine(buf)
} }
} }
static void IntelABIIndexEntries (file) static void IntelABIIndexEntries (File* file)
File* file;
{ {
Table* t; Table* t;
TableEnt* te; TableEnt* te;
@ -656,8 +625,7 @@ static void IntelABIIndexEntries (file)
} }
} }
static void DefaultIndexEntries (file) static void DefaultIndexEntries (File* file)
File* file;
{ {
Table* t; Table* t;
TableEnt* te; TableEnt* te;
@ -671,9 +639,7 @@ static void DefaultIndexEntries (file)
} }
} }
static void IndexEntries (file,abi) static void IndexEntries (File* file, int abi)
File* file;
int abi;
{ {
switch (abi) { switch (abi) {
case X_SPARC_ABI: case X_SPARC_ABI:
@ -688,8 +654,7 @@ static void IndexEntries (file,abi)
} }
} }
static char* DoComment (line) static char* DoComment (char* line)
char* line;
{ {
char* tag; char* tag;
char* eol; char* eol;
@ -707,9 +672,7 @@ static char* DoComment (line)
return ret; return ret;
} }
int main(argc, argv) int main(int argc, char** argv)
int argc;
char** argv;
{ {
int len, i; int len, i;
char* tagline = NULL; char* tagline = NULL;