Do not use '#endif/#else xxx'; it is not allowed for ANSI C

This commit is contained in:
ceriel
1991-12-17 15:28:58 +00:00
parent 8daa5b2260
commit d33da47a2a
67 changed files with 306 additions and 298 deletions

View File

@@ -98,7 +98,7 @@ idfappfun(fun, opt)
}
}
}
#endif IDF_DEBUG
#endif /* IDF_DEBUG */
struct idf *
str2idf(tg, cpy)

View File

@@ -58,7 +58,7 @@ Now this is really ridiculous! You deserve what you get!!
#ifdef INP_TYPE
extern INP_TYPE INP_VAR;
#endif INP_TYPE
#endif /* INP_TYPE */
#ifdef DEBUG
#define INP_PRIVATE
@@ -73,7 +73,7 @@ struct INP_buffer_header {
char *bh_ipp; /* current read pointer (= stacked ipp) */
#ifdef INP_TYPE
INP_TYPE bh_i; /* user defined */
#endif INP_TYPE
#endif /* INP_TYPE */
File *bh_fd; /* A file descriptor in case of a file */
char bh_eofreturned; /* set if we returned eof for this buffer */
};
@@ -84,7 +84,7 @@ struct INP_i_buf {
char ib_text[INP_BUFSIZE+INP_NPUSHBACK];
};
# endif not INP_READ_IN_ONE
#endif /* not INP_READ_IN_ONE */
char *_ipp;
INP_PRIVATE struct INP_buffer_header *INP_head, *INP_free;
@@ -124,7 +124,7 @@ INP_rdfile(fd, fn, size, pbuf)
(*pbuf)[rsize] = '\0'; /* invoke loadbuf() at end */
return 1;
}
#endif INP_READ_IN_ONE
#endif /* INP_READ_IN_ONE */
#ifndef INP_READ_IN_ONE
/* Input buffer supplying routines: INP_pbuf()
@@ -147,7 +147,7 @@ INP_pbuf()
*/
return &(ib->ib_text[INP_NPUSHBACK-1]);
}
#endif not INP_READ_IN_ONE
#endif /* not INP_READ_IN_ONE */
/* Input buffer administration: INP_push_bh() and INP_pop_bh()
*/
@@ -160,7 +160,7 @@ INP_push_bh()
bh->bh_ipp = _ipp;
#ifdef INP_TYPE
bh->bh_i = INP_VAR;
#endif INP_TYPE
#endif /* INP_TYPE */
}
bh = INP_free;
if (bh) INP_free = bh->bh_next;
@@ -194,7 +194,7 @@ INP_pop_bh()
_ipp = bh->bh_ipp; /* restore previous input pointer */
#ifdef INP_TYPE
INP_VAR = bh->bh_i;
#endif INP_TYPE
#endif /* INP_TYPE */
return 1;
}
@@ -217,7 +217,7 @@ INP_rdblock(fd, buf, n)
buf[*n] = '\0';
return 1;
}
#endif not INP_READ_IN_ONE
#endif /* not INP_READ_IN_ONE */
/* Miscellaneous routines :
INP_mk_filename()
@@ -258,7 +258,7 @@ InsertFile(filnam, table, result)
#ifdef INP_READ_IN_ONE
char *text;
long size;
#endif INP_READ_IN_ONE
#endif /* INP_READ_IN_ONE */
File *fd = 0;
if (!filnam) fd = STDIN;
@@ -301,7 +301,7 @@ InsertFile(filnam, table, result)
}
bh->bh_size = size;
_ipp = bh->bh_text = text;
#else not INP_READ_IN_ONE
#else /* not INP_READ_IN_ONE */
if (
!(_ipp = bh->bh_text = INP_pbuf())
||
@@ -309,7 +309,7 @@ InsertFile(filnam, table, result)
if (fd != STDIN) sys_close(fd);
return 0;
}
#endif INP_READ_IN_ONE
#endif /* INP_READ_IN_ONE */
bh->bh_fd = fd; /* this is a file */
if (result) *result = filnam;
return 1;
@@ -376,7 +376,7 @@ loadbuf()
}
}
#endif not INP_READ_IN_ONE
#endif /* not INP_READ_IN_ONE */
if (FromFile && bh->bh_fd != STDIN) sys_close(bh->bh_fd);
#if INP_NPUSHBACK > 1
@@ -401,9 +401,9 @@ loadbuf()
ib = i_ptr->ib_next;
free((char *) i_ptr);
i_ptr = ib;
#else INP_READ_IN_ONE
#else /* INP_READ_IN_ONE */
free(bh->bh_text);
#endif INP_READ_IN_ONE
#endif /* INP_READ_IN_ONE */
}
bh->bh_text = buf;
bh->bh_size = INP_NPUSHBACK - 1;

View File

@@ -303,4 +303,4 @@ Error(fmt, s, ml) char *fmt, *s; mallink *ml; {
return 0; /* to satisfy lint */
}
#endif CHECK
#endif /* CHECK */

View File

@@ -49,7 +49,7 @@ typedef union _inf mallink;
#define _this_size_of(ml) ((ml)[-4+OFF_SET]).ui
#ifndef CHECK
#define N_WORDS 4
#else ifdef CHECK
#else /* ifdef CHECK */
#define _checksum_of(ml) ((ml)[-5+OFF_SET]).ui
#define _print_of(ml) ((ml)[-6+OFF_SET]).ui
#define _mark_of(ml) ((ml)[-7+OFF_SET]).ui

View File

@@ -130,4 +130,4 @@ free_list_entry(i) {
*/
return free_list[i];
}
#endif CHECK
#endif /* CHECK */

View File

@@ -31,7 +31,7 @@ extern char *SBRK();
#define MAX_SZ_IN_STORE (MAX_STORE*ALIGNMENT)
private do_free(), sell_out();
privatedata mallink *store[MAX_STORE];
#endif STORE
#endif /* STORE */
char *
malloc(n)
@@ -57,7 +57,7 @@ malloc(n)
return block_of_mallink(ml);
}
}
#endif STORE
#endif /* STORE */
check_work_empty("malloc, entry");
@@ -116,7 +116,7 @@ malloc(n)
sell_out();
ml = first_present(min_class);
if (ml == MAL_NULL) {
#endif STORE
#endif /* STORE */
/* In this emergency we try to locate a suitable
chunk in the free_list just below the safe
one; some of these chunks may fit the job.
@@ -130,7 +130,7 @@ malloc(n)
#ifdef STORE
}
else started_working_on(ml);
#endif STORE
#endif /* STORE */
}
else {
assert((size_type)p == align((size_type)p));
@@ -196,7 +196,7 @@ do_free(ml)
#ifndef STORE
if (free_of(ml)) return;
#endif STORE
#endif /* STORE */
started_working_on(ml);
set_free(ml, 1);
calc_checksum(ml);
@@ -340,7 +340,7 @@ sell_out() {
}
}
#endif STORE
#endif /* STORE */
#ifdef ASSERT
public
@@ -358,4 +358,4 @@ m_assert(fn, ln)
write(2, "\n", 1);
maldump(1);
}
#endif ASSERT
#endif /* ASSERT */

View File

@@ -391,4 +391,4 @@ wr_dbug(buf, size)
OUTWRITE(PARTDBUG, buf, size);
}
#endif SYMDBUG
#endif /* SYMDBUG */

View File

@@ -52,9 +52,9 @@ checkarg(arg, typset)
}
return 1;
}
#else not CHECKING
#else /* not CHECKING */
#define checkarg(arg, x) 1
#endif CHECKING
#endif /* CHECKING */
/* EM_doinstr: An EM instruction
*/
@@ -72,7 +72,7 @@ EM_doinstr(p)
return;
}
}
#endif CHECKING
#endif /* CHECKING */
switch(parametertype) {
case PAR_NO:
break;
@@ -389,7 +389,7 @@ EM_mkcalls(line)
EM_error = "Message not ended";
return 0;
}
#endif CHECKING
#endif /* CHECKING */
EM_error = 0;
switch(line->em_type) {
default:

View File

@@ -92,9 +92,9 @@ static int wsize, psize; /* word size and pointer size */
#ifdef CHECKING
static char *argrange = "Argument range error";
#define check(expr) (expr || EM_error || (EM_error = argrange))
#else not CHECKING
#else /* not CHECKING */
#define check(x) /* nothing */
#endif CHECKING
#endif /* CHECKING */
/* Error handling
*/
@@ -117,9 +117,9 @@ xfatal(s)
}
#include "readk.c"
#else not COMPACT
#else /* not COMPACT */
#include "reade.c"
#endif COMPACT
#endif /* COMPACT */
/* EM_open: Open input file, get magic word if COMPACT.
*/
@@ -147,9 +147,9 @@ EM_open(filename)
EM_error = "Illegal magic word";
return 0;
}
#else not COMPACT
#else /* not COMPACT */
inithash(); /* initialize hashtable */
#endif COMPACT
#endif /* COMPACT */
EM_initialized = 1;
return 1;
@@ -228,7 +228,7 @@ EM_getinstr(p)
p->em_type = EM_FATAL;
return 0;
}
#endif CHECKING
#endif /* CHECKING */
if (!state) { /* All clear, get a new line */
gethead(p);
@@ -247,14 +247,14 @@ EM_getinstr(p)
}
#ifndef COMPACT
if (j == PAR_B) i = ptyp(sp_ilb2);
#endif COMPACT
#endif /* COMPACT */
if (j != PAR_NO) getarg(i, &(p->em_arg));
#ifndef COMPACT
if (j == PAR_B) {
p->em_cst = p->em_ilb;
p->em_argtype = cst_ptyp;
}
#endif COMPACT
#endif /* COMPACT */
/* range checking
*/
#ifdef CHECKING
@@ -304,10 +304,10 @@ EM_getinstr(p)
check(p->em_cst >= 0 && p->em_cst <= 2);
break;
}
#endif CHECKING
#endif /* CHECKING */
#ifndef COMPACT
checkeol();
#endif COMPACT
#endif /* COMPACT */
}
break;
case EM_PSEU:
@@ -334,7 +334,7 @@ EM_getinstr(p)
if (! EM_error)
EM_error="Third argument of hol/bss not 0/1";
}
#endif CHECKING
#endif /* CHECKING */
break;
case ps_exa:
case ps_ina:
@@ -378,7 +378,7 @@ EM_getinstr(p)
if (p->em_opcode != ps_con && p->em_opcode != ps_rom) {
checkeol();
}
#endif COMPACT
#endif /* COMPACT */
break;
case EM_STARTMES:
startmes(p);

View File

@@ -48,7 +48,7 @@ getarg(typset, ap)
register int i = getbyte();
#ifdef CHECKING
int argtyp;
#endif CHECKING
#endif /* CHECKING */
ap->ema_argtype = 0;
switch(i) {
@@ -75,7 +75,7 @@ getarg(typset, ap)
EM_error = "Illegal data label";
break;
}
#endif CHECKING
#endif /* CHECKING */
break;
case sp_ilb1: /* Instruction label encoded in one byte */
@@ -91,7 +91,7 @@ getarg(typset, ap)
EM_error = "Illegal instruction label";
break;
}
#endif CHECKING
#endif /* CHECKING */
break;
case sp_cst2: /* A cst encoded in two bytes */
@@ -180,11 +180,11 @@ getarg(typset, ap)
if (argtyp == sp_cend) {
ap->ema_argtype = 0;
}
#else not CHECKING
#else /* not CHECKING */
if (i == sp_cend) {
ap->ema_argtype = 0;
}
#endif CHECKING
#endif /* CHECKING */
}
#ifdef CHECKING
@@ -209,7 +209,7 @@ checkident(s)
}
return 1;
}
#endif CHECKING
#endif /* CHECKING */
/* getstring: read a string from the input
*/
@@ -231,7 +231,7 @@ getstring(isident)
s->length = 0;
return s;
}
#endif CHECKING
#endif /* CHECKING */
if (n > s->maxlen) {
if (! s->maxlen) {
@@ -253,7 +253,7 @@ getstring(isident)
EM_error = "Illegal identifier";
}
}
#endif CHECKING
#endif /* CHECKING */
return s;
}
@@ -305,7 +305,7 @@ gethead(p)
if (p->em_ilb > 32767 && !EM_error) {
EM_error = "Illegal instruction label definition";
}
#endif CHECKING
#endif /* CHECKING */
break;
case sp_dlb1: /* Numeric data label */
@@ -322,7 +322,7 @@ gethead(p)
if (p->em_dlb > 32767 && !EM_error) {
EM_error = "Illegal data label definition";
}
#endif CHECKING
#endif /* CHECKING */
break;
case sp_dnam: /* Non-numeric data label */