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

View file

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