diff -Naur a/ar/ar.c b/ar/ar.c --- a/ar/ar.c 2014-03-14 00:33:19.000000000 -0400 +++ b/ar/ar.c 2023-02-10 23:42:30.766631935 -0500 @@ -295,11 +295,7 @@ FILE is the name of the file (for error messages). */ void -mywrite (desc, pbuf, bytes, file) - int desc; - void *pbuf; - int bytes; - char *file; +mywrite (int desc, void *pbuf, int bytes, char *file) { register int val; register char * buf = pbuf; @@ -315,9 +311,7 @@ } int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int i; @@ -513,13 +507,13 @@ } void -scan (function, crflag) +scan ( #ifdef __STDC__ - void (*function) (struct member_desc member, FILE *istream); + void (*function) (struct member_desc member, FILE *istream), #else - void (*function) (); + void (*function) (), #endif - int crflag; + int crflag) { FILE *arcstream = fopen (archive, "r"); @@ -601,9 +595,7 @@ } void -print_descr (member, instream) - struct member_desc member; - FILE * instream; +print_descr (struct member_desc member, FILE * instream) { char *timestring; if (!verbose) @@ -620,8 +612,7 @@ } void -print_modes (modes) - int modes; +print_modes (int modes) { putchar (modes & 0400 ? 'r' : '-'); putchar (modes & 0200 ? 'w' : '-'); @@ -637,9 +628,7 @@ #define BUFSIZE 1024 void -extract_member (member, istream) - struct member_desc member; - FILE *istream; +extract_member (struct member_desc member, FILE *istream) { int ncopied = 0; FILE *ostream; @@ -695,9 +684,7 @@ } void -print_contents (member, istream) - struct member_desc member; - FILE *istream; +print_contents (struct member_desc member, FILE *istream) { int ncopied = 0; @@ -729,8 +716,7 @@ create a new archive. */ struct mapelt * -make_map (nonexistent_ok) - int nonexistent_ok; +make_map (int nonexistent_ok) { struct mapelt mapstart; mapstart.next = 0; @@ -740,9 +726,7 @@ } void -add_to_map (member, istream) - struct member_desc member; - FILE * istream; +add_to_map (struct member_desc member, FILE * istream) { struct mapelt *mapelt = (struct mapelt *) xmalloc (sizeof (struct mapelt)); mapelt->info = member; @@ -755,8 +739,7 @@ /* Return the last element of the specified map. */ struct mapelt * -last_mapelt (map) - struct mapelt *map; +last_mapelt (struct mapelt *map) { struct mapelt *tail = map; while (tail->next) tail = tail->next; @@ -766,8 +749,7 @@ /* Return the element of the specified map which precedes elt. */ struct mapelt * -prev_mapelt (map, elt) - struct mapelt *map, *elt; +prev_mapelt (struct mapelt *map, struct mapelt *elt) { struct mapelt *tail = map; while (tail->next && tail->next != elt) @@ -779,9 +761,7 @@ /* Return the element of the specified map which has the specified name. */ struct mapelt * -find_mapelt_noerror (map, name) - struct mapelt *map; - register char *name; +find_mapelt_noerror (struct mapelt *map, register char *name) { register struct mapelt *tail; unsigned int len; @@ -816,9 +796,7 @@ } struct mapelt * -find_mapelt (map, name) - struct mapelt *map; - char *name; +find_mapelt (struct mapelt *map, char *name) { register struct mapelt *found = find_mapelt_noerror (map, name); if (found == 0) @@ -934,9 +912,7 @@ */ void -write_archive (map, appendflag) - struct mapelt *map; - int appendflag; +write_archive (struct mapelt *map, int appendflag) { char *tempname = make_tempname (archive); int indesc = lock_indesc; @@ -1059,9 +1035,7 @@ } void -header_from_map (header, mapelt) - struct ar_hdr *header; - struct mapelt *mapelt; +header_from_map (struct ar_hdr *header, struct mapelt *mapelt) { unsigned int namelen; char *p; @@ -1116,8 +1090,7 @@ /* gets just the file part of name */ char * -basename (path) - char *path; +basename (char *path) { char *save, *start; for (start = save = path; *path; path++) @@ -1132,11 +1105,7 @@ /* writes to file open on OUTDESC with name OUTNAME. */ void -copy_out_member (mapelt, archive_indesc, outdesc, outname) - struct mapelt *mapelt; - int archive_indesc; - int outdesc; - char *outname; +copy_out_member (struct mapelt *mapelt, int archive_indesc, int outdesc, char *outname) { struct ar_hdr header; int indesc; @@ -1192,9 +1161,7 @@ It is open on OUTDESC and its name is OUTNAME. */ void -touch_symdef_member (outdesc, outname) - int outdesc; - char *outname; +touch_symdef_member (int outdesc, char *outname) { struct stat statbuf; int i; @@ -1215,8 +1182,7 @@ } char * -make_tempname (name) - char *name; +make_tempname (char *name) { #if defined(USG) || defined(SHORT_FILENAME) /* sigh. 14 character filenames are *wonderful*, just *wonderful*. */ @@ -1264,9 +1230,7 @@ } void -delete_from_map (name, map) - char *name; - struct mapelt *map; +delete_from_map (char *name, struct mapelt *map) { struct mapelt *this = find_mapelt (map, name); @@ -1321,9 +1285,7 @@ } int -move_in_map (name, map, after) - char *name; - struct mapelt *map, *after; +move_in_map (char *name, struct mapelt *map, struct mapelt *after) { struct mapelt *this = find_mapelt (map, name); struct mapelt *prev; @@ -1430,9 +1392,7 @@ exist or (optionally) is older. */ int -insert_in_map (name, map, after) - char *name; - struct mapelt *map, *after; +insert_in_map (char *name, struct mapelt *map, struct mapelt *after) { struct mapelt *old = find_mapelt_noerror (map, name); struct mapelt *this; @@ -1474,11 +1434,11 @@ */ void -extract_members (function) +extract_members ( #ifdef __STDC__ - void (*function) (struct member_desc member, FILE *istream); + void (*function) (struct member_desc member, FILE *istream)) #else - void (*function) (); + void (*function) ()) #endif { struct mapelt *map; @@ -1513,11 +1473,7 @@ are descriptor and name of file to write to. */ void -write_symdef_member (mapelt, map, outdesc, outname) - struct mapelt *mapelt; - struct mapelt *map; - int outdesc; - char *outname; +write_symdef_member (struct mapelt *mapelt, struct mapelt *map, int outdesc, char *outname) { struct ar_hdr header; struct mapelt *mapptr; @@ -1590,9 +1546,7 @@ } void -read_old_symdefs (map, archive_indesc) - struct mapelt *map; - int archive_indesc; +read_old_symdefs (struct mapelt *map, int archive_indesc) { struct mapelt *mapelt; char *data; @@ -1636,14 +1590,8 @@ Return 0 for failure or 1 for success. */ int -read_header_info (mapelt, desc, offset, syms_offset, syms_size, strs_offset, strs_size) - struct mapelt *mapelt; - int desc; - long int offset; - long int *syms_offset; - unsigned int *syms_size; - long int *strs_offset; - unsigned int *strs_size; +read_header_info (struct mapelt *mapelt, int desc, long int offset, long int *syms_offset, + unsigned int *syms_size, long int *strs_offset, unsigned int *strs_size) { struct exec hdr; int len; @@ -1683,9 +1631,7 @@ by reading the file it is coming from. */ void -make_new_symdefs (mapelt, archive_indesc) - struct mapelt *mapelt; - int archive_indesc; +make_new_symdefs (struct mapelt *mapelt, int archive_indesc) { int indesc; char *name = mapelt->info.name; @@ -1798,9 +1744,7 @@ Return the number of symbols left. */ int -filter_symbols (syms, symcount) - struct nlist *syms; - unsigned int symcount; +filter_symbols (struct nlist *syms, unsigned int symcount) { struct nlist *from, *to; struct nlist *end = syms + symcount; @@ -1817,9 +1761,7 @@ /* Update the __.SYMDEF data before writing a new archive. */ void -update_symdefs (map, archive_indesc) - struct mapelt *map; - int archive_indesc; +update_symdefs (struct mapelt *map, int archive_indesc) { struct mapelt *tail; int pos; @@ -1987,9 +1929,7 @@ /* Print error message and usage message, and exit. */ void -usage (s1, val) - char *s1; - int val; +usage (char *s1, int val) { char vbuf[16]; sprintf(vbuf, "%d", val); @@ -2003,8 +1943,7 @@ /* Print error message and exit. */ void -fatal (s1, s2) - char *s1, *s2; +fatal (char *s1, char *s2) { error (s1, s2); exit (1); @@ -2013,8 +1952,7 @@ /* Print error message. `s1' is printf control string, the rest are args. */ void -error (s1, s2) - char *s1, *s2; +error (char *s1, char *s2) { fprintf (stderr, "%s: ", program_name); fprintf (stderr, s1, s2); @@ -2022,8 +1960,7 @@ } void -error3 (s1, s2, s3) - char *s1, *s2, *s3; +error3 (char *s1, char *s2, char *s3) { fprintf (stderr, "%s: ", program_name); fprintf (stderr, s1, s2, s3); @@ -2031,9 +1968,7 @@ } void -error_with_file (string, mapelt) - char *string; - struct mapelt *mapelt; +error_with_file (char *string, struct mapelt *mapelt) { fprintf (stderr, "%s: ", program_name); fprintf (stderr, "%s", string); @@ -2045,15 +1980,13 @@ } void -perror_with_name (name) - char *name; +perror_with_name (char *name) { error (concat ("", strerror(errno), " for %s"), name); } void -pfatal_with_name (name) - char *name; +pfatal_with_name (char *name) { fatal (concat ("", strerror(errno), " for %s"), name); } @@ -2062,8 +1995,7 @@ concatenate those of S1, S2, and S3. */ char * -concat (s1, s2, s3) - const char *s1, *s2, *s3; +concat (const char *s1, const char *s2, const char *s3) { int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); char *result = (char *) xmalloc (len1 + len2 + len3 + 1); @@ -2079,8 +2011,7 @@ /* Like malloc but get fatal error if memory is exhausted. */ char * -xmalloc (size) - unsigned int size; +xmalloc (unsigned int size) { #ifdef MALLOC_0_RETURNS_NULL char *result = malloc (size ? size : 1); @@ -2093,9 +2024,7 @@ } char * -xrealloc (ptr, size) - char *ptr; - unsigned int size; +xrealloc (char *ptr, unsigned int size) { char *result = realloc (ptr, size); if (result == 0) @@ -2106,8 +2035,7 @@ #ifndef HAVE_RENAME int -rename (from, to) - char *from, *to; +rename (char *from, char *to) { (void)unlink (to); if (link (from, to) < 0 diff -Naur a/as/alloc.c b/as/alloc.c --- a/as/alloc.c 2014-03-14 00:33:19.000000000 -0400 +++ b/as/alloc.c 2023-02-10 23:42:30.766631935 -0500 @@ -53,8 +53,7 @@ } void * -asalloc(size) -unsigned int size; +asalloc(unsigned int size) { void * rv; #ifdef USE_FIXED_HEAP @@ -75,9 +74,7 @@ void * -asrealloc(oldptr, size) -void * oldptr; -unsigned int size; +asrealloc(void * oldptr, unsigned int size) { void * rv; #ifdef USE_FIXED_HEAP diff -Naur a/as/as.c b/as/as.c --- a/as/as.c 2014-03-14 00:33:19.000000000 -0400 +++ b/as/as.c 2023-02-10 23:42:30.766631935 -0500 @@ -37,9 +37,7 @@ FORWARD void summ_number P((unsigned num)); FORWARD void usage P((void)); -PUBLIC int main(argc, argv) -int argc; -char **argv; +PUBLIC int main(int argc, char **argv) { init_heap(); initp1(); @@ -62,8 +60,7 @@ return 0; } -PUBLIC void as_abort(message) -char *message; +PUBLIC void as_abort(char *message) { write(STDOUT, "as: ", 4); write(STDOUT, message, strlen(message)); @@ -138,9 +135,7 @@ ptext(); } -PRIVATE int my_creat(name, message) -char *name; -char *message; +PRIVATE int my_creat(char *name, char *message) { int fd; @@ -153,9 +148,7 @@ return fd; } -PRIVATE void process_args(argc, argv) -int argc; -char **argv; +PRIVATE void process_args(int argc, char **argv) { char *arg; bool_t isnextarg; @@ -315,8 +308,7 @@ inidata = (~binaryg & inidata) | (RELBIT | UNDBIT); } /* IMPBIT from inidata unless binaryg */ -PRIVATE void summary(fd) -int fd; +PRIVATE void summary(int fd) { outfd = fd; writenl(); @@ -326,8 +318,7 @@ writesn(" warnings"); } -PRIVATE void summ_number(num) -unsigned num; +PRIVATE void summ_number(unsigned num) { /* format number like line numbers */ char buf[16]; diff -Naur a/as/express.c b/as/express.c --- a/as/express.c 2014-03-14 00:33:19.000000000 -0400 +++ b/as/express.c 2023-02-10 23:42:30.766631935 -0500 @@ -33,8 +33,7 @@ } } -PRIVATE void experror(err_str) -char * err_str; +PRIVATE void experror(char * err_str) { error(err_str); expundefined(); diff -Naur a/as/genbin.c b/as/genbin.c --- a/as/genbin.c 2014-03-14 00:33:19.000000000 -0400 +++ b/as/genbin.c 2023-02-10 23:42:30.767631930 -0500 @@ -192,8 +192,7 @@ /* write char to binary file or directly to memory */ -PUBLIC void putbin(ch) -opcode_pt ch; +PUBLIC void putbin(opcode_pt ch) { if (binfil != 0x0) { @@ -253,9 +252,7 @@ /* write sized offset to binary file or directly to memory */ -PRIVATE void putbinoffset(offset, size) -offset_t offset; -count_t size; +PRIVATE void putbinoffset(offset_t offset, count_t size) { char buf[sizeof offset]; diff -Naur a/as/genlist.c b/as/genlist.c --- a/as/genlist.c 2014-03-14 00:33:19.000000000 -0400 +++ b/as/genlist.c 2023-02-10 23:42:30.767631930 -0500 @@ -84,9 +84,7 @@ /* format 1 byte number as 2 hex digits, return ptr to end */ -PRIVATE char *build_1hex_number(num, where) -opcode_pt num; -register char *where; +PRIVATE char *build_1hex_number(opcode_pt num, register char *where) { where[0] = hexdigit[((unsigned) num % 256) / 16]; where[1] = hexdigit[(unsigned) num % 16]; @@ -95,9 +93,7 @@ /* format 2 byte number as 4 hex digits, return ptr to end */ -PUBLIC char *build_2hex_number(num, where) -unsigned num; -char *where; +PUBLIC char *build_2hex_number(unsigned num, char *where) { return build_1hex_number((opcode_pt) num, build_1hex_number((opcode_pt) (num / 256), where)); @@ -106,10 +102,7 @@ /* format 2 byte number as decimal with given width (pad with leading '0's) */ /* return ptr to end */ -PUBLIC char *build_number(num, width, where) -unsigned num; -unsigned width; -register char *where; +PUBLIC char *build_number(unsigned num, unsigned width, register char *where) { static unsigned powers_of_10[] = {1, 10, 100, 1000, 10000,}; unsigned char digit; @@ -131,8 +124,7 @@ /* record number and position of error (or error buffer overflow) */ -PUBLIC void warning(err_str) -char * err_str; +PUBLIC void warning(char * err_str) { if (!as_warn.current) return; ++totwarn; @@ -140,8 +132,7 @@ error(err_str); } -PUBLIC void error(err_str) -char * err_str; +PUBLIC void error(char * err_str) { register struct error_s *errptr; register struct error_s *errptrlow; @@ -189,8 +180,7 @@ /* list 1 line unconditionally */ -PRIVATE void list1(fd) -fd_t fd; +PRIVATE void list1(fd_t fd) { outfd = fd; listcode(); @@ -413,8 +403,7 @@ /* pad out error line to begin under 1st char of source listing */ -PRIVATE void paderrorline(nspaces) -unsigned nspaces; +PRIVATE void paderrorline(unsigned nspaces) { int nstars = LINUM_LEN; @@ -426,8 +415,7 @@ /* write 1 character */ -PUBLIC void writec(ch) -char ch; +PUBLIC void writec(char ch) { write(outfd, &ch, 1); } @@ -441,8 +429,7 @@ /* write 1 offset_t, order to suit target */ -PUBLIC void writeoff(offset) -offset_t offset; +PUBLIC void writeoff(offset_t offset) { char buf[sizeof offset]; @@ -456,16 +443,14 @@ /* write string */ -PUBLIC void writes(s) -char *s; +PUBLIC void writes(char *s) { write(outfd, s, strlen(s)); } /* write string followed by newline */ -PUBLIC void writesn(s) -char *s; +PUBLIC void writesn(char *s) { writes(s); writenl(); @@ -473,8 +458,7 @@ /* write 1 word, order to suit target */ -PUBLIC void writew(word) -unsigned word; +PUBLIC void writew(unsigned word) { char buf[2]; diff -Naur a/as/genobj.c b/as/genobj.c --- a/as/genobj.c 2014-03-14 00:33:19.000000000 -0400 +++ b/as/genobj.c 2023-02-10 23:42:30.767631930 -0500 @@ -28,7 +28,7 @@ FORWARD void flushabs P((void)); FORWARD void flushrmb P((void)); -FORWARD void genobjadr P((struct address_s *adrptr, int size)); +FORWARD void genobjadr P((struct address_s *adrptr, smallcount_t size)); FORWARD void putobj1 P((opcode_pt ch)); FORWARD void putobj4 P((u32_T offset)); FORWARD void putobjoffset P((offset_t offset, count_t size)); @@ -37,8 +37,7 @@ /* accumulate RMB requests into 1 (so + and - requests cancel) */ -PUBLIC void accumulate_rmb(offset) -offset_t offset; +PUBLIC void accumulate_rmb(offset_t offset) { if (objectc) { @@ -212,9 +211,7 @@ /* generate object code for current address */ -PRIVATE void genobjadr(adrptr, size) -struct address_s *adrptr; -smallcount_t size; +PRIVATE void genobjadr(struct address_s *adrptr, smallcount_t size) { unsigned char byte; unsigned symnum; @@ -590,8 +587,7 @@ /* write char to absolute object code buffer, flush if necessary */ -PUBLIC void putabs(ch) -opcode_pt ch; +PUBLIC void putabs(opcode_pt ch) { if (objectc) { @@ -605,8 +601,7 @@ /* write char to object code buffer, flush if necessary */ -PUBLIC void putobj(ch) -opcode_pt ch; +PUBLIC void putobj(opcode_pt ch) { if (objectc) { @@ -618,8 +613,7 @@ /* write char to object code buffer assuming nothing in absolute & rmb bufs */ -PRIVATE void putobj1(ch) -opcode_pt ch; +PRIVATE void putobj1(opcode_pt ch) { if (objbufptr >= objbufend) flushobj(); @@ -628,8 +622,7 @@ /* write 32 bit offset to object code buffer assuming ... */ -PRIVATE void putobj4(offset) -u32_T offset; +PRIVATE void putobj4(u32_T offset) { char buf[sizeof offset]; @@ -639,9 +632,7 @@ /* write sized offset to object code buffer assuming ... */ -PRIVATE void putobjoffset(offset, size) -offset_t offset; -count_t size; +PRIVATE void putobjoffset(offset_t offset, count_t size) { char buf[sizeof offset]; @@ -662,8 +653,7 @@ /* write word to object code buffer assuming ... */ -PRIVATE void putobjword(word) -unsigned word; +PRIVATE void putobjword(unsigned word) { char buf[sizeof word]; @@ -674,9 +664,7 @@ /* write several bytes to object code buffer assuming ... */ -PRIVATE void writeobj(buf, count) -char *buf; -unsigned count; +PRIVATE void writeobj(char *buf, unsigned count) { do putobj1(*buf++); diff -Naur a/as/gensym.c b/as/gensym.c --- a/as/gensym.c 2014-03-14 00:33:19.000000000 -0400 +++ b/as/gensym.c 2023-02-10 23:42:30.767631930 -0500 @@ -137,9 +137,7 @@ /* print symbol nicely formatted for given column */ -PRIVATE int printsym(symptr, column) -register struct sym_s *symptr; -unsigned column; +PRIVATE int printsym(register struct sym_s *symptr, unsigned column) { unsigned char length; register struct sym_listing_s *listptr; @@ -187,10 +185,7 @@ /* shell sort symbols */ -PRIVATE void sort(array, top, nameflag) -struct sym_s **array; -struct sym_s **top; -bool_pt nameflag; +PRIVATE void sort(struct sym_s **array, struct sym_s **top, bool_pt nameflag) { int gap; int i; diff -Naur a/as/macro.c b/as/macro.c --- a/as/macro.c 2014-03-14 00:33:19.000000000 -0400 +++ b/as/macro.c 2023-02-10 23:42:30.767631930 -0500 @@ -15,8 +15,7 @@ next:string. The first string is the macro number in 4 bytes. */ -PUBLIC void entermac(symptr) -struct sym_s *symptr; +PUBLIC void entermac(struct sym_s *symptr) { if (maclevel >= MAXMAC) error(MACOV); diff -Naur a/as/mops.c b/as/mops.c --- a/as/mops.c 2014-03-14 00:33:19.000000000 -0400 +++ b/as/mops.c 2023-02-10 23:42:30.768631925 -0500 @@ -418,8 +418,7 @@ FORWARD void yesimmed P((struct ea_s *eap)); FORWARD void yes_samesize P((void)); -PRIVATE void Eb(eap) -register struct ea_s *eap; +PRIVATE void Eb(register struct ea_s *eap) { Ex(eap); if (eap->size != 0x1) @@ -433,8 +432,7 @@ } } -PRIVATE void Ew(eap) -register struct ea_s *eap; +PRIVATE void Ew(register struct ea_s *eap) { Ex(eap); if (eap->size != 0x2) @@ -448,53 +446,46 @@ } } -PRIVATE void Ev(eap) -register struct ea_s *eap; +PRIVATE void Ev(register struct ea_s *eap) { Ex(eap); notbytesize(eap); } -PRIVATE void Ex(eap) -register struct ea_s *eap; +PRIVATE void Ex(register struct ea_s *eap) { getea(eap); notimmed(eap); notsegorspecreg(eap); } -PRIVATE void Gd(eap) -register struct ea_s *eap; +PRIVATE void Gd(register struct ea_s *eap) { Gx(eap); if (eap->size != 0x4) kgerror(ILL_SIZE); } -PRIVATE void Gw(eap) -register struct ea_s *eap; +PRIVATE void Gw(register struct ea_s *eap) { Gx(eap); if (eap->size != 0x2) kgerror(ILL_SIZE); } -PRIVATE void Gv(eap) -register struct ea_s *eap; +PRIVATE void Gv(register struct ea_s *eap) { Gx(eap); notbytesize(eap); } -PRIVATE void Gx(eap) -register struct ea_s *eap; +PRIVATE void Gx(register struct ea_s *eap) { Ex(eap); notindirect(eap); } -PRIVATE void buildea(eap) -register struct ea_s *eap; +PRIVATE void buildea(register struct ea_s *eap) { opsize_t asize; @@ -586,9 +577,7 @@ opcode = ESCAPE_OPCODE_BASE | ((opcode & 0x70) >> 0x4); } -PRIVATE void buildimm(eap, signflag) -register struct ea_s *eap; -bool_pt signflag; +PRIVATE void buildimm(register struct ea_s *eap, bool_pt signflag) { immadr = eap->displ; immcount = eap->size; @@ -623,8 +612,7 @@ /* Check size and build segword. */ -PRIVATE void buildsegword(eap) -register struct ea_s *eap; +PRIVATE void buildsegword(register struct ea_s *eap) { if (eap->size == 0x0) #ifdef NODEFAULTSIZE @@ -642,8 +630,7 @@ segword = regsegword[eap->base]; } -PRIVATE void buildunary(opc) -opcode_pt opc; +PRIVATE void buildunary(opcode_pt opc) { if (mcount != 0x0) { @@ -653,8 +640,7 @@ } } -PRIVATE opsize_pt displsize(eap) -register struct ea_s *eap; +PRIVATE opsize_pt displsize(register struct ea_s *eap) { opsize_t asize; @@ -708,8 +694,7 @@ return fpreg; } -PRIVATE bool_pt getaccumreg(eap) -register struct ea_s *eap; +PRIVATE bool_pt getaccumreg(register struct ea_s * eap) { if ((eap->base = regchk()) != AXREG && eap->base != ALREG && eap->base != EAXREG) @@ -769,8 +754,7 @@ buildsegword(&source); } -PRIVATE bool_pt getdxreg(eap) -register struct ea_s *eap; +PRIVATE bool_pt getdxreg(register struct ea_s *eap) { if ((eap->base = regchk()) != DXREG) return FALSE; @@ -809,8 +793,7 @@ optional-imediate-prefix displ(scaled index) -- anachronism */ -PRIVATE void getea(eap) -register struct ea_s *eap; +PRIVATE void getea(register struct ea_s *eap) { bool_t leading_displ; bool_t leading_immed; @@ -967,9 +950,7 @@ needcpu(eap->size==4?3:0); } -PRIVATE void getimmed(eap, immed_count) -struct ea_s *eap; -count_t immed_count; +PRIVATE void getimmed(struct ea_s *eap, count_t immed_count) { getea(eap); yesimmed(eap); @@ -980,16 +961,14 @@ } } -PRIVATE void getindirect(eap) -register struct ea_s *eap; +PRIVATE void getindirect(register struct ea_s *eap) { getea(eap); if (eap->indcount == 0x0) kgerror(IND_REQ); } -PRIVATE void getshift(eap) -register struct ea_s *eap; +PRIVATE void getshift(register struct ea_s *eap) { getcomma(); getea(eap); @@ -1003,8 +982,7 @@ Return register number (adjusted if necessary to a legal index) or NOREG. */ -PRIVATE reg_pt indregchk(matchreg) -reg_pt matchreg; +PRIVATE reg_pt indregchk(reg_pt matchreg) { reg_pt reg; @@ -1050,15 +1028,13 @@ return reg; } -PRIVATE void kgerror(err_str) -char * err_str; +PRIVATE void kgerror(char * err_str) { error(err_str); sprefix = oprefix = aprefix = mcount = 0x0; } -PRIVATE void lbranch(backamount) -int backamount; +PRIVATE void lbranch(int backamount) { mcount += defsize + 0x1; segadj(); @@ -2314,36 +2290,31 @@ buildregular(); } -PRIVATE void notbytesize(eap) -register struct ea_s *eap; +PRIVATE void notbytesize(register struct ea_s *eap) { if (eap->size == 0x1) kgerror(ILL_SIZE); } -PRIVATE void notimmed(eap) -register struct ea_s *eap; +PRIVATE void notimmed(register struct ea_s *eap) { if (eap->indcount == 0x0 && eap->base == NOREG) kgerror(ILL_IMM_MODE); } -PRIVATE void notindirect(eap) -register struct ea_s *eap; +PRIVATE void notindirect(register struct ea_s *eap) { if (eap->indcount != 0x0) kgerror(ILL_IND); } -PRIVATE void notsegorspecreg(eap) -register struct ea_s *eap; +PRIVATE void notsegorspecreg(register struct ea_s *eap) { if (regsegword[eap->base] >= SEGMOV) kgerror(ILLREG); } -PRIVATE void yesimmed(eap) -register struct ea_s *eap; +PRIVATE void yesimmed(register struct ea_s *eap) { if (eap->indcount == 0x1) eap->indcount = 0x0; diff -Naur a/as/pops.c b/as/pops.c --- a/as/pops.c 2014-03-14 00:33:19.000000000 -0400 +++ b/as/pops.c 2023-02-10 23:42:30.768631925 -0500 @@ -17,17 +17,15 @@ FORWARD void constdata P((unsigned size)); FORWARD void docomm P((void)); FORWARD void doelseif P((pfv func)); -FORWARD void doequset P((int labits)); -FORWARD void doentexp P((int entbits, int impbits)); +FORWARD void doequset P((unsigned char labits)); +FORWARD void doentexp P((unsigned char entbits, unsigned char impbits)); FORWARD void dofcc P((void)); FORWARD void doif P((pfv func)); FORWARD struct sym_s *needlabel P((void)); FORWARD void showredefinedlabel P((void)); FORWARD void setloc P((unsigned seg)); -PRIVATE void bumpsem(flagptr, defval) -register struct flags_s *flagptr; -int defval; +PRIVATE void bumpsem(register struct flags_s *flagptr, int defval) { int newcount; @@ -70,8 +68,7 @@ /* check symbol is either undefined */ /* or has the same segment & relocatability as lc */ -PUBLIC bool_pt checksegrel(symptr) -register struct sym_s *symptr; +PUBLIC bool_pt checksegrel(register struct sym_s *symptr) { if ((symptr->type & LABIT || (symptr->data & IMPBIT && !(symptr->data & UNDBIT))) && @@ -94,8 +91,7 @@ /* allocate constant data (zero except for size 1), default zero for size 1 */ -PRIVATE void constdata(size) -unsigned size; +PRIVATE void constdata(unsigned size) { offset_t remaining; @@ -157,8 +153,7 @@ /* common routine for ELSEIF/ELSEIFC */ -PRIVATE void doelseif(func) -pfv func; +PRIVATE void doelseif(pfv func) { if (iflevel == 0) error(ELSEIFBAD); @@ -186,8 +181,7 @@ /* common routine for EQU/SET */ -PRIVATE void doequset(labits) -unsigned char labits; +PRIVATE void doequset(unsigned char labits) { register struct sym_s *labptr; unsigned char olddata; @@ -230,9 +224,7 @@ /* common routine for ENTRY/EXPORT */ -PRIVATE void doentexp(entbits, impbits) -unsigned char entbits; -unsigned char impbits; +PRIVATE void doentexp(unsigned char entbits, unsigned char impbits) { struct sym_s *symptr; @@ -389,8 +381,7 @@ /* common routine for IF/IFC */ -PRIVATE void doif(func) -pfv func; +PRIVATE void doif(pfv func) { if (iflevel >= MAXIF) error(IFOV); @@ -420,8 +411,7 @@ } } -PUBLIC void fatalerror(err_str) -char * err_str; +PUBLIC void fatalerror(char * err_str) { error(err_str); skipline(); @@ -432,8 +422,7 @@ /* swap position with label position, do error, put back posn */ /* also clear label ptr */ -PUBLIC void labelerror(err_str) -char * err_str; +PUBLIC void labelerror(char * err_str) { struct sym_s *oldgsymptr; char *oldlineptr; @@ -1095,8 +1084,7 @@ /* set location segment */ -PRIVATE void setloc(seg) -unsigned seg; +PRIVATE void setloc(unsigned seg) { if (pass == last_pass && seg != (lcdata & SEGM)) putobj((opcode_pt) (seg | OBJ_SET_SEG)); diff -Naur a/as/proto.h b/as/proto.h --- a/as/proto.h 2014-03-14 00:33:19.000000000 -0400 +++ b/as/proto.h 2023-02-10 23:42:30.768631925 -0500 @@ -34,7 +34,7 @@ void warning P((char * errorstr)); void error P((char * errorstr)); void listline P((void)); -void writec P((int ch)); +void writec P((char ch)); void writenl P((void)); void writeoff P((offset_t offset)); void writes P((char *s)); diff -Naur a/as/readsrc.c b/as/readsrc.c --- a/as/readsrc.c 2014-03-14 00:33:19.000000000 -0400 +++ b/as/readsrc.c 2023-02-10 23:42:30.769631920 -0500 @@ -87,8 +87,7 @@ clearsource(); /* sentinel to invoke blank skipping */ } -PUBLIC fd_t open_input(name) -char *name; +PUBLIC fd_t open_input(char *name) { fd_t fd; #if BIGBUFFER == 1 @@ -455,10 +454,7 @@ PRIVATE long ftpos = 0; PRIVATE int lastfd = -1; -PRIVATE int inp_line(fd, buf, size) -int fd; -char * buf; -int size; +PRIVATE int inp_line(int fd, char * buf, int size) { int offt = 0; if( fd!=lastfd ) inp_seek(-1, 0L); @@ -479,8 +475,7 @@ return offt; } -PRIVATE long inp_tell(fd) -int fd; +PRIVATE long inp_tell(int fd) { if( fd != lastfd ) return lseek(fd, 0L, 1); @@ -488,9 +483,7 @@ return ftpos + in_start; } -PRIVATE void inp_seek(fd, posn) -int fd; -long posn; +PRIVATE void inp_seek(int fd, long posn) { if( lastfd != -1 ) lseek(lastfd, ftpos+in_start, 0); diff -Naur a/as/table.c b/as/table.c --- a/as/table.c 2014-03-14 00:33:19.000000000 -0400 +++ b/as/table.c 2023-02-10 23:42:30.769631920 -0500 @@ -30,7 +30,7 @@ FORWARD void printchain P((void)); #endif -FORWARD void install P((register char *keyptr, int data)); +FORWARD void install P((register char *keyptr, unsigned char data)); PUBLIC void inst_keywords() { @@ -48,9 +48,7 @@ #endif } -PRIVATE void install(keyptr, data) -register char *keyptr; -unsigned char data; +PRIVATE void install(register char *keyptr, unsigned char data) { char lowcasebuf[20]; unsigned namelength; diff -Naur a/as/typeconv.c b/as/typeconv.c --- a/as/typeconv.c 2014-03-14 00:33:19.000000000 -0400 +++ b/as/typeconv.c 2023-02-10 23:42:30.769631920 -0500 @@ -11,7 +11,7 @@ #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)); } #ifdef __AS386_16__ static int no_swap = 1; @@ -20,9 +20,7 @@ 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; #ifdef __AS386_16__ @@ -47,9 +45,7 @@ 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 ) @@ -62,9 +58,7 @@ 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__ @@ -81,10 +75,7 @@ } } -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) { @@ -103,10 +94,7 @@ } } -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) { @@ -125,8 +113,7 @@ } } -PUBLIC u2_pt c2u2(buf) -char *buf; +PUBLIC u2_pt c2u2(char *buf) { u2_pt res; #ifdef __AS386_16__ @@ -138,8 +125,7 @@ return res; } -PUBLIC u4_t c4u4(buf) -char *buf; +PUBLIC u4_t c4u4(char *buf) { u4_t res; int i; @@ -154,9 +140,7 @@ return res; } -PUBLIC u4_t cnu4(buf, count) -char *buf; -unsigned count; +PUBLIC u4_t cnu4(char *buf, unsigned count) { switch (count) { @@ -174,9 +158,7 @@ } } -PUBLIC u2_pt cnu2(buf, count) -char *buf; -unsigned count; +PUBLIC u2_pt cnu2(char *buf, unsigned count) { switch (count) { diff -Naur a/bcc/assign.c b/bcc/assign.c --- a/bcc/assign.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/assign.c 2023-02-10 23:42:30.769631920 -0500 @@ -15,9 +15,7 @@ struct symstruct *source, uoffset_T size)); FORWARD void fconvert P((struct symstruct *source, struct typestruct *type)); -PUBLIC void assign(source, target) -struct symstruct *source; -struct symstruct *target; +PUBLIC void assign(struct symstruct *source, struct symstruct *target) { store_pt regpushed; store_pt sourcereg; @@ -148,9 +146,7 @@ /* block move assumes itypesize == accregsize && BREG size == 1 */ -PRIVATE void blockmove(source, target) -struct symstruct *source; -struct symstruct *target; +PRIVATE void blockmove(struct symstruct *source, struct symstruct *target) { struct symstruct oldtarget; uoffset_T typesize; @@ -196,11 +192,7 @@ *target = oldtarget; } -PRIVATE void call3(funcname, target, source, size) -char *funcname; -struct symstruct *target; -struct symstruct *source; -uoffset_T size; +PRIVATE void call3(char *funcname, struct symstruct *target, struct symstruct *source, uoffset_T size) { store_pt regpushed; offset_T spmark; @@ -222,9 +214,7 @@ } } -PUBLIC void cast(type, target) -struct typestruct *type; -struct symstruct *target; +PUBLIC void cast(struct typestruct *type, struct symstruct *target) { scalar_t newscalar; uoffset_T newsize; @@ -343,8 +333,7 @@ /* extend char or short to int (unsigned if from unsigned) */ -PUBLIC void extend(target) -struct symstruct *target; +PUBLIC void extend(struct symstruct *target) { scalar_t tscalar; @@ -376,9 +365,7 @@ } } -PRIVATE void fconvert(source, type) -struct symstruct *source; -struct typestruct *type; +PRIVATE void fconvert(struct symstruct *source, struct typestruct *type) { offset_T spmark; diff -Naur a/bcc/bcc.c b/bcc/bcc.c --- a/bcc/bcc.c 2023-02-10 23:42:07.339748916 -0500 +++ b/bcc/bcc.c 2023-02-10 23:42:30.769631920 -0500 @@ -191,9 +191,7 @@ char * libc = "-lc"; int -main(argc, argv) -int argc; -char ** argv; +main(int argc, char ** argv) { struct file_list * next_file; char * temp; @@ -277,22 +275,19 @@ } char * -copystr(str) -char * str; +copystr(char * str) { return strcpy(xalloc(strlen(str)+1), str); } char * -catstr(str, str2) -char * str, * str2; +catstr(char * str, char * str2) { return strcat(strcpy(xalloc(strlen(str)+strlen(str2)+1), str), str2); } void -run_aspreproc(file) -struct file_list * file; +run_aspreproc(struct file_list * file) { static char cc1bcc[] = CC1BCC; @@ -319,8 +314,7 @@ } void -run_preproc(file) -struct file_list * file; +run_preproc(struct file_list * file) { int last_stage = 0; int combined_cpp; @@ -373,8 +367,7 @@ } void -run_unproto(file) -struct file_list * file; +run_unproto(struct file_list * file) { command.cmd = UNPROTO; command_reset(); @@ -385,8 +378,7 @@ } void -run_compile(file) -struct file_list * file; +run_compile(struct file_list * file) { if (opt_arch == 3) command.cmd = CC1C386; else if (opt_arch<5) command.cmd = CC1BCC; @@ -410,8 +402,7 @@ } void -run_optim(file) -struct file_list * file; +run_optim(struct file_list * file) { char buf[32]; if (opt_arch<5) command.cmd = OPTIM; @@ -451,8 +442,7 @@ } void -run_as(file) -struct file_list * file; +run_as(struct file_list * file) { char * buf; switch(opt_arch) @@ -539,8 +529,7 @@ } void -validate_link_opt(option) -char * option; +validate_link_opt(char * option) { int err = 0; if (option[0] != '-') return; @@ -685,8 +674,7 @@ } void -command_opt(option) -char * option; +command_opt(char * option) { if (command.maxargs <= command.numargs+1) { char ** newbuf = xalloc(command.maxargs*2*sizeof(char**)); @@ -708,8 +696,7 @@ } void -command_opts(optkey) -int optkey; +command_opts(int optkey) { struct opt_list * ol; for(ol=options; ol; ol=ol->next) @@ -717,11 +704,7 @@ command_opt(ol->opt); } -void newfilename(file, last_stage, new_extn, use_o) -struct file_list * file; -int last_stage; -int new_extn; -int use_o; +void newfilename(struct file_list * file, int last_stage, int new_extn, int use_o) { file->filetype = new_extn; if (file->oldfile) free(file->oldfile); @@ -787,9 +770,7 @@ } void -getargs(argc, argv) -int argc; -char ** argv; +getargs(int argc, char ** argv) { int ar; char * pflag = 0; @@ -1122,8 +1103,7 @@ } void -build_prefix(path1, path2, path3) -char * path1, * path2, * path3; +build_prefix(char * path1, char * path2, char * path3) { char * newstr; int l; @@ -1142,8 +1122,7 @@ } void -add_prefix(path) -char * path; +add_prefix(char * path) { char ** p; if (!path || !*path) return; @@ -1162,9 +1141,7 @@ fatal("Too many -B options"); } -void append_file (filename, ftype) -char * filename; -int ftype; +void append_file (char * filename, int ftype) { struct file_list * newfile = xalloc(sizeof(struct file_list)); char * s; @@ -1202,9 +1179,7 @@ } void -append_option (option, otype) -char * option; -int otype; +append_option (char * option, int otype) { struct opt_list * newopt = xalloc(sizeof(struct opt_list)); @@ -1222,9 +1197,7 @@ } void -prepend_option (option, otype) -char * option; -int otype; +prepend_option (char * option, int otype) { struct opt_list * newopt = xalloc(sizeof(struct opt_list)); @@ -1235,8 +1208,7 @@ options = newopt; } -char * build_libpath(opt, str, suffix) -char * opt, * str, * suffix; +char * build_libpath(char * opt, char * str, char * suffix) { char * newstr; newstr = xalloc(strlen(opt)+strlen(str)+strlen(prefix_path)+strlen(suffix)+1); @@ -1248,8 +1220,7 @@ } void * -xalloc (size) -int size; +xalloc (int size) { void * p = malloc(size); if (!p) fatal("Out of memory"); @@ -1273,8 +1244,7 @@ exit(1); } -void fatal(str) -char * str; +void fatal(char * str) { fprintf(stderr, "%s: Fatal error: %s.\n", progname, str); exit(1); @@ -1377,8 +1347,7 @@ #endif void -run_command(file) -struct file_list * file; +run_command(struct file_list * file) { #ifdef __BCC__ static char ** minienviron[] = { diff -Naur a/bcc/bcc-cc1.c b/bcc/bcc-cc1.c --- a/bcc/bcc-cc1.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/bcc-cc1.c 2023-02-10 23:42:30.770631915 -0500 @@ -4,9 +4,7 @@ #include "bcc.h" -PUBLIC int main(argc, argv) -int argc; -char **argv; +PUBLIC int main(int argc, char **argv) { debug(1, "Start"); growheap(0); /* init order is important */ diff -Naur a/bcc/codefrag.c b/bcc/codefrag.c --- a/bcc/codefrag.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/codefrag.c 2023-02-10 23:42:30.770631915 -0500 @@ -617,9 +617,7 @@ /* add constant to register */ -PUBLIC void addconst(offset, reg) -offset_T offset; -store_pt reg; +PUBLIC void addconst(offset_T offset, store_pt reg) { #ifdef I8088 #ifdef I80386 @@ -670,9 +668,7 @@ /* adjust lc for signed offset */ -PUBLIC void adjlc(offset, reg) -offset_T offset; -store_pt reg; +PUBLIC void adjlc(offset_T offset, store_pt reg) { if (!(reg & CHARREGS)) { @@ -693,8 +689,7 @@ /* adjust stack ptr by adding a labelled constant less current sp */ -PUBLIC void adjsp(label) -label_no label; +PUBLIC void adjsp(label_no label) { outaddsp(); outbyte(LOCALSTARTCHAR); @@ -721,8 +716,7 @@ /* and accumulator with constant */ -PUBLIC void andconst(offset) -offset_T offset; +PUBLIC void andconst(offset_T offset) { char_t botbits; uoffset_T topbits; @@ -805,16 +799,14 @@ /* clear register to 0 */ -PRIVATE void clr(reg) -store_pt reg; +PRIVATE void clr(store_pt reg) { loadconst((offset_T) 0, reg); } /* define common storage */ -PUBLIC void common(name) -char *name; +PUBLIC void common(char *name) { #ifdef I8088 outcommon(); @@ -840,8 +832,7 @@ /* define long */ -PUBLIC void deflong(value) -uoffset_T value; +PUBLIC void deflong(uoffset_T value) { uoffset_T longhigh; uoffset_T longlow; @@ -877,8 +868,7 @@ /* define null storage */ -PUBLIC void defnulls(nullcount) -uoffset_T nullcount; +PUBLIC void defnulls(uoffset_T nullcount) { if (nullcount != 0) { @@ -889,10 +879,7 @@ /* define string */ -PUBLIC label_no defstr(sptr, stop, dataflag) -char *sptr; -char *stop; -bool_pt dataflag; +PUBLIC label_no defstr(char *sptr, char *stop, bool_pt dataflag) { int byte; /* promoted char for output */ label_no strlab; @@ -981,9 +968,7 @@ /* divide D register by a constant if it is easy to do with shifts */ -PUBLIC bool_pt diveasy(divisor, uflag) -value_t divisor; -bool_pt uflag; +PUBLIC bool_pt diveasy(value_t divisor, bool_pt uflag) { bool_t sign; @@ -1034,9 +1019,7 @@ /* equate a name to an EOL-terminated string */ -PUBLIC void equ(name, string) -char *name; -char *string; +PUBLIC void equ(char *name, char *string) { outstr(name); outequate(); @@ -1045,9 +1028,7 @@ /* equate a local label to a value */ -PUBLIC void equlab(label, offset) -label_no label; -offset_T offset; +PUBLIC void equlab(label_no label, offset_T offset) { outbyte(LOCALSTARTCHAR); outlabel(label); @@ -1058,8 +1039,7 @@ /* import or export a variable */ -PUBLIC void globl(name) -char *name; +PUBLIC void globl(char *name) { outglobl(); outnccname(name); @@ -1067,8 +1047,7 @@ /* import a variable */ -PUBLIC void import(name) -char *name; +PUBLIC void import(char *name) { outimport(); outnccname(name); @@ -1076,8 +1055,7 @@ /* extend an int to a long */ -PUBLIC void itol(reg) -store_pt reg; +PUBLIC void itol(store_pt reg) { #define TEMP_LABEL_FOR_REGRESSION_TESTS #ifdef TEMP_LABEL_FOR_REGRESSION_TESTS @@ -1108,15 +1086,13 @@ /* define local common storage */ -PUBLIC void lcommlab(label) -label_no label; +PUBLIC void lcommlab(label_no label) { outlabel(label); outlcommon(); } -PUBLIC void lcommon(name) -char *name; +PUBLIC void lcommon(char *name) { outccname(name); outlcommon(); @@ -1126,10 +1102,7 @@ /* load effective address */ -PUBLIC void lea(offset, sourcereg, targreg) -offset_T offset; -store_pt sourcereg; -store_pt targreg; +PUBLIC void lea(offset_T offset, store_pt sourcereg, store_pt targreg) { outlea(); outregname(targreg); @@ -1142,9 +1115,7 @@ /* load constant into given register */ -PUBLIC void loadconst(offset, reg) -offset_T offset; -store_pt reg; +PUBLIC void loadconst(offset_T offset, store_pt reg) { #ifdef I8088 if (offset == 0) @@ -1200,9 +1171,7 @@ /* partially long shift left register by a constant (negative = infinity) */ -PUBLIC int lslconst(shift, reg) -value_t shift; -store_pt reg; +PUBLIC int lslconst(value_t shift, store_pt reg) { if ((uvalue_t) shift >= INT16BITSTO) { @@ -1236,10 +1205,7 @@ /* partially long shift right register by a constant (negative = infinity) */ -PUBLIC int lsrconst(shift, reg, uflag) -value_t shift; -store_pt reg; -bool_pt uflag; +PUBLIC int lsrconst(value_t shift, store_pt reg, bool_pt uflag) { if ((uvalue_t) shift >= INT16BITSTO) { @@ -1287,9 +1253,7 @@ /* take D register modulo a constant if it is easy to do with a mask */ -PUBLIC bool_pt modeasy(divisor, uflag) -value_t divisor; -bool_pt uflag; +PUBLIC bool_pt modeasy(value_t divisor, bool_pt uflag) { bool_t sign; @@ -1317,9 +1281,7 @@ /* multiply register by a constant if it is easy to do with shifts */ -PUBLIC bool_pt muleasy(factor, reg) -uvalue_t factor; -store_pt reg; +PUBLIC bool_pt muleasy(uvalue_t factor, store_pt reg) { int mulstack[MAXINTBITSTO / 2 + 1]; /* must be signed, not a fastin_t */ fastin_pt count; @@ -1397,8 +1359,7 @@ /* negate a register */ -PUBLIC void negreg(reg) -store_pt reg; +PUBLIC void negreg(store_pt reg) { if ((store_t) reg == BREG) extBnegD(); @@ -1408,8 +1369,7 @@ /* return string of operator */ -PUBLIC char *opstring(op) -op_pt op; +PUBLIC char *opstring(op_pt op) { switch (op) { @@ -1432,8 +1392,7 @@ /* print a c compiler name with leading CCNAMEPREXFIX */ -PUBLIC void outccname(name) -char *name; +PUBLIC void outccname(char *name) { outbyte(CCNAMEPREFIX); outstr(name); @@ -1448,8 +1407,7 @@ /* print immediate address */ -PUBLIC void outimmadr(offset) -offset_T offset; +PUBLIC void outimmadr(offset_T offset) { #ifdef I8088 if (!isbyteoffset(offset)) @@ -1464,9 +1422,7 @@ /* print register, comma, immediate address and adjust lc */ -PUBLIC void outimadj(offset, targreg) -offset_T offset; -store_pt targreg; +PUBLIC void outimadj(offset_T offset, store_pt targreg) { outregname(targreg); adjlc(offset, targreg); @@ -1491,8 +1447,7 @@ /* print cc name, then newline */ -PUBLIC void outnccname(name) -char *name; +PUBLIC void outnccname(char *name) { outccname(name); outnl(); @@ -1500,8 +1455,7 @@ /* print separator, immediate address, newline */ -PUBLIC void outncimmadr(offset) -offset_T offset; +PUBLIC void outncimmadr(offset_T offset) { #ifdef I8088 outcomma(); @@ -1515,8 +1469,7 @@ /* print signed offset and adjust lc */ -PUBLIC void outoffset(offset) -offset_T offset; +PUBLIC void outoffset(offset_T offset) { #ifdef MC6809 if (!is5bitoffset(offset)) @@ -1532,8 +1485,7 @@ outstr(stackregstr); } -PUBLIC void public(name) -char *name; +PUBLIC void public(char *name) { #ifndef AS09 outexport(); @@ -1545,8 +1497,7 @@ /* print cc name as a private label */ -PUBLIC void private(name) -char *name; +PUBLIC void private(char *name) { #ifdef LABELENDCHAR outccname(name); @@ -1558,9 +1509,7 @@ /* exchange registers */ -PUBLIC void regexchange(sourcereg, targreg) -store_pt sourcereg; -store_pt targreg; +PUBLIC void regexchange(store_pt sourcereg, store_pt targreg) { outexchange(); outregname(sourcereg); @@ -1573,9 +1522,7 @@ /* transfer a register */ -PUBLIC void regtransfer(sourcereg, targreg) -store_pt sourcereg; -store_pt targreg; +PUBLIC void regtransfer(store_pt sourcereg, store_pt targreg) { outtransfer(); #ifdef TARGET_FIRST @@ -1610,9 +1557,7 @@ /* set a name to a value */ -PUBLIC void set(name, value) -char *name; -offset_T value; +PUBLIC void set(char *name, offset_T value) { outccname(funcname); outbyte(LOCALSTARTCHAR); @@ -1658,8 +1603,7 @@ /* shift left register by 1 */ -PUBLIC void sl1(reg) -store_pt reg; +PUBLIC void sl1(store_pt reg) { outsl(); #ifdef I8088 @@ -1674,9 +1618,7 @@ /* shift left register by a constant (negative = infinity) */ -PUBLIC void slconst(shift, reg) -value_t shift; -store_pt reg; +PUBLIC void slconst(value_t shift, store_pt reg) { #ifdef I80386 if (i386_32) @@ -1725,9 +1667,7 @@ /* shift right D register by a constant (negative = infinity) */ -PUBLIC void srconst(shift, uflag) -value_t shift; -bool_pt uflag; +PUBLIC void srconst(value_t shift, bool_pt uflag) { #ifdef I80386 if (i386_32) @@ -1795,8 +1735,7 @@ /* extend an unsigned in DREG to a long */ -PUBLIC void uitol(reg) -store_pt reg; +PUBLIC void uitol(store_pt reg) { if (lowregisDreg()) clr(reg); diff -Naur a/bcc/dbnode.c b/bcc/dbnode.c --- a/bcc/dbnode.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/dbnode.c 2023-02-10 23:42:30.770631915 -0500 @@ -44,8 +44,7 @@ FORWARD void outindchars P((int byte, indn_pt count)); -PUBLIC void dbitem(item) -struct symstruct *item; +PUBLIC void dbitem(struct symstruct *item) { dbtype(item->type); if (item->storage == NOSTORAGE) @@ -126,8 +125,7 @@ outindchars(']', item->indcount); } -PUBLIC void dbtype(type) -struct typestruct *type; +PUBLIC void dbtype(struct typestruct *type) { for ( ; type != NULL; type = type->nexttype) { @@ -156,8 +154,7 @@ } } -PUBLIC void dbnode(exp) /* sub-nodes must be leaves */ -struct nodestruct *exp; +PUBLIC void dbnode(struct nodestruct *exp) /* sub-nodes must be leaves */ { if (!dbnodeon) return; @@ -189,9 +186,7 @@ outnstr("! Debug: expression subtree swapping"); } -PRIVATE void outindchars(byte, count) -int byte; -indn_pt count; +PRIVATE void outindchars(int byte, indn_pt count) { while (count--) outbyte(byte); diff -Naur a/bcc/dbprintf.c b/bcc/dbprintf.c --- a/bcc/dbprintf.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/dbprintf.c 2023-02-10 23:43:01.981476405 -0500 @@ -1,6 +1,8 @@ #include #include +#include +#include #if defined(__STDC__) && !defined(__FIRST_ARG_IN_AX__) #include @@ -10,6 +12,8 @@ #define va_strt(p,i) va_start(p) #endif +int vdbprintf(register __const char *fmt, register va_list ap); + #if defined(__STDC__) && !defined(__FIRST_ARG_IN_AX__) int dbprintf(const char * fmt, ...) #else @@ -30,9 +34,7 @@ static void putch(int ch) { static char buf[2]; *buf = ch; write(2,buf,1); } int -vdbprintf(fmt, ap) -register __const char *fmt; -register va_list ap; +vdbprintf(register __const char *fmt, register va_list ap) { int c; int count = 0; diff -Naur a/bcc/declare.c b/bcc/declare.c --- a/bcc/declare.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/declare.c 2023-02-10 23:42:30.770631915 -0500 @@ -54,9 +54,7 @@ FORWARD void rdeclarator P((void)); FORWARD bool_pt regdecl P((void)); -PRIVATE struct typestruct *chainprefix(pretype, sufftype) -struct typestruct *pretype; -struct typestruct *sufftype; +PRIVATE struct typestruct *chainprefix(struct typestruct *pretype, struct typestruct *sufftype) { if (pretype->nexttype != NULL) { @@ -324,10 +322,7 @@ /* declselt - get list of declarations for a structure/union member */ -PRIVATE void declselt(structype, psoffset, ptypelist) -struct typestruct *structype; -offset_T *psoffset; -struct typelist **ptypelist; +PRIVATE void declselt(struct typestruct *structype, offset_T *psoffset, struct typelist **ptypelist) { struct typestruct *basetype; value_t fieldwidth; @@ -959,8 +954,7 @@ argsallowed = FALSE; } -PRIVATE void initarray(type) -struct typestruct *type; +PRIVATE void initarray(struct typestruct *type) { uoffset_T basesize; struct typestruct *basetype; @@ -1001,8 +995,7 @@ defnulls(remaining * basesize); } -PRIVATE void inititem(type) -struct typestruct *type; +PRIVATE void inititem(struct typestruct *type) { sym_t startsym; @@ -1034,8 +1027,7 @@ } } -PRIVATE void initstruct(type) -struct typestruct *type; +PRIVATE void initstruct(struct typestruct *type) { struct typestruct *memtype; uoffset_T newoffset; @@ -1074,14 +1066,12 @@ nextsym(); } -PRIVATE void multidecl(sname) -char *sname; +PRIVATE void multidecl(char *sname) { error2error(sname, " already declared"); } -PRIVATE void need(charneeded) -int charneeded; +PRIVATE void need(int charneeded) { static char message[] = "need 'x'"; @@ -1240,9 +1230,7 @@ return anons; } -PUBLIC void anonname(name, i) -char *name; -int i; +PUBLIC void anonname(char *name, int i) { if (i == 0xfff) fatalerror("Too many anonymous structs/unions"); diff -Naur a/bcc/express.c b/bcc/express.c --- a/bcc/express.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/express.c 2023-02-10 23:42:30.771631910 -0500 @@ -98,8 +98,7 @@ return lhs; } -PRIVATE struct nodestruct *exp3to12(lprecedence) -fastin_pt lprecedence; +PRIVATE struct nodestruct *exp3to12(fastin_pt lprecedence) { struct nodestruct *lhs; op_pt op; @@ -206,8 +205,7 @@ return parent; } -PRIVATE struct nodestruct *postfix_exp(seenlp) -bool_pt seenlp; +PRIVATE struct nodestruct *postfix_exp(bool_pt seenlp) { struct nodestruct *nodeptr; struct symstruct *symptr; diff -Naur a/bcc/exptree.c b/bcc/exptree.c --- a/bcc/exptree.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/exptree.c 2023-02-10 23:42:30.771631910 -0500 @@ -39,15 +39,13 @@ FORWARD int redscalar P((struct nodestruct *nodeptr)); FORWARD struct nodestruct *unconvert P((struct nodestruct *nodeptr)); -PRIVATE void badlvalue(nodeptr) -struct nodestruct *nodeptr; +PRIVATE void badlvalue(struct nodestruct *nodeptr) { error("invalid lvalue"); fixnode(nodeptr); } -PRIVATE void binconvert(nodeptr) -register struct nodestruct *nodeptr; +PRIVATE void binconvert(register struct nodestruct *nodeptr) { bool_t bothscalar; value_t divisor; @@ -118,15 +116,12 @@ nodeptr->nodetype = itype; } -PRIVATE void castiright(nodeptr) -struct nodestruct *nodeptr; +PRIVATE void castiright(struct nodestruct *nodeptr) { nodeptr->right = castnode(itype, nodeptr->right); } -PUBLIC struct nodestruct *castnode(type, nodeptr) -struct typestruct *type; -struct nodestruct *nodeptr; +PUBLIC struct nodestruct *castnode(struct typestruct *type, struct nodestruct *nodeptr) { struct symstruct *symptr; @@ -148,8 +143,7 @@ ettop = (etptr = etree) + ETREESIZE; } -PRIVATE void fixnode(nodeptr) -register struct nodestruct *nodeptr; +PRIVATE void fixnode(register struct nodestruct *nodeptr) { nodeptr->tag = LEAF; nodeptr->flags = nodeptr->weight = 0; @@ -157,8 +151,7 @@ nodeptr->nodetype = errtype; } -PRIVATE bool_pt isconst0(nodeptr) -register struct nodestruct *nodeptr; +PRIVATE bool_pt isconst0(register struct nodestruct *nodeptr) { register struct symstruct *symptr; @@ -168,8 +161,7 @@ symptr->type->scalar & ISCALAR; } -PRIVATE bool_pt isnodecharconst(nodeptr) -register struct nodestruct *nodeptr; +PRIVATE bool_pt isnodecharconst(register struct nodestruct *nodeptr) { register struct symstruct *symptr; @@ -181,8 +173,7 @@ return FALSE; } -PUBLIC struct nodestruct *leafnode(source) -struct symstruct *source; +PUBLIC struct nodestruct *leafnode(struct symstruct *source) { register struct nodestruct *leafptr; @@ -196,8 +187,7 @@ return leafptr; } -PRIVATE void needint(nodeptr) -struct nodestruct *nodeptr; +PRIVATE void needint(struct nodestruct *nodeptr) { if (!(nodeptr->nodetype->scalar & ISCALAR)) { @@ -206,8 +196,7 @@ } } -PRIVATE void neednonstruct(nodeptr) -struct nodestruct *nodeptr; +PRIVATE void neednonstruct(struct nodestruct *nodeptr) { if (nodeptr->nodetype->constructor & STRUCTU) { @@ -216,8 +205,7 @@ } } -PRIVATE void needscalar(nodeptr) -struct nodestruct *nodeptr; +PRIVATE void needscalar(struct nodestruct *nodeptr) { if (!nodeptr->nodetype->scalar) { @@ -226,8 +214,7 @@ } } -PRIVATE void needspv(nodeptr) -struct nodestruct *nodeptr; +PRIVATE void needspv(struct nodestruct *nodeptr) { if (nodeptr->nodetype->constructor & (ARRAY | FUNCTION | STRUCTU)) { @@ -236,10 +223,7 @@ } } -PUBLIC struct nodestruct *node(t, p1, p2) -op_pt t; -struct nodestruct *p1; -struct nodestruct *p2; +PUBLIC struct nodestruct *node(op_pt t, struct nodestruct *p1, struct nodestruct *p2) { #if MAXREGS != 1 weight_t rightweight; @@ -812,8 +796,7 @@ } } -PRIVATE struct typestruct *nodetype(nodeptr) -struct nodestruct *nodeptr; +PRIVATE struct typestruct *nodetype(struct nodestruct *nodeptr) { scalar_t bothscalar; scalar_t lscalar; @@ -1097,16 +1080,14 @@ return left->nodetype; } -PRIVATE int redscalar(nodeptr) -register struct nodestruct *nodeptr; +PRIVATE int redscalar(register struct nodestruct *nodeptr) { if (isnodecharconst(nodeptr)) return CHAR; return nodeptr->nodetype->scalar; } -PRIVATE struct nodestruct *unconvert(nodeptr) -struct nodestruct *nodeptr; +PRIVATE struct nodestruct *unconvert(struct nodestruct *nodeptr) { if (nodeptr->nodetype->constructor & (ARRAY | FUNCTION)) return castnode(pointype(nodeptr->nodetype->constructor & ARRAY ? diff -Naur a/bcc/floatop.c b/bcc/floatop.c --- a/bcc/floatop.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/floatop.c 2023-02-10 23:42:30.771631910 -0500 @@ -15,8 +15,7 @@ return nonzero iff the result is a temp double on the base of the stack -----------------------------------------------------------------------------*/ -PUBLIC bool_pt f_indirect(target) -struct symstruct *target; +PUBLIC bool_pt f_indirect(struct symstruct *target) { if (target->indcount == 0) { @@ -72,9 +71,7 @@ result is double on stack (or in condition codes for EQOP) -----------------------------------------------------------------------------*/ -PUBLIC void float1op(op, source) -op_pt op; -struct symstruct *source; +PUBLIC void float1op(op_pt op, struct symstruct *source) { saveopreg(); pointat(source); @@ -94,10 +91,7 @@ result is double on stack (or in condition codes for EQOP) ----------------------------------------------------------------------------*/ -PUBLIC void floatop(op, source, target) -op_pt op; -struct symstruct *source; -struct symstruct *target; +PUBLIC void floatop(op_pt op, struct symstruct *source, struct symstruct *target) { store_t regmark; bool_t sflag; @@ -156,8 +150,7 @@ OPREG must be free -----------------------------------------------------------------------------*/ -PUBLIC void fpush(source) -struct symstruct *source; +PUBLIC void fpush(struct symstruct *source) { scalar_t scalar; @@ -183,8 +176,7 @@ records that target has just been pushed to a double on the stack -----------------------------------------------------------------------------*/ -PUBLIC void justpushed(target) -struct symstruct *target; +PUBLIC void justpushed(struct symstruct *target) { sp -= dtypesize; onstack(target); diff -Naur a/bcc/function.c b/bcc/function.c --- a/bcc/function.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/function.c 2023-02-10 23:42:30.771631910 -0500 @@ -24,15 +24,13 @@ /* call a named (assembly interface) procedure, don't print newline after */ -PUBLIC void call(name) -char *name; +PUBLIC void call(char *name) { out_callstring(); outstr(name); } -PUBLIC void function(source) -struct symstruct *source; +PUBLIC void function(struct symstruct *source) { if (source->indcount == 0 && source->storage == GLOBAL && !(source->flags & LABELLED) && *source->name.namep != 0) @@ -223,9 +221,7 @@ } } -PUBLIC void listo(target, lastargsp) -struct symstruct *target; -offset_T lastargsp; +PUBLIC void listo(struct symstruct *target, offset_T lastargsp) { extend(target); push(target); @@ -246,8 +242,7 @@ } } -PUBLIC void listroot(target) -struct symstruct *target; +PUBLIC void listroot(struct symstruct *target) { extend(target); /* necessary regs are free since they were saved for function */ diff -Naur a/bcc/gencode.c b/bcc/gencode.c --- a/bcc/gencode.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/gencode.c 2023-02-10 23:42:30.772631905 -0500 @@ -149,10 +149,7 @@ FORWARD void smakeleaf P((struct nodestruct *exp)); FORWARD void tcheck P((struct nodestruct *exp)); -PRIVATE void abop(op, source, target) -op_pt op; -struct symstruct *source; -struct symstruct *target; +PRIVATE void abop(op_pt op, struct symstruct *source, struct symstruct *target) { store_pt regmark; store_pt regpushed; @@ -210,8 +207,7 @@ recovlist(regpushed); } -PUBLIC void bileaf(exp) -struct nodestruct *exp; +PUBLIC void bileaf(struct nodestruct *exp) { bool_t commutop; bool_t tookaddress; @@ -367,8 +363,7 @@ } } -PUBLIC fastin_pt bitcount(number) -register uvalue_t number; +PUBLIC fastin_pt bitcount(register uvalue_t number) { register fastin_pt count; @@ -457,8 +452,7 @@ #endif } -PUBLIC fastin_pt highbit(number) -register uvalue_t number; +PUBLIC fastin_pt highbit(register uvalue_t number) { register fastin_pt bit; @@ -467,8 +461,7 @@ return bit; } -PUBLIC void makeleaf(exp) -struct nodestruct *exp; +PUBLIC void makeleaf(struct nodestruct *exp) { ccode_t condtrue; op_pt op; @@ -690,8 +683,7 @@ #endif } -PRIVATE void smakeleaf(exp) -struct nodestruct *exp; +PRIVATE void smakeleaf(struct nodestruct *exp) { struct nodestruct *left; @@ -714,8 +706,7 @@ #ifdef SELFTYPECHECK -PRIVATE void tcheck(exp) -register struct nodestruct *exp; +PRIVATE void tcheck(register struct nodestruct *exp) { register struct symstruct *target; diff -Naur a/bcc/genloads.c b/bcc/genloads.c --- a/bcc/genloads.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/genloads.c 2023-02-10 23:42:30.772631905 -0500 @@ -20,8 +20,7 @@ FORWARD void outnnadr P((struct symstruct *adr)); FORWARD fastin_pt pushpull P((store_pt reglist, bool_pt pushflag)); -PUBLIC void addoffset(source) -struct symstruct *source; +PUBLIC void addoffset(struct symstruct *source) { #ifdef I8088 if (source->level == OFFKLUDGELEVEL) @@ -47,8 +46,7 @@ } } -PUBLIC void address(source) -struct symstruct *source; +PUBLIC void address(struct symstruct *source) { if (source->indcount == 0) bugerror("taking address of non-lvalue"); @@ -68,8 +66,7 @@ bugerror("bad address"); } -PRIVATE void blockpush(source) -struct symstruct *source; +PRIVATE void blockpush(struct symstruct *source) { struct symstruct *length; offset_T spmark; @@ -98,9 +95,7 @@ indirec(source); } -PUBLIC void exchange(source, target) -struct symstruct *source; -struct symstruct *target; +PUBLIC void exchange(struct symstruct *source, struct symstruct *target) { store_t tempreg; @@ -151,9 +146,7 @@ (except for PC register direct, since there is no LEAX D,PC) -----------------------------------------------------------------------------*/ -PUBLIC void indexadr(source, target) -struct symstruct *source; -struct symstruct *target; +PUBLIC void indexadr(struct symstruct *source, struct symstruct *target) { #ifdef MC6809 bool_t canABX; @@ -289,8 +282,7 @@ target->storage = targreg; } -PUBLIC void indirec(source) -struct symstruct *source; +PUBLIC void indirec(struct symstruct *source) { if (!(source->type->constructor & (ARRAY | POINTER))) bugerror("illegal indirection"); @@ -315,9 +307,7 @@ the result has no offset -----------------------------------------------------------------------------*/ -PUBLIC void load(source, targreg) -struct symstruct *source; -store_pt targreg; +PUBLIC void load(struct symstruct *source, store_pt targreg) { if (source->type->scalar & DLONG) { @@ -422,9 +412,7 @@ bugerror("attempting to load non-scalar non-pointer"); } -PRIVATE void loadadr(source, targreg) -struct symstruct *source; -store_pt targreg; +PRIVATE void loadadr(struct symstruct *source, store_pt targreg) { if ((store_t) targreg & ALLDATREGS) { @@ -468,8 +456,7 @@ loadreg(source, targreg); } -PUBLIC void loadany(source) -struct symstruct *source; +PUBLIC void loadany(struct symstruct *source) { if (source->indcount != 0 || source->offset.offi != 0 || /* kludge u cmp */ source->level == OFFKLUDGELEVEL || !(source->storage & allregs)) @@ -492,9 +479,7 @@ } } -PRIVATE void loadlongindirect(source, targreg) -struct symstruct *source; -store_pt targreg; +PRIVATE void loadlongindirect(struct symstruct *source, store_pt targreg) { sc_t flags; offset_T offset; @@ -517,9 +502,7 @@ source->type = type; } -PUBLIC void loadreg(source, targreg) -struct symstruct *source; -store_pt targreg; +PUBLIC void loadreg(struct symstruct *source, store_pt targreg) { offset_T longhigh; offset_T longlow; @@ -629,8 +612,7 @@ } } -PUBLIC void makelessindirect(source) -struct symstruct *source; +PUBLIC void makelessindirect(struct symstruct *source) { store_pt lreg; @@ -650,9 +632,7 @@ #endif } -PUBLIC void movereg(source, targreg) -struct symstruct *source; -store_pt targreg; +PUBLIC void movereg(struct symstruct *source, store_pt targreg) { if ((store_t) targreg & ALLDATREGS && source->type->scalar & CHAR) targreg = BREG; @@ -685,8 +665,7 @@ source->offset.offi = 0; /* indcount was adjusted by outadr */ } -PUBLIC void onstack(target) -register struct symstruct *target; +PUBLIC void onstack(register struct symstruct *target) { target->storage = LOCAL; target->flags = TEMP; @@ -696,22 +675,19 @@ target->offset.offi = sp; } -PUBLIC void outadr(adr) -struct symstruct *adr; +PUBLIC void outadr(struct symstruct *adr) { outnnadr(adr); outnl(); } -PUBLIC void outcregname(reg) -store_pt reg; +PUBLIC void outcregname(store_pt reg) { outcomma(); outregname(reg); } -PRIVATE void outnamoffset(adr) -struct symstruct *adr; +PRIVATE void outnamoffset(struct symstruct *adr) { if (adr->flags & LABELLED) outlabel(adr->name.label); @@ -732,15 +708,13 @@ /* print comma, then register name, then newline */ -PUBLIC void outncregname(reg) -store_pt reg; +PUBLIC void outncregname(store_pt reg) { outcomma(); outnregname(reg); } -PRIVATE void outnnadr(adr) -struct symstruct *adr; +PRIVATE void outnnadr(struct symstruct *adr) { bool_t indflag; @@ -971,8 +945,7 @@ /* print register name, then newline */ -PUBLIC void outnregname(reg) -store_pt reg; +PUBLIC void outnregname(store_pt reg) { outregname(reg); outnl(); @@ -980,8 +953,7 @@ /* print register name */ -PUBLIC void outregname(reg) -store_pt reg; +PUBLIC void outregname(store_pt reg) { switch ((store_t) reg) { @@ -1053,8 +1025,7 @@ #if defined(I8088) && defined(I80386) /* print register name for short type */ -PUBLIC void outshortregname(reg) -store_pt reg; +PUBLIC void outshortregname(store_pt reg) { switch ((store_t) reg) { @@ -1090,8 +1061,7 @@ target must be singly indirect or float or double -----------------------------------------------------------------------------*/ -PUBLIC void pointat(target) -struct symstruct *target; +PUBLIC void pointat(struct symstruct *target) { if (target->type->scalar & RSCALAR) (void) f_indirect(target); @@ -1100,15 +1070,13 @@ target->type = target->type->nexttype; } -PUBLIC void poplist(reglist) -store_pt reglist; +PUBLIC void poplist(store_pt reglist) { if (reglist) sp += pushpull(reglist, FALSE); } -PUBLIC void push(source) -struct symstruct *source; +PUBLIC void push(struct symstruct *source) { store_t reg; #ifdef I8088 @@ -1192,16 +1160,13 @@ onstack(source); } -PUBLIC void pushlist(reglist) -store_pt reglist; +PUBLIC void pushlist(store_pt reglist) { if ((store_t) reglist) sp -= pushpull(reglist, TRUE); } -PRIVATE fastin_pt pushpull(reglist, pushflag) -store_pt reglist; -bool_pt pushflag; +PRIVATE fastin_pt pushpull(store_pt reglist, bool_pt pushflag) { store_pt lastregbit; void (*ppfunc) P((void)); @@ -1290,8 +1255,7 @@ return bytespushed; } -PUBLIC void pushreg(reg) -store_pt reg; +PUBLIC void pushreg(store_pt reg) { outpshs(); outtab(); @@ -1299,9 +1263,7 @@ sp -= pshregsize; } -PUBLIC void storereg(sourcereg, target) -store_pt sourcereg; -struct symstruct *target; +PUBLIC void storereg(store_pt sourcereg, struct symstruct *target) { store_pt targreg; @@ -1373,9 +1335,7 @@ structure.element -----------------------------------------------------------------------------*/ -PUBLIC void struc(source, target) -struct symstruct *source; -struct symstruct *target; +PUBLIC void struc(struct symstruct *source, struct symstruct *target) { address(target); if (source->offset.offi != 0 || source->level == OFFKLUDGELEVEL) @@ -1393,9 +1353,7 @@ } } -PUBLIC void transfer(source, targreg) -struct symstruct *source; -store_pt targreg; +PUBLIC void transfer(struct symstruct *source, store_pt targreg) { regtransfer(source->storage, targreg); source->storage = targreg; diff -Naur a/bcc/glogcode.c b/bcc/glogcode.c --- a/bcc/glogcode.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/glogcode.c 2023-02-10 23:42:30.772631905 -0500 @@ -54,10 +54,7 @@ FORWARD void testcond P((struct nodestruct *exp, label_no truelab, label_no falselab, bool_pt nojump)); -PUBLIC void cmp(source, target, pcondtrue) -struct symstruct *source; -struct symstruct *target; -ccode_t *pcondtrue; +PUBLIC void cmp(struct symstruct *source, struct symstruct *target, ccode_t *pcondtrue) { label_no falselab; @@ -93,10 +90,7 @@ loadlogical(target, falselab); } -PRIVATE void cmplocal(source, target, pcondtrue) -struct symstruct *source; -struct symstruct *target; -ccode_t *pcondtrue; +PRIVATE void cmplocal(struct symstruct *source, struct symstruct *target, ccode_t *pcondtrue) { scalar_t sscalar; scalar_t tempscalar; @@ -189,8 +183,7 @@ #ifdef MC6809 -PRIVATE void cmporsub(target) -struct symstruct *target; +PRIVATE void cmporsub(struct symstruct *target) { if (target->storage & ALLDATREGS) outsub(); @@ -202,10 +195,7 @@ } } -PRIVATE bool_pt cmpsmallconst(intconst, target, pcondtrue) -value_t intconst; -struct symstruct *target; -ccode_t *pcondtrue; +PRIVATE bool_pt cmpsmallconst(value_t intconst, struct symstruct *target, ccode_t *pcondtrue) { store_pt targreg; @@ -228,11 +218,10 @@ #endif -PRIVATE void comparecond(exp, truelab, falselab, nojump) -struct nodestruct *exp; -label_no truelab; -label_no falselab; -bool_pt nojump; /* NB if nonzero, is ~0 so complement is 0 */ +PRIVATE void comparecond(struct nodestruct *exp, + label_no truelab, + label_no falselab, + bool_pt nojump /* NB if nonzero, is ~0 so complement is 0 */) { ccode_t condtrue; store_t regmark; @@ -275,8 +264,7 @@ lbranch(condtrue, truelab); } -PUBLIC void condop(exp) -struct nodestruct *exp; +PUBLIC void condop(struct nodestruct *exp) { label_no exitlab; label_no falselab; @@ -316,11 +304,10 @@ exp->left.symptr = truesym; } -PRIVATE void jumpcond(exp, truelab, falselab, nojump) -struct nodestruct *exp; -label_no truelab; -label_no falselab; -bool_pt nojump; /* NB if nonzero, is ~0 so complement is 0 */ +PRIVATE void jumpcond(struct nodestruct *exp, + label_no truelab, + label_no falselab, + bool_pt nojump /* NB if nonzero, is ~0 so complement is 0 */) { switch (exp->tag) { @@ -347,9 +334,7 @@ } } -PUBLIC void jumpfalse(exp, label) -struct nodestruct *exp; -label_no label; +PUBLIC void jumpfalse(struct nodestruct *exp, label_no label) { label_no truelab; @@ -357,9 +342,7 @@ deflabel(truelab); } -PUBLIC void jumptrue(exp, label) -struct nodestruct *exp; -label_no label; +PUBLIC void jumptrue(struct nodestruct *exp, label_no label) { label_no falselab; @@ -367,9 +350,7 @@ deflabel(falselab); } -PRIVATE void loadlogical(source, falselab) -struct symstruct *source; -label_no falselab; +PRIVATE void loadlogical(struct symstruct *source, label_no falselab) { label_no exitlab; struct symstruct *target; @@ -386,11 +367,10 @@ outnlabel(exitlab); } -PRIVATE void logandcond(exp, truelab, falselab, nojump) -struct nodestruct *exp; -label_no truelab; -label_no falselab; -bool_pt nojump; /* NB if nonzero, is ~0 so complement is 0 */ +PRIVATE void logandcond(struct nodestruct *exp, + label_no truelab, + label_no falselab, + bool_pt nojump /* NB if nonzero, is ~0 so complement is 0 */) { label_no andlab; @@ -400,8 +380,7 @@ jumpcond(exp->right, truelab, falselab, nojump); } -PUBLIC void logop(exp) -struct nodestruct *exp; +PUBLIC void logop(struct nodestruct *exp) { label_no falselab; struct symstruct *target; @@ -416,11 +395,10 @@ exp->left.symptr = target; } -PRIVATE void logorcond(exp, truelab, falselab, nojump) -struct nodestruct *exp; -label_no truelab; -label_no falselab; -bool_pt nojump; /* NB if nonzero, is ~0 so complement is 0 */ +PRIVATE void logorcond(struct nodestruct *exp, + label_no truelab, + label_no falselab, + bool_pt nojump /* NB if nonzero, is ~0 so complement is 0 */) { label_no orlab; @@ -430,8 +408,7 @@ jumpcond(exp->right, truelab, falselab, nojump); } -PRIVATE void reduceconst(source) -struct symstruct *source; +PRIVATE void reduceconst(struct symstruct *source) { if (source->storage == CONSTANT && ischarconst(source->offset.offv) && (source->type->scalar & (CHAR | SHORT | INT | DLONG)) != DLONG) @@ -443,9 +420,7 @@ } } -PRIVATE void test(target, pcondtrue) -struct symstruct *target; -ccode_t *pcondtrue; +PRIVATE void test(struct symstruct *target, ccode_t *pcondtrue) { #ifdef I8088 store_t targreg; @@ -530,11 +505,10 @@ /* test expression and jump depending on NE/EQ */ -PRIVATE void testcond(exp, truelab, falselab, nojump) -struct nodestruct *exp; -label_no truelab; -label_no falselab; -bool_pt nojump; /* NB if nonzero, is ~0 so complement is 0 */ +PRIVATE void testcond(struct nodestruct *exp, + label_no truelab, + label_no falselab, + bool_pt nojump /* NB if nonzero, is ~0 so complement is 0 */) { ccode_t condtrue; struct symstruct *source; diff -Naur a/bcc/hardop.c b/bcc/hardop.c --- a/bcc/hardop.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/hardop.c 2023-02-10 23:42:30.772631905 -0500 @@ -14,9 +14,7 @@ FORWARD void sub1 P((struct symstruct *source, struct symstruct *target)); -PUBLIC void add(source, target) -struct symstruct *source; -struct symstruct *target; +PUBLIC void add(struct symstruct *source, struct symstruct *target) { scalar_t sscalar; @@ -60,9 +58,7 @@ target->type = iscalartotype(target->type->scalar | sscalar); } -PUBLIC void incdec(op, source) -op_pt op; -struct symstruct *source; +PUBLIC void incdec(op_pt op, struct symstruct *source) { offset_T bump; bool_t postflag; @@ -182,8 +178,7 @@ #endif } -PUBLIC void neg(target) -struct symstruct *target; +PUBLIC void neg(struct symstruct *target) { scalar_t scalar; struct symstruct *source; @@ -213,8 +208,7 @@ } } -PUBLIC void not(target) -struct symstruct *target; +PUBLIC void not(struct symstruct *target) { if (target->type->scalar & DLONG) long1op(NOTOP, target); @@ -228,10 +222,7 @@ /* 1-byte ops like AND acting on integers (not both constant) */ -PUBLIC void op1(op, source, target) -op_pt op; -struct symstruct *source; -struct symstruct *target; +PUBLIC void op1(op_pt op, struct symstruct *source, struct symstruct *target) { char *opstr; #ifdef OP1 @@ -424,9 +415,7 @@ } } -PUBLIC void ptrsub(source, target) -struct symstruct *source; -struct symstruct *target; +PUBLIC void ptrsub(struct symstruct *source, struct symstruct *target) { label_no exitlab; uoffset_T factor; @@ -461,9 +450,7 @@ } } -PUBLIC void sub(source, target) -struct symstruct *source; -struct symstruct *target; +PUBLIC void sub(struct symstruct *source, struct symstruct *target) { scalar_t sscalar; @@ -489,9 +476,7 @@ target->type = iscalartotype(target->type->scalar | sscalar); } -PRIVATE void sub1(source, target) -struct symstruct *source; -struct symstruct *target; +PRIVATE void sub1(struct symstruct *source, struct symstruct *target) { if (source->storage == CONSTANT) source->type = itype; diff -Naur a/bcc/input.c b/bcc/input.c --- a/bcc/input.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/input.c 2023-02-10 23:42:30.772631905 -0500 @@ -153,8 +153,7 @@ } #ifdef BUILTIN_CPP -PRIVATE void definefile(fname) -char *fname; +PRIVATE void definefile(char *fname) { char *def; @@ -366,9 +365,7 @@ /* initialise current input file */ -PRIVATE void inputinit(fname, fd) -char *fname; -fd_t fd; +PRIVATE void inputinit(char *fname, fd_t fd) { register struct fbufstruct *newinputbuf; @@ -478,9 +475,7 @@ /* open input and output files and get options */ -PUBLIC void openio(argc, argv) -int argc; -char *argv[]; +PUBLIC void openio(int argc, char *argv[]) { register char *arg; int argn; diff -Naur a/bcc/label.c b/bcc/label.c --- a/bcc/label.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/label.c 2023-02-10 23:42:30.773631900 -0500 @@ -70,10 +70,7 @@ /* add label to circular list */ -PRIVATE void addlabel(cond, label, patch) -ccode_pt cond; -label_no label; -char *patch; +PRIVATE void addlabel(ccode_pt cond, label_no label, char *patch) { register struct labdatstruct *labptr; @@ -128,9 +125,7 @@ /* clear out labels no longer in buffer */ -PUBLIC void clearlabels(patchbuf, patchtop) -char *patchbuf; -char *patchtop; +PUBLIC void clearlabels(char *patchbuf, char *patchtop) { register struct labdatstruct *labptr; struct labdatstruct *labtop; @@ -166,8 +161,7 @@ /* define location of label and backpatch references to it */ -PUBLIC void deflabel(label) -label_no label; +PUBLIC void deflabel(label_no label) { char *cnameptr; struct labdatstruct *labmin; @@ -240,8 +234,7 @@ addlabel((ccode_pt) 0, label, (char *) NULL); } -PRIVATE struct labdatstruct *findlabel(label) -label_no label; +PRIVATE struct labdatstruct *findlabel(label_no label) { register struct labdatstruct *labptr; struct labdatstruct *labtop; @@ -273,17 +266,14 @@ /* jump to label */ -PUBLIC void jump(label) -label_no label; +PUBLIC void jump(label_no label) { lbranch(RA, label); } /* long branch on condition to label */ -PUBLIC void lbranch(cond, label) -ccode_pt cond; -label_no label; +PUBLIC void lbranch(ccode_pt cond, label_no label) { #ifdef I8088 char *cnameptr; @@ -361,8 +351,7 @@ /* print condition code name */ -PUBLIC void outcond(cond) -ccode_pt cond; +PUBLIC void outcond(ccode_pt cond) { char *cnameptr; @@ -375,8 +364,7 @@ /* print label */ -PUBLIC void outlabel(label) -label_no label; +PUBLIC void outlabel(label_no label) { outbyte(LABELSTARTCHAR); outhexdigs((uoffset_T) label); @@ -384,8 +372,7 @@ /* print label and newline */ -PUBLIC void outnlabel(label) -label_no label; +PUBLIC void outnlabel(label_no label) { outlabel(label); #ifdef LABELENDCHAR @@ -397,9 +384,7 @@ /* short branch on condition to label */ -PUBLIC void sbranch(cond, label) -ccode_pt cond; -label_no label; +PUBLIC void sbranch(ccode_pt cond, label_no label) { #ifdef I8088 char *cnameptr; diff -Naur a/bcc/loadexp.c b/bcc/loadexp.c --- a/bcc/loadexp.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/loadexp.c 2023-02-10 23:42:30.773631900 -0500 @@ -32,8 +32,7 @@ return 1; } -PUBLIC void initexpression(type) -struct typestruct *type; +PUBLIC void initexpression(struct typestruct *type) { struct nodestruct *etmark; struct nodestruct *exp; @@ -142,9 +141,7 @@ exprptr = exprmark; } -PUBLIC struct typestruct *loadexpression(targreg, targtype) -store_pt targreg; -struct typestruct *targtype; +PUBLIC struct typestruct *loadexpression(store_pt targreg, struct typestruct *targtype) { struct nodestruct *etmark; struct nodestruct *exp; diff -Naur a/bcc/longop.c b/bcc/longop.c --- a/bcc/longop.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/longop.c 2023-02-10 23:42:30.773631900 -0500 @@ -18,10 +18,7 @@ or singly indirect (local, global, or from an index reg) -----------------------------------------------------------------------------*/ -PUBLIC void longop(op, source, target) -op_pt op; -struct symstruct *source; -struct symstruct *target; +PUBLIC void longop(op_pt op, struct symstruct *source, struct symstruct *target) { store_pt reglist; store_t regmark; @@ -138,9 +135,7 @@ or singly indirect (local, global, or from an index reg) -----------------------------------------------------------------------------*/ -PUBLIC void long1op(op, target) -op_pt op; -struct symstruct *target; +PUBLIC void long1op(op_pt op, struct symstruct *target) { pushlist(reguse & OPREG); load(target, OPREG); diff -Naur a/bcc/output.c b/bcc/output.c --- a/bcc/output.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/output.c 2023-02-10 23:42:30.773631900 -0500 @@ -37,8 +37,7 @@ #endif #endif -PUBLIC void bugerror(message) -char *message; +PUBLIC void bugerror(char *message) { error2error("compiler bug? - ", message); } @@ -60,17 +59,14 @@ /* error handler */ -PUBLIC void error(message) -char *message; +PUBLIC void error(char *message) { error2error(message, ""); } /* error handler - concatenate 2 messages */ -PUBLIC void error2error(message1, message2) -char *message1; -char *message2; +PUBLIC void error2error(char *message1, char *message2) { char *warning; @@ -147,8 +143,7 @@ /* fatal error, exit early */ -PUBLIC void fatalerror(message) -char *message; +PUBLIC void fatalerror(char *message) { error(message); finishup(); @@ -233,15 +228,13 @@ output = 1; /* standard output */ } -PUBLIC void limiterror(message) -char *message; +PUBLIC void limiterror(char *message) { error2error("compiler limit exceeded - ", message); finishup(); } -PUBLIC void openout(oname) -char *oname; +PUBLIC void openout(char *oname) { if (output != 1) fatalerror("more than one output file"); @@ -254,8 +247,7 @@ /* print character */ -PUBLIC void outbyte(c) -int c; +PUBLIC void outbyte(int c) { #if C_CODE || __AS09__ + __AS386_16__ + __AS386_32__ != 1 register char *outp; @@ -343,10 +335,7 @@ /* print line number in format ("# %u \"%s\"%s", nr, fname, str) */ -PUBLIC void outcpplinenumber(nr, fname, str) -unsigned nr; -char *fname; -char *str; +PUBLIC void outcpplinenumber(unsigned nr, char *fname, char *str) { outstr("# "); outudec(nr); @@ -358,8 +347,7 @@ /* print unsigned offset, hex format */ -PUBLIC void outhex(num) -uoffset_T num; +PUBLIC void outhex(uoffset_T num) { #ifdef HEXSTARTCHAR if (num >= 10) @@ -374,8 +362,7 @@ /* print unsigned offset, hex format with digits only (no hex designator) */ -PUBLIC void outhexdigs(num) -register uoffset_T num; +PUBLIC void outhexdigs(register uoffset_T num) { if (num >= 0x10) { @@ -387,8 +374,7 @@ /* print string terminated by EOL */ -PUBLIC void outline(s) -char *s; +PUBLIC void outline(char *s) { register char *outp; register char *rs; @@ -426,8 +412,7 @@ /* print character, then newline */ -PUBLIC void outnbyte(byte) -int byte; +PUBLIC void outnbyte(int byte) { outbyte(byte); outnl(); @@ -435,8 +420,7 @@ /* print unsigned offset, hex format, then newline */ -PUBLIC void outnhex(num) -uoffset_T num; +PUBLIC void outnhex(uoffset_T num) { outhex(num); outnl(); @@ -457,8 +441,7 @@ /* print opcode and newline, bump lc by 1 */ -PUBLIC void outnop1str(s) -char *s; +PUBLIC void outnop1str(char *s) { opcodeleadin(); outstr(s); @@ -468,8 +451,7 @@ /* print opcode and newline, bump lc by 2 */ -PUBLIC void outnop2str(s) -char *s; +PUBLIC void outnop2str(char *s) { opcodeleadin(); outstr(s); @@ -479,8 +461,7 @@ /* print string, then newline */ -PUBLIC void outnstr(s) -char *s; +PUBLIC void outnstr(char *s) { outstr(s); outnl(); @@ -488,8 +469,7 @@ /* print opcode */ -PUBLIC void outop0str(s) -char *s; +PUBLIC void outop0str(char *s) { opcodeleadin(); outstr(s); @@ -497,8 +477,7 @@ /* print opcode, bump lc by 1 */ -PUBLIC void outop1str(s) -char *s; +PUBLIC void outop1str(char *s) { opcodeleadin(); outstr(s); @@ -507,8 +486,7 @@ /* print opcode, bump lc by 2 */ -PUBLIC void outop2str(s) -char *s; +PUBLIC void outop2str(char *s) { opcodeleadin(); outstr(s); @@ -517,8 +495,7 @@ /* print opcode, bump lc by 3 */ -PUBLIC void outop3str(s) -char *s; +PUBLIC void outop3str(char *s) { opcodeleadin(); outstr(s); @@ -534,8 +511,7 @@ /* print signed offset, hex format */ -PUBLIC void outshex(num) -offset_T num; +PUBLIC void outshex(offset_T num) { if (num >= -(maxoffsetto + 1)) { @@ -547,8 +523,7 @@ /* print string */ -PUBLIC void outstr(s) -char *s; +PUBLIC void outstr(char *s) { #if C_CODE || __AS09__ + __AS386_16__ + __AS386_32__ != 1 register char *outp; @@ -725,8 +700,7 @@ /* print unsigned, decimal format */ -PUBLIC void outudec(num) -unsigned num; +PUBLIC void outudec(unsigned num) { char str[10 + 1]; @@ -739,8 +713,7 @@ /* print unsigned value, hex format (like outhex except value_t is larger) */ -PUBLIC void outuvalue(num) -uvalue_t num; +PUBLIC void outuvalue(uvalue_t num) { #ifdef HEXSTARTCHAR if (num >= 10) @@ -755,8 +728,7 @@ /* print unsigned value, hex format with digits only (no hex designator) */ -PRIVATE void outvaldigs(num) -register uvalue_t num; +PRIVATE void outvaldigs(register uvalue_t num) { if (num >= 0x10) { @@ -768,8 +740,7 @@ /* print signed value, hex format (like outshex except value_t is larger) */ -PUBLIC void outvalue(num) -register value_t num; +PUBLIC void outvalue(register value_t num) { if (num < 0) { @@ -784,9 +755,7 @@ /* push decimal digits of an unsigned onto a stack of chars */ -PUBLIC char *pushudec(s, num) -register char *s; -register unsigned num; +PUBLIC char *pushudec(register char *s, register unsigned num) { register unsigned reduction; diff -Naur a/bcc/preproc.c b/bcc/preproc.c --- a/bcc/preproc.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/preproc.c 2023-02-10 23:42:30.773631900 -0500 @@ -477,9 +477,8 @@ symptr->prev = hashptr; } -PRIVATE void defineorundefinestring(str, defineflag) -char *str; /* "name[=def]" or "name def" */ -bool_pt defineflag; +PRIVATE void defineorundefinestring(char *str /* "name[=def]" or "name def" */, + bool_pt defineflag) { char *fakeline; unsigned len; @@ -531,8 +530,7 @@ ourfree(fakeline - 3); } -PUBLIC void definestring(str) -char *str; /* "name[=def]" or "name def" */ +PUBLIC void definestring(char *str /* "name[=def]" or "name def" */) { defineorundefinestring(str, TRUE); } @@ -873,8 +871,7 @@ /* ifcontrol - process #if, #ifdef, #ifndef */ -PRIVATE void ifcontrol(ifcase) -sym_pt ifcase; +PRIVATE void ifcontrol(sym_pt ifcase) { bool_t iftrue; struct symstruct *symptr; @@ -1073,8 +1070,7 @@ delsym(symptr); } -PUBLIC void undefinestring(str) -char *str; +PUBLIC void undefinestring(char *str) { defineorundefinestring(str, FALSE); } diff -Naur a/bcc/preserve.c b/bcc/preserve.c --- a/bcc/preserve.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/preserve.c 2023-02-10 23:42:30.774631895 -0500 @@ -10,9 +10,7 @@ /* change stack ptr without changing condition codes */ -PUBLIC void changesp(newsp, absflag) -offset_T newsp; -bool_pt absflag; +PUBLIC void changesp(offset_T newsp, bool_pt absflag) { if (newsp != sp || ((bool_t) absflag && switchnow != NULL)) { @@ -56,9 +54,7 @@ /* load source to any while preserving target */ -PUBLIC void loadpres(source, target) -struct symstruct *source; -struct symstruct *target; +PUBLIC void loadpres(struct symstruct *source, struct symstruct *target) { store_t regmark; @@ -83,8 +79,7 @@ /* change stack ptr */ -PUBLIC void modstk(newsp) -offset_T newsp; +PUBLIC void modstk(offset_T newsp) { if (newsp != sp) { @@ -108,9 +103,7 @@ /* preserve target without changing source */ -PUBLIC void pres2(source, target) -struct symstruct *source; -struct symstruct *target; +PUBLIC void pres2(struct symstruct *source, struct symstruct *target) { if (target->storage & allregs) { @@ -130,8 +123,7 @@ /* preserve source */ -PUBLIC void preserve(source) -struct symstruct *source; +PUBLIC void preserve(struct symstruct *source) { if (source->storage & allregs) { @@ -145,9 +137,7 @@ /* preserve lvalue target without changing source or target */ -PUBLIC store_pt preslval(source, target) -struct symstruct *source; -struct symstruct *target; +PUBLIC store_pt preslval(struct symstruct *source, struct symstruct *target) { store_pt regpushed; @@ -164,8 +154,7 @@ return regpushed; } -PUBLIC void recovlist(reglist) -store_pt reglist; +PUBLIC void recovlist(store_pt reglist) { poplist(reglist); reguse |= (store_t) reglist; @@ -181,9 +170,7 @@ /* CONSTANT, BREG, DREG, XREG = INDREG0, UREG = INDREG1, YREG = INDREG2 */ #endif -PUBLIC void savereturn(savelist, saveoffset) -store_pt savelist; -offset_T saveoffset; +PUBLIC void savereturn(store_pt savelist, offset_T saveoffset) { store_t reg; smalin_t *regoffptr; diff -Naur a/bcc/scan.c b/bcc/scan.c --- a/bcc/scan.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/scan.c 2023-02-10 23:42:30.774631895 -0500 @@ -141,8 +141,7 @@ } } -PUBLIC void cppscan(asm_only) -int asm_only; +PUBLIC void cppscan(int asm_only) { int start_of_line = 1; #ifndef ASM_BARE @@ -290,8 +289,7 @@ } } -PUBLIC void eofin(message) -char *message; +PUBLIC void eofin(char *message) { error2error("end of file in ", message); } diff -Naur a/bcc/softop.c b/bcc/softop.c --- a/bcc/softop.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/softop.c 2023-02-10 23:42:30.774631895 -0500 @@ -19,10 +19,7 @@ considerable effort goes into avoiding unnecessary pushes -----------------------------------------------------------------------------*/ -PUBLIC void softop(op, source, target) -op_pt op; -struct symstruct *source; -struct symstruct *target; +PUBLIC void softop(op_pt op, struct symstruct *source, struct symstruct *target) { store_t regpushed; store_t regmark; diff -Naur a/bcc/state.c b/bcc/state.c --- a/bcc/state.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/state.c 2023-02-10 23:42:30.774631895 -0500 @@ -75,8 +75,7 @@ /* --- utility routines --- */ -PRIVATE void addloop(newloop) -struct loopstruct *newloop; +PRIVATE void addloop(struct loopstruct *newloop) { newloop->breaklab = getlabel(); newloop->contlab = getlabel(); @@ -101,8 +100,7 @@ loopnow = loopnow->prevloop; } -PRIVATE void evalexpression(exp) -struct nodestruct *exp; +PRIVATE void evalexpression(struct nodestruct *exp) { offset_T spmark; @@ -123,17 +121,14 @@ exprptr = exprmark; } -PRIVATE bool_pt isforever(exp) -register struct nodestruct *exp; +PRIVATE bool_pt isforever(register struct nodestruct *exp) { return exp == NULL || (exp->tag == LEAF && exp->left.symptr->storage == CONSTANT && exp->left.symptr->offset.offv != 0); } -PRIVATE void sort(caselist, count) /* shell sort */ -struct casestruct *caselist; -int count; +PRIVATE void sort(struct casestruct *caselist, int count) /* shell sort */ { register int gap; register int i; @@ -668,8 +663,7 @@ jump(dfaultlab); } -PUBLIC void outswoffset (offset) -offset_T offset; +PUBLIC void outswoffset (offset_T offset) { #ifdef FRAMEPOINTER outoffset(offset - softsp - framep); diff -Naur a/bcc/table.c b/bcc/table.c --- a/bcc/table.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/table.c 2023-02-10 23:42:30.775631890 -0500 @@ -154,9 +154,7 @@ FORWARD struct symstruct *addkeyword P((char *name, sym_pt code)); FORWARD void heapcorrupterror P((void)); -PUBLIC struct symstruct *addglb(name, type) -char *name; -struct typestruct *type; +PUBLIC struct symstruct *addglb(char *name, struct typestruct *type) { struct symstruct **hashptr; struct symstruct *oldsymptr = NULL; /* for -Wall */ @@ -190,9 +188,7 @@ return symptr; } -PRIVATE struct symstruct *addkeyword(name, code) -char *name; -sym_pt code; +PRIVATE struct symstruct *addkeyword(char *name, sym_pt code) { struct symstruct *symptr; @@ -201,9 +197,7 @@ return symptr; } -PUBLIC struct symstruct *addloc(name, type) -char *name; -struct typestruct *type; +PUBLIC struct symstruct *addloc(char *name, struct typestruct *type) { struct symstruct **hashptr; register struct symstruct *symptr; @@ -232,19 +226,14 @@ return symptr; } -PUBLIC struct symstruct *addlorg(name, type) -char *name; -struct typestruct *type; +PUBLIC struct symstruct *addlorg(char *name, struct typestruct *type) { if (level != GLBLEVEL) return addloc(name, type); return addglb(name, type); } -PUBLIC void addsym(name, type, symptr) -char *name; -struct typestruct *type; -register struct symstruct *symptr; +PUBLIC void addsym(char *name, struct typestruct *type, register struct symstruct *symptr) { if (type->constructor & (ARRAY | FUNCTION)) symptr->indcount = 0; @@ -257,8 +246,7 @@ strcpy(symptr->name.namea, name); } -PUBLIC struct symstruct *constsym(longconst) -value_t longconst; +PUBLIC struct symstruct *constsym(value_t longconst) { register struct symstruct *symptr; @@ -267,8 +255,7 @@ return symptr; } -PUBLIC void delsym(symptr) -register struct symstruct *symptr; +PUBLIC void delsym(register struct symstruct *symptr) { if ((*(symptr->prev) = symptr->next) != NULL) symptr->next->prev = symptr->prev; @@ -432,8 +419,7 @@ #endif -PUBLIC struct symstruct *exprsym(symptr) -struct symstruct *symptr; +PUBLIC struct symstruct *exprsym(struct symstruct *symptr) { register struct symstruct *newsymptr; @@ -450,8 +436,7 @@ return newsymptr; } -PUBLIC struct symstruct *findlorg(name) -char *name; +PUBLIC struct symstruct *findlorg(char *name) { struct symstruct *symptr; @@ -462,8 +447,7 @@ return symptr; } -PUBLIC struct symstruct *findstruct(name) -char *name; +PUBLIC struct symstruct *findstruct(char *name) { struct symstruct *symptr; @@ -476,8 +460,7 @@ /* convert name to a hash table ptr */ -PUBLIC struct symstruct **gethashptr(sname) -char *sname; +PUBLIC struct symstruct **gethashptr(char *sname) { register int hashval; register char *rsname; @@ -506,9 +489,7 @@ /* hold string for dumping at end, to avoid mixing it with other data */ -PUBLIC label_no holdstr(sptr, stop) -char *sptr; -char *stop; +PUBLIC label_no holdstr(char *sptr, char *stop) { register struct string *stringp; @@ -553,14 +534,12 @@ delsym(symptr); } -PUBLIC void ourfree(ptr) -void *ptr; +PUBLIC void ourfree(void *ptr) { free(ptr); } -PUBLIC void *ourmalloc(nbytes) -unsigned nbytes; +PUBLIC void *ourmalloc(unsigned nbytes) { void *ptr; @@ -569,8 +548,7 @@ return ptr; } -PUBLIC void outofmemoryerror(message) -char *message; +PUBLIC void outofmemoryerror(char *message) { error2error("compiler out of memory", message); @@ -594,9 +572,7 @@ finishup(); } -PUBLIC void *growobject(object, extra) -void *object; -unsigned extra; +PUBLIC void *growobject(void *object, unsigned extra) { /* size_t */ unsigned oblength; @@ -627,8 +603,7 @@ #define ALLOC_OVERHEAD (sizeof (unsigned)) #endif -PUBLIC void growheap(size) -unsigned size; +PUBLIC void growheap(unsigned size) { register char *newptr; @@ -647,8 +622,7 @@ *(unsigned *) newptr = MARKER; } -PUBLIC void *qmalloc(size) -unsigned size; +PUBLIC void *qmalloc(unsigned size) { register char *ptr; @@ -659,9 +633,7 @@ return ptr; } -PUBLIC void swapsym(sym1, sym2) -struct symstruct *sym1; -struct symstruct *sym2; +PUBLIC void swapsym(struct symstruct *sym1, struct symstruct *sym2) { struct symstruct swaptemp; @@ -693,9 +665,7 @@ } #ifndef VERY_SMALL_MEMORY -PUBLIC struct symstruct *findstrm(type, name) -struct typestruct *type; -char *name; +PUBLIC struct symstruct *findstrm(struct typestruct *type, char *name) { struct symstruct *symptr; int i; diff -Naur a/bcc/type.c b/bcc/type.c --- a/bcc/type.c 2014-03-14 00:33:19.000000000 -0400 +++ b/bcc/type.c 2023-02-10 23:42:30.775631890 -0500 @@ -23,8 +23,7 @@ PRIVATE char skey0; PRIVATE char skey1; -PUBLIC struct typestruct *addstruct(structname) -char *structname; +PUBLIC struct typestruct *addstruct(char *structname) { unsigned namelength; struct symstruct *symptr; @@ -64,8 +63,7 @@ } #endif -PUBLIC struct typestruct *iscalartotype(scalar) -scalar_pt scalar; +PUBLIC struct typestruct *iscalartotype(scalar_pt scalar) { if (scalar & LONG) { @@ -99,22 +97,17 @@ return type; } -PUBLIC void outntypechar(type) -struct typestruct *type; +PUBLIC void outntypechar(struct typestruct *type) { outnbyte(*type->tname); } -PUBLIC struct typestruct *pointype(type) -struct typestruct *type; +PUBLIC struct typestruct *pointype(struct typestruct *type) { return prefix(POINTER, ptypesize, type); } -PUBLIC struct typestruct *prefix(constructor, size, type) -constr_pt constructor; -uoffset_T size; -struct typestruct *type; +PUBLIC struct typestruct *prefix(constr_pt constructor, uoffset_T size, struct typestruct *type) { register struct typestruct *searchtype; @@ -145,8 +138,7 @@ return type->prevtype = searchtype; } -PUBLIC struct typestruct *promote(type) -struct typestruct *type; +PUBLIC struct typestruct *promote(struct typestruct *type) { scalar_t scalar; @@ -165,8 +157,7 @@ return type; } -PUBLIC struct typestruct *tosigned(type) -struct typestruct *type; +PUBLIC struct typestruct *tosigned(struct typestruct *type) { switch (type->scalar & ~(UNSIGNED | DLONG)) { @@ -184,8 +175,7 @@ } } -PUBLIC struct typestruct *tounsigned(type) -struct typestruct *type; +PUBLIC struct typestruct *tounsigned(struct typestruct *type) { switch (type->scalar & ~(UNSIGNED | DLONG)) { diff -Naur a/bootblocks/makeboot.c b/bootblocks/makeboot.c --- a/bootblocks/makeboot.c 2023-02-10 23:42:07.332748951 -0500 +++ b/bootblocks/makeboot.c 2023-02-10 23:42:30.780631865 -0500 @@ -183,11 +183,28 @@ unsigned char bpb_flags[100]; int has_bpb_overrides = 0; +// Forward declarations static void check_msdos(); +int set_superfield(char * setstr); +int Usage(); +int open_disk(char * diskname); +int read_sector(int sectno, char * loadaddr); +int check_simpledos(int bb_fatbits); +int check_tar(); +int check_zapped(); +int check_mbr(); +int copy_tarblock(); +int copy_mbr(char * boot_data, int boot_size); +int copy_superfields(char * bootsect); +int save_super(char * bootsect); +int print_super(char * bootsect); +int close_disk(); +int set_dosname(int boot_name); +int set_asciz(int boot_name); +int write_sector(int sectno, char * loadaddr); -main(argc, argv) -int argc; -char ** argv; +int +main(int argc, char ** argv) { FILE * fd; struct bblist *ptr = bblocks; @@ -368,6 +385,7 @@ exit(0); } +int Usage() { struct bblist *ptr = bblocks; @@ -392,8 +410,7 @@ /**************************************************************************/ int -open_disk(diskname) -char * diskname; +open_disk(char * diskname) { #ifdef __MSDOS__ /* Freedos fix */ @@ -423,6 +440,7 @@ return 0; } +int close_disk() { if( diskfd && disktype == 0 ) fclose(diskfd); @@ -431,9 +449,7 @@ } int -write_sector(sectno, loadaddr) -int sectno; -char * loadaddr; +write_sector(int sectno, char * loadaddr) { #ifdef __MSDOS__ if( disktype == 1 || disktype == 2 || disktype == 129 ) @@ -489,9 +505,7 @@ } int -read_sector(sectno, loadaddr) -int sectno; -char * loadaddr; +read_sector(int sectno, char * loadaddr) { int cc; #ifdef __MSDOS__ @@ -709,6 +723,7 @@ #endif /**************************************************************************/ +int check_zapped() { int i; @@ -746,8 +761,7 @@ #define buff_tar (*(struct tar_head*) buffer) #define boot_tar (*(struct tar_head*) tarboot_data) -unsigned int oct(s) -char *s; +unsigned int oct(char *s) { unsigned int val = 0; int i; @@ -756,6 +770,7 @@ return val; } +int check_tar() { char vbuf[100]; @@ -799,6 +814,7 @@ return 0; } +int copy_tarblock() { char lbuf[20]; @@ -931,8 +947,8 @@ { 0, -1,0,0} }; -print_super(bootsect) -char * bootsect; +int +print_super(char * bootsect) { static char * fieldnames[] = { "System ID", @@ -1020,8 +1036,8 @@ } } -decode_super(bootsect) -char * bootsect; +int +decode_super(char * bootsect) { int i; @@ -1054,8 +1070,8 @@ copy_zero = 0; } -save_super(bootsect) -char * bootsect; +int +save_super(char * bootsect) { FILE * fd; char * fname = "makeboot.sav"; @@ -1067,8 +1083,7 @@ fclose(fd); } -set_superfield(setstr) -char * setstr; +int set_superfield(char * setstr) { int i, l; char * av; @@ -1087,8 +1102,8 @@ } } -copy_superfields(bootsect) -char * bootsect; +int +copy_superfields(char * bootsect) { int i, j; @@ -1150,8 +1165,8 @@ if(!force) exit(2); } -check_simpledos(bb_fatbits) -int bb_fatbits; +int +check_simpledos(int bb_fatbits) { long numclust = 0xFFFF; char * err = 0; @@ -1226,8 +1241,8 @@ } } -set_dosname(boot_name) -int boot_name; +int +set_dosname(int boot_name) { char dos_name[20]; int i,j; @@ -1248,8 +1263,8 @@ memcpy(buffer+boot_name, dos_name, 11); } -set_asciz(boot_name) -int boot_name; +int +set_asciz(int boot_name) { int i, j; @@ -1290,6 +1305,7 @@ } } +int check_mbr() { int i = 0; @@ -1321,9 +1337,8 @@ } } -copy_mbr(boot_data, boot_size) -char * boot_data; -int boot_size; +int +copy_mbr(char * boot_data, int boot_size) { int boot_to_copy = 446; diff -Naur a/cpp/cpp.c b/cpp/cpp.c --- a/cpp/cpp.c 2014-03-14 00:33:19.000000000 -0400 +++ b/cpp/cpp.c 2023-02-10 23:42:30.775631890 -0500 @@ -189,8 +189,7 @@ { int rv; dont_subst++; rv=get_onetok(SKIP_SPACE); dont_subst--; return rv; } static int -get_onetok(keep) -int keep; +get_onetok(int keep) { char * p; int state; @@ -545,7 +544,7 @@ } static void -unchget(ch) +unchget(int ch) { #if CPP_DEBUG fprintf(stderr, "\b", ch); @@ -914,8 +913,7 @@ } static int -do_proc_if(type) -int type; +do_proc_if(int type) { int ch = 0; if(if_false && if_hidden) @@ -1042,8 +1040,7 @@ } static int_type -get_expression(prio) -int prio; +get_expression(int prio) { int_type lvalue; int_type rvalue; @@ -1255,11 +1252,7 @@ } void -gen_substrings(macname, data_str, arg_count, is_vararg) -char * macname; -char * data_str; -int arg_count; -int is_vararg; +gen_substrings(char * macname, char * data_str, int arg_count, int is_vararg) { char * mac_text = 0; struct arg_store *arg_list; @@ -1381,10 +1374,7 @@ } static char * -insert_substrings(data_str, arg_list, arg_count) -char * data_str; -struct arg_store *arg_list; -int arg_count; +insert_substrings(char * data_str, struct arg_store *arg_list, int arg_count) { int ac, ch; char * p, * s; diff -Naur a/cpp/hash.c b/cpp/hash.c --- a/cpp/hash.c 2014-03-14 00:33:19.000000000 -0400 +++ b/cpp/hash.c 2023-02-10 23:42:30.775631890 -0500 @@ -31,9 +31,7 @@ static int hashvalue P((int namespace, char * word)); void * -read_entry(namespace, word) -int namespace; -char * word; +read_entry(int namespace, char * word) { int hash_val; struct hashentry * hashline; @@ -53,10 +51,7 @@ } char * -set_entry(namespace, word, value) -int namespace; -char * word; -void * value; +set_entry(int namespace, char * word, void * value) { int hash_val, i; struct hashentry * hashline, *prev; @@ -103,9 +98,7 @@ return hashline->word; } -static int hashvalue(namespace, word) -int namespace; -char * word; +static int hashvalue(int namespace, char * word) { int val = namespace; char *p = word; diff -Naur a/cpp/main.c b/cpp/main.c --- a/cpp/main.c 2014-03-14 00:33:19.000000000 -0400 +++ b/cpp/main.c 2023-02-10 23:42:30.775631890 -0500 @@ -38,9 +38,7 @@ FILE * ofd = 0; int -main(argc, argv) -int argc; -char ** argv; +main(int argc, char ** argv) { int ar, i; char * p; @@ -170,8 +168,7 @@ } void -undefine_macro(name) -char * name; +undefine_macro(char * name) { struct define_item * ptr; @@ -183,8 +180,7 @@ } void -define_macro(name) -char * name; +define_macro(char * name) { char * p; char * value; @@ -207,10 +203,7 @@ } FILE * -open_include(fname, mode, checkrel) -char * fname; -char * mode; -int checkrel; +open_include(char * fname, char * mode, int checkrel) { FILE * fd = 0; int i; @@ -247,9 +240,7 @@ static int outpos = 0; void -cmsg(mtype, str) -char * mtype; -char * str; +cmsg(char * mtype, char * str) { if (c_fname && (*c_fname || c_lineno)) fprintf(stderr, "%s:%d: ", c_fname, c_lineno); @@ -261,31 +252,27 @@ } void -cfatal(str) -char * str; +cfatal(char * str) { cmsg("CPP-FATAL error", str); exit(255); } void -cerror(str) -char * str; +cerror(char * str) { exit_code = 1; cmsg("error", str); } void -cwarn(str) -char * str; +cwarn(char * str) { cmsg("warning", str); } void -pr_indent(count) -int count; +pr_indent(int count) { if(count>10) count=10; while(count>0) {fprintf(ofd, "\t"); count--; } @@ -439,8 +426,7 @@ } char * -token_txn(token) -int token; +token_txn(int token) { char * s = "UNKNOWN"; static char buf[17]; diff -Naur a/cpp/token1.h b/cpp/token1.h --- a/cpp/token1.h 2014-03-14 00:33:19.000000000 -0400 +++ b/cpp/token1.h 2023-02-10 23:42:30.776631885 -0500 @@ -12,9 +12,7 @@ __inline #endif static unsigned int -hash1 (str, len) - register const char *str; - register unsigned int len; +hash1 (register const char *str, register unsigned int len) { static unsigned char asso_values[] = { @@ -52,9 +50,7 @@ __inline #endif struct token_trans * -is_ctok (str, len) - register const char *str; - register unsigned int len; +is_ctok (register const char *str, register unsigned int len) { static struct token_trans wordlist[] = { diff -Naur a/cpp/token2.h b/cpp/token2.h --- a/cpp/token2.h 2014-03-14 00:33:19.000000000 -0400 +++ b/cpp/token2.h 2023-02-10 23:42:30.776631885 -0500 @@ -12,9 +12,7 @@ __inline #endif static unsigned int -hash2 (str, len) - register const char *str; - register unsigned int len; +hash2 (register const char *str, register unsigned int len) { static unsigned char asso_values[] = { @@ -64,9 +62,7 @@ __inline #endif struct token_trans * -is_ckey (str, len) - register const char *str; - register unsigned int len; +is_ckey (register const char *str, register unsigned int len) { static struct token_trans wordlist[] = { diff -Naur a/ifdef.c b/ifdef.c --- a/ifdef.c 2014-03-14 00:33:19.000000000 -0400 +++ b/ifdef.c 2023-02-10 23:42:30.776631885 -0500 @@ -60,9 +60,8 @@ void manifest_constant P((void)); int -main(argc, argv) -int argc; -char ** argv; +main(int argc, char ** argv) + { int ar; char * ptr; @@ -106,8 +105,7 @@ exit(0); } -void Usage(prog) -char * prog; +void Usage(char * prog) { fprintf(stderr, "Usage: %s [-DFLAG] [-UFLAG] [-blcrhMDU] [-C##] files\n", prog); @@ -126,9 +124,7 @@ } void -save_name(varname, state) -char * varname; -int state; +save_name(char * varname, int state) { struct varrec * curr; struct varrec * prev = 0; @@ -152,8 +148,7 @@ } void -do_file(fname) -char * fname; +do_file(char * fname) { filename = fname; prline = lineno = 0; @@ -192,8 +187,7 @@ } void -set_line(lineno) -int lineno; +set_line(int lineno) { if( prline+2 == lineno ) printf("\n"); @@ -253,9 +247,7 @@ } int -do_ifdef(p, which) -char * p; -int which; +do_ifdef(char * p, int which) { char * nm; char * s; @@ -298,8 +290,7 @@ #if 0 -do_if(p) -char * p; +do_if(char * p) { /* * Look for: @@ -370,8 +361,7 @@ #endif void -check_name(nm) -char * nm; +check_name(char * nm) { char * p; char * s; @@ -396,8 +386,7 @@ } void -fatal(msg) -char * msg; +fatal(char * msg) { fprintf(stderr, "Fatal error:%s\n", msg); exit(1); diff -Naur a/ld/io.c b/ld/io.c --- a/ld/io.c 2014-03-14 00:33:19.000000000 -0400 +++ b/ld/io.c 2023-02-10 23:42:30.776631885 -0500 @@ -60,8 +60,7 @@ 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) @@ -117,9 +116,7 @@ #endif } -PUBLIC void errtrace(name, level) -char *name; -int level; +PUBLIC void errtrace(char *name, int level) { while (level-- > 0) putbyte(' '); @@ -174,8 +171,7 @@ } #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 @@ } } -PUBLIC void openout(filename) -char *filename; +PUBLIC void openout(char *filename) { mode_t oldmask; @@ -228,8 +223,7 @@ #endif } -PRIVATE void outhexdigs(num) -register bin_off_t num; +PRIVATE void outhexdigs(register bin_off_t num) { if (num >= 0x10) { @@ -239,8 +233,7 @@ putbyte(hexdigit[num]); } -PRIVATE void put04x(num) -register unsigned num; +PRIVATE void put04x(register unsigned num) { putbyte(hexdigit[num / 0x1000]); putbyte(hexdigit[(num / 0x100) & 0x0F]); @@ -250,8 +243,7 @@ #ifdef LONG_OFFSETS -PUBLIC void put08lx(num) -register bin_off_t num; +PUBLIC void put08lx(register bin_off_t num) { put04x(num / 0x10000); put04x(num % 0x10000); @@ -259,8 +251,7 @@ #else /* not LONG_OFFSETS */ -PUBLIC void put08x(num) -register bin_off_t num; +PUBLIC void put08x(register bin_off_t num) { putstr("0000"); put04x(num); @@ -268,9 +259,7 @@ #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 @@ putstr(str); } -PUBLIC void putbyte(ch) -int ch; +PUBLIC void putbyte(int ch) { register char *ebuf; @@ -294,15 +282,13 @@ errbufptr = ebuf; } -PUBLIC void putstr(message) -char *message; +PUBLIC void putstr(char *message) { while (*message != 0) putbyte(*message++); } -PRIVATE void putstrn(message) -char *message; +PRIVATE void putstrn(char *message) { putstr(message); putbyte('\n'); @@ -333,9 +319,7 @@ return ch; } -PUBLIC void readin(buf, count) -char *buf; -unsigned count; +PUBLIC void readin(char *buf, unsigned count) { int ch; @@ -347,9 +331,7 @@ } } -PUBLIC bool_pt readineofok(buf, count) -char *buf; -unsigned count; +PUBLIC bool_pt readineofok(char *buf, unsigned count) { int ch; @@ -362,16 +344,14 @@ 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 @@ } #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 @@ } #endif -PUBLIC void writechar(ch) -int ch; +PUBLIC void writechar(int ch) { register char *obuf; @@ -404,9 +382,7 @@ } #ifdef REL_OUTPUT -PUBLIC void writedrel(buf, count) -register char *buf; -unsigned count; +PUBLIC void writedrel(register char *buf, unsigned count) { register char *rbuf; @@ -421,9 +397,7 @@ } #endif -PUBLIC void writeout(buf, count) -register char *buf; -unsigned count; +PUBLIC void writeout(register char *buf, unsigned count) { register char *obuf; @@ -442,9 +416,7 @@ } #ifdef REL_OUTPUT -PUBLIC void writetrel(buf, count) -register char *buf; -unsigned count; +PUBLIC void writetrel(register char *buf, unsigned count) { register char *rbuf; @@ -465,22 +437,19 @@ /* 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 @@ 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); @@ -515,12 +482,7 @@ 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 +509,7 @@ putstrn(""); } -PUBLIC void interseg(fname, aname, name) -char *fname, *aname, *name; +PUBLIC void interseg(char *fname, char *aname, char *name) { ++errcount; refer(); @@ -574,8 +535,7 @@ putstr(": "); } -PUBLIC void reserved(name) -char *name; +PUBLIC void reserved(char *name) { ++errcount; stderr_out(); @@ -583,10 +543,7 @@ 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 +555,7 @@ errexit(""); } -PUBLIC void undefined(name) -char *name; +PUBLIC void undefined(char *name) { ++errcount; stderr_out(); @@ -634,8 +590,7 @@ #endif } -PUBLIC void use_error(message) -char *message; +PUBLIC void use_error(char *message) { refer(); putstrn(message); diff -Naur a/ld/ld.c b/ld/ld.c --- a/ld/ld.c 2014-03-14 00:33:19.000000000 -0400 +++ b/ld/ld.c 2023-02-10 23:42:30.776631885 -0500 @@ -39,10 +39,7 @@ 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 @@ return name; } -PRIVATE char *expandlib(fn) -char *fn; +PRIVATE char *expandlib(char *fn) { char *path, *s; int i; @@ -73,9 +69,7 @@ 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 -Naur a/ld/linksyms.c b/ld/linksyms.c --- a/ld/linksyms.c 2014-03-14 00:33:19.000000000 -0400 +++ b/ld/linksyms.c 2023-02-10 23:42:30.777631880 -0500 @@ -15,8 +15,7 @@ /* 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 @@ while (needlink); } -PRIVATE void linkrefs(modptr) -struct modstruct *modptr; +PRIVATE void linkrefs(struct modstruct *modptr) { register struct symstruct **symparray; register struct symstruct *symptr; diff -Naur a/ld/objdump86.c b/ld/objdump86.c --- a/ld/objdump86.c 2014-03-14 00:33:19.000000000 -0400 +++ b/ld/objdump86.c 2023-02-10 23:42:30.777631880 -0500 @@ -90,9 +90,7 @@ long tot_size_text=0, tot_size_data=0, tot_size_bss=0; int -main(argc, argv) -int argc; -char ** argv; +main(int argc, char ** argv) { int ar; char * p; @@ -138,8 +136,7 @@ } void -do_file(fname) -char * fname; +do_file(char * fname) { unsigned int magic; long filelength; @@ -184,8 +181,7 @@ /* read archive header and return length */ long -read_arheader(archentry) -char *archentry; +read_arheader(char *archentry) { char * endptr; struct ar_hdr arheader; @@ -203,9 +199,7 @@ } void -do_module(fname, archive) -char * fname; -char * archive; +do_module(char * fname, char * archive) { int modno, i; @@ -304,8 +298,7 @@ } int -error(str) -char * str; +error(char * str) { switch( display_mode ) { @@ -594,8 +587,7 @@ } long -get_sized(sz) -int sz; +get_sized(int sz) { switch(sz) { @@ -651,8 +643,7 @@ } void -hex_output(ch) -int ch; +hex_output(int ch) { static char linebuf[80]; static char buf[20]; diff -Naur a/ld/readobj.c b/ld/readobj.c --- a/ld/readobj.c 2014-03-14 00:33:19.000000000 -0400 +++ b/ld/readobj.c 2023-02-10 23:42:30.777631880 -0500 @@ -49,9 +49,7 @@ /* 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 @@ /* read archive header and return length */ -PRIVATE long readarheader(parchentry) -char **parchentry; +PRIVATE long readarheader(char **parchentry) { struct ar_hdr arheader; char *endptr; @@ -141,9 +138,7 @@ /* 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 @@ /* 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; @@ -287,9 +281,7 @@ modlast = modptr; } -PRIVATE bool_pt redsym(symptr, value) -register struct symstruct *symptr; -bin_off_t value; +PRIVATE bool_pt redsym(register struct symstruct *symptr, bin_off_t value) { register struct redlist *rlptr; char class; @@ -329,9 +321,7 @@ 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 @@ 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 @@ 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 -Naur a/ld/table.c b/ld/table.c --- a/ld/table.c 2014-03-14 00:33:19.000000000 -0400 +++ b/ld/table.c 2023-02-10 23:42:30.777631880 -0500 @@ -45,8 +45,7 @@ /* 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 @@ /* lookup named symbol */ -PUBLIC struct symstruct *findsym(name) -char *name; +PUBLIC struct symstruct *findsym(char *name) { struct symstruct *symptr; @@ -90,8 +88,7 @@ /* 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 @@ /* 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 @@ /* our version of malloc */ -PUBLIC char *ourmalloc(nbytes) -unsigned nbytes; +PUBLIC char *ourmalloc(unsigned nbytes) { char *allocptr; @@ -164,8 +159,7 @@ /* our version of free (release from bottom of table) */ -PUBLIC void ourfree(cptr) -char *cptr; +PUBLIC void ourfree(char *cptr) { check_used(); tableptr = cptr; @@ -197,8 +191,7 @@ /* release from top of table */ -PUBLIC void release(cptr) -char *cptr; +PUBLIC void release(char *cptr) { check_used(); mainavail += cptr - tableend; @@ -223,8 +216,7 @@ /* allocate space for string */ -PUBLIC char *stralloc(s) -char *s; +PUBLIC char *stralloc(char *s) { return strcpy(ourmalloc((unsigned) strlen(s) + 1), s); } diff -Naur a/ld/typeconv.c b/ld/typeconv.c --- a/ld/typeconv.c 2014-03-14 00:33:19.000000000 -0400 +++ b/ld/typeconv.c 2023-02-10 23:42:30.778631875 -0500 @@ -11,16 +11,14 @@ #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 +41,7 @@ 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 +54,7 @@ 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 +71,7 @@ } } -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 +90,7 @@ } } -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 +109,7 @@ } } -PUBLIC u2_pt c2u2(buf) -char *buf; +PUBLIC u2_pt c2u2(char *buf) { u2_pt res; #ifdef __AS386_16__ @@ -134,8 +121,7 @@ return res; } -PUBLIC u4_t c4u4(buf) -char *buf; +PUBLIC u4_t c4u4(char *buf) { u4_t res; int i; @@ -150,9 +136,7 @@ return res; } -PUBLIC u4_t cnu4(buf, count) -char *buf; -unsigned count; +PUBLIC u4_t cnu4(char *buf, unsigned count) { switch (count) { @@ -170,9 +154,7 @@ } } -PUBLIC u2_pt cnu2(buf, count) -char *buf; -unsigned count; +PUBLIC u2_pt cnu2(char *buf, unsigned count) { switch (count) { diff -Naur a/ld/writebin.c b/ld/writebin.c --- a/ld/writebin.c 2014-03-14 00:33:19.000000000 -0400 +++ b/ld/writebin.c 2023-02-10 23:42:30.778631875 -0500 @@ -121,12 +121,8 @@ #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 @@ -644,8 +640,7 @@ #endif /* EDOS */ -PRIVATE void linkmod(modptr) -struct modstruct *modptr; +PRIVATE void linkmod(struct modstruct *modptr) { char buf[ABS_TEXT_MAX]; int command; @@ -820,8 +815,7 @@ } } -PRIVATE void padmod(modptr) -struct modstruct *modptr; +PRIVATE void padmod(struct modstruct *modptr) { bin_off_t count; fastin_t seg; @@ -849,9 +843,7 @@ } } -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 +854,7 @@ symptr->value = value; } -PRIVATE void symres(name) -register char *name; +PRIVATE void symres(register char *name) { register struct symstruct *symptr; @@ -882,8 +873,7 @@ /* set new segment */ -PRIVATE void setseg(newseg) -fastin_pt newseg; +PRIVATE void setseg(fastin_pt newseg) { if (newseg != curseg) { @@ -894,16 +884,14 @@ } } -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; @@ -1035,8 +1023,7 @@ #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 +1038,8 @@ #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)); diff -Naur a/ld/writex86.c b/ld/writex86.c --- a/ld/writex86.c 2014-03-14 00:33:19.000000000 -0400 +++ b/ld/writex86.c 2023-02-10 23:42:30.778631875 -0500 @@ -102,13 +102,8 @@ /* write binary file */ -PUBLIC void write_elks(outfilename, argsepid, argbits32, argstripflag, arguzp, argxsym) -char *outfilename; -bool_pt argsepid; -bool_pt argbits32; -bool_pt argstripflag; -bool_pt arguzp; -bool_pt argxsym; +PUBLIC void write_elks(char *outfilename, bool_pt argsepid, bool_pt argbits32, + bool_pt argstripflag, bool_pt arguzp, bool_pt argxsym) { char buf4[4]; char *cptr; @@ -454,8 +449,7 @@ executable(); } -PRIVATE void linkmod(modptr) -struct modstruct *modptr; +PRIVATE void linkmod(struct modstruct *modptr) { char buf[ABS_TEXT_MAX]; int command; @@ -555,8 +549,7 @@ } } -PRIVATE void padmod(modptr) -struct modstruct *modptr; +PRIVATE void padmod(struct modstruct *modptr) { bin_off_t count; fastin_t seg; @@ -584,9 +577,7 @@ } } -PRIVATE void setsym(name, value) -char *name; -bin_off_t value; +PRIVATE void setsym(char *name, bin_off_t value) { struct symstruct *symptr; @@ -594,8 +585,7 @@ symptr->value = value; } -PRIVATE void symres(name) -register char *name; +PRIVATE void symres(register char *name) { register struct symstruct *symptr; @@ -611,8 +601,7 @@ /* set new segment */ -PRIVATE void setseg(newseg) -fastin_pt newseg; +PRIVATE void setseg(fastin_pt newseg) { if (newseg != curseg) { @@ -623,8 +612,7 @@ } } -PRIVATE void skip(countsize) -unsigned countsize; +PRIVATE void skip(unsigned countsize) { writenulls((bin_off_t) readsize(countsize)); } @@ -721,8 +709,7 @@ } #endif -PRIVATE void writenulls(count) -bin_off_t count; +PRIVATE void writenulls(bin_off_t count) { long lcount = count; spos += count; diff -Naur a/unproto/hash.c b/unproto/hash.c --- a/unproto/hash.c 2014-03-14 00:33:19.000000000 -0400 +++ b/unproto/hash.c 2023-02-10 23:42:30.778631875 -0500 @@ -31,9 +31,7 @@ /* hash - hash a string; original author: P. J. Weinberger at Bell Labs. */ -int hash(s, size) -register char *s; -unsigned size; +int hash(register char *s, unsigned size) { register unsigned long h = 0; register unsigned long g; diff -Naur a/unproto/strsave.c b/unproto/strsave.c --- a/unproto/strsave.c 2014-03-14 00:33:19.000000000 -0400 +++ b/unproto/strsave.c 2023-02-10 23:42:30.778631875 -0500 @@ -24,15 +24,15 @@ static char strsave_sccsid[] = "@(#) strsave.c 1.1 92/01/15 21:53:13"; -/* C library */ - -extern char *strcpy(); -extern char *malloc(); - /* Application-specific stuff */ #include "error.h" +#include +#include + +extern int hash(register char *s, unsigned size); + #define STR_TABSIZE 100 struct string { diff -Naur a/unproto/symbol.c b/unproto/symbol.c --- a/unproto/symbol.c 2014-03-14 00:33:19.000000000 -0400 +++ b/unproto/symbol.c 2023-02-10 23:42:30.779631870 -0500 @@ -51,8 +51,12 @@ #include "token.h" #include "symbol.h" +#include + #define SYM_TABSIZE 20 +extern int hash(register char *s, unsigned size); + static struct symbol *sym_tab[SYM_TABSIZE] = {0,}; /* More string stuff. Maybe it should go to an #include file. */ diff -Naur a/unproto/tok_class.c b/unproto/tok_class.c --- a/unproto/tok_class.c 2014-03-14 00:33:19.000000000 -0400 +++ b/unproto/tok_class.c 2023-02-10 23:42:30.779631870 -0500 @@ -49,6 +49,7 @@ /* C library */ #include +#include extern char *strcpy(); extern long time(); diff -Naur a/unproto/tok_io.c b/unproto/tok_io.c --- a/unproto/tok_io.c 2023-02-10 23:42:07.323748996 -0500 +++ b/unproto/tok_io.c 2023-02-10 23:42:30.779631870 -0500 @@ -79,13 +79,10 @@ /* C library */ #include +#include +#include #include -extern char *strchr(); -extern char *malloc(); -extern char *realloc(); -extern char *strcpy(); - /* Application-specific stuff */ #include "token.h" diff -Naur a/unproto/unproto.c b/unproto/unproto.c --- a/unproto/unproto.c 2014-03-14 00:33:19.000000000 -0400 +++ b/unproto/unproto.c 2023-02-10 23:42:30.779631870 -0500 @@ -137,6 +137,7 @@ #include #include #include +#include #include extern void exit();