Use prototypes in mach/proto/as/comm5.c

Order the function prototypes in comm1.h to match the order of the
function definitions in *.c files.
This commit is contained in:
George Koehler 2017-01-17 16:41:29 -05:00
parent 916d270534
commit ba2a03705e
2 changed files with 57 additions and 42 deletions

View file

@ -104,21 +104,28 @@ extern struct outhead outhead;
extern int curr_token; extern int curr_token;
/* forward function declarations */ /* forward function declarations */
/* comm5.c */
int yylex(void);
void putval(int);
int getval(int);
int nextchar(void);
#ifdef ASLD #ifdef ASLD
extern char *readident(); char *readident(int);
#endif #endif
extern char *remember(); int hash(char *);
extern item_t *fb_shift(); item_t *item_search(char *);
extern item_t *fb_alloc(); void item_insert(item_t *, int);
extern item_t *item_alloc(); item_t *item_alloc(int);
extern item_t *item_search(); item_t *fb_alloc(int);
extern valu_t load(); item_t *fb_shift(int);
extern FILE *ffcreat(); /* comm7.c */
extern FILE *fftemp(); valu_t load();
char *remember();
extern void fatal(const char* s, ...); FILE *ffcreat();
extern void serror(const char* s, ...); FILE *fftemp();
extern void warning(const char* s, ...); void fatal(const char *, ...);
void serror(const char *, ...);
void warning(const char *, ...);
/* ========== Machine dependent C declarations ========== */ /* ========== Machine dependent C declarations ========== */

View file

@ -11,9 +11,16 @@
extern YYSTYPE yylval; extern YYSTYPE yylval;
void putval(); static void readcode(int);
static int induo(int);
static int inident(int);
static int innumber(int);
static int instring(int);
static int inescape(void);
static int infbsym(char *);
yylex() int
yylex(void)
{ {
register c; register c;
@ -71,7 +78,7 @@ yylex()
} }
void void
putval(c) putval(int c)
{ {
register valu_t v; register valu_t v;
register n = 0; register n = 0;
@ -144,7 +151,8 @@ putval(c)
putc(*p++, tempfile); putc(*p++, tempfile);
} }
getval(c) int
getval(int c)
{ {
register n = 0; register n = 0;
register valu_t v; register valu_t v;
@ -209,7 +217,8 @@ getval(c)
/* ---------- lexical scan in pass 1 ---------- */ /* ---------- lexical scan in pass 1 ---------- */
nextchar() int
nextchar(void)
{ {
register c; register c;
@ -233,7 +242,8 @@ nextchar()
return(c); return(c);
} }
readcode(n) static void
readcode(int n)
{ {
register c; register c;
@ -252,8 +262,8 @@ readcode(n)
} while (--n); } while (--n);
} }
induo(c) static int
register c; induo(int c)
{ {
static short duo[] = { static short duo[] = {
('='<<8) | '=', OP_EQ, ('='<<8) | '=', OP_EQ,
@ -277,8 +287,8 @@ register c;
static char name[NAMEMAX+1]; static char name[NAMEMAX+1];
inident(c) static int
register c; inident(int c)
{ {
register char *p = name; register char *p = name;
register item_t *ip; register item_t *ip;
@ -309,8 +319,7 @@ register c;
#ifdef ASLD #ifdef ASLD
char * char *
readident(c) readident(int c)
register c;
{ {
register n = NAMEMAX; register n = NAMEMAX;
register char *p = name; register char *p = name;
@ -326,8 +335,8 @@ register c;
} }
#endif #endif
innumber(c) static int
register c; innumber(int c)
{ {
register char *p; register char *p;
register radix; register radix;
@ -373,7 +382,8 @@ register c;
return(NUMBER); return(NUMBER);
} }
instring(termc) static int
instring(int termc)
{ {
register char *p; register char *p;
register c; register c;
@ -412,7 +422,8 @@ instring(termc)
return(STRING); return(STRING);
} }
inescape() static int
inescape(void)
{ {
register c, j, r; register c, j, r;
@ -442,8 +453,8 @@ inescape()
return(c); return(c);
} }
infbsym(p) static int
register char *p; infbsym(char *p)
{ {
register lab; register lab;
register item_t *ip; register item_t *ip;
@ -469,8 +480,8 @@ ok:
return(FBSYM); return(FBSYM);
} }
hash(p) int
register char *p; hash(char *p)
{ {
register unsigned short h; register unsigned short h;
register c; register c;
@ -484,8 +495,7 @@ register char *p;
} }
item_t * item_t *
item_search(p) item_search(char *p)
char *p;
{ {
register h; register h;
register item_t *ip; register item_t *ip;
@ -503,15 +513,15 @@ done:
return(ip); return(ip);
} }
item_insert(ip, h) void
item_t *ip; item_insert(item_t *ip, int h)
{ {
ip->i_next = hashtab[h]; ip->i_next = hashtab[h];
hashtab[h] = ip; hashtab[h] = ip;
} }
item_t * item_t *
item_alloc(typ) item_alloc(int typ)
{ {
register item_t *ip; register item_t *ip;
static nleft = 0; static nleft = 0;
@ -532,8 +542,7 @@ item_alloc(typ)
} }
item_t * item_t *
fb_alloc(lab) fb_alloc(int lab)
register lab;
{ {
register item_t *ip, *p; register item_t *ip, *p;
@ -548,8 +557,7 @@ register lab;
} }
item_t * item_t *
fb_shift(lab) fb_shift(int lab)
register lab;
{ {
register item_t *ip; register item_t *ip;