From: Alan Cox Date: Thu, 23 Jun 2016 16:48:05 +0000 (+0100) Subject: ld09: update so it builds on pure ANSI compilers X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e458330a758293b63145b2f7a81428e685eaf311;p=FUZIX.git ld09: update so it builds on pure ANSI compilers --- diff --git a/Applications/ld09/io.c b/Applications/ld09/io.c index 542ab63b..7c092d30 100644 --- a/Applications/ld09/io.c +++ b/Applications/ld09/io.c @@ -35,7 +35,7 @@ PRIVATE char *outbuftop; /* output buffer top */ PRIVATE int outfd; /* output file descriptor */ PRIVATE mode_t outputperms; /* permissions of output file */ PRIVATE char *outputname; /* name of output file */ -PRIVATE char *refname; /* name of program for error reference */ +PRIVATE const char *refname; /* name of program for error reference */ #ifdef REL_OUTPUT PRIVATE char *trelbuf; /* extra output buffer for text relocations */ PRIVATE char *trelbufptr; /* text relocation output buffer ptr */ @@ -56,12 +56,11 @@ FORWARD void flushtrel P((void)); FORWARD void outhexdigs P((bin_off_t num)); FORWARD void outputerror P((char *message)); FORWARD void put04x P((unsigned num)); -FORWARD void putstrn P((char *message)); +FORWARD void putstrn P((const char *message)); FORWARD void refer P((void)); FORWARD void stderr_out P((void)); -PUBLIC void ioinit(progname) -char *progname; +PUBLIC void ioinit(char *progname) { infd = ERR; if (*progname) @@ -89,7 +88,7 @@ char *progname; #endif } -PUBLIC void closein() +PUBLIC void closein(void) { if (infd != ERR && close(infd) < 0) inputerror("cannot close"); @@ -117,16 +116,14 @@ PUBLIC void closeout() #endif } -PUBLIC void errtrace(name, level) -char *name; -int level; +PUBLIC void errtrace(char *name, int level) { while (level-- > 0) putbyte(' '); putstrn(name); } -PUBLIC void executable() +PUBLIC void executable(void) { if (errcount) unlink(outputname); @@ -136,14 +133,14 @@ PUBLIC void executable() #endif } -PUBLIC void flusherr() +PUBLIC void flusherr(void) { if( errbufptr != errbuf ) write(errfil, errbuf, (unsigned) (errbufptr - errbuf)); errbufptr = errbuf; } -PRIVATE void stderr_out() +PRIVATE void stderr_out(void) { if( errfil != STDERR_FILENO ) { @@ -152,7 +149,7 @@ PRIVATE void stderr_out() } } -PRIVATE void flushout() +PRIVATE void flushout(void) { unsigned nbytes; @@ -163,7 +160,7 @@ PRIVATE void flushout() } #ifdef REL_OUTPUT -PRIVATE void flushtrel() +PRIVATE void flushtrel(void) { unsigned nbytes; @@ -174,8 +171,7 @@ PRIVATE void flushtrel() } #endif -PUBLIC void openin(filename) -char *filename; +PUBLIC void openin(char *filename) { #if 0 /* XXX - this probably won't work with constructed lib names? */ if (infd == ERR || strcmp(inputname, filename) != 0) @@ -193,8 +189,7 @@ char *filename; } } -PUBLIC void openout(filename) -char *filename; +PUBLIC void openout(char *filename) { mode_t oldmask; @@ -228,8 +223,7 @@ char *filename; #endif } -PRIVATE void outhexdigs(num) -register bin_off_t num; +PRIVATE void outhexdigs(bin_off_t num) { if (num >= 0x10) { @@ -239,8 +233,7 @@ register bin_off_t num; putbyte(hexdigit[num]); } -PRIVATE void put04x(num) -register unsigned num; +PRIVATE void put04x(unsigned num) { putbyte(hexdigit[num / 0x1000]); putbyte(hexdigit[(num / 0x100) & 0x0F]); @@ -250,8 +243,7 @@ register unsigned num; #ifdef LONG_OFFSETS -PUBLIC void put08lx(num) -register bin_off_t num; +PUBLIC void put08lx(bin_off_t num) { put04x(num / 0x10000); put04x(num % 0x10000); @@ -259,8 +251,7 @@ register bin_off_t num; #else /* not LONG_OFFSETS */ -PUBLIC void put08x(num) -register bin_off_t num; +PUBLIC void put08x(bin_off_t num) { putstr("0000"); put04x(num); @@ -268,9 +259,7 @@ register bin_off_t num; #endif /* not LONG_OFFSETS */ -PUBLIC void putbstr(width, str) -unsigned width; -char *str; +PUBLIC void putbstr(unsigned width, char *str) { unsigned length; @@ -279,8 +268,7 @@ char *str; putstr(str); } -PUBLIC void putbyte(ch) -int ch; +PUBLIC void putbyte(int ch) { register char *ebuf; @@ -294,22 +282,20 @@ int ch; errbufptr = ebuf; } -PUBLIC void putstr(message) -char *message; +PUBLIC void putstr(const char *message) { while (*message != 0) putbyte(*message++); } -PRIVATE void putstrn(message) -char *message; +PRIVATE void putstrn(char *message) { putstr(message); putbyte('\n'); flusherr(); errfil = STDOUT_FILENO; } -PUBLIC int readchar() +PUBLIC int readchar(void) { int ch; @@ -333,9 +319,7 @@ PUBLIC int readchar() return ch; } -PUBLIC void readin(buf, count) -char *buf; -unsigned count; +PUBLIC void readin(char *buf, unsigned count) { int ch; @@ -347,9 +331,7 @@ unsigned count; } } -PUBLIC bool_pt readineofok(buf, count) -char *buf; -unsigned count; +PUBLIC bool_pt readineofok(char *buf, unsigned count) { int ch; @@ -362,16 +344,14 @@ unsigned count; return FALSE; } -PUBLIC void seekin(offset) -unsigned long offset; +PUBLIC void seekin(unsigned long offset) { inbufptr = inbufend = inbuf; if (lseek(infd, (off_t) offset, SEEK_SET) != offset) prematureeof(); } -PUBLIC void seekout(offset) -unsigned long offset; +PUBLIC void seekout(unsigned long offset) { flushout(); if (lseek(outfd, (off_t) offset, SEEK_SET) != offset) @@ -379,8 +359,7 @@ unsigned long offset; } #ifdef REL_OUTPUT -PUBLIC void seektrel(offset) -unsigned long offset; +PUBLIC void seektrel(unsigned long offset) { flushtrel(); if (lseek(trelfd, (off_t) offset, SEEK_SET) != offset) @@ -388,8 +367,7 @@ unsigned long offset; } #endif -PUBLIC void writechar(ch) -int ch; +PUBLIC void writechar(int ch) { register char *obuf; @@ -404,9 +382,7 @@ int ch; } #ifdef REL_OUTPUT -PUBLIC void writedrel(buf, count) -register char *buf; -unsigned count; +PUBLIC void writedrel(char *buf, unsigned count) { register char *rbuf; @@ -421,9 +397,7 @@ unsigned count; } #endif -PUBLIC void writeout(buf, count) -register char *buf; -unsigned count; +PUBLIC void writeout(char *buf, unsigned count) { register char *obuf; @@ -442,9 +416,7 @@ unsigned count; } #ifdef REL_OUTPUT -PUBLIC void writetrel(buf, count) -register char *buf; -unsigned count; +PUBLIC void writetrel(char *buf, unsigned count) { register char *rbuf; @@ -465,22 +437,19 @@ unsigned count; /* error module */ -PRIVATE void errexit(message) -char *message; +PRIVATE void errexit(char *message) { putstrn(message); exit(2); } -PUBLIC void fatalerror(message) -char *message; +PUBLIC void fatalerror(char *message) { refer(); errexit(message); } -PUBLIC void inputerror(message) -char *message; +PUBLIC void inputerror(char *message) { refer(); putstr(message); @@ -488,16 +457,14 @@ char *message; errexit(inputname); } -PUBLIC void input1error(message) -char *message; +PUBLIC void input1error(char *message) { refer(); putstr(inputname); errexit(message); } -PRIVATE void outputerror(message) -char *message; +PRIVATE void outputerror(char *message) { refer(); putstr(message); @@ -505,22 +472,18 @@ char *message; errexit(outputname); } -PUBLIC void outofmemory() +PUBLIC void outofmemory(void) { inputerror("out of memory while processing"); } -PUBLIC void prematureeof() +PUBLIC void prematureeof(void) { inputerror("premature end of"); } -PUBLIC void redefined(name, message, archentry, deffilename, defarchentry) -char *name; -char *message; -char *archentry; -char *deffilename; -char *defarchentry; +PUBLIC void redefined(char *name, char *message, char *archentry, + char *deffilename, char *defarchentry) { ++warncount; refer(); @@ -547,8 +510,7 @@ char *defarchentry; putstrn(""); } -PUBLIC void interseg(fname, aname, name) -char *fname, *aname, *name; +PUBLIC void interseg(char *fname, char *aname, char *name) { ++errcount; refer(); @@ -567,15 +529,14 @@ char *fname, *aname, *name; putstrn(""); } -PRIVATE void refer() +PRIVATE void refer(void) { stderr_out(); putstr(refname); putstr(": "); } -PUBLIC void reserved(name) -char *name; +PUBLIC void reserved(char *name) { ++errcount; stderr_out(); @@ -583,10 +544,7 @@ char *name; putstrn(name); } -PUBLIC void size_error(seg, count, size) -int seg; -bin_off_t count; -bin_off_t size; +PUBLIC void size_error(int seg, bin_off_t count, bin_off_t size) { refer(); putstr("seg "); @@ -598,8 +556,7 @@ bin_off_t size; errexit(""); } -PUBLIC void undefined(name) -char *name; +PUBLIC void undefined(char *name) { ++errcount; stderr_out(); @@ -607,7 +564,7 @@ char *name; putstrn(name); } -PUBLIC void usage() +PUBLIC void usage(void) { stderr_out(); putstr("usage: "); @@ -623,7 +580,7 @@ PUBLIC void usage() #endif } -PUBLIC void version_msg() +PUBLIC void version_msg(void) { stderr_out(); #ifdef VERSION @@ -634,8 +591,7 @@ PUBLIC void version_msg() #endif } -PUBLIC void use_error(message) -char *message; +PUBLIC void use_error(char *message) { refer(); putstrn(message); diff --git a/Applications/ld09/ld.c b/Applications/ld09/ld.c index 3a472681..61c970df 100644 --- a/Applications/ld09/ld.c +++ b/Applications/ld09/ld.c @@ -39,10 +39,7 @@ PRIVATE int lastlib = NR_STDLIBS; FORWARD char *buildname P((char *pre, char *mid, char *suf)); FORWARD char *expandlib P((char *fn)); -PRIVATE char *buildname(pre, mid, suf) -char *pre; -char *mid; -char *suf; +PRIVATE char *buildname(char *pre, char *mid, char *suf) { char *name; @@ -53,8 +50,7 @@ char *suf; return name; } -PRIVATE char *expandlib(fn) -char *fn; +PRIVATE char *expandlib(char *fn) { char *path, *s; int i; @@ -73,9 +69,7 @@ char *fn; return NUL_PTR; } -PUBLIC int main(argc, argv) -int argc; -char **argv; +PUBLIC int main(int argc, char **argv) { register char *arg; int argn; diff --git a/Applications/ld09/linksyms.c b/Applications/ld09/linksyms.c index 9c1a61f5..1444c594 100644 --- a/Applications/ld09/linksyms.c +++ b/Applications/ld09/linksyms.c @@ -15,8 +15,7 @@ PUBLIC bool_t reloc_output = 0; /* link all symbols connected to entry symbols */ -PUBLIC void linksyms(argreloc_output) -bool_pt argreloc_output; +PUBLIC void linksyms(bool_pt argreloc_output) { char needlink; struct entrylist *elptr; @@ -70,8 +69,7 @@ bool_pt argreloc_output; while (needlink); } -PRIVATE void linkrefs(modptr) -struct modstruct *modptr; +PRIVATE void linkrefs(struct modstruct *modptr) { register struct symstruct **symparray; register struct symstruct *symptr; diff --git a/Applications/ld09/objchop.c b/Applications/ld09/objchop.c index c7631c1e..23b96aae 100644 --- a/Applications/ld09/objchop.c +++ b/Applications/ld09/objchop.c @@ -8,7 +8,7 @@ #ifndef __OUT_OK -main() +int main(int argc, char *argv[]) { fprintf(stderr, "Compile error: struct exec invalid\n"); exit(1); @@ -19,9 +19,36 @@ main() FILE * ifd; struct exec header; -main(argc, argv) -int argc; -char ** argv; +void fatal(const char * str) +{ + fprintf(stderr, "objchop: %s\n", str); + exit(2); +} + +int write_file(char *fname, long bsize) +{ + char buffer[1024]; + int ssize; + FILE * ofd; + + ofd = fopen(fname, "w"); + if( ofd == 0 ) fatal("Cannot open output file"); + + while(bsize>0) + { + if( bsize > sizeof(buffer) ) ssize = sizeof(buffer); + else ssize = bsize; + + if( (ssize=fread(buffer, 1, ssize, ifd)) <= 0 ) + fatal("Error reading segment from executable"); + if( fwrite(buffer, 1, ssize, ofd) != ssize ) + fatal("Error writing output file"); + bsize -= ssize; + } + fclose(ofd); +} + +int main(int argc, char **argv) { FILE * ofd; if( argc != 5 ) fatal("Usage: objchop a.out text.bin data.bin sizes.asm"); @@ -56,36 +83,4 @@ char ** argv; exit(0); } -write_file(fname, bsize) -char * fname; -long bsize; -{ - char buffer[1024]; - int ssize; - FILE * ofd; - - ofd = fopen(fname, "w"); - if( ofd == 0 ) fatal("Cannot open output file"); - - while(bsize>0) - { - if( bsize > sizeof(buffer) ) ssize = sizeof(buffer); - else ssize = bsize; - - if( (ssize=fread(buffer, 1, ssize, ifd)) <= 0 ) - fatal("Error reading segment from executable"); - if( fwrite(buffer, 1, ssize, ofd) != ssize ) - fatal("Error writing output file"); - bsize -= ssize; - } - fclose(ofd); -} - -fatal(str) -char * str; -{ - fprintf(stderr, "objchop: %s\n", str); - exit(2); -} - #endif diff --git a/Applications/ld09/readobj.c b/Applications/ld09/readobj.c index 6cc9a847..79884824 100644 --- a/Applications/ld09/readobj.c +++ b/Applications/ld09/readobj.c @@ -40,7 +40,7 @@ FORWARD unsigned segbits P((unsigned seg, char *sizedesc)); /* initialise object file handler */ -PUBLIC void objinit() +PUBLIC void objinit(void) { modfirst = modlast = NUL_PTR; entryfirst = entrylast = NUL_PTR; @@ -49,9 +49,7 @@ PUBLIC void objinit() /* read all symbol definitions in an object file */ -PUBLIC void readsyms(filename, trace) -char *filename; -bool_pt trace; +PUBLIC void readsyms(char *filename, bool_pt trace) { char *archentry; long filelength; @@ -102,8 +100,7 @@ bool_pt trace; /* read archive header and return length */ -PRIVATE long readarheader(parchentry) -char **parchentry; +PRIVATE long readarheader(char **parchentry) { struct ar_hdr arheader; char *endptr; @@ -122,7 +119,7 @@ char **parchentry; /* read and check file header of the object file just opened */ -PRIVATE unsigned readfileheader() +PRIVATE unsigned readfileheader(void) { struct { @@ -141,9 +138,7 @@ PRIVATE unsigned readfileheader() /* read the next module */ -PRIVATE void readmodule(filename, archentry) -char *filename; -char *archentry; +PRIVATE void readmodule(char *filename, char *archentry) { struct symdstruct /* to save parts of symbol before name known */ { @@ -224,8 +219,7 @@ char *archentry; /* put symbol on entry symbol list if it is not already */ -PUBLIC void entrysym(symptr) -struct symstruct *symptr; +PUBLIC void entrysym(struct symstruct *symptr) { register struct entrylist *elptr; @@ -244,7 +238,7 @@ struct symstruct *symptr; /* read the header of the next module */ -PRIVATE void reedmodheader() +PRIVATE void reedmodheader(void) { struct { @@ -287,9 +281,7 @@ PRIVATE void reedmodheader() modlast = modptr; } -PRIVATE bool_pt redsym(symptr, value) -register struct symstruct *symptr; -bin_off_t value; +PRIVATE bool_pt redsym(struct symstruct *symptr, bin_off_t value) { register struct redlist *rlptr; char class; @@ -329,9 +321,7 @@ bin_off_t value; return TRUE; } -PRIVATE unsigned checksum(string, length) -char *string; -unsigned length; +PRIVATE unsigned checksum(char *string, unsigned length) { unsigned char sum; /* this is a 1-byte checksum */ @@ -340,14 +330,12 @@ unsigned length; return sum; } -PUBLIC bin_off_t readconvsize(countindex) -unsigned countindex; +PUBLIC bin_off_t readconvsize(unsigned countindex) { return readsize(convertsize[countindex]); } -PUBLIC bin_off_t readsize(count) -unsigned count; +PUBLIC bin_off_t readsize(unsigned count) { char buf[MAX_OFFSET_SIZE]; @@ -357,17 +345,13 @@ unsigned count; return cntooffset(buf, count); } -PRIVATE unsigned segbits(seg, sizedesc) -unsigned seg; -char *sizedesc; +PRIVATE unsigned segbits(unsigned seg, char *sizedesc) { return 3 & ((unsigned) sizedesc[((NSEG - 1) - seg) / 4] >> (2 * (seg % 4))); /* unsigned to give logical shift */ } -PUBLIC unsigned segsizecount(seg, modptr) -unsigned seg; -struct modstruct *modptr; +PUBLIC unsigned segsizecount(unsigned seg, struct modstruct *modptr) { return convertsize[segbits(seg, modptr->segsizedesc)]; } diff --git a/Applications/ld09/table.c b/Applications/ld09/table.c index f960da05..1ddb7163 100644 --- a/Applications/ld09/table.c +++ b/Applications/ld09/table.c @@ -24,7 +24,7 @@ FORWARD void check_used P((void)); /* initialise symbol table */ -PUBLIC void syminit() +PUBLIC void syminit(void) { unsigned i; @@ -45,8 +45,7 @@ PUBLIC void syminit() /* add named symbol to end of table - initialise only name and next fields */ /* caller must not duplicate names of externals for findsym() to work */ -PUBLIC struct symstruct *addsym(name) -char *name; +PUBLIC struct symstruct *addsym(char *name) { struct symstruct **hashptr; struct symstruct *oldsymptr = 0; @@ -76,8 +75,7 @@ char *name; /* lookup named symbol */ -PUBLIC struct symstruct *findsym(name) -char *name; +PUBLIC struct symstruct *findsym(char *name) { struct symstruct *symptr; @@ -90,8 +88,7 @@ char *name; /* convert name to a hash table ptr */ -PRIVATE struct symstruct **gethashptr(name) -register char *name; +PRIVATE struct symstruct **gethashptr(char *name) { register unsigned hashval; @@ -131,8 +128,7 @@ HASHVAL.EXIT /* move symbol descriptor entries to top of table (no error checking) */ -PUBLIC char *moveup(nbytes) -unsigned nbytes; +PUBLIC char *moveup(unsigned nbytes) { register char *source; register char *target; @@ -150,8 +146,7 @@ unsigned nbytes; /* our version of malloc */ -PUBLIC char *ourmalloc(nbytes) -unsigned nbytes; +PUBLIC char *ourmalloc(unsigned nbytes) { char *allocptr; @@ -164,8 +159,7 @@ unsigned nbytes; /* our version of free (release from bottom of table) */ -PUBLIC void ourfree(cptr) -char *cptr; +PUBLIC void ourfree(char *cptr) { check_used(); tableptr = cptr; @@ -174,7 +168,7 @@ char *cptr; /* read string from file into table at offset suitable for next symbol */ -PUBLIC char *readstring() +PUBLIC char *readstring(void) { int c; char *s; @@ -197,8 +191,7 @@ PUBLIC char *readstring() /* release from top of table */ -PUBLIC void release(cptr) -char *cptr; +PUBLIC void release(char *cptr) { check_used(); mainavail += cptr - tableend; @@ -207,7 +200,7 @@ char *cptr; tableend = cptr; } -PRIVATE void check_used() +PRIVATE void check_used(void) { int used; @@ -215,7 +208,7 @@ PRIVATE void check_used() if (used > maxused) maxused = used; } -PUBLIC int memory_used() +PUBLIC int memory_used(void) { check_used(); return maxused; @@ -223,8 +216,7 @@ PUBLIC int memory_used() /* allocate space for string */ -PUBLIC char *stralloc(s) -char *s; +PUBLIC char *stralloc(char *s) { return strcpy(ourmalloc((unsigned) strlen(s) + 1), s); } diff --git a/Applications/ld09/typeconv.c b/Applications/ld09/typeconv.c index d8c0c89c..6387b4af 100644 --- a/Applications/ld09/typeconv.c +++ b/Applications/ld09/typeconv.c @@ -10,17 +10,17 @@ #include "type.h" #include "globvar.h" -void xxerr P((char *)); -void xxerr(x) char * x; { write(2, x, strlen(x)); } +void xxerr(char *x) +{ + write(2, x, strlen(x)); +} static int no_swap = 1; static int long_off[4] = {0,1,2,3}; static int int_off[2] = {0,1}; -PUBLIC bool_pt typeconv_init(big_endian, long_big_endian) -bool_pt big_endian; -bool_pt long_big_endian; +PUBLIC bool_pt typeconv_init(bool_pt big_endian, bool_pt long_big_endian) { int i; no_swap = (!big_endian && !long_big_endian); @@ -43,9 +43,7 @@ bool_pt long_big_endian; return 1; } -PUBLIC void u2c2(buf, offset) -char *buf; -u2_pt offset; +PUBLIC void u2c2(char *buf, u2_pt offset) { #ifdef __AS386_16__ if( no_swap ) @@ -58,9 +56,7 @@ u2_pt offset; buf[int_off[1]] = (offset>>8); } -PUBLIC void u4c4(buf, offset) -char *buf; -u4_t offset; +PUBLIC void u4c4(char *buf, u4_t offset) { int i; #ifdef __AS386_16__ @@ -77,10 +73,7 @@ u4_t offset; } } -PUBLIC void u4cn(buf, offset, count) -char *buf; -u4_t offset; -unsigned count; +PUBLIC void u4cn(char *buf, u4_t offset, unsigned count) { switch(count) { @@ -99,10 +92,7 @@ unsigned count; } } -PUBLIC void u2cn(buf, offset, count) -char *buf; -u2_pt offset; -unsigned count; +PUBLIC void u2cn(char *buf, u2_pt offset, unsigned count) { switch(count) { @@ -121,8 +111,7 @@ unsigned count; } } -PUBLIC u2_pt c2u2(buf) -char *buf; +PUBLIC u2_pt c2u2(char *buf) { u2_pt res; #ifdef __AS386_16__ @@ -134,8 +123,7 @@ char *buf; return res; } -PUBLIC u4_t c4u4(buf) -char *buf; +PUBLIC u4_t c4u4(char *buf) { u4_t res; int i; @@ -150,9 +138,7 @@ char *buf; return res; } -PUBLIC u4_t cnu4(buf, count) -char *buf; -unsigned count; +PUBLIC u4_t cnu4(char *buf, unsigned count) { switch (count) { @@ -170,9 +156,7 @@ unsigned count; } } -PUBLIC u2_pt cnu2(buf, count) -char *buf; -unsigned count; +PUBLIC u2_pt cnu2(char *buf, unsigned count) { switch (count) { diff --git a/Applications/ld09/writebin.c b/Applications/ld09/writebin.c index 85350689..2b216711 100644 --- a/Applications/ld09/writebin.c +++ b/Applications/ld09/writebin.c @@ -121,12 +121,8 @@ FORWARD void writenulls P((bin_off_t count)); #define FUNCNAME writebin #endif -PUBLIC void FUNCNAME(outfilename, argsepid, argbits32, argstripflag, arguzp) -char *outfilename; -bool_pt argsepid; -bool_pt argbits32; -bool_pt argstripflag; -bool_pt arguzp; +PUBLIC void FUNCNAME(char *outfilename, bool_pt argsepid, bool_pt argbits32, + bool_pt argstripflag, bool_pt arguzp) { char buf4[4]; #ifdef EDOS @@ -585,8 +581,7 @@ bool_pt arguzp; #ifdef EDOS -PRIVATE unsigned binheaderlength(commandname) -char *commandname; +PRIVATE unsigned binheaderlength(char *commandname) { unsigned count; char *name; @@ -611,9 +606,7 @@ char *commandname; /* the special name _main is converted to the command name first */ /* copy upper case and numerals, convert lower case to upper, ignore rest */ -PRIVATE char *idconvert(elptr, commandname) -struct entrylist *elptr; -char *commandname; +PRIVATE char *idconvert(struct entrylist *elptr, char *commandname) { char *name; char *newname; @@ -644,8 +637,7 @@ char *commandname; #endif /* EDOS */ -PRIVATE void linkmod(modptr) -struct modstruct *modptr; +PRIVATE void linkmod(struct modstruct *modptr) { char buf[ABS_TEXT_MAX]; int command; @@ -820,8 +812,7 @@ struct modstruct *modptr; } } -PRIVATE void padmod(modptr) -struct modstruct *modptr; +PRIVATE void padmod(struct modstruct *modptr) { bin_off_t count; fastin_t seg; @@ -849,9 +840,7 @@ struct modstruct *modptr; } } -PRIVATE void setsym(name, value) -char *name; -bin_off_t value; +PRIVATE void setsym(char *name, bin_off_t value) { struct symstruct *symptr; @@ -862,8 +851,7 @@ bin_off_t value; symptr->value = value; } -PRIVATE void symres(name) -register char *name; +PRIVATE void symres(char *name) { register struct symstruct *symptr; @@ -882,8 +870,7 @@ register char *name; /* set new segment */ -PRIVATE void setseg(newseg) -fastin_pt newseg; +PRIVATE void setseg(fastin_pt newseg) { if (newseg != curseg) { @@ -894,16 +881,14 @@ fastin_pt newseg; } } -PRIVATE void skip(countsize) -unsigned countsize; +PRIVATE void skip(unsigned countsize) { writenulls((bin_off_t) readsize(countsize)); } #ifdef EDOS -PRIVATE void writeheader(commandname) -char *commandname; +PRIVATE void writeheader(char *commandname) { char buf[MAX_OFFSET_SIZE]; bin_off_t offset; @@ -952,7 +937,7 @@ char *commandname; #ifdef MINIX -PRIVATE void writeheader() +PRIVATE void writeheader(void) { struct exec header; @@ -1035,8 +1020,7 @@ PRIVATE void writeheader() #endif /* MINIX */ -PRIVATE void writenulls(count) -bin_off_t count; +PRIVATE void writenulls(bin_off_t count) { long lcount = count; if( lcount < 0 ) @@ -1051,12 +1035,8 @@ bin_off_t count; #define FUNCNAME writebin #endif -PUBLIC void FUNCNAME(outfilename, argsepid, argbits32, argstripflag, arguzp) -char *outfilename; -bool_pt argsepid; -bool_pt argbits32; -bool_pt argstripflag; -bool_pt arguzp; +PUBLIC void FUNCNAME(char *outfilename, bool_pt argsepid, bool_pt argbits32, + bool_pt argstripflag, bool_pt arguzp) { char * s = "WARNING: Native a.out generation not included, sorry\n"; write(2, s, strlen(s));