From 8494e6c7228657c1b34963e6d98e9fedb9a084db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= Date: Fri, 24 Oct 2025 07:21:09 +0200 Subject: [PATCH 1/2] Replace old-style function defitions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit They are no longer allowed in C23. Citing the GCC documentation: "An old-style (or “K&R”) function definition is the way function definitions were written in the 1980s. [..] There is no reason to write a definition this way nowadays, but they can still be seen in older GNU programs." https://www.gnu.org/software/c-intro-and-ref/manual/html_node/Old_002dStyle-Function-Definitions.html --- check.c | 10 +--- crossref.c | 34 +++-------- database.c | 105 ++++++++------------------------ entry.c | 13 ++-- error.c | 18 +----- expand.c | 23 +------ init.c | 3 +- io.c | 12 ++-- key.c | 171 +++++++++++------------------------------------------ macros.c | 52 ++++------------ main.c | 60 +++++-------------- names.c | 69 ++++----------------- parse.c | 42 ++++--------- print.c | 56 ++++-------------- pxfile.c | 21 ++----- record.c | 46 ++++---------- rewrite.c | 102 +++++++------------------------- rsc.c | 19 ++---- s_parse.c | 22 ++----- sbuffer.c | 24 +++----- stack.c | 3 +- symbols.c | 28 +++------ tex_aux.c | 17 ++---- tex_read.c | 71 +++++++--------------- type.c | 14 ++--- wordlist.c | 21 ++----- 26 files changed, 255 insertions(+), 801 deletions(-) diff --git a/check.c b/check.c index d445b8c5..c1e18022 100644 --- a/check.c +++ b/check.c @@ -66,8 +66,7 @@ ** key the key to check ** Returns: nothing **___________________________________________________ */ -void add_unique_field(key) /* */ - Symbol key; /* */ +void add_unique_field(Symbol key) /* */ { StringBuffer *sb = sbopen(); /* */ sbputs((char*)SymbolValue(key), sb); /* */ key = symbol(lower((String)sbflush(sb))); /* */ @@ -85,8 +84,7 @@ void add_unique_field(key) /* */ ** db ** Returns: nothing **___________________________________________________ */ -void apply_checks(db) /* */ - DB db; /* */ +void apply_checks(DB db) /* */ { /* */ if (rsc_double_check || unique_fields) /* Maybe look for doubles */ { db_forall(db, do_checks); } /* or apply unique checks */ @@ -103,9 +101,7 @@ void apply_checks(db) /* */ ** rec the record ** Returns: |false| **___________________________________________________ */ -static bool do_checks(db,rec) /* */ - DB db; /* */ - Record rec; /* */ +static bool do_checks(DB db, Record rec) /* */ { register Record prev; /* */ register Record rec2; /* */ WordList wl; /* */ diff --git a/crossref.c b/crossref.c index 44658272..050ef894 100644 --- a/crossref.c +++ b/crossref.c @@ -73,11 +73,7 @@ ** df destination field name ** Returns: the new map **___________________________________________________ */ -static Map new_map(sr,sf,dr,df) /* */ - rec_type sr; /* */ - Symbol sf; /* */ - rec_type dr; /* */ - Symbol df; /* */ +static Map new_map(rec_type sr, Symbol sf, rec_type dr, Symbol df) /* */ { Map m; /* */ if ( (m = (Map)malloc(sizeof(SMap))) == (Map)NULL)/* */ { OUT_OF_MEMORY("map"); } /* */ @@ -98,8 +94,7 @@ static Map new_map(sr,sf,dr,df) /* */ ** m the map ** Returns: nothing **___________________________________________________ */ -static void free_map(m) /* */ - Map m; /* */ +static void free_map(Map m) /* */ { Map nxt; /* */ while (m) /* */ { nxt = NextMap(m); /* */ @@ -146,11 +141,7 @@ void clear_map() /* */ ** d_fld the destination field name ** Returns: nothing **___________________________________________________ */ -void map_add(s_rec,s_fld,d_rec,d_fld) /* */ - rec_type s_rec; /* */ - Symbol s_fld; /* */ - rec_type d_rec; /* */ - Symbol d_fld; /* */ +void map_add(rec_type s_rec, Symbol s_fld, rec_type d_rec, Symbol d_fld) /* */ { int idx; /* */ Map m; /* */ /* */ @@ -187,10 +178,7 @@ void map_add(s_rec,s_fld,d_rec,d_fld) /* */ ** d_rec the index of the destination entry type ** Returns: the new field name or |NO_SYMBOL| **___________________________________________________ */ -Symbol map_get(s_rec, s_fld, d_rec) /* */ - rec_type s_rec; /* */ - Symbol s_fld; /* */ - rec_type d_rec; /* */ +Symbol map_get(rec_type s_rec, Symbol s_fld, rec_type d_rec) /* */ { int i = MAP_INDEX(s_rec, s_fld, d_rec); /* */ Map m = map[i]; /* */ /* */ @@ -212,8 +200,7 @@ Symbol map_get(s_rec, s_fld, d_rec) /* */ ** spec the argument ** Returns: nothing **___________________________________________________ */ -void crossref_map(spec) /* */ - String spec; /* */ +void crossref_map(String spec) /* */ { Symbol *src, *dest; /* */ Symbol src_field, dest_field; /* */ Symbol *sp, *dp; /* */ @@ -272,12 +259,7 @@ void crossref_map(spec) /* */ ** msg the message prefix for an unknown entry message ** Returns: |true| iff the record could be inserted **___________________________________________________ */ -static bool insert_record(db, rec, hp, s, msg) /* */ - DB db; /* */ - Record rec; /* */ - register Symbol *hp; /* */ - Symbol s; /* */ - String msg; /* */ +static bool insert_record(DB db, Record rec, register Symbol *hp, Symbol s, String msg) /* */ { Record r; /* */ Symbol t, ms; /* */ int i; /* */ @@ -310,9 +292,7 @@ static bool insert_record(db, rec, hp, s, msg) /* */ ** rec The record to expand ** Returns: |false| iff an error has occured **___________________________________________________ */ -bool expand_crossref(db, rec) /* */ - DB db; /* */ - Record rec; /* */ +bool expand_crossref(DB db, Record rec) /* */ { register Symbol *hp; /* */ register int i; /* */ String x; /* */ diff --git a/database.c b/database.c index 3d6a2896..c60dc71f 100644 --- a/database.c +++ b/database.c @@ -103,8 +103,7 @@ DB new_db() /* */ ** db Database to release. ** Returns: nothing **___________________________________________________ */ -void free_db(db) /* */ - DB db; /* */ +void free_db(DB db) /* */ { /* */ free_record(DBnormal(db)); /* */ free_record(DBstring(db)); /* */ @@ -127,10 +126,7 @@ void free_db(db) /* */ ** rec the record ** Returns: **___________________________________________________ */ -int apply_modify(db, key, rec) /* */ - DB db; /* */ - Symbol key; /* */ - Record rec; /* */ +int apply_modify(DB db, Symbol key, Record rec) /* */ { Symbol *hp = RecordHeap(rec); /* */ int i; /* */ Record r = db_find(db, key); /* */ @@ -169,11 +165,7 @@ int apply_modify(db, key, rec) /* */ ** verbose the verbose indicator ** Returns: **___________________________________________________ */ -static bool apply_alias(db, key, rec, verbose) /* */ - DB db; /* */ - Symbol key; /* */ - Record rec; /* */ - bool verbose; /* */ +static bool apply_alias(DB db, Symbol key, Record rec, bool verbose) /* */ { Record r = db_find(db, key); /* */ if (r == RecordNULL) /* */ { WARNING2("Entry to alias not found: ", key); /* */ @@ -200,10 +192,7 @@ static bool apply_alias(db, key, rec, verbose) /* */ ** verbose Boolean to determine whether progress should be reported. ** Returns: nothing **___________________________________________________ */ -void db_insert(db, rec, verbose) /* */ - DB db; /* */ - Record rec; /* */ - bool verbose; /* */ +void db_insert(DB db, Record rec, bool verbose) /* */ { Record *rp; /* */ /* */ switch (RecordType(rec)) /* */ @@ -291,10 +280,7 @@ void db_insert(db, rec, verbose) /* */ ** verbose Boolean to determine whether progress should be reported. ** Returns: |true| if the file can not be opened. |false| otherwise. **___________________________________________________ */ -bool read_db(db, file, verbose) /* */ - DB db; /* */ - String file; /* */ - bool verbose; /* */ +bool read_db(DB db, String file, bool verbose) /* */ { register int type; /* */ static Record master_record = RecordNULL; /* */ Record rec; /* */ @@ -361,9 +347,7 @@ bool read_db(db, file, verbose) /* */ ** s the string ** Returns: nothing **___________________________________________________ */ -static void mark_string(rec, s) /* */ - Record rec; /* */ - String s; /* */ +static void mark_string(Record rec, String s) /* */ { int d; /* */ Record r; /* */ /* */ @@ -421,11 +405,7 @@ static void mark_string(rec, s) /* */ ** allp the indicator for printing all ** Returns: nothing **___________________________________________________ */ -static void print_segment(file, db, rec, allp) /* */ - FILE *file; /* */ - DB db; /* */ - Record rec; /* */ - bool allp; /* */ +static void print_segment(FILE *file, DB db, Record rec, bool allp) /* */ { /* */ if (rec == RecordNULL) return; /* */ /* */ @@ -456,11 +436,7 @@ static void print_segment(file, db, rec, allp) /* */ ** rec the record ** Returns: nothing **___________________________________________________ */ -static void preprint_string(file, db, strings, rec)/* */ - FILE *file; /* */ - DB db; /* */ - Record strings; /* */ - Record rec; /* */ +static void preprint_string(FILE *file, DB db, Record strings, Record rec)/* */ { int i, d; /* */ Record r; /* */ /* */ @@ -534,10 +510,7 @@ static void preprint_string(file, db, strings, rec)/* */ ** allp the indicator to include all ** Returns: nothing **___________________________________________________ */ -static void print_strings(file, db, allp) /* */ - FILE *file; /* */ - DB db; /* */ - bool allp; /* */ +static void print_strings(FILE *file, DB db, bool allp) /* */ { Record strings = DBstring(db); /* */ Record rec; /* */ /* */ @@ -640,10 +613,7 @@ static void print_strings(file, db, allp) /* */ ** spec String containing the specification of the parts to print. ** Returns: nothing **___________________________________________________ */ -void print_db(file,db,spec) /* */ - FILE *file; /* */ - DB db; /* */ - char *spec; /* */ +void print_db(FILE *file, DB db, char *spec) /* */ { /* */ while (*spec) /* */ { switch (*(spec++)) /* */ @@ -690,9 +660,7 @@ void print_db(file,db,spec) /* */ ** rec Record to delete. ** Returns: nothing **___________________________________________________ */ -void delete_record(db,rec) /* */ - DB db; /* */ - Record rec; /* */ +void delete_record(DB db, Record rec) /* */ { Record *rp; /* */ /* */ switch (RecordType(rec)) /* */ @@ -731,9 +699,7 @@ void delete_record(db,rec) /* */ ** processing. It takes two arguments a |DB| and a |Record|. ** Returns: nothing **___________________________________________________ */ -void db_forall(db,fct) /* */ - DB db; /* */ - bool (*fct)_ARG((DB,Record)); /* Function pointer */ +void db_forall(DB db, bool (*fct)_ARG((DB,Record))) /* */ { register Record rec, next; /* */ /* */ if (DBnormal(db) == RecordNULL) return; /* */ @@ -770,9 +736,7 @@ void db_forall(db,fct) /* */ ** key the key to search for ** Returns: the record found or |NULL| if none is found **___________________________________________________ */ -Record db_find(db,key) /* */ - DB db; /* */ - Symbol key; /* */ +Record db_find(DB db, Symbol key) /* */ { register Record rec; /* */ /* */ DebugPrint2("Finding... ", SymbolValue(key)); /* */ @@ -820,9 +784,7 @@ Record db_find(db,key) /* */ ** key the key to search for ** Returns: the record found or |NULL| if none is found **___________________________________________________ */ -Record db_search(db, key) /* */ - DB db; /* */ - Symbol key; /* */ +Record db_search(DB db, Symbol key) /* */ { register Record rec; /* */ /* */ if (DBnormal(db) == RecordNULL) return RecordNULL;/* */ @@ -854,9 +816,7 @@ Record db_search(db, key) /* */ ** key Key to find. ** Returns: nothing **___________________________________________________ */ -Symbol db_new_key(db, key) /* */ - DB db; /* */ - Symbol key; /* */ +Symbol db_new_key(DB db, Symbol key) /* */ { register Record rec; /* */ /* */ if (DBnormal(db) == RecordNULL) return NULL; /* */ @@ -890,8 +850,7 @@ Symbol db_new_key(db, key) /* */ ** db Database to rewind. ** Returns: nothing **___________________________________________________ */ -void db_rewind(db) /* */ - DB db; /* */ +void db_rewind(DB db) /* */ { /* */ if (DBnormal(db) == RecordNULL) return; /* */ /* */ @@ -908,9 +867,7 @@ void db_rewind(db) /* */ ** less the comparator ** Returns: **___________________________________________________ */ -static Record rec__sort(rec,less) /* */ - Record rec; /* */ - int (*less)_ARG((Record,Record)); /* Function pointer */ +static Record rec__sort(Record rec, int (*less)_ARG((Record,Record))) /* */ { Record r; /* */ Record new; /* */ /* */ @@ -966,10 +923,7 @@ static Record rec__sort(rec,less) /* */ ** NOTE: CURRENTLY THE ALGORITHM IS NOT STABLE: ** Records with the same key may get mixed in the sorted list. **___________________________________________________ */ -static Record insert_record(rec,ptr,less) /* */ - register Record rec; /* */ - register Record ptr; /* */ - int (*less)_ARG((Record,Record)); /* Function pointer */ +static Record insert_record(register Record rec, register Record ptr, int (*less)_ARG((Record,Record))) /* */ { /* */ if (ptr == RecordNULL) { /* List is empty */ PrevRecord(rec) = RecordNULL; /* */ @@ -1021,9 +975,7 @@ static Record insert_record(rec,ptr,less) /* */ ** r2 Second record to compare. ** Returns: 1 if the first record is smaller than the second one. **___________________________________________________ */ -static int cmp_heap(r1,r2) /* */ - register Record r1; /* */ - register Record r2; /* */ +static int cmp_heap(register Record r1, register Record r2) /* */ { /* */ return symcmp(*RecordHeap(r1), /* */ *RecordHeap(r2)) < 0; /* */ @@ -1041,8 +993,7 @@ static int cmp_heap(r1,r2) /* */ ** less comparison function to use. ** Returns: nothing **___________________________________________________ */ -void db_mac_sort(db) /* */ - DB db; /* */ +void db_mac_sort(DB db) /* */ { /* */ DBstring(db) = rec__sort(DBstring(db), cmp_heap);/* */ } /*------------------------*/ @@ -1060,9 +1011,7 @@ void db_mac_sort(db) /* */ ** is less than the second one. ** Returns: nothing **___________________________________________________ */ -void db_sort(db,less) /* */ - DB db; /* */ - int (*less)_ARG((Record,Record)); /* Function pointer */ +void db_sort(DB db, int (*less)_ARG((Record,Record))) /* */ { /* */ DBnormal(db) = rec__sort(DBnormal(db), less); /* */ } /*------------------------*/ @@ -1079,10 +1028,7 @@ void db_sort(db,less) /* */ ** localp Boolean determining whether the search is only local to the db. ** Returns: The macro expansion or |NULL| upon failure. **___________________________________________________ */ -Symbol db_string(db, sym, localp) /* */ - DB db; /* */ - Symbol sym; /* */ - bool localp; /* */ +Symbol db_string(DB db, Symbol sym, bool localp) /* */ { Record rec; /* */ /* */ if ((rec=DBstring(db))) /* */ @@ -1122,9 +1068,7 @@ Symbol db_string(db, sym, localp) /* */ ** lp pointer to an integer for the length. ** Returns: Static array containing the statistics. **___________________________________________________ */ -int * db_count(db,lp) /* */ - DB db; /* */ - int *lp; /* */ +int * db_count(DB db, int *lp) /* */ { static int *count; /* */ static int len = 0; /* */ int i; /* */ @@ -1214,8 +1158,7 @@ int * db_count(db,lp) /* */ ** db Database to treat ** Returns: nothing **___________________________________________________ */ -void db_xref_undelete(db) /* */ - DB db; /* */ +void db_xref_undelete(DB db) /* */ { Record rec = DBnormal(db); /* */ if (rec == RecordNULL) return; /* No entries left anyhow.*/ /* */ diff --git a/entry.c b/entry.c index aec47c74..dbc2e504 100644 --- a/entry.c +++ b/entry.c @@ -132,8 +132,7 @@ void init_entries() /* */ ** s String containing the name of the entry. ** Returns: nothing **___________________________________________________ */ -void def_entry_type(sym) /* */ - Symbol sym; /* */ +void def_entry_type(Symbol sym) /* */ { int i; /* */ String s = SymbolValue(sym); /* */ /* */ @@ -172,9 +171,7 @@ void def_entry_type(sym) /* */ ** Returns: |true| iff the arguments are identical or the second ** string is a substring not followed by a letter or digit. **___________________________________________________ */ -static bool match(s,t) /* */ - register String s; /* */ - register String t; /* */ +static bool match(register String s, register String t) /* */ { /* */ while (*t) /* */ { if ( ToLower(*s) != ToLower(*t) ) return false;/* */ @@ -192,8 +189,7 @@ static bool match(s,t) /* */ ** s String of the potential entry name. ** Returns: The index in the array or |NOOP|. **___________________________________________________ */ -rec_type find_entry_type(s) /* */ - String s; /* */ +rec_type find_entry_type(String s) /* */ { int i; /* */ /* */ for (i = 0; i < entry_ptr; ++i) /* */ @@ -213,8 +209,7 @@ rec_type find_entry_type(s) /* */ ** idx Index of entry type. ** Returns: Print representation of the entry type or |NULL|. **___________________________________________________ */ -Symbol get_entry_type(idx) /* */ - int idx; /* */ +Symbol get_entry_type(int idx) /* */ { /* */ return (idx < 0 || idx >= entry_ptr /* */ ? NO_SYMBOL /* */ diff --git a/error.c b/error.c index df4a1662..96c15337 100644 --- a/error.c +++ b/error.c @@ -65,8 +65,7 @@ ** file the output file to write error messages to ** Returns: nothing **___________________________________________________ */ -void init_error(file) /* */ - FILE * file; /* */ +void init_error(FILE *file) /* */ { /* */ err_file = file; /* */ } /*------------------------*/ @@ -86,10 +85,7 @@ void init_error(file) /* */ ** s1 the optional postfix string ** Returns: nothing **___________________________________________________ */ -void err_location(lineno,fname,s1) /* */ - int lineno; /* */ - String fname; /* */ - char* s1; /* */ +void err_location(int lineno, String fname, char *s1) /* */ { /* */ (void)fprintf(err_file, /* */ " (line %d in %s)", /* */ @@ -153,15 +149,7 @@ void err_location(lineno,fname,s1) /* */ ** fname The file name where the error occurred. ** Returns: nothing **___________________________________________________ */ -void error(type, s1, s2, s3, line, err_pos, line_no, fname)/* */ - int type; /* defined in error.h */ - String s1; /* 1st error message */ - String s2; /* 2nd error message */ - String s3; /* 3rd error message */ - String line; /* line_no string. */ - String err_pos; /* error position in line */ - int line_no; /* line number */ - Symbol fname; /* file name */ +void error(int type, String s1, String s2, String s3, String line, String err_pos, int line_no, Symbol fname)/* */ { /* */ if ( (type&ERR_WARNING) /* anything less than an */ && rsc_quiet ) return; /* error is ignored. */ diff --git a/expand.c b/expand.c index 6376240c..af445822 100644 --- a/expand.c +++ b/expand.c @@ -76,12 +76,7 @@ ** static variable of this function and will be overwritten with ** the next invocation. **___________________________________________________ */ -Symbol expand_rhs(sym,pre,post,db,lowercase) /* */ - Symbol sym; /* */ - Symbol pre; /* */ - Symbol post; /* */ - DB db; /* */ - bool lowercase; /* */ +Symbol expand_rhs(Symbol sym, Symbol pre, Symbol post, DB db, bool lowercase) /* */ { static StringBuffer *sb = NULL; /* */ String s; /* */ /* */ @@ -116,12 +111,7 @@ Symbol expand_rhs(sym,pre,post,db,lowercase) /* */ ** db the database ** Returns: nothing **___________________________________________________ */ -static void expand__(s, sb, q_open, q_close, db) /* */ - register String s; /* */ - StringBuffer *sb; /* */ - String q_open; /* */ - String q_close; /* */ - DB db; /* */ +static void expand__(register String s, StringBuffer *sb, String q_open, String q_close, DB db) /* */ { /* */ if (!expand(s,sb,true,true,q_open,q_close,db)) /* */ { PUTS(q_close, sb); } /* */ @@ -146,14 +136,7 @@ static void expand__(s, sb, q_open, q_close, db) /* */ ** q_close Close delimiter. This is a close brace or a double quote. ** Returns: **___________________________________________________ */ -static bool expand(s, sb, brace, first, q_open, q_close, db)/* */ - register String s; /* specification */ - StringBuffer *sb; /* output device */ - bool brace; /* is a brace needed? */ - bool first; /* is this the first part?*/ - String q_open; /* open delimiter */ - String q_close; /* close delimiter */ - DB db; /* */ +static bool expand(register String s, StringBuffer *sb, bool brace, bool first, String q_open, String q_close, DB db)/* */ { /* */ while ( *s ) /* */ { /* */ diff --git a/init.c b/init.c index b41230fa..3a6ed643 100644 --- a/init.c +++ b/init.c @@ -68,8 +68,7 @@ ** progname Name of the program for |KPATHSEA|. ** Returns: nothing **___________________________________________________ */ -void init_bibtool(progname) /* */ - char * progname; /* */ +void init_bibtool(char *progname) /* */ { /* */ #ifdef EMTEX_LIKE_PATH static StringBuffer *sb_rsc; /* */ diff --git a/io.c b/io.c index de174fe5..c3cae105 100644 --- a/io.c +++ b/io.c @@ -76,8 +76,7 @@ ** file File name to save. ** Returns: nothing **___________________________________________________ */ -void save_input_file(file) /* */ - Symbol file; /* */ +void save_input_file(Symbol file) /* */ { /* */ if (file == NO_SYMBOL) /* */ { WARNING("Missing input file name. Flag ignored.");/* */ @@ -126,8 +125,7 @@ int get_no_inputs() /* */ ** i the index of the input file to access ** Returns: the references input file name or NULL otherwise **___________________________________________________ */ -Symbol get_input_file(i) /* */ - int i; /* */ +Symbol get_input_file(int i) /* */ { return (i >= 0 && i < input_file_ptr /* */ ? input_files[i] /* */ : NO_SYMBOL); /* */ @@ -148,8 +146,7 @@ Symbol get_input_file(i) /* */ ** file File name to save ** Returns: nothing **___________________________________________________ */ -void save_output_file(file) /* */ - Symbol file; /* */ +void save_output_file(Symbol file) /* */ { if (output_file != NO_SYMBOL) /* */ { WARNING2("Output file redefined: ", /* */ SymbolValue(file)); /* */ @@ -184,8 +181,7 @@ Symbol get_output_file() /* */ ** file File name to save ** Returns: nothing **___________________________________________________ */ -void save_macro_file(file) /* */ - Symbol file; /* */ +void save_macro_file(Symbol file) /* */ { if ( macro_file != NULL ) /* */ { WARNING2("Macro file redefined: ", /* */ SymbolValue(file)); /* */ diff --git a/key.c b/key.c index 8bb03e78..6df3c53f 100644 --- a/key.c +++ b/key.c @@ -144,8 +144,7 @@ static size_t words_used = 0; ** word word to push ** Returns: nothing **___________________________________________________ */ -static void push_word(word) /* */ - register String word; /* */ +static void push_word(register String word) /* */ { PushWord(word); /* */ } /*------------------------*/ @@ -157,8 +156,7 @@ static void push_word(word) /* */ ** s word to push ** Returns: nothing **___________________________________________________ */ -static void Push_Word(s) /* */ - register String s; /* */ +static void Push_Word(register String s) /* */ { register String *wp; /* */ /* */ words_len += WordLenInc; /* */ @@ -225,9 +223,7 @@ static void Push_Word(s) /* */ ** The characters which are not allowed are silently suppressed. ** Returns: nothing **___________________________________________________ */ -void set_separator(n, s) /* */ - register int n; /* */ - String s; /* */ +void set_separator(register int n, String s) /* */ { /* */ if (n < 0 || n >= NoSeps) /* */ { ERROR("Invalid separator reference."); /* */ @@ -275,8 +271,7 @@ void set_separator(n, s) /* */ ** n the index ** Returns: the separator for the given index or NULL **___________________________________________________ */ -Symbol get_separator(n) /* */ - int n; /* */ +Symbol get_separator(int n) /* */ { /* */ if (n < 0 || n >= NoSeps) /* */ { ERROR("Invalid separator reference."); /* */ @@ -325,8 +320,7 @@ Symbol get_separator(n) /* */ ** value String representation of the new value. ** Returns: nothing **___________________________________________________ */ -void set_base(value) /* */ - String value; /* */ +void set_base(String value) /* */ { /* */ if (case_eq(value,(String)"upper")) key_base = KEY_BASE_UPPER;/* */ else if (case_eq(value,(String)"lower")) key_base = KEY_BASE_LOWER;/* */ @@ -373,9 +367,7 @@ String get_base() /* */ ** digits String of digits to use ** Returns: **___________________________________________________ */ -static char * itostr(i,digits) /* */ - register int i; /* */ - register char *digits; /* */ +static char * itostr(register int i, register char *digits) /* */ { static char buffer[ITOA_LEN]; /* buffer to store result */ register char *bp; /* buffer pointer */ register int sign, /* */ @@ -494,10 +486,7 @@ static void key_init() /* */ ** flags ** Returns: **___________________________________________________ */ -static int deTeX(line,save_fct,flags) /* */ - String line; /* */ - int flags; /* */ - void (*save_fct)_ARG((String)); /* */ +static int deTeX(String line, void (*save_fct)_ARG((String)), int flags) /* */ { static String buffer; /* */ static size_t len = 0; /* */ Uchar c; /* */ @@ -605,11 +594,7 @@ static int deTeX(line,save_fct,flags) /* */ ** trans Translation table ** Returns: nothing **___________________________________________________ */ -static void push_s(sb,s,max,trans) /* */ - StringBuffer *sb; /* */ - String s; /* */ - int max; /* */ - String trans; /* */ +static void push_s(StringBuffer *sb, String s, int max, String trans) /* */ { /* */ if ( max <= 0 ) /* */ { while ( *s ) /* */ @@ -642,8 +627,7 @@ static void push_s(sb,s,max,trans) /* */ ** word Word to add. ** Returns: nothing **___________________________________________________ */ -void add_ignored_word(word) /* */ - Symbol word; /* */ +void add_ignored_word(Symbol word) /* */ { /* */ key_init(); /* */ add_word(word, /* */ @@ -679,8 +663,7 @@ void clear_ignored_words() /* */ ** fct Function to apply. ** Returns: The return status of the last |fct| call. **___________________________________________________ */ -bool foreach_ignored_word(fct) /* */ - bool (*fct)_ARG((Symbol)); /* */ +bool foreach_ignored_word(bool (*fct)_ARG((Symbol))) /* */ { int i; /* */ /* */ key_init(); /* */ @@ -706,14 +689,7 @@ bool foreach_ignored_word(fct) /* */ ** sep String separating the words. ** Returns: nothing **___________________________________________________ */ -static void fmt_title(sb, line, len, in, trans, ignore, sep)/* */ - StringBuffer *sb; /* */ - String line; /* */ - int len; /* */ - int in; /* */ - String trans; /* Translation table */ - bool ignore; /* */ - Symbol sep; /* */ +static void fmt_title(StringBuffer *sb, String line, int len, int in, String trans, bool ignore, Symbol sep)/* */ { bool first = true; /* */ int nw, i, j; /* */ String s; /* */ @@ -766,12 +742,7 @@ static void fmt_title(sb, line, len, in, trans, ignore, sep)/* */ ** ignore flag to indicate if certain words should be ignored. ** Returns: **___________________________________________________ */ -static bool fmt_c_words(line, min, max, not, ignore)/* */ - String line; /* */ - int min; /* */ - int max; /* */ - bool not; /* */ - bool ignore; /* */ +static bool fmt_c_words(String line, int min, int max, bool not, bool ignore)/* */ { int n, i, nw; /* */ /* */ ResetWords; /* */ @@ -809,8 +780,7 @@ static bool fmt_c_words(line, min, max, not, ignore)/* */ ** s ** Returns: nothing **___________________________________________________ */ -void def_format_type(s) /* */ - String s; /* */ +void def_format_type(String s) /* */ { int n; /* */ String cp; /* */ Uchar c; /* */ @@ -853,12 +823,7 @@ void def_format_type(s) /* */ ** trans translation table ** Returns: nothing **___________________________________________________ */ -static void fmt_names(sb,line,maxname,post,trans) /* */ - StringBuffer *sb; /* */ - String line; /* Name list string */ - int maxname; /* number of names b4 etal*/ - int post; /* number of relevant char*/ - String trans; /* Translation table */ +static void fmt_names(StringBuffer *sb, String line, int maxname, int post, String trans) /* */ { int wp, /* */ i; /* */ static bool undef_warning = false; /* */ @@ -913,11 +878,7 @@ static void fmt_names(sb,line,maxname,post,trans) /* */ ** not negation flag ** Returns: **___________________________________________________ */ -static bool fmt_c_names(line,min,max,not) /* */ - String line; /* Name list string */ - int min; /* number of relevant char*/ - int max; /* number of names b4 etal*/ - bool not; /* negation flag */ +static bool fmt_c_names(String line, int min, int max, bool not) /* */ { int wp, /* */ i, /* */ n; /* */ @@ -960,14 +921,7 @@ static bool fmt_c_names(line,min,max,not) /* */ ** trunc Boolean indicating whether or not to truncate the number. ** Returns: **___________________________________________________ */ -static bool fmt_digits(sb,s,mp,pp,n,sel,trunc) /* */ - StringBuffer *sb; /* */ - register String s; /* */ - int mp; /* */ - int pp; /* */ - register int n; /* */ - int sel; /* */ - bool trunc; /* */ +static bool fmt_digits(StringBuffer *sb, register String s, int mp, int pp, register int n, int sel, bool trunc) /* */ { register String cp; /* */ /* */ if (n < 0) { n = ( mp ? 1 : 0x7fff ); } /* */ @@ -1019,12 +973,7 @@ static bool fmt_digits(sb,s,mp,pp,n,sel,trunc) /* */ ** sep Separator ** Returns: nothing **___________________________________________________ */ -static void fmt_string(sb,s,n,trans,sep) /* */ - StringBuffer *sb; /* */ - register String s; /* */ - register int n; /* */ - register String trans; /* */ - String sep; /* */ +static void fmt_string(StringBuffer *sb, register String s, register int n, register String trans, String sep) /* */ { /* */ while (*s && n > 0) /* */ { if (is_allowed(*s)) /* */ @@ -1053,11 +1002,7 @@ static void fmt_string(sb,s,n,trans,sep) /* */ ** not negation flag ** Returns: **___________________________________________________ */ -static bool fmt_c_string(s,min,max,not) /* */ - register String s; /* */ - register int min; /* */ - register int max; /* */ - register bool not; /* */ +static bool fmt_c_string(String s, register int min, register int max, register bool not) /* */ { int n = 0; /* */ /* */ while (*s) /* */ @@ -1117,9 +1062,7 @@ void end_key_gen() /* */ ** rec Record to consider ** Returns: nothing **___________________________________________________ */ -bool mark_key(db,rec) /* */ - DB db; /* */ - Record rec; /* */ +bool mark_key(DB db, Record rec) /* */ { /* */ POSSIBLY_UNUSED(db); /* */ /* */ @@ -1139,9 +1082,7 @@ bool mark_key(db,rec) /* */ ** rec Record to consider. ** Returns: nothing **___________________________________________________ */ -void make_key(db,rec) /* */ - DB db; /* */ - register Record rec; /* */ +void make_key(DB db, register Record rec) /* */ { register String kp; /* */ Symbol key; /* */ Symbol old; /* */ @@ -1235,9 +1176,7 @@ void make_key(db,rec) /* */ ** rec Record to consider. ** Returns: nothing **___________________________________________________ */ -void make_sort_key(db,rec) /* */ - DB db; /* */ - register Record rec; /* */ +void make_sort_key(DB db, register Record rec) /* */ { register String kp; /* */ /* */ if ( IsSpecialRecord(RecordType(rec)) ) return; /* */ @@ -1270,9 +1209,7 @@ void make_sort_key(db,rec) /* */ ** Returns: The address of the new node. ** Upon failure exit() is called. **___________________________________________________ */ -static KeyNode new_key_node(type, sym) /* */ - int type; /* */ - Symbol sym; /* */ +static KeyNode new_key_node(int type, Symbol sym) /* */ { KeyNode new_node; /* */ if( (new_node=(KeyNode)malloc(sizeof(SKeyNode))) ==/* */ (KeyNode)0 ) /* */ @@ -1295,8 +1232,7 @@ static KeyNode new_key_node(type, sym) /* */ ** kn KeyNode to be freed. ** Returns: nothing **___________________________________________________ */ -void free_key_node(kn) /* */ - KeyNode kn; /* */ +void free_key_node(KeyNode kn) /* */ { KeyNode next; /* */ /* */ while ( kn != (KeyNode)0 ) /* */ @@ -1317,9 +1253,7 @@ void free_key_node(kn) /* */ ** treep the pointer to the tree to be extended ** Returns: |true| iff the operation succeeds **___________________________________________________ */ -static bool add_fmt_tree(s, treep) /* */ - char *s; /* */ - KeyNode *treep; /* */ +static bool add_fmt_tree(char *s, KeyNode *treep) /* */ { KeyNode kn, kn_or; /* */ int special = 0; /* */ String s0 = (String)s; /* */ @@ -1410,8 +1344,7 @@ static bool add_fmt_tree(s, treep) /* */ ** s Specification string ** Returns: nothing **___________________________________________________ */ -void add_format(s) /* */ - register char *s; /* */ +void add_format(register char *s) /* */ { /* */ if (s == NULL) /* */ { WARNING("Missing key format."); /* */ @@ -1452,8 +1385,7 @@ void add_format(s) /* */ ** s Specification string ** Returns: nothing **___________________________________________________ */ -void add_sort_format(s) /* */ - register char *s; /* */ +void add_sort_format(register char *s) /* */ { /* */ if ( s == NULL ) /* */ { WARNING("Missing sort key format."); /* */ @@ -1473,9 +1405,7 @@ void add_sort_format(s) /* */ ** knp ** Returns: Error code. 0 = success **___________________________________________________ */ -static int fmt_parse(sp,knp) /* */ - char **sp; /* */ - KeyNode *knp; /* */ +static int fmt_parse(char **sp, KeyNode *knp) /* */ { int ret; /* */ KeyNode new; /* */ /* */ @@ -1505,9 +1435,7 @@ static int fmt_parse(sp,knp) /* */ ** knp Pointer to the key node in which to store the result ** Returns: Error code or 0 upon success **___________________________________________________ */ -static int fmt__parse(sp,knp) /* */ - char **sp; /* */ - KeyNode *knp; /* */ +static int fmt__parse(char **sp, KeyNode *knp) /* */ { register char *cp; /* */ char c; /* */ int ret; /* */ @@ -1623,11 +1551,7 @@ static int fmt__parse(sp,knp) /* */ ** db the database ** Returns: |false| upon success. **___________________________________________________ */ -static bool eval_fmt(sb,kn,rec,db) /* */ - StringBuffer *sb; /* */ - KeyNode kn; /* */ - Record rec; /* */ - DB db; /* */ +static bool eval_fmt(StringBuffer *sb, KeyNode kn, Record rec, DB db) /* */ { int pos = sbtell(sb); /* */ /* */ tmp_key_db = db; /* */ @@ -1649,10 +1573,7 @@ static bool eval_fmt(sb,kn,rec,db) /* */ ** rec the record ** Returns: **___________________________________________________ */ -static bool eval__fmt(sb,kn,rec) /* */ - StringBuffer *sb; /* */ - KeyNode kn; /* */ - Record rec; /* */ +static bool eval__fmt(StringBuffer *sb, KeyNode kn, Record rec) /* */ { Symbol s; /* */ int pos; /* */ String trans; /* */ @@ -1885,10 +1806,7 @@ static bool eval__fmt(sb,kn,rec) /* */ ** rec the record ** Returns: nothing **___________________________________________________ */ -static void eval__special(sb,kn,rec) /* */ - StringBuffer *sb; /* */ - KeyNode kn; /* */ - Record rec; /* */ +static void eval__special(StringBuffer *sb, KeyNode kn, Record rec) /* */ { Symbol s; /* */ bool missing = true; /* */ int fmt; /* */ @@ -1982,11 +1900,7 @@ static void eval__special(sb,kn,rec) /* */ ** Returns: |1| iff the format is invalid or the evaluation fails. |0| ** otherwise. **___________________________________________________ */ -int apply_fmt(sb,fmt,rec,db) /* */ - StringBuffer *sb; /* */ - char *fmt; /* */ - Record rec; /* */ - DB db; /* */ +int apply_fmt(StringBuffer *sb, char *fmt, Record rec, DB db) /* */ { static char *old_fmt = NULL; /* */ static KeyNode old_kn = (KeyNode)0; /* */ /* */ @@ -2020,11 +1934,7 @@ int apply_fmt(sb,fmt,rec,db) /* */ ** cp format ** Returns: The first character after the % format. **___________________________________________________ */ -String fmt_expand(sb,cp,db,rec) /* */ - StringBuffer *sb; /* */ - Uchar *cp; /* */ - DB db; /* */ - Record rec; /* */ +String fmt_expand(StringBuffer *sb, Uchar *cp, DB db, Record rec) /* */ { Symbol field; /* */ Uchar c; /* */ String trans = trans_id; /* */ @@ -2204,9 +2114,7 @@ String fmt_expand(sb,cp,db,rec) /* */ ** in ** Returns: nothing **___________________________________________________ */ -static void show_fmt(kn,in) /* */ - register KeyNode kn; /* */ - register int in; /* */ +static void show_fmt(register KeyNode kn, register int in) /* */ { register int i; /* */ #define NLin(S) ErrC('\n');for(i=in;i>0;i--) ErrC(' '); (void)fputs(S,err_file) #define ErrS(S) (void)fputs(S,err_file) @@ -2274,10 +2182,7 @@ static void show_fmt(kn,in) /* */ ** arbitrary string. ** Returns: The address of the value or |NULL|. **___________________________________________________ */ -Symbol get_field(db,rec,name) /* */ - DB db; /* */ - register Record rec; /* */ - register Symbol name; /* */ +Symbol get_field(DB db, register Record rec, register Symbol name) /* */ { String s = SymbolValue(name); /* */ Symbol sym; /* */ DebugPrint2("get_field ", s); /* */ @@ -2478,11 +2383,7 @@ Symbol get_field(db,rec,name) /* */ ** value the new value ** Returns: |false| if the asignment has succeeded. **___________________________________________________ */ -bool set_field(db,rec,name,value) /* */ - DB db; /* */ - register Record rec; /* */ - Symbol name; /* */ - Symbol value; /* */ +bool set_field(DB db, register Record rec, Symbol name, Symbol value) /* */ { int c = *SymbolValue(name); /* */ POSSIBLY_UNUSED(db); /* */ /* */ diff --git a/macros.c b/macros.c index c9313839..6397ff4f 100644 --- a/macros.c +++ b/macros.c @@ -54,11 +54,7 @@ ** count The initial reference count. ** Returns: The new |Macro|. **___________________________________________________ */ -Macro new_macro(name, value, next, count) /* */ - Symbol name; /* */ - Symbol value; /* */ - int count; /* */ - Macro next; /* */ +Macro new_macro(Symbol name, Symbol value, Macro next, int count) /* */ { register Macro macro; /* */ /* */ if ( (macro=(Macro)malloc(sizeof(SMacro))) == MacroNULL )/* */ @@ -80,8 +76,7 @@ Macro new_macro(name, value, next, count) /* */ ** mac First Macro to release. ** Returns: nothing **___________________________________________________ */ -void free_macro(mac) /* */ - Macro mac; /* */ +void free_macro(Macro mac) /* */ { Macro next; /* */ /* */ while (mac) /* */ @@ -102,10 +97,7 @@ void free_macro(mac) /* */ ** count initial count for the macro. ** Returns: nothing **___________________________________________________ */ -int def_macro(name, val, count) /* */ - Symbol name; /* */ - Symbol val; /* */ - int count; /* */ +int def_macro(Symbol name, Symbol val, int count) /* */ { register Macro *mp; /* */ /* */ for (mp = ¯os; /* */ @@ -144,9 +136,7 @@ int def_macro(name, val, count) /* */ ** is required. ** Returns: The value or |NULL|. **___________________________________________________ */ -Symbol look_macro(name, add) /* */ - Symbol name; /* */ - int add; /* */ +Symbol look_macro(Symbol name, int add) /* */ { register Macro *mp; /* */ /* */ for (mp = ¯os; /* */ @@ -184,8 +174,7 @@ Symbol look_macro(name, add) /* */ ** fct Function to apply to each macro. ** Returns: nothing **___________________________________________________ */ -void foreach_macro(fct) /* */ - bool (*fct) _ARG((Symbol ,Symbol )); /* */ +void foreach_macro(bool (*fct) _ARG((Symbol, Symbol))) /* */ { Macro mac; /* */ for (mac = macros; /* */ mac != MacroNULL; /* */ @@ -208,9 +197,7 @@ void foreach_macro(fct) /* */ ** Returns: |true| if the function has terminated the loop and ** |false| in case the end of the list has been reached **___________________________________________________ */ -bool each_macro(m, fct) /* */ - Macro m; /* */ - bool (*fct) _ARG((Symbol ,Symbol)); /* */ +bool each_macro(Macro m, bool (*fct) _ARG((Symbol, Symbol))) /* */ { /* */ for ( ; m != MacroNULL; m = NextMacro(m)) /* */ { if (! (*fct)(MacroName(m), MacroValue(m))) /* */ @@ -227,9 +214,7 @@ bool each_macro(m, fct) /* */ ** allp if == 0 only the used macros are written. ** Returns: nothing **___________________________________________________ */ -void dump_mac(fname,allp) /* */ - char *fname; /* */ - int allp; /* */ +void dump_mac(char *fname, int allp) /* */ { FILE *file; /* */ register Macro mac; /* */ /* */ @@ -308,9 +293,7 @@ void init_macros() /* */ ** value the value of the item ** Returns: nothing **___________________________________________________ */ -static void def_item(name, value) /* */ - register Symbol name; /* */ - register Symbol value; /* */ +static void def_item(register Symbol name, register Symbol value) /* */ { /* */ items = new_macro(name, value, items, 0); /* */ } /*------------------------*/ @@ -331,8 +314,7 @@ static void def_item(name, value) /* */ ** during the process. ** Returns: nothing **___________________________________________________ */ -void def_field_type(s) /* */ - String s; /* */ +void def_field_type(String s) /* */ { Symbol name; /* */ /* */ while (*s && !is_allowed(*s)) ++s; /* */ @@ -362,10 +344,7 @@ void def_field_type(s) /* */ ** |SYMBOL_TYPE_UPPER|, or |SYMBOL_TYPE_CASED|. ** Returns: the requested value **___________________________________________________ */ -static Symbol get_mapped_or_cased(name, mac, type) /* */ - Symbol name; /* */ - int type; /* */ - register Macro mac; /* */ +static Symbol get_mapped_or_cased(Symbol name, register Macro mac, int type) /* */ { static StringBuffer* sb = (StringBuffer*)NULL; /* */ register String s; /* */ /* */ @@ -429,9 +408,7 @@ static Symbol get_mapped_or_cased(name, mac, type) /* */ ** Returns: A pointer to a static string. This location is reused ** upon the next invocation of this function. **___________________________________________________ */ -Symbol get_item(name, type) /* */ - Symbol name; /* */ - int type; /* */ +Symbol get_item(Symbol name, int type) /* */ { return get_mapped_or_cased(name, items, type); /* */ } /*------------------------*/ @@ -451,9 +428,7 @@ Symbol get_item(name, type) /* */ ** key the key as printed ** Returns: nothing **___________________________________________________ */ -void save_key(name, key) /* */ - Symbol name; /* */ - Symbol key; /* */ +void save_key(Symbol name, Symbol key) /* */ { keys = new_macro(name, key, keys, 1); /* */ } /*------------------------*/ @@ -467,8 +442,7 @@ void save_key(name, key) /* */ ** name the name of the key to find. This must be in lower-case ** Returns: the requested representation **___________________________________________________ */ -Symbol get_key(name) /* */ - Symbol name; /* */ +Symbol get_key(Symbol name) /* */ { return get_mapped_or_cased(name, /* */ keys, /* */ SYMBOL_TYPE_LOWER); /* */ diff --git a/main.c b/main.c index 83cd6a06..697462f4 100644 --- a/main.c +++ b/main.c @@ -78,11 +78,7 @@ /* Internal Programs */ /*===========================================================================*/ -#ifdef __STDC__ #define _ARG(A) A -#else -#define _ARG(A) () -#endif int main _ARG((int argc,char *argv[])); /* main.c */ static bool do_keys _ARG((DB db,Record rec)); /* main.c */ static bool do_no_keys _ARG((DB db,Record rec)); /* main.c */ @@ -169,8 +165,7 @@ char * getenv(name) /* */ ** fullp Boolean. If |false| only the version is displayed. ** Returns: nothing **___________________________________________________ */ -static void usage(fullp) /* */ - bool fullp; /* */ +static void usage(bool fullp) /* */ { static char *comma = ", "; /* */ char *sep = " "; /* */ POSSIBLY_UNUSED(comma); /* */ @@ -237,9 +232,7 @@ static void usage(fullp) /* */ ** rec the record ** Returns: |false| **___________________________________________________ */ -static bool keep_selected(db, rec) /* */ - DB db; /* */ - Record rec; /* */ +static bool keep_selected(DB db, Record rec) /* */ { /* */ if (!is_selected(db, rec)) /* */ { SetRecordDELETED(rec); } /* */ @@ -258,9 +251,7 @@ static bool keep_selected(db, rec) /* */ ** rec the record ** Returns: |false| **___________________________________________________ */ -static bool keep_xref(db,rec) /* */ - DB db; /* */ - Record rec; /* */ +static bool keep_xref(DB db, Record rec) /* */ { /* */ if (!RecordIsDELETED(rec)) /* */ { Symbol key; /* */ @@ -305,9 +296,7 @@ static bool keep_xref(db,rec) /* */ ** the_db the database ** Returns: nothing **___________________________________________________ */ -static void write_macros(m_file, the_db) /* */ - char* m_file; /* */ - DB the_db; /* */ +static void write_macros(char *m_file, DB the_db) /* */ { FILE * file; /* */ /* */ if (m_file == NULL || *m_file == 0) return; /* */ @@ -332,8 +321,7 @@ static void write_macros(m_file, the_db) /* */ ** db the database ** Returns: nothing **___________________________________________________ */ -static void read_in_files(db) /* */ - DB db; /* */ +static void read_in_files(DB db) /* */ { int i; /* */ Symbol in; /* */ /* */ @@ -353,8 +341,7 @@ static void read_in_files(db) /* */ ** db the database ** Returns: nothing **___________________________________________________ */ -static void write_output(db) /* */ - DB db; /* */ +static void write_output(DB db) /* */ { FILE *file; /* */ Symbol o_file = get_output_file(); /* */ /* */ @@ -402,9 +389,7 @@ static void write_output(db) /* */ ** which leads to an |exit()|. Thus this function does ** not need to signal an error to the calling environment. **___________________________________________________ */ -int main(argc,argv) /* */ - int argc; /* Argument count */ - char *argv[]; /* Argument values */ +int main(int argc, char *argv[]) /* */ { DB the_db; /* The \BibTool{} program */ /* currently handles a */ /* single database at a */ @@ -621,9 +606,7 @@ int main(argc,argv) /* */ ** r2 the second record ** Returns: **___________________________________________________ */ -static int rec_gt(r1, r2) /* */ - Record r1; /* */ - Record r2; /* */ +static int rec_gt(Record r1, Record r2) /* */ { return symcmp(RecordSortkey(r1), /* */ RecordSortkey(r2)) < 0; /* */ } /*------------------------*/ @@ -638,9 +621,7 @@ static int rec_gt(r1, r2) /* */ ** r2 the second record ** Returns: **___________________________________________________ */ -static int rec_lt(r1, r2) /* */ - Record r1; /* */ - Record r2; /* */ +static int rec_lt(Record r1, Record r2) /* */ { return symcmp(RecordSortkey(r1), /* */ RecordSortkey(r2)) > 0; /* */ } /*------------------------*/ @@ -655,9 +636,7 @@ static int rec_lt(r1, r2) /* */ ** r2 the second record ** Returns: **___________________________________________________ */ -static int rec_gt_cased(r1, r2) /* */ - Record r1; /* */ - Record r2; /* */ +static int rec_gt_cased(Record r1, Record r2) /* */ { return symcmp(get_key(RecordSortkey(r1)), /* */ get_key(RecordSortkey(r2))) < 0; /* */ } /*------------------------*/ @@ -672,9 +651,7 @@ static int rec_gt_cased(r1, r2) /* */ ** r2 the second record ** Returns: **___________________________________________________ */ -static int rec_lt_cased(r1, r2) /* */ - Record r1; /* */ - Record r2; /* */ +static int rec_lt_cased(Record r1, Record r2) /* */ { return symcmp(get_key(RecordSortkey(r1)), /* */ get_key(RecordSortkey(r2))) > 0; /* */ } /*------------------------*/ @@ -686,9 +663,7 @@ static int rec_lt_cased(r1, r2) /* */ ** rec the record ** Returns: |false| **___________________________________________________ */ -static bool do_keys(db, rec) /* */ - DB db; /* */ - Record rec; /* */ +static bool do_keys(DB db, Record rec) /* */ { /* */ rewrite_record(db, rec); /* */ sort_record(rec); /* */ @@ -706,9 +681,7 @@ static bool do_keys(db, rec) /* */ ** rec the record ** Returns: |false| **___________________________________________________ */ -static bool do_no_keys(db, rec) /* */ - DB db; /* */ - Record rec; /* */ +static bool do_no_keys(DB db, Record rec) /* */ { /* */ rewrite_record(db, rec); /* */ sort_record(rec); /* */ @@ -728,9 +701,7 @@ static bool do_no_keys(db, rec) /* */ ** first_rec the first record ** Returns: |false| **___________________________________________________ */ -static bool update_crossref(db, rec) /* */ - DB db; /* */ - Record rec; /* */ +static bool update_crossref(DB db, Record rec) /* */ { register Symbol *hp; /* */ register int i; /* */ Symbol s; /* */ @@ -779,8 +750,7 @@ static bool update_crossref(db, rec) /* */ ** c Character to print. ** Returns: nothing **___________________________________________________ */ -void printchar(c) /* */ - register char c; /* */ +void printchar(register char c) /* */ { ErrC(c); /* */ } /*------------------------*/ #endif diff --git a/names.c b/names.c index 6b4c6372..e08c4566 100644 --- a/names.c +++ b/names.c @@ -79,13 +79,7 @@ ** post ** Returns: The new instance of a node. **___________________________________________________ */ -static NameNode new_name_node(type, strip, trim, pre, mid, post)/* */ - int type; /* */ - int strip; /* */ - int trim; /* */ - Symbol pre; /* */ - Symbol mid; /* */ - Symbol post; /* */ +static NameNode new_name_node(int type, int strip, int trim, Symbol pre, Symbol mid, Symbol post)/* */ { NameNode node; /* */ /* */ if ( (node = (NameNode)malloc(sizeof(SNameNode))) == NameNULL )/* */ @@ -111,8 +105,7 @@ static NameNode new_name_node(type, strip, trim, pre, mid, post)/* */ ** node Node to free. ** Returns: nothing **___________________________________________________ */ -static void free_name_node(node) /* */ - NameNode node; /* */ +static void free_name_node(NameNode node) /* */ { NameNode next; /* */ /* */ while ( node ) /* */ @@ -133,8 +126,7 @@ static void free_name_node(node) /* */ ** n ** Returns: nothing **___________________________________________________ */ -static void dump_name_node(n) /* */ - NameNode n; /* */ +static void dump_name_node(NameNode n) /* */ { /* */ fputc('%',err_file); /* */ switch ( NameType(n) & NameTranslationMask ) /* */ @@ -176,9 +168,7 @@ static void dump_name_node(n) /* */ ** midp ** Returns: **___________________________________________________ */ -static void set_type(sp,midp) /* */ - char **sp; /* */ - char **midp; /* */ +static void set_type(char **sp, char **midp) /* */ { char c, *s, *mid; /* */ int type = 0; /* */ /* */ @@ -209,9 +199,7 @@ static void set_type(sp,midp) /* */ ** s ** Returns: nothing **___________________________________________________ */ -void set_name_format(nodep,s) /* */ - NameNode *nodep; /* */ - char *s; /* */ +void set_name_format(NameNode *nodep, char *s) /* */ { int n, /* */ type, /* */ strip, /* */ @@ -288,8 +276,7 @@ void set_name_format(nodep,s) /* */ ** s ** Returns: **___________________________________________________ */ -NameNode name_format(s) /* */ - String s; /* */ +NameNode name_format(String s) /* */ { int type, /* */ strip, /* */ trim; /* */ @@ -397,15 +384,7 @@ NameNode name_format(s) /* */ ** Returns: Pointer to static string which is reused upon the next ** invocation of this function. **___________________________________________________ */ -String pp_list_of_names(wa,format,trans,max,comma,and,namesep,etal)/* */ - String *wa; /* */ - NameNode format; /* */ - String trans; /* */ - int max; /* */ - String comma; /* */ - String and; /* */ - char *namesep; /* */ - char *etal; /* */ +String pp_list_of_names(String *wa, NameNode format, String trans, int max, String comma, String and, char *namesep, char *etal)/* */ { String *w; /* */ String word; /* */ int commas; /* */ @@ -468,14 +447,7 @@ String pp_list_of_names(wa,format,trans,max,comma,and,namesep,etal)/* */ ** commas ** Returns: nothing **___________________________________________________ */ -static void pp_one_name(sb, w, format, trans, len, comma, commas)/* */ - StringBuffer *sb; /* */ - String *w; /* */ - NameNode format; /* */ - String trans; /* */ - int len; /* */ - String comma; /* */ - int commas; /* */ +static void pp_one_name(StringBuffer *sb, String *w, NameNode format, String trans, int len, String comma, int commas)/* */ { NameNode nn; /* */ char t; /* */ char *type; /* */ @@ -617,11 +589,7 @@ static void pp_one_name(sb, w, format, trans, len, comma, commas)/* */ ** sb the target string buffer ** Returns: nothing **___________________________________________________ */ -static void initial(s,trans,len,sb) /* */ - String s; /* */ - String trans; /* */ - int len; /* */ - StringBuffer *sb; /* */ +static void initial(String s, String trans, int len, StringBuffer *sb) /* */ { /* */ if (len < 0) { sbputs((char*)s, sb); return; } /* */ /* */ @@ -646,9 +614,7 @@ static void initial(s,trans,len,sb) /* */ ** Roman numbers ** Returns: **___________________________________________________ */ -static bool is_jr(s, eager) /* */ - String s; /* */ - bool eager; /* */ +static bool is_jr(String s, bool eager) /* */ { /* */ switch ( ToLower(*s) ) /* */ { case 'j': /* */ @@ -720,8 +686,7 @@ static bool is_jr(s, eager) /* */ ** s Word to test ** Returns: |true| or |false| **___________________________________________________ */ -static bool is_lower_word(s) /* */ - register String s; /* */ +static bool is_lower_word(register String s) /* */ { /* */ while(*s) /* */ { if ( is_lower(*s) ) return true; /* */ @@ -751,13 +716,7 @@ static bool is_lower_word(s) /* */ ** etal string to be added instead of `and others' ** Returns: a new symbol with the reformatted names. **___________________________________________________ */ -char * pp_names(s, format, trans, max, namesep, etal)/* */ - char *s; /* */ - NameNode format; /* */ - String trans; /* */ - int max; /* */ - char *namesep; /* */ - char *etal; /* */ +char * pp_names(char *s, NameNode format, String trans, int max, char *namesep, char *etal)/* */ { char *wp, /* */ *comma, /* */ *and; /* */ @@ -833,9 +792,7 @@ char * pp_names(s, format, trans, max, namesep, etal)/* */ ** argv Array of command line arguments (and program name) ** Returns: **___________________________________________________ */ -int main(argc,argv) /* */ - int argc; /* */ - char *argv[]; /* */ +int main(int argc, char *argv[]) /* */ { Uchar s[1024]; /* */ NameNode format = NameNULL; /* */ /* */ diff --git a/parse.c b/parse.c index 19ec8bd8..f72d67d3 100644 --- a/parse.c +++ b/parse.c @@ -144,11 +144,7 @@ ** env the environment string ** Returns: nothing **___________________________________________________ */ -static void init___(pathp,pattern,envvp,env) /* */ - char ***pathp; /* */ - char **pattern; /* */ - char **envvp; /* */ - char *env; /* */ +static void init___(char ***pathp, char **pattern, char **envvp, char *env) /* */ { register char **cpp, /* */ *cp; /* */ /* */ @@ -214,8 +210,7 @@ void init_read() /* */ ** s String to print ** Returns: |true| to indicate that continuation is desired. **___________________________________________________ */ -static int see_bib_msg(s) /* */ - register char *s; /* */ +static int see_bib_msg(register char *s) /* */ { /* */ if (rsc_verbose) VerbosePrint2("Trying ", s); /* */ return true; /* */ @@ -242,8 +237,7 @@ static int see_bib_msg(s) /* */ ** fname Name of the file or |NULL|. ** Returns: |true| iff the file could be opened for reading. **___________________________________________________ */ -bool see_bib(fname) /* */ - register String fname; /* */ +bool see_bib(register String fname) /* */ { /* */ init_parse(); /* */ InitLine; /* */ @@ -393,8 +387,7 @@ static int fill_line() /* */ ** returned. ** Returns: The next character **___________________________________________________ */ -static int skip(inc) /* */ - register bool inc; /* */ +static int skip(register bool inc) /* */ { /* */ FOREVER /* */ { if (EmptyC && fill_line()) return EOF; /* */ @@ -467,8 +460,7 @@ static int skip_nl() /* */ ** alpha indicator that the symbol has to start with an alpha character ** Returns: Success status **___________________________________________________ */ -static bool parse_symbol(alpha) /* */ - register int alpha; /* */ +static bool parse_symbol(register int alpha) /* */ { register Uchar c; /* */ register String cp; /* */ /* */ @@ -493,8 +485,7 @@ static bool parse_symbol(alpha) /* */ ** alpha indicator that the symbol has to start with an alpha character ** Returns: Success status **___________________________________________________ */ -static bool parse_key(alpha) /* */ - register int alpha; /* */ +static bool parse_key(register int alpha) /* */ { register Uchar c; /* */ register String cp; /* */ Symbol name; /* */ @@ -553,8 +544,7 @@ static void parse_number() /* */ ** off the input stream. ** Returns: Success status **___________________________________________________" */ -static bool parse_string(quotep) /* */ - int quotep; /* */ +static bool parse_string(int quotep) /* */ { int c; /* */ int left; /* */ int start_flno = flno; /* */ @@ -594,8 +584,7 @@ static bool parse_string(quotep) /* */ ** the input stream. ** Returns: Success status **___________________________________________________ */ -static bool parse_block(quotep) /* */ - bool quotep; /* */ +static bool parse_block(bool quotep) /* */ { int c; /* */ int left; /* */ int start_flno = flno; /* */ @@ -687,8 +676,7 @@ static bool parse_rhs() /* */ ** rec The record to store the result in ** Returns: Success status **___________________________________________________ */ -static bool parse_equation(rec) /* */ - Record rec; /* */ +static bool parse_equation(Record rec) /* */ { Symbol s, t; /* */ /* */ ExpectSymbol(true, false); /* */ @@ -720,8 +708,7 @@ static bool parse_equation(rec) /* */ ** rec Record to store the result in. ** Returns: The type of the entry read, |BIB_EOF|, or |BIB_NOOP|. **___________________________________________________ */ -int parse_bib(rec) /* */ - Record rec; /* */ +int parse_bib(Record rec) /* */ { register rec_type type; /* */ register int n, /* */ c; /* */ @@ -921,8 +908,7 @@ int parse_bib(rec) /* */ ** val The string representation of the file search path. ** Returns: nothing **___________________________________________________ */ -void set_rsc_path(val) /* */ - String val; /* */ +void set_rsc_path(String val) /* */ { /* */ rsc_v_rsc = val; /* */ init___(&r_path, /* */ @@ -940,8 +926,7 @@ void set_rsc_path(val) /* */ ** fname The file name to take into account. ** Returns: |true| iff the operation succeeds. **___________________________________________________ */ -static bool see_rsc(fname) /* */ - String fname; /* */ +static bool see_rsc(String fname) /* */ { /* */ if (fname == StringNULL) return false; /* */ /* */ @@ -1015,8 +1000,7 @@ static bool parse_value() /* */ ** name Name of the file to read from. ** Returns: |true| if an error has occured **___________________________________________________ */ -bool read_rsc(name) /* */ - String name; /* */ +bool read_rsc(String name) /* */ { int c; /* */ Symbol token; /* */ String s_filename; /* */ diff --git a/print.c b/print.c index 795c20e0..16fe7003 100644 --- a/print.c +++ b/print.c @@ -93,8 +93,7 @@ ** s String description of the value. ** Returns: nothing **___________________________________________________ */ -void set_symbol_type(s) /* */ - register String s; /* */ +void set_symbol_type(register String s) /* */ { if ( case_eq(s, s_upper) ) /* */ { symbol_type = SYMBOL_TYPE_UPPER; } /* */ else if ( case_eq(s, s_cased) ) /* */ @@ -134,8 +133,7 @@ String get_symbol_type() /* */ ** s String description of the value. ** Returns: nothing **___________________________________________________ */ -void set_key_type(s) /* */ - register String s; /* */ +void set_key_type(register String s) /* */ { if ( case_cmp(s,s_upper) ) /* */ { key_type = SYMBOL_TYPE_UPPER; } /* */ else if ( case_cmp(s,s_cased) ) /* */ @@ -161,8 +159,7 @@ void set_key_type(s) /* */ ** s String description of the value. ** Returns: nothing **___________________________________________________ */ -void rsc_align(s) /* */ - String s; /* */ +void rsc_align(String s) /* */ { /* */ int val = 0; /* */ while (*s && is_space(*s)) { s++; } /* */ @@ -201,8 +198,7 @@ void rsc_align(s) /* */ ** rec the record ** Returns: nothing **___________________________________________________ */ - static void adjust_align(rec) /* */ - Record rec; /* */ + static void adjust_align(Record rec) /* */ { register int i; /* */ register int len; /* */ Symbol *hp = RecordHeap(rec); /* */ @@ -239,10 +235,7 @@ void rsc_align(s) /* */ ** fct function to use for writing a character. ** Returns: nothing **___________________________________________________ */ -static void puts_in(s,in,fct) /* */ - register String s; /* */ - register int in; /* */ - int (*fct)_ARG((int)); /* */ +static void puts_in(register String s, register int in, int (*fct)_ARG((int))) /* */ { /* */ while ( *s ) /* */ { (void)(*fct)(*s); /* */ @@ -269,9 +262,7 @@ static void puts_in(s,in,fct) /* */ ** fct function to use for writing a character. ** Returns: nothing **___________________________________________________ */ -static void indent(col,fct) /* */ - register int col; /* */ - int (*fct)_ARG((int)); /* */ +static void indent(register int col, int (*fct)_ARG((int))) /* */ { /* */ if ( col > rsc_linelen ) col = rsc_linelen; /* */ while ( column < col ) /* */ @@ -300,10 +291,7 @@ static void indent(col,fct) /* */ ** fct function to use for writing a character. ** Returns: nothing **___________________________________________________ */ -static void line_breaking(t, align, fct) /* */ - register String t; /* string to print. */ - int align; /* alignment column */ - int (*fct)_ARG((int)); /* */ +static void line_breaking(register String t, int align, int (*fct)_ARG((int))) /* */ { register String s; /* intermediate pointer */ char end_c; /* temp. character. */ int brace, /* brace counter */ @@ -433,12 +421,7 @@ static void line_breaking(t, align, fct) /* */ ** fct function to use for writing a character. ** Returns: nothing **___________________________________________________' */ -static void print_equation(pre, lhs, rhs, align, fct)/* */ - String pre; /* */ - Symbol lhs; /* */ - Symbol rhs; /* */ - int align; /* */ - int (*fct)_ARG((int)); /* */ +static void print_equation(String pre, Symbol lhs, Symbol rhs, int align, int (*fct)_ARG((int)))/* */ { /* */ if ( align >= 0 ) indent(rsc_indent, fct); /* */ /* */ @@ -467,8 +450,7 @@ static void print_equation(pre, lhs, rhs, align, fct)/* */ ** c Character to print. ** Returns: The return status of |fputc()|. **___________________________________________________ */ -static int fput_char(c) /* */ - int c; /* */ +static int fput_char(int c) /* */ { return fputc(c, ofile); /* */ } /*------------------------*/ @@ -483,11 +465,7 @@ static int fput_char(c) /* */ ** start Initial string used before the type. Should be "@" normally. ** Returns: nothing **___________________________________________________ */ -void fput_record(file, rec, db, start) /* */ - FILE *file; /* */ - DB db; /* */ - Record rec; /* record to print */ - String start; /* initial string = "@" */ +void fput_record(FILE *file, Record rec, DB db, String start) /* */ { /* */ ofile = file; /* */ put_record(fput_char, rec, db, start); /* */ @@ -503,8 +481,7 @@ void fput_record(file, rec, db, start) /* */ ** c Character to print. ** Returns: The return status of |fputc()|. **___________________________________________________ */ -static int sput_char(c) /* */ - int c; /* */ +static int sput_char(int c) /* */ { return sbputchar(c, osb); /* */ } /*------------------------*/ @@ -520,10 +497,7 @@ static int sput_char(c) /* */ ** start Initial string used before the type. Should be "@" normally. ** Returns: The string containing the printed representation. **___________________________________________________ */ -char * sput_record(rec, db, start) /* */ - DB db; /* */ - Record rec; /* record to print */ - String start; /* initial string = "@" */ +char * sput_record(Record rec, DB db, String start) /* */ { /* */ if ( osb == NULL ) osb = sbopen(); /* */ sbrewind(osb); /* */ @@ -581,11 +555,7 @@ char * sput_record(rec, db, start) /* */ ** start Initial string used before the type. Should be "@" normally. ** Returns: nothing **___________________________________________________ */ -void put_record(fct, rec, db, start) /* */ - int (*fct)_ARG((int)); /* */ - Record rec; /* */ - DB db; /* */ - String start; /* initial string = "@" */ +void put_record(int (*fct)_ARG((int)), Record rec, DB db, String start) /* */ { Symbol *hp; /* heap pointer */ unsigned int i; /* */ char open_brace, close_brace; /* */ diff --git a/pxfile.c b/pxfile.c index bc099d68..e7b83229 100644 --- a/pxfile.c +++ b/pxfile.c @@ -108,10 +108,7 @@ ** Returns: The return value is |true| ** Otherwise |false| is returned and nothing changed. **___________________________________________________ */ -static bool absolute_file(name,basename,path) /* */ - char *name; /* */ - char **basename; /* */ - char ***path; /* */ +static bool absolute_file(char *name, char **basename, char ***path) /* */ { static char *absolut_path[2]; /* */ static int first = (-1); /* */ size_t l; /* */ @@ -172,12 +169,7 @@ static bool absolute_file(name,basename,path) /* */ ** show A function pointer or |NULL|. ** Returns: A file pointer refering to the file or |NULL|. **___________________________________________________ */ -FILE * px_fopen(name,mode,pattern,path,show) /* */ - char * name; /* */ - char * mode; /* */ - char **pattern; /* */ - char **path; /* */ - int (*show)_ARG((char*)); /* */ +FILE * px_fopen(char *name, char *mode, char **pattern, char **path, int (*show)_ARG((char*))) /* */ { char **fmt; /* */ char **pp; /* */ FILE * file; /* */ @@ -241,9 +233,7 @@ FILE * px_fopen(name,mode,pattern,path,show) /* */ ** sep Separator ** Returns: The array of the components **___________________________________________________ */ -char ** px_s2p(s,sep) /* */ - char * s; /* */ - int sep; /* */ +char ** px_s2p(char *s, int sep) /* */ { register char *cp; /* */ register size_t l = 1; /* */ char **pattern; /* */ @@ -316,10 +306,7 @@ char ** px_s2p(s,sep) /* */ ** se ** Returns: **___________________________________________________ */ -static void expand_env(s,se,res) /* */ - char * s; /* */ - char * se; /* */ - StringBuffer * res; /* */ +static void expand_env(char *s, char *se, StringBuffer *res) /* */ { /* */ StringBuffer * val = sbopen(); /* */ /* */ diff --git a/record.c b/record.c index 286aa63d..f11b14fb 100644 --- a/record.c +++ b/record.c @@ -67,8 +67,7 @@ ** rec The record to copy. ** Returns: The new copy of |rec|. **___________________________________________________ */ -Record copy_record(rec) /* */ - register Record rec; /* */ +Record copy_record(register Record rec) /* */ { register Record new; /* */ register Symbol *new_heap, /* */ *old_heap; /* */ @@ -109,9 +108,7 @@ Record copy_record(rec) /* */ ** size The initial heap size. ** Returns: The new record. **___________________________________________________ */ -Record new_record(token,size) /* */ - int token; /* */ - int size; /* */ +Record new_record(int token, int size) /* */ { register Record new; /* */ register Symbol *new_heap; /* */ register int i; /* */ @@ -145,8 +142,7 @@ Record new_record(token,size) /* */ ** rec Arbitrary Record in the chain. ** Returns: nothing **___________________________________________________ */ -void free_record(rec) /* */ - Record rec; /* */ +void free_record(Record rec) /* */ { Record r; /* */ /* */ if ( rec == RecordNULL ) return; /* */ @@ -170,8 +166,7 @@ void free_record(rec) /* */ ** rec record to free ** Returns: nothing **___________________________________________________ */ -void free_1_record(rec) /* */ - Record rec; /* */ +void free_1_record(Record rec) /* */ { int i; /* */ /* */ if ( rec != RecordNULL ) /* */ @@ -200,8 +195,7 @@ void free_1_record(rec) /* */ ** rec Record to free. ** Returns: nothing **___________________________________________________ */ -Record unlink_record(rec) /* */ - Record rec; /* */ +Record unlink_record(Record rec) /* */ { Record r; /* */ /* */ if ( NextRecord(rec) ) /* */ @@ -234,8 +228,7 @@ Record unlink_record(rec) /* */ ** Returns: Pointer to some entry in the cleared chain or ** |RecordNULL| if none is left. **___________________________________________________ */ -Record record_gc(rec) /* */ - Record rec; /* */ +Record record_gc(Record rec) /* */ { Record ret = RecordNULL; /* */ /* */ if ( rec == RecordNULL ) return rec; /* */ @@ -267,9 +260,7 @@ Record record_gc(rec) /* */ ** key the key ** Returns: **___________________________________________________ */ -Symbol record_get(rec, key) /* */ - Record rec; /* */ - Symbol key; /* */ +Symbol record_get(Record rec, Symbol key) /* */ { int i; /* */ register Symbol *hp; /* */ register Symbol s, t; /* */ @@ -295,8 +286,7 @@ Symbol record_get(rec, key) /* */ ** rec the record ** Returns: **___________________________________________________ */ -int count_record(rec) /* */ - Record rec; /* */ +int count_record(Record rec) /* */ { int len = 0; /* */ int i; /* */ register Symbol *hp; /* */ @@ -327,11 +317,7 @@ int count_record(rec) /* */ ** err indicator that a warning for double fields should be issued. ** Returns: nothing **___________________________________________________ */ -void push_to_record(rec, s, t, err) /* */ - register Record rec; /* */ - register Symbol s; /* */ - register Symbol t; /* */ - bool err; /* */ +void push_to_record(register Record rec, register Symbol s, register Symbol t, bool err) /* */ { register int i; /* */ /* */ if (s == sym_crossref || s == sym_xdata) /* */ @@ -383,10 +369,7 @@ void push_to_record(rec, s, t, err) /* */ ** t Right hand side of the equation. ** Returns: nothing **___________________________________________________ */ -void provide_to_record(rec,s,t) /* */ - register Record rec; /* */ - register Symbol s; /* */ - register Symbol t; /* */ +void provide_to_record(register Record rec, register Symbol s, register Symbol t) /* */ { register int i; /* */ /* */ if (s == sym_crossref || s == sym_xdata) /* */ @@ -432,8 +415,7 @@ void provide_to_record(rec,s,t) /* */ ** s Initial string to fill in the WordList structure ** Returns: **___________________________________________________ */ -WordList new_wordlist(s) /* */ - Symbol s; /* */ +WordList new_wordlist(Symbol s) /* */ { register WordList wl; /* */ if ( (wl=(WordList)malloc(sizeof(SWordList))) == WordNULL )/* */ { OUT_OF_MEMORY("WordList"); } /* */ @@ -464,8 +446,7 @@ WordList new_wordlist(s) /* */ ** val string resource of the order. ** Returns: nothing **___________________________________________________ */ -void add_sort_order(val) /* */ - Symbol val; /* */ +void add_sort_order(Symbol val) /* */ { Symbol sym; /* */ rec_type type; /* */ OrderList ol; /* */ @@ -538,8 +519,7 @@ void add_sort_order(val) /* */ ** rec Record to sort ** Returns: nothing **___________________________________________________ */ -void sort_record(rec) /* */ - register Record rec; /* */ +void sort_record(register Record rec) /* */ { Record r; /* Temp. record */ OrderList ol; /* */ int i, ptr; /* */ diff --git a/rewrite.c b/rewrite.c index 2a92fa6d..1957f696 100644 --- a/rewrite.c +++ b/rewrite.c @@ -135,8 +135,7 @@ void clear_addlist() /* */ ** fct the function to be applied ** Returns: the termination indicator **___________________________________________________ */ -bool foreach_addlist(fct) /* */ - bool (*fct) _ARG((Symbol key, Symbol val)); /* */ +bool foreach_addlist(bool (*fct) _ARG((Symbol key, Symbol val))) /* */ { return each_macro(addlist, fct); /* */ } /*------------------------*/ @@ -148,8 +147,7 @@ bool foreach_addlist(fct) /* */ ** | token=value| ** Returns: nothing **___________________________________________________ */ -void add_field(spec) /* */ - String spec; /* */ +void add_field(String spec) /* */ { register Symbol field, value; /* */ /* */ sp_open(spec); /* */ @@ -171,9 +169,7 @@ void add_field(spec) /* */ ** rec Record in which the field should be removed. ** Returns: nothing **___________________________________________________ */ -void remove_field(field, rec) /* */ - register Symbol field; /* */ - Record rec; /* */ +void remove_field(register Symbol field, Record rec) /* */ { register int i; /* */ /* */ for (i = 0; i < RecordFree(rec); i += 2 ) /* */ @@ -208,13 +204,7 @@ void remove_field(field, rec) /* */ ** casep Boolean; indicating case sensitive comparison. ** Returns: A pointer to the allocated structure or |NULL| upon failure. **___________________________________________________ */ -static Rule new_rule(field, value, pattern, frame, flags, casep)/* */ - Symbol field; /* */ - Symbol value; /* */ - Symbol pattern; /* */ - Symbol frame; /* */ - int flags; /* */ - int casep; /* */ +static Rule new_rule(Symbol field, Symbol value, Symbol pattern, Symbol frame, int flags, int casep)/* */ { register Rule rule; /* */ static int init = 1; /* */ /* */ @@ -295,8 +285,7 @@ static Rule new_rule(field, value, pattern, frame, flags, casep)/* */ ** rule First rule in the list. ** Returns: nothing **___________________________________________________ */ -static void free_rule(rule) /* */ - Rule rule; /* */ +static void free_rule(Rule rule) /* */ { Rule next; /* */ /* */ while (rule) /* */ @@ -321,12 +310,7 @@ static void free_rule(rule) /* */ ** casep the indicator for cased matching ** Returns: nothing **___________________________________________________ */ -static void add_rule(s,rp,rp_end,flags,casep) /* */ - String s; /* */ - Rule *rp; /* */ - Rule *rp_end; /* */ - int flags; /* */ - int casep; /* */ +static void add_rule(String s, Rule *rp, Rule *rp_end, int flags, int casep) /* */ { Symbol field; /* */ Symbol pattern; /* */ Symbol frame; /* */ @@ -424,12 +408,7 @@ static void add_rule(s,rp,rp_end,flags,casep) /* */ ** rec ** Returns: nothing **___________________________________________________ */ -static void rewrite_1(frame,sb,match,db,rec) /* */ - String frame; /* */ - StringBuffer *sb; /* */ - String match; /* */ - DB db; /* */ - Record rec; /* */ +static void rewrite_1(String frame, StringBuffer *sb, String match, DB db, Record rec) /* */ { /* */ for (; *frame; frame++) /* */ { if (*frame == '%') /* */ @@ -486,10 +465,7 @@ static void rewrite_1(frame,sb,match,db,rec) /* */ ** rec the record ** Returns: |true| iff the rule applies **___________________________________________________ */ -static bool selector_hits(rule, db, rec) /* */ - Rule rule; /* */ - DB db; /* */ - Record rec; /* */ +static bool selector_hits(Rule rule, DB db, Record rec) /* */ { Symbol field = RuleFrame(rule); /* */ Symbol value; /* */ int len; /* */ @@ -526,12 +502,7 @@ static bool selector_hits(rule, db, rec) /* */ ** rec the record ** Returns: the result of the replacement **___________________________________________________ */ -static String repl_regex(field, value, rule, db, rec)/* */ - Symbol field; /* */ - Symbol value; /* */ - Rule rule; /* */ - DB db; /* */ - Record rec; /* */ +static String repl_regex(Symbol field, Symbol value, Rule rule, DB db, Record rec)/* */ { /* */ String val = SymbolValue(value); /* */ #ifdef REGEX @@ -650,12 +621,7 @@ static String repl_regex(field, value, rule, db, rec)/* */ ** rec the record ** Returns: **___________________________________________________ */ -static String check_regex(field, value, rule, db, rec)/* */ - Symbol field; /* */ - Symbol value; /* */ - register Rule rule; /* */ - DB db; /* */ - Record rec; /* */ +static String check_regex(Symbol field, Symbol value, register Rule rule, DB db, Record rec)/* */ { /* */ #ifdef REGEX int len; /* */ @@ -715,8 +681,7 @@ static String check_regex(field, value, rule, db, rec)/* */ ** spec the argument ** Returns: nothing **___________________________________________________ */ -void rename_field(spec) /* */ - Symbol spec; /* */ +void rename_field(Symbol spec) /* */ { String s = SymbolValue(spec); /* */ Symbol from; /* */ Symbol to; /* */ @@ -773,8 +738,7 @@ void rename_field(spec) /* */ ** s Rule to save ** Returns: nothing **___________________________________________________ */ -void add_rewrite_rule(s) /* */ - String s; /* */ +void add_rewrite_rule(String s) /* */ { /* */ DebugPrintF1("add rewrite rule\n"); /* */ /* */ @@ -802,8 +766,7 @@ static Rule *k_rules = (Rule*)NULL; ** spec the specification ** Returns: nothing **___________________________________________________ */ -void keep_field(spec) /* */ - Symbol spec; /* */ +void keep_field(Symbol spec) /* */ { String s = SymbolValue(spec); /* */ Symbol* names; /* */ Symbol* np; /* */ @@ -874,9 +837,7 @@ void keep_field(spec) /* */ ** flags the additional rule flags ** Returns: nothing **___________________________________________________ */ -void add_check_rule(s,flags) /* */ - String s; /* */ - int flags; /* */ +void add_check_rule(String s, int flags) /* */ { /* */ DebugPrintF1("add check rule\n"); /* */ add_rule(s, /* */ @@ -897,10 +858,7 @@ void add_check_rule(s,flags) /* */ ** db the database ** Returns: **___________________________________________________ */ -static bool dont_keep(sym,rec,db) /* */ - Symbol sym; /* */ - Record rec; /* */ - DB db; /* */ +static bool dont_keep(Symbol sym, Record rec, DB db) /* */ { Rule r; /* */ int idx = (int)((long)sym % K_RULES_SIZE); /* */ if (idx < 0) idx = -idx; /* */ @@ -923,9 +881,7 @@ static bool dont_keep(sym,rec,db) /* */ ** db The database record is belonging to. ** Returns: nothing **___________________________________________________ */ -void rewrite_record(db, rec) /* */ - DB db; /* */ - register Record rec; /* */ +void rewrite_record(DB db, register Record rec) /* */ { register int i; /* */ register Symbol *hp; /* heap pointer */ register Macro mac; /* */ @@ -1051,10 +1007,7 @@ void rewrite_record(db, rec) /* */ ** negated. ** Returns: nothing **___________________________________________________ */ -void add_extract(s,regexp,notp) /* */ - Symbol s; /* */ - int regexp; /* */ - int notp; /* */ +void add_extract(Symbol s, int regexp, int notp) /* */ { /* */ add_rule(SymbolValue(s), /* The main task is */ &x_rule, /* performed by */ @@ -1074,8 +1027,7 @@ void add_extract(s,regexp,notp) /* */ ** s Regular expression to search for. ** Returns: nothing **___________________________________________________ */ -void save_regex(s) /* */ - String s; /* */ +void save_regex(String s) /* */ { String t = malloc( (size_t)strlen((char*)s) /* */ + (size_t)strlen((char*)rsc_sel_fields)/* */ + 4 ); /* */ @@ -1110,8 +1062,7 @@ void save_regex(s) /* */ ** ignored the letters to be ignored ** Returns: Nothing **___________________________________________________ */ -static void init_s_search(ignored) /* */ - String ignored; /* */ +static void init_s_search(String ignored) /* */ { int i; /* */ for (i = 0; i < 256; i++) s_class[i] = i; /* */ /* */ @@ -1161,9 +1112,7 @@ static void init_s_search(ignored) /* */ ** s the string ** Returns: **___________________________________________________ */ -static bool s_match(p,s) /* */ - String p; /* */ - String s; /* */ +static bool s_match(String p, String s) /* */ { /* */ while (*p && s_class[(unsigned int)*p] == '\0') p++;/* */ /* */ @@ -1188,9 +1137,7 @@ static bool s_match(p,s) /* */ ** Returns: If a match is found then |true| is returned. Otherwise ** |false|. **___________________________________________________ */ -static bool s_search(pattern,s) /* */ - String pattern; /* */ - String s; /* */ +static bool s_search(String pattern, String s) /* */ { /* */ if ( s_cased != rsc_case_select || /* */ strcmp((char*)s_ignored, /* */ @@ -1221,9 +1168,7 @@ static bool s_search(pattern,s) /* */ ** Returns: |true| iff the record is seleced by a regexp or none is ** given. **___________________________________________________ */ -bool is_selected(db,rec) /* */ - DB db; /* */ - Record rec; /* */ +bool is_selected(DB db, Record rec) /* */ { /* */ int len, i; /* */ Symbol value; /* */ @@ -1318,8 +1263,7 @@ bool is_selected(db,rec) /* */ ** name ** Returns: nothing **___________________________________________________ */ -int set_regex_syntax(name) /* */ - char* name; /* */ +int set_regex_syntax(char *name) /* */ { /* */ #ifdef REGEX if ( strcmp(name,"emacs") == 0 ) /* */ diff --git a/rsc.c b/rsc.c index b5dc83fd..0d49d762 100644 --- a/rsc.c +++ b/rsc.c @@ -180,8 +180,7 @@ bool search_rsc() /* */ ** name The name of the resource file to read. ** Returns: |false| iff the reading failed. **___________________________________________________ */ -bool load_rsc(name) /* */ - register String name; /* */ +bool load_rsc(register String name) /* */ { /* */ if (r_v == NULL) { init_rsc(); } /* */ return (name != NULL ? read_rsc(name) : false); /* */ @@ -196,8 +195,7 @@ bool load_rsc(name) /* */ ** name the name of the resource file ** Returns: **___________________________________________________ */ -bool resource(name) /* */ - register String name; /* */ +bool resource(register String name) /* */ { /* */ bool ret = load_rsc(name); /* */ if (!ret) { NoRscError(name); } /* */ @@ -215,8 +213,7 @@ bool resource(name) /* */ ** sym String to check for the boolean value. ** Returns: |true| iff the string represents true. **___________________________________________________ */ -static bool test_true(sym) /* */ - Symbol sym; /* */ +static bool test_true(Symbol sym) /* */ { register String s = SymbolValue(sym); /* */ /* */ switch ( *s ) /* */ @@ -250,8 +247,7 @@ static bool test_true(sym) /* */ ** s String containing a resource command. ** Returns: |true| iff an error has occurred. **___________________________________________________ */ -bool use_rsc(s) /* */ - String s; /* */ +bool use_rsc(String s) /* */ { register Symbol name, /* */ value; /* */ /* */ @@ -280,9 +276,7 @@ bool use_rsc(s) /* */ ** val The new value of the resource. ** Returns: |false| iff everything went right. **___________________________________________________ */ -bool set_rsc(name,val) /* */ - Symbol name; /* */ - Symbol val; /* */ +bool set_rsc(Symbol name, Symbol val) /* */ { /* */ if ( rsc_verbose ) /* */ { VerbosePrint4("Set resource ", /* */ @@ -333,8 +327,7 @@ bool set_rsc(name,val) /* */ ** s String to print. ** Returns: nothing **___________________________________________________ */ -void rsc_print(s) /* */ - String s; /* */ +void rsc_print(String s) /* */ { ErrPrintF("%s\n", (char*)s); /* print the string itself*/ /* followed by a newline */ } /*------------------------*/ diff --git a/s_parse.c b/s_parse.c index 0144ae32..3cb0c617 100644 --- a/s_parse.c +++ b/s_parse.c @@ -67,8 +67,7 @@ ** s String to open for parsing. ** Returns: nothing **___________________________________________________ */ -void sp_open(s) /* */ - String s; /* */ +void sp_open(String s) /* */ { sp_line = s; /* */ } /*------------------------*/ @@ -94,8 +93,7 @@ void sp_close() /* */ ** sp the string pointer ** Returns: **___________________________________________________ */ -String sp_eos(sp) /* */ - String *sp; /* */ +String sp_eos(String *sp) /* */ { register String s = *sp; /* */ /* */ while( is_space(*s) ) s++; /* */ @@ -119,8 +117,7 @@ String sp_eos(sp) /* */ ** sp the string pointer ** Returns: **___________________________________________________ */ -void sp_skip(sp) /* */ - register String *sp; /* */ +void sp_skip(register String *sp) /* */ { register String s = *sp; /* */ while ( is_space(*s) /* */ || *s == '=' /* */ @@ -184,10 +181,7 @@ void sp_skip(sp) /* */ ** message should be created in case of an error. ** Returns: A symbol containing the requested entity or |NULL|. **___________________________________________________ */ -Symbol s_parse(type, sp, errp) /* */ - int type; /* */ - String *sp; /* */ - bool errp; /* */ +Symbol s_parse(int type, String *sp, bool errp) /* */ { register String s = *sp; /* */ Uchar c; /* */ String cp; /* */ @@ -329,10 +323,7 @@ Symbol s_parse(type, sp, errp) /* */ ** verbose the indicator whether an error message should be produced ** Returns: |true| iff the expected string is found **___________________________________________________ */ -bool sp_expect(sp, expect, verbose) /* */ - register String *sp; /* */ - register String expect; /* */ - bool verbose; /* */ +bool sp_expect(register String *sp, register String expect, bool verbose) /* */ { /* */ while (is_space(**sp)) (*sp)++; /* */ /* */ @@ -358,8 +349,7 @@ bool sp_expect(sp, expect, verbose) /* */ ** sp the pointer to the value to be parsed ** Returns: an array of Symbols **___________________________________________________ */ -Symbol* sp_symbols(sp) /* */ - String *sp; /* */ +Symbol* sp_symbols(String *sp) /* */ { Symbol s; /* */ Symbol *a = NULL; /* */ int n = 0; /* */ diff --git a/sbuffer.c b/sbuffer.c index 7a9357ab..62ed2328 100644 --- a/sbuffer.c +++ b/sbuffer.c @@ -95,8 +95,7 @@ StringBuffer* sbopen() /* */ ** sb Pointer to string buffer which should be closed ** Returns: Return |false| upon failure. **___________________________________________________ */ -bool sbclose(sb) /* */ - StringBuffer* sb; /* */ +bool sbclose(StringBuffer *sb) /* */ { /* */ if (sb == NULL) return true; /* */ if (sb->sb__string != NULL) free(sb->sb__string);/* */ @@ -112,9 +111,7 @@ bool sbclose(sb) /* */ ** sb Destination string buffer. ** Returns: |false| if something went wrong. **___________________________________________________ */ -bool sbputs(s,sb) /* */ - char *s; /* */ - StringBuffer* sb; /* */ +bool sbputs(char *s, StringBuffer *sb) /* */ { /* */ if (sb == NULL) return false; /* */ /* */ @@ -139,9 +136,7 @@ bool sbputs(s,sb) /* */ ** sb Destination string buffer. ** Returns: |false| if no memory is left. **___________________________________________________ */ -bool sbputc(c,sb) /* */ - register int c; /* */ - register StringBuffer* sb; /* */ +bool sbputc(register int c, register StringBuffer *sb) /* */ { register char *cp; /* */ /* */ if ( sb->sb__ptr >= sb->sb__size ) /* */ @@ -172,8 +167,7 @@ bool sbputc(c,sb) /* */ ** Returns: The string contained in the string buffer as a proper ** C string. **___________________________________________________ */ -char* sbflush(sb) /* */ - StringBuffer* sb; /* */ +char* sbflush(StringBuffer *sb) /* */ { /* */ (void)sbputchar('\0',sb); /* */ sb->sb__ptr--; /* */ @@ -188,8 +182,7 @@ char* sbflush(sb) /* */ ** sb String buffer to consider. ** Returns: nothing **___________________________________________________ */ -void sbrewind(sb) /* */ - StringBuffer* sb; /* */ +void sbrewind(StringBuffer *sb) /* */ { sb->sb__ptr = 0; /* */ } /*------------------------*/ @@ -203,8 +196,7 @@ void sbrewind(sb) /* */ ** position. This is an integer offset from the beginning ** of the string buffer. **___________________________________________________ */ -int sbtell(sb) /* */ - StringBuffer* sb; /* */ +int sbtell(StringBuffer *sb) /* */ { return sb->sb__ptr; /* */ } /*------------------------*/ @@ -218,9 +210,7 @@ int sbtell(sb) /* */ ** pos New position of the string buffer. ** Returns: |false| if everything went right. **___________________________________________________ */ -bool sbseek(sb, pos) /* */ - StringBuffer* sb; /* */ - int pos; /* */ +bool sbseek(StringBuffer *sb, int pos) /* */ { /* */ if ( pos < 0 || pos > sb->sb__ptr ) return true; /* */ sb->sb__ptr = pos; /* */ diff --git a/stack.c b/stack.c index b5f7913d..be336d92 100644 --- a/stack.c +++ b/stack.c @@ -76,8 +76,7 @@ ** s String to push to the stack. ** Returns: nothing **___________________________________________________ */ -void push_string(s) /* */ - register Symbol s; /* */ +void push_string(register Symbol s) /* */ { /* */ if ( stack_ptr >= stack_size ) /* */ { stack_size += 16; /* */ diff --git a/symbols.c b/symbols.c index 9ce7db8e..8dd870fb 100644 --- a/symbols.c +++ b/symbols.c @@ -160,8 +160,7 @@ ** Returns: Pointer to newly allocated memory containing a ** duplicate of the argument string. **___________________________________________________ */ -char * new_string(s) /* */ - register char * s; /* */ +char * new_string(register char *s) /* */ { register char * t; /* */ if ( (t=malloc((size_t)strlen(s) + 1)) == NULL ) /* */ { OUT_OF_MEMORY("string"); } /* */ @@ -185,8 +184,7 @@ char * new_string(s) /* */ ** value String value of the |SymTab| node. ** Returns: Pointer to a new instance of a |SymTab|. **___________________________________________________ */ -static SymTab new_sym_tab(value) /* */ - String value; /* */ +static SymTab new_sym_tab(String value) /* */ { register SymTab new_symtab; /* */ Symbol sym; /* */ /* */ @@ -215,8 +213,7 @@ static SymTab new_sym_tab(value) /* */ ** s string to be analyzed. ** Returns: hash index **___________________________________________________ */ -static int hashindex(s) /* */ - String s; /* */ +static int hashindex(String s) /* */ { int index = 0; /* */ while (*s) index = (index + *(s++)) % HASHMAX; /* */ return ( index < 0 ? -index : index ); /* */ @@ -282,8 +279,7 @@ void init_symbols() /* */ ** sym the symbol to search for ** Returns: **___________________________________________________ */ -static SymTab* get_sym_tab(sym) /* */ - register Symbol sym; /* */ +static SymTab* get_sym_tab(register Symbol sym) /* */ { register SymTab *stp; /* */ /* */ if (sym == NO_SYMBOL) return NULL; /* ignore dummies. */ @@ -327,8 +323,7 @@ static SymTab* get_sym_tab(sym) /* */ ** s String which should be translated into a symbol. ** Returns: The new symbol. **___________________________________________________ */ -Symbol symbol(s) /* */ - String s; /* */ +Symbol symbol(String s) /* */ { register SymTab *stp; /* */ Symbol sym; /* */ /* */ @@ -371,8 +366,7 @@ Symbol symbol(s) /* */ ** sym Symbol to be released. ** Returns: nothing **___________________________________________________ */ -void sym_unlink(sym) /* */ - register Symbol sym; /* */ +void sym_unlink(register Symbol sym) /* */ { /* */ if (sym == NO_SYMBOL) return; /* ignore dummies. */ #ifdef COMPLEX_SYMBOL @@ -413,8 +407,7 @@ void sym_unlink(sym) /* */ ** sym ** Returns: nothing **___________________________________________________ */ -void sym_del(sym) /* */ - Symbol sym; /* */ +void sym_del(Symbol sym) /* */ { /* */ #ifdef COMPLEX_SYMBOL SymTab *stp; /* */ @@ -488,9 +481,7 @@ void sym_gc() /* */ ** lowercase indicate that lowering is requested ** Returns: **___________________________________________________ */ -Symbol sym_extract(sp, lowercase) /* */ - register String *sp; /* pointer to first char */ - bool lowercase; /* */ +Symbol sym_extract(register String *sp, bool lowercase) /* */ { Uchar c; /* */ String t = *sp; /* */ Symbol sym; /* */ @@ -518,8 +509,7 @@ Symbol sym_extract(sp, lowercase) /* */ ** sym_arr symbol array ** Returns: nothing **___________________________________________________ */ -void free_sym_array(sym_arr) /* */ - Symbol *sym_arr; /* */ +void free_sym_array(Symbol *sym_arr) /* */ { Symbol *a; /* */ for (a = sym_arr; *a; a++) /* */ { if (*a) UnlinkSymbol(*a); } /* */ diff --git a/tex_aux.c b/tex_aux.c index 392e7dd9..2695f75d 100644 --- a/tex_aux.c +++ b/tex_aux.c @@ -89,8 +89,7 @@ void clear_aux() /* */ ** fct funtion to apply ** Returns: |cite_star| **___________________________________________________ */ -bool foreach_aux(fct) /* */ - bool (fct)_ARG((Symbol)); /* */ +bool foreach_aux(bool (fct)_ARG((Symbol))) /* */ { int i; /* */ for (i = 0; i < 32; i++) /* */ { foreach_word(cite[i], fct); } /* */ @@ -106,8 +105,7 @@ bool foreach_aux(fct) /* */ ** key the reference key of * for all ** Returns: nothing **___________________________________________________ */ -static void save_ref(key) /* */ - register String key; /* */ +static void save_ref(register String key) /* */ { /* */ if (cite_star) return; /* */ /* */ @@ -125,8 +123,7 @@ static void save_ref(key) /* */ ** s reference key to check ** Returns: |true| if the reference is used. **___________________________________________________ */ -bool aux_used(s) /* */ - Symbol s; /* */ +bool aux_used(Symbol s) /* */ { /* */ return cite_star /* */ || find_word(SymbolValue(s), /* */ @@ -159,10 +156,7 @@ bool aux_used(s) /* */ ** indicating the status of the operation. ** Returns: |true| iff the file could not be opened. **___________________________________________________ */ -bool read_aux(fname, fct, verbose) /* */ - String fname; /* aux file name */ - void (*fct)_ARG((Symbol)); /* */ - bool verbose; /* */ +bool read_aux(String fname, void (*fct)_ARG((Symbol)), bool verbose) /* */ { FILE *file; /* */ int c; /* */ char* s; /* */ @@ -278,8 +272,7 @@ bool read_aux(fname, fct, verbose) /* */ ** Returns: |false| iff all entries are kept because of an ** explicit or implicit star (*). **___________________________________________________ */ -bool apply_aux(db) /* */ - DB db; /* */ +bool apply_aux(DB db) /* */ { Record rec, rec1; /* */ /* */ if (cite_star) return false; /* No selection desired. */ diff --git a/tex_read.c b/tex_read.c index 7f930ecd..9ad7dac9 100644 --- a/tex_read.c +++ b/tex_read.c @@ -221,9 +221,7 @@ static void init_TeX() /* */ ** string the strign value ** Returns: the new token **___________________________________________________ */ -static Token new_token(type, string) /* */ - int type; /* */ - String string; /* */ +static Token new_token(int type, String string) /* */ { Token new; /* */ /* */ if ( token_free_list != TokenNULL ) /* */ @@ -253,10 +251,7 @@ static Token new_token(type, string) /* */ ** argp ** Returns: **___________________________________________________ */ -static Token token_list_copy(t,nt,argp) /* */ - register Token t; /* */ - Token nt; /* */ - Token *argp; /* */ +static Token token_list_copy(register Token t, Token nt, Token *argp) /* */ { register Token a,p; /* */ int i; /* */ /* */ @@ -296,8 +291,7 @@ static Token token_list_copy(t,nt,argp) /* */ ** t ** Returns: nothing **___________________________________________________ */ -static void free_1_token(t) /* */ - register Token t; /* */ +static void free_1_token(register Token t) /* */ { NextToken(t) = token_free_list; /* */ token_free_list = t; /* */ if ( TokenSeq(t) ) free(TokenSeq(t)); /* */ @@ -312,8 +306,7 @@ static void free_1_token(t) /* */ ** t ** Returns: nothing **___________________________________________________ */ -static void free_tokens(t) /* */ - register Token t; /* */ +static void free_tokens(register Token t) /* */ { register Token t0; /* */ /* */ for ( t0 = t; /* */ @@ -333,8 +326,7 @@ static void free_tokens(t) /* */ ** t ** Returns: **___________________________________________________ */ -static String tokens_to_string(t) /* */ - Token t; /* */ +static String tokens_to_string(Token t) /* */ { register Token t1; /* */ register String s, /* */ sp; /* */ @@ -376,11 +368,10 @@ static String tokens_to_string(t) /* */ ** ** ** Arguments: -** get_fct +** get_fct function * to get char ** Returns: **___________________________________________________ */ -static int TeX_fill_line(get_fct) /* */ - int (*get_fct)_ARG((void)); /* function * to get char */ +static int TeX_fill_line(int (*get_fct)_ARG((void))) /* */ { register int c; /* */ register Token t; /* */ register int spaces = 0; /* */ @@ -433,8 +424,7 @@ static int TeX_fill_line(get_fct) /* */ ** get_fct the function to acquire a character ** Returns: the token read **___________________________________________________ */ -static Token TeX_get_token(get_fct) /* */ - int (*get_fct)_ARG((void)); /* function * to get char */ +static Token TeX_get_token(int (*get_fct)_ARG((void))) /* */ { register Token t, t1, t2; /* */ /* */ for (;;) /* */ @@ -511,8 +501,7 @@ static Token TeX_get_token(get_fct) /* */ ** s the string to read from ** Returns: nothing **___________________________________________________ */ -static void init_get(s) /* */ - register String s; /* */ +static void init_get(register String s) /* */ { g_p = g_s = s; /* */ } /*------------------------*/ @@ -538,9 +527,7 @@ static int do_get() /* */ ** arity ** Returns: **___________________________________________________ */ -static Token tokenize(s, arity) /* */ - String s; /* */ - int arity; /* */ +static Token tokenize(String s, int arity) /* */ { Token t = TokenNULL, /* */ t_ret = TokenNULL, /* */ nt, t0; /* */ @@ -577,10 +564,7 @@ static Token tokenize(s, arity) /* */ ** tokens the tokens ** Returns: **___________________________________________________ */ -static MacDef new_macdef(name, arity, tokens) /* */ - String name; /* */ - int arity; /* */ - Token tokens; /* */ +static MacDef new_macdef(String name, int arity, Token tokens) /* */ { MacDef new; /* */ /* */ if ( (new=(MacDef)malloc(sizeof(SMacDef))) == NULL )/* */ @@ -602,8 +586,7 @@ static MacDef new_macdef(name, arity, tokens) /* */ ** mac ** Returns: nothing **___________________________________________________ */ -static void free_macdef(mac) /* */ - MacDef mac; /* */ +static void free_macdef(MacDef mac) /* */ { /* */ if ( mac == MacDefNULL ) return; /* */ free(MacroToken(mac)); /* */ @@ -620,9 +603,7 @@ static void free_macdef(mac) /* */ ** md the macro to start searching at ** Returns: **___________________________________________________ */ -static MacDef find_macro(name, md) /* */ - register String name; /* */ - register MacDef md; /* */ +static MacDef find_macro(register String name, register MacDef md) /* */ { /* */ for ( ; md != MacDefNULL; md = NextMacro(md) ) /* */ { if ( strcmp((char*)MacroName(md), /* */ @@ -643,10 +624,7 @@ static MacDef find_macro(name, md) /* */ ** body ** Returns: nothing **___________________________________________________ */ -void TeX_define(name, arity, body) /* */ - String name; /* */ - int arity; /* */ - String body; /* */ +void TeX_define(String name, int arity, String body) /* */ { register MacDef md; /* */ /* */ if ( 0 > arity || arity > 9 ) return; /* */ @@ -671,8 +649,7 @@ void TeX_define(name, arity, body) /* */ ** s ** Returns: nothing **___________________________________________________ */ -void TeX_def(s) /* */ - String s; /* */ +void TeX_def(String s) /* */ { String name, /* */ ep = NULL; /* */ int arity = 0; /* */ @@ -715,10 +692,7 @@ void TeX_def(s) /* */ ** s Body of the definition as string. ** Returns: nothing **___________________________________________________ */ -void TeX_active(c, arity, s) /* */ - int c; /* */ - int arity; /* */ - String s; /* */ +void TeX_active(int c, int arity, String s) /* */ { /* */ EnsureInit; /* */ if ( active[c] ) free_macdef(active[c]); /* */ @@ -798,8 +772,7 @@ static int get_file() /* */ ** file File pointer of the file to read from. ** Returns: nothing **___________________________________________________ */ -void TeX_open_file(file) /* */ - FILE * file; /* */ +void TeX_open_file(FILE *file) /* */ { src_file = file; /* */ src_get = get_file; /* */ tex_clear; /* */ @@ -812,8 +785,7 @@ void TeX_open_file(file) /* */ ** s String to read from. ** Returns: nothing **___________________________________________________ */ -void TeX_open_string(s) /* */ - String s; /* */ +void TeX_open_string(String s) /* */ { src_ptr = src_string = s; /* */ src_get = get_string; /* */ tex_clear; /* */ @@ -842,8 +814,7 @@ void TeX_close() /* */ ** tp the pointer to the token ** Returns: **___________________________________________________ */ -static bool fill_token(tp) /* */ - register Token *tp; /* */ +static bool fill_token(register Token *tp) /* */ { /* */ if ( *tp == TokenNULL /* */ && (*tp=TeX_get_token(src_get)) == TokenNULL)/* */ @@ -864,9 +835,7 @@ static bool fill_token(tp) /* */ ** sp Pointer to position where the string is stored. ** Returns: |false| iff everything went right. **___________________________________________________ */ -bool TeX_read(cp, sp) /* */ - String cp; /* */ - String *sp; /* */ +bool TeX_read(String cp, String *sp) /* */ { static Token t = TokenNULL; /* */ static Token old_t = TokenNULL; /* */ static Token arg[10]; /* */ diff --git a/type.c b/type.c index 6ff60295..6163aefe 100644 --- a/type.c +++ b/type.c @@ -85,8 +85,7 @@ void init_type() /* */ ** s the allowed word separator characters ** Returns: nothing **___________________________________________________ */ -void add_word_sep(s) /* */ - register String s; /* */ +void add_word_sep(register String s) /* */ { /* */ if ( s == StringNULL ) return; /* */ for ( ; *s ; s++ ) /* */ @@ -107,9 +106,7 @@ void add_word_sep(s) /* */ ** t Second string to consider. ** Returns: |true| iff the strings are equal. **___________________________________________________ */ -bool case_eq(s, t) /* */ - register String s; /* */ - register String t; /* */ +bool case_eq(register String s, register String t)/* */ { /* */ #ifdef DEBUG assert(s != NULL); /* */ @@ -134,9 +131,7 @@ bool case_eq(s, t) /* */ ** t the second string ** Returns: **___________________________________________________ */ -int cmp(s, t) /* */ - register String s; /* */ - register String t; /* */ +int cmp(register String s, register String t) /* */ { register int d; /* */ while ( *s ) /* */ { d = *(s++) - *(t++); /* */ @@ -152,8 +147,7 @@ int cmp(s, t) /* */ ** s string to convert ** Returns: The converted string. **___________________________________________________ */ -String lower(s) /* */ - register String s; /* */ +String lower(register String s) /* */ { String t = s; /* */ while ( *s ) { *s = ToLower(*s); ++s; } /* */ return t; /* */ diff --git a/wordlist.c b/wordlist.c index c8be2a27..2d603f74 100644 --- a/wordlist.c +++ b/wordlist.c @@ -66,9 +66,7 @@ ** wlp Pointer to a wordlist. ** Returns: nothing **___________________________________________________ */ -void add_word(sym, wlp) /* */ - register Symbol sym; /* */ - register WordList *wlp; /* */ +void add_word(register Symbol sym, register WordList *wlp) /* */ { register WordList wl; /* */ register int cmp = 1; /* */ /* */ @@ -103,10 +101,7 @@ void add_word(sym, wlp) /* */ ** fct Function to call to free the memory occupied by the word. ** Returns: |0| if the word was not found. |1| otherwise. **___________________________________________________ */ -int delete_word(sym, wlp, fct) /* */ - Symbol sym; /* */ - WordList *wlp; /* */ - void (*fct)_ARG((String)); /* */ +int delete_word(Symbol sym, WordList *wlp, void (*fct)_ARG((String))) /* */ { WordList wl; /* */ int cmp = 1; /* */ while ( *wlp != WordNULL /* */ @@ -134,9 +129,7 @@ int delete_word(sym, wlp, fct) /* */ ** If it is |NULL| then no function is called. ** Returns: nothing **___________________________________________________ */ -void free_words(wlp, fct) /* */ - WordList *wlp; /* */ - void (*fct)_ARG((Symbol)); /* */ +void free_words(WordList *wlp, void (*fct)_ARG((Symbol))) /* */ { WordList wl, next; /* */ /* */ if (wlp == NULL) return; /* */ @@ -171,9 +164,7 @@ void free_words(wlp, fct) /* */ ** fct function to apply. ** Returns: return value of last function or |true|. **___________________________________________________ */ -bool foreach_word(wl, fct) /* */ - WordList wl; /* */ - bool (*fct)_ARG((Symbol)); /* */ +bool foreach_word(WordList wl, bool (*fct)_ARG((Symbol))) /* */ { bool ret = true; /* */ while ( wl && (ret=(fct)(ThisWord(wl))) ) /* */ { wl = NextWord(wl); } /* */ @@ -189,9 +180,7 @@ bool foreach_word(wl, fct) /* */ ** wl Word list to search in. ** Returns: |false| iff the word does not occur in the word list. **___________________________________________________ */ -bool find_word(s, wl) /* */ - register String s; /* */ - register WordList wl; /* */ +bool find_word(register String s, register WordList wl) /* */ { /* */ while ( wl != WordNULL ) /* */ { if (case_eq(SymbolValue(ThisWord(wl)), s)) /* */ From 2b1fe0f33846e8b99f003a441a22000756d4f8e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= Date: Fri, 24 Oct 2025 21:39:47 +0200 Subject: [PATCH 2/2] Adjust forward declaration to match argument types --- expand.c | 2 +- parse.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/expand.c b/expand.c index af445822..59f39e7d 100644 --- a/expand.c +++ b/expand.c @@ -47,7 +47,7 @@ #define _ARG(A) () #endif Symbol expand_rhs _ARG((Symbol s,Symbol pre,Symbol post,DB db, bool lowercase));/* expand.c*/ - static bool expand _ARG((String s,StringBuffer *sb,int brace,int first,String q_open,String q_close,DB db));/* expand.c*/ + static bool expand _ARG((String s, StringBuffer *sb, bool brace, bool first, String q_open, String q_close, DB db));/* expand.c*/ static void expand__ _ARG((String s,StringBuffer *sb,String q_open,String q_close,DB db));/* expand.c*/ /*****************************************************************************/ diff --git a/parse.c b/parse.c index f72d67d3..0d303c49 100644 --- a/parse.c +++ b/parse.c @@ -55,7 +55,7 @@ bool see_bib _ARG((String fname)); /* parse.c */ bool seen _ARG((void)); /* parse.c */ int parse_bib _ARG((Record rec)); /* parse.c */ - static bool parse_block _ARG((int quotep)); /* parse.c */ + static bool parse_block _ARG((bool quotep)); /* parse.c */ static bool parse_equation _ARG((Record rec)); /* parse.c */ static bool parse_key _ARG((int alpha)); /* parse.c */ static bool parse_rhs _ARG((void)); /* parse.c */ @@ -65,7 +65,7 @@ static bool see_rsc _ARG((String fname)); /* parse.c */ static int fill_line _ARG((void)); /* parse.c */ static int see_bib_msg _ARG((char *s)); /* parse.c */ - static int skip _ARG((int inc)); /* parse.c */ + static int skip _ARG((bool inc)); /* parse.c */ static int skip_c _ARG((void)); /* parse.c */ static int skip_nl _ARG((void)); /* parse.c */ static void init___ _ARG((char ***pathp,char **pattern,char **envvp,char *env));/* parse.c*/