}
}
}
-#endif IDF_DEBUG
+#endif /* IDF_DEBUG */
struct idf *
str2idf(tg, cpy)
#ifdef INP_TYPE
extern INP_TYPE INP_VAR;
-#endif INP_TYPE
+#endif /* INP_TYPE */
#ifdef DEBUG
#define INP_PRIVATE
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 */
};
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;
(*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()
*/
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()
*/
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;
_ipp = bh->bh_ipp; /* restore previous input pointer */
#ifdef INP_TYPE
INP_VAR = bh->bh_i;
-#endif INP_TYPE
+#endif /* INP_TYPE */
return 1;
}
buf[*n] = '\0';
return 1;
}
-#endif not INP_READ_IN_ONE
+#endif /* not INP_READ_IN_ONE */
/* Miscellaneous routines :
INP_mk_filename()
#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;
}
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())
||
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;
}
}
-#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
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;
return 0; /* to satisfy lint */
}
-#endif CHECK
+#endif /* CHECK */
#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
*/
return free_list[i];
}
-#endif CHECK
+#endif /* CHECK */
#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)
return block_of_mallink(ml);
}
}
-#endif STORE
+#endif /* STORE */
check_work_empty("malloc, entry");
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.
#ifdef STORE
}
else started_working_on(ml);
-#endif STORE
+#endif /* STORE */
}
else {
assert((size_type)p == align((size_type)p));
#ifndef STORE
if (free_of(ml)) return;
-#endif STORE
+#endif /* STORE */
started_working_on(ml);
set_free(ml, 1);
calc_checksum(ml);
}
}
-#endif STORE
+#endif /* STORE */
#ifdef ASSERT
public
write(2, "\n", 1);
maldump(1);
}
-#endif ASSERT
+#endif /* ASSERT */
OUTWRITE(PARTDBUG, buf, size);
}
-#endif SYMDBUG
+#endif /* SYMDBUG */
}
return 1;
}
-#else not CHECKING
+#else /* not CHECKING */
#define checkarg(arg, x) 1
-#endif CHECKING
+#endif /* CHECKING */
/* EM_doinstr: An EM instruction
*/
return;
}
}
-#endif CHECKING
+#endif /* CHECKING */
switch(parametertype) {
case PAR_NO:
break;
EM_error = "Message not ended";
return 0;
}
-#endif CHECKING
+#endif /* CHECKING */
EM_error = 0;
switch(line->em_type) {
default:
#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
*/
}
#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.
*/
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;
p->em_type = EM_FATAL;
return 0;
}
-#endif CHECKING
+#endif /* CHECKING */
if (!state) { /* All clear, get a new line */
gethead(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
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:
if (! EM_error)
EM_error="Third argument of hol/bss not 0/1";
}
-#endif CHECKING
+#endif /* CHECKING */
break;
case ps_exa:
case ps_ina:
if (p->em_opcode != ps_con && p->em_opcode != ps_rom) {
checkeol();
}
-#endif COMPACT
+#endif /* COMPACT */
break;
case EM_STARTMES:
startmes(p);
register int i = getbyte();
#ifdef CHECKING
int argtyp;
-#endif CHECKING
+#endif /* CHECKING */
ap->ema_argtype = 0;
switch(i) {
EM_error = "Illegal data label";
break;
}
-#endif CHECKING
+#endif /* CHECKING */
break;
case sp_ilb1: /* Instruction label encoded in one byte */
EM_error = "Illegal instruction label";
break;
}
-#endif CHECKING
+#endif /* CHECKING */
break;
case sp_cst2: /* A cst encoded in two bytes */
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
}
return 1;
}
-#endif CHECKING
+#endif /* CHECKING */
/* getstring: read a string from the input
*/
s->length = 0;
return s;
}
-#endif CHECKING
+#endif /* CHECKING */
if (n > s->maxlen) {
if (! s->maxlen) {
EM_error = "Illegal identifier";
}
}
-#endif CHECKING
+#endif /* CHECKING */
return s;
}
if (p->em_ilb > 32767 && !EM_error) {
EM_error = "Illegal instruction label definition";
}
-#endif CHECKING
+#endif /* CHECKING */
break;
case sp_dlb1: /* Numeric data label */
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 */
# ifndef NORCSID
static string rcsid3 = "$Header$";
-# endif NORCSID
+#endif /* NORCSID */
/*
* Some codestrings used more than once
for (i = 0; i < nnonterms; i++) {
if (! IN(f->f_used, i)) continue;
p = &nonterms[i];
+ if (!(p->n_flags & GENSTATIC)) continue;
if (g_gettype(p->n_rule) == EORULE &&
getntparams(p) == 0) {
continue;
}
- if (p->n_flags & GENSTATIC) fputs("static ", fpars);
+ fputs("static ", fpars);
genextname(i, p->n_name, fpars);
fputs("();\n", fpars);
}
getaction(0);
fprintf(f, ") goto L_%d;\n", hulp1);
if (q->t_flags & NOCONF) {
- fputs("#endif ___NOCONFLICT___\n", f);
+ fputs("#endif /* ___NOCONFLICT___ */\n", f);
}
}
if (safeterm == 0 || (!onerror && safeterm <= SAFESCANDONE)) {
int ntprint;
# ifndef NDEBUG
int debug;
-# endif not NDEBUG
+#endif /* not NDEBUG */
p_file files;
p_file maxfiles;
p_file pfile;
}
incl_file = ++arg;
break;
-# endif not NDEBUG
+#endif /* not NDEBUG */
case 'x':
case 'X':
ntneeded = 1;
}
tnum++;
}
-#endif AAL
+#endif /* AAL */
echo '#ifndef lint' > Version.c
echo 'char Version[] = "ACK C preprocessor Version XXX";' | \
sed "s/XXX/`RC -i`/" >> Version.c
- echo '#endif lint' >> Version.c
+ echo '#endif' >> Version.c
case ']':
error("unbalanced parenthesis");
break;
-#endif __MATCHING_PAR__
+#endif /* __MATCHING_PAR__ */
case '(':
copyact('(', ')', level+1);
case '[':
copyact('[', ']', level+1);
break;
-#endif __MATCHING_PAR__
+#endif /* __MATCHING_PAR__ */
case '\n':
LineNumber++;
{ERRONEOUS, "erroneous"},
{0, ""}
};
-#endif ____
+#endif /* ____ */
}
}
-#endif TRACE
+#endif /* TRACE */
} \
while ( 0 )
-#endif ACK_MOD
+#endif /* ACK_MOD */
}
}
}
-#endif DB_MALLOC
+#endif /* DB_MALLOC */
return new;
}
fwrite(FRA_sh, 1, (int)(FRALimit), core_file);
fwrite(data_sh, 1, (int)(HL), core_file);
fwrite(stack_sh, 1, (int)(ML+1-SL), core_file);
-#endif LOGGING
+#endif /* LOGGING */
fclose(core_file);
core_file = 0;
#ifdef LOGGING
char *data_sh; /* shadowbytes */
-#endif LOGGING
+#endif /* LOGGING */
PRIVATE warn_dtbits();
#ifdef LOGGING
data_sh = Malloc((size)p2i(HL), "shadowspace for data");
dt_clear_area(i2p(0), HL);
-#endif LOGGING
+#endif /* LOGGING */
}
#ifdef LOGGING
data_sh = Realloc(data_sh, (size)(p2i(HL) + 1),
"shadowspace for heap");
-#endif LOGGING
+#endif /* LOGGING */
}
#ifdef LOGGING
if (p > HP) {
dt_clear_area(HP, p);
}
-#endif LOGGING
+#endif /* LOGGING */
HP = p;
}
#ifdef LOGGING
/* a psize zero is ambiguous */
int sh_flags = (l == 0 && n == psize) ? (SH_INT|SH_DATAP) : SH_INT;
-#endif LOGGING
+#endif /* LOGGING */
LOG(("@g6 dt_stn(%lu, %lu, %lu)", addr, l, n));
ch_in_data(addr, n);
data_loc(addr) = (char) l;
#ifdef LOGGING
dt_sh(addr) = sh_flags;
-#endif LOGGING
+#endif /* LOGGING */
l = l>>8;
}
}
#ifdef LOGGING
/* a psize zero is ambiguous */
int sh_flags = (l == 0 && wsize == psize) ? (SH_INT|SH_DATAP) : SH_INT;
-#endif LOGGING
+#endif /* LOGGING */
LOG(("@g6 dt_stw(%lu, %lu)", addr, l));
ch_in_data(addr, wsize);
data_loc(addr) = (char) l;
#ifdef LOGGING
dt_sh(addr) = sh_flags;
-#endif LOGGING
+#endif /* LOGGING */
l = l>>8;
}
}
dt_fl(addr);
}
}
-#endif NOFLOAT
+#endif /* NOFLOAT */
/************************************************************************
* Data load division. *
warning(WGDPEXP);
warn_dtbits(addr, psize);
}
-#endif LOGGING
+#endif /* LOGGING */
p = p_in_data(addr);
LOG(("@g6 dt_lddp() returns %lu", p));
warning(WGIPEXP);
warn_dtbits(addr, psize);
}
-#endif LOGGING
+#endif /* LOGGING */
p = p_in_data(addr);
LOG(("@g6 dt_ldip() returns %lu", p));
warning(n == 1 ? WGCEXP : WGIEXP);
warn_dtbits(addr, n);
}
-#endif LOGGING
+#endif /* LOGGING */
addr += n-1;
for (i = (int) n-1; i >= 0; i--, addr--) {
warning(WGIEXP);
warn_dtbits(addr, wsize);
}
-#endif LOGGING
+#endif /* LOGGING */
addr += wsize-1;
for (i = (int) wsize-1; i >= 0; i--, addr--) {
warning(n == 1 ? WGCEXP : WGIEXP);
warn_dtbits(addr, n);
}
-#endif LOGGING
+#endif /* LOGGING */
addr += n-2;
l = btos(data_loc(addr + 1));
warning(WGIEXP);
warn_dtbits(addr, wsize);
}
-#endif LOGGING
+#endif /* LOGGING */
addr += wsize-2;
l = btos(data_loc(addr + 1));
data_loc(d2) = data_loc(d1);
#ifdef LOGGING
dt_sh(d2) = dt_sh(d1) & ~SH_PROT;
-#endif LOGGING
+#endif /* LOGGING */
}
}
data_loc(d) = stack_loc(s);
#ifdef LOGGING
dt_sh(d) = st_sh(s) & ~SH_PROT;
-#endif LOGGING
+#endif /* LOGGING */
}
}
warningcont(WWASINSP);
}
-#endif LOGGING
+#endif /* LOGGING */
#ifndef NOFLOAT
extern double fpop();
-#endif NOFLOAT
+#endif /* NOFLOAT */
PRIVATE compare_obj();
LOG(("@T6 DoCMF(%ld)", l));
spoilFRA();
wpush((long)(t < s ? 1 : t > s ? -1 : 0));
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
DoCMU(l)
comp_res = 1;
break;
}
-#endif LOGGING
+#endif /* LOGGING */
if (stack_loc(addr1) != stack_loc(addr2)) {
comp_res = 1;
break;
#ifndef NOFLOAT
extern double fpop();
-#endif NOFLOAT
+#endif /* NOFLOAT */
DoCII()
{
default:
wtrap(WILLCONV, EILLINS);
}
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
DoCIF()
default:
wtrap(WILLCONV, EILLINS);
}
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
DoCUF()
default:
wtrap(WILLCONV, EILLINS);
}
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
DoCFF()
default:
wtrap(WILLCONV, EILLINS);
}
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
DoCIU()
default:
wtrap(WILLCONV, EILLINS);
}
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
extern double fpop();
-#define MAXDOUBLE 99.e999 /* IEEE infinity */ /*???*/
+#ifdef __STDC__
+#include <float.h>
+#define MAXDOUBLE DBL_MAX
+#else /* not __STDC__ */
+#if defined(vax) || defined(pdp) || defined(__vax) || defined(__pdp)
+#define MAXDOUBLE 1.701411834604692293e+38
+#else
+#define MAXDOUBLE 1.7976931348623157e+308
+#endif
+#endif /* not __STDC__ */
#define SMALL (1.0/MAXDOUBLE)
PRIVATE double adf(), sbf(), mlf(), dvf();
PRIVATE double floor(), fabs();
PRIVATE fef(), fif();
-#endif NOFLOAT
+#endif /* NOFLOAT */
DoADF(l)
register size l;
LOG(("@F6 DoADF(%ld)", l));
spoilFRA();
fpush(adf(fpop(l), t), l);
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
DoSBF(l)
LOG(("@F6 DoSBF(%ld)", l));
spoilFRA();
fpush(sbf(fpop(l), t), l);
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
DoMLF(l)
LOG(("@F6 DoMLF(%ld)", l));
spoilFRA();
fpush(mlf(fpop(l), t), l);
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
DoDVF(l)
LOG(("@F6 DoDVF(%ld)", l));
spoilFRA();
fpush(dvf(fpop(l), t), l);
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
DoNGF(l)
LOG(("@F6 DoNGF(%ld)", l));
spoilFRA();
fpush(-t, l);
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
DoFIF(l)
LOG(("@F6 DoFIF(%ld)", l));
spoilFRA();
fif(fpop(l), t, l);
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
DoFEF(l)
LOG(("@F6 DoFEF(%ld)", l));
spoilFRA();
fef(fpop(arg_wf(l)), l);
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
#ifndef NOFLOAT
return (0.0);
}
-#else NOFLOAT
+#else /* NOFLOAT */
nofloat() {
fatal("attempt to execute a floating point instruction on an EM machine without FP");
}
-#endif NOFLOAT
+#endif /* NOFLOAT */
LOG(("@Z6 DoZRF(%ld)", l));
spoilFRA();
fpush(0.0, arg_wf(l));
-#else NOFLOAT
+#else /* NOFLOAT */
arg = arg;
nofloat();
-#endif NOFLOAT
+#endif /* NOFLOAT */
}
DoZER(l)
warning(WSHLARGE);
w2 = nbytes*8 - 1;
}
-#endif LOGGING
+#endif /* LOGGING */
if (!(IgnMask&BIT(EIOVFL))) {
/* check overflow */
w2 = nbytes*8 - 1;
}
}
-#endif LOGGING
+#endif /* LOGGING */
/* calculate result */
return (w1 >> w2);
#ifdef LOGGING
extern int must_test;
-#endif LOGGING
+#endif /* LOGGING */
#ifdef LOGGING
#define check_def(p,l) if (!st_sh(p) || !st_sh(p+l)) {warning(WUNLOG);}
#else
#define check_def(p,l)
-#endif LOGGING
+#endif /* LOGGING */
DoAND(l)
register size l;
t = l*8 - 1;
}
}
-#endif LOGGING
+#endif /* LOGGING */
/* calculate result */
while (t--) {
t = l*8 - 1;
}
}
-#endif LOGGING
+#endif /* LOGGING */
/* calculate result */
while (t--) {
if (sz != FRASize) {
warning(FRASize < sz ? WRFUNSML : WRFUNLAR);
}
-#endif LOGGING
+#endif /* LOGGING */
pushFRA(sz);
spoilFRA();
#define check_seg(s1,s2,w)
-#endif SEGCHECK
+#endif /* SEGCHECK */
DoADP(l)
register long l;
#ifdef LOGGING
extern int must_test;
-#endif LOGGING
+#endif /* LOGGING */
#define adu(w1,w2) (unsigned long)(w1 + w2)
#define sbu(w1,w2) (unsigned long)(w1 - w2)
w2 = nbytes*8 - 1;
}
}
-#endif LOGGING
+#endif /* LOGGING */
/* calculate result */
return (w1 << w2);
w2 = nbytes*8 - 1;
}
}
-#endif LOGGING
+#endif /* LOGGING */
/* calculate result */
return (w1 >> w2);
return (buf);
}
-#endif LOGGING
+#endif /* LOGGING */
#ifdef LOGGING
char *FRA_sh; /* shadowbytes */
-#endif LOGGING
+#endif /* LOGGING */
init_FRA() {
FRA = Malloc(FRALimit, "Function Return Area");
#ifdef LOGGING
FRA_sh = Malloc(FRALimit, "shadowspace for Function Return Area");
-#endif LOGGING
+#endif /* LOGGING */
FRA_def = UNDEFINED; /* set FRA illegal */
}
stack_loc(SP + i) = FRA[i];
#ifdef LOGGING
st_sh(SP + i) = (i < FRASize ? FRA_sh[i] : UNDEFINED);
-#endif LOGGING
+#endif /* LOGGING */
}
}
FRA[i] = stack_loc(SP + i);
#ifdef LOGGING
FRA_sh[i] = st_sh(SP + i);
-#endif LOGGING
+#endif /* LOGGING */
}
st_dec(max(sz, wsize));
}
#define p2i(p) (p) /* convert pointer to index */
#define i2p(p) (ptr)(p) /* convert index to pointer */
-#else UNSIGNED
+#else /* UNSIGNED */
typedef char *ptr; /* pointer to EM address */
#define p2i(p) (long)(p) /* convert pointer to index */
#define i2p(p) (ptr)(p) /* convert index to pointer */
-#endif UNSIGNED
+#endif /* UNSIGNED */
/* The EM size is an integer type; a cast suffices */
typedef long size;
st_undef(a);
}
}
-#endif LOGGING
+#endif /* LOGGING */
#ifdef LOGGING
extern long inr; /* from log.c */
-#endif LOGGING
+#endif /* LOGGING */
/******** General file handling ********/
#ifdef LOGGING
open_log(firsttime);
-#endif LOGGING
+#endif /* LOGGING */
}
/*VARARGS0*/
#ifdef LOGGING
close_log();
-#endif LOGGING
+#endif /* LOGGING */
exit(rc);
}
#ifdef LOGGING
sprintf(buff, "\"%s\", line %ld, INR = %ld", fn, getLIN(), inr);
-#else LOGGING
+#else /* LOGGING */
sprintf(buff, "\"%s\", line %ld", fn, getLIN());
-#endif LOGGING
+#endif /* LOGGING */
return buff;
}
return (res ? atol(res) : def);
}
-#endif LOGGING
+#endif /* LOGGING */
#define LOG(a)
-#endif LOGGING
+#endif /* LOGGING */
#define V7IOSETC (('t'<<8)|17)
#define V7IOGETC (('t'<<8)|18)
-#endif V7IOCTL
+#endif /* V7IOCTL */
/************************************************************************
long count; /* might get ALIGNMENT problems with this one */
int ldisc; /* might get ALIGNMENT problems with this one */
int pgrp; /* might get ALIGNMENT problems with this one */
-#endif V7IOCTL
+#endif /* V7IOCTL */
struct tchars tc_buf;
#ifndef V7IOCTL
struct ltchars ltc_buf;
-#endif V7IOCTL
-#endif BSD_X
+#endif /* V7IOCTL */
+#endif /* BSD_X */
#ifdef V7IOCTL
case V7IOGETC:
req = TIOCGETC;
break;
-#endif BSD_X
+#endif /* BSD_X */
default:
einval(WBADIOCTL);
return (-1); /* Fake return value */
}
-#endif V7IOCTL
+#endif /* V7IOCTL */
switch (req) {
case TIOCSETP:
#ifdef BSD4_1 /* from system.h */
case TIOCSETN:
-#endif BSD4_1
+#endif /* BSD4_1 */
/* set fd's parameters according to sgtty buffer */
/* pointed to (addr), so first fill sg_buf properly. */
if ( !mem2sgtty(addr, &sg_buf)
}
break;
-#endif V7IOCTL
-#endif BSD_X
+#endif /* V7IOCTL */
+#endif /* BSD_X */
default:
einval(WBADIOCTL);
#ifdef LOGGING
extern long inr; /* from log.c */
-#endif LOGGING
+#endif /* LOGGING */
PRIVATE char *dflt_av[] = {"e.out", 0}; /* default arguments */
else if (logarg(argv[i])) {
/* interesting for the logging machine */
}
-#endif LOGGING
+#endif /* LOGGING */
else break;
}
#ifdef LOGGING
/* Initialize the logging machine */
init_log();
-#endif LOGGING
+#endif /* LOGGING */
if (argc > i)
init(argc - i, argv + i);
#ifdef NOFLOAT
if (FLAGS&FB_REALS)
warning(WFLUSED);
-#endif NOFLOAT
+#endif /* NOFLOAT */
if (FLAGS&FB_EXTRA)
warning(WEXTRIGN);
/* log this instruction */
logging = 1;
}
-#endif LOGGING
+#endif /* LOGGING */
LOG(("@x9 PC = %lu OPCODE = %lu", PC,
btol(text_loc(PC)) < SECONDARY ?
#ifdef LOGGING
log_eoi();
-#endif LOGGING
+#endif /* LOGGING */
}
if (must_tally) {
#ifdef BSD_X /* from system.h */
#include <sys/timeb.h>
-#endif BSD_X
+#endif /* BSD_X */
#ifdef SYS_V
struct timeb { /* non-existing; we use an ad-hoc definition */
long time;
unsigned short millitm;
short timezone, dstflag;
};
-#endif SYS_V
+#endif /* SYS_V */
#ifdef BSD4_2 /* from system.h */
#include <sys/time.h>
-#endif BSD4_2
+#endif /* BSD4_2 */
#ifdef SYS_V
#include <sys/errno.h>
#undef ERANGE /* collision with trap.h */
#include <fcntl.h>
#include <time.h>
-#endif SYS_V
+#endif /* SYS_V */
#include <em_abs.h>
#include "logging.h"
extern unsigned int alarm();
extern long time();
extern void sync();
-#endif SYS_V
+#endif /* SYS_V */
#define INT2SIZE max(wsize, 2L)
#define INT4SIZE max(wsize, 4L)
#ifdef BSD4_2 /* from system.h */
struct timeval tv; /* private timeval buffer */
-#endif BSD4_2
+#endif /* BSD4_2 */
#ifdef BSD_X /* from system.h */
time_t utimbuf[2]; /* private utime buffer */
-#endif BSD_X
+#endif /* BSD_X */
#ifdef SYS_V /* from system.h */
struct {time_t x, y;} utimbuf; /* private utime buffer */
-#endif SYS_V
+#endif /* SYS_V */
char *cp;
int nr;
UNDEFINED : DEFINED;
#else
ES_def = DEFINED;
-#endif LOGGING
+#endif /* LOGGING */
ES = pop_int();
running = 0; /* stop the machine */
LOG(("@m9 Exit: ES = %ld", ES));
LOG(("@m6 Read: char = '%c'", *(buf[0] + i)));
}
}
-#endif LOGGING
+#endif /* LOGGING */
if (in_gda(dsp1) && !in_gda(dsp1 + (n-1))) {
efault(WRGDAH);
warning(in_stack(addr) ? WWLUNDEF : WWGUNDEF);
}
}
-#endif LOGGING
+#endif /* LOGGING */
check_buf(0, (size)nbytes);
for ( nr = nbytes, addr = dsp1, cp = buf[0];
LOG(("@m6 write: char = '%c'", *(buf[0] + i)));
}
}
-#endif LOGGING
+#endif /* LOGGING */
if ((n = write(fd, buf[0], nbytes)) == -1)
goto write_error;
if ( !savestr(0, dsp1)
#ifndef BSD4_2 /* from system.h */
|| umount(buf[0]) == -1
-#else BSD4_2
+#else /* BSD4_2 */
|| unmount(buf[0]) == -1
-#endif BSD4_2
+#endif /* BSD4_2 */
) {
push_err();
LOG(("@m4 Umount: failed, dsp1 = %lu, errno = %d",
tm = pop_int4();
#ifndef BSD4_2 /* from system.h */
rc = stime(&tm);
-#else BSD4_2
+#else /* BSD4_2 */
tv.tv_sec = tm;
tv.tv_usec = 0; /* zero microseconds */
rc = settimeofday(&tv, (struct timezone *)0);
-#endif BSD4_2
+#endif /* BSD4_2 */
if (rc == -1) {
push_err();
LOG(("@m4 Stime: failed, tm = %ld, errno = %d",
#ifdef BSD_X /* from system.h */
utimbuf[0] = actime;
utimbuf[1] = modtime;
-#endif BSD_X
+#endif /* BSD_X */
#ifdef SYS_V /* from system.h */
utimbuf.x = actime;
utimbuf.y = modtime;
-#endif SYS_V
+#endif /* SYS_V */
if (!savestr(0, dsp1) || utime(buf[0], utimbuf) == -1) {
push_err();
LOG(("@m4 Utime: failed, dsp1 = %lu, dsp2 = %lu, errno = %d",
dsp2 = pop_ptr();
#ifdef BSD_X /* from system.h */
ftime(&tb_buf);
-#endif BSD_X
+#endif /* BSD_X */
#ifdef SYS_V /* from system.h */
tb_buf.time = time((time_t*)0);
tb_buf.millitm = 0;
tb_buf.timezone = timezone / 60;
tb_buf.dstflag = daylight;
-#endif SYS_V
+#endif /* SYS_V */
if (!timeb2mem(dsp2, &tb_buf)) {
push_err();
LOG(("@m4 Ftime: failed, dsp2 = %lu, errno = %d",
}
#ifdef BSD_X /* from system.h */
fdnew = dup2(fd1, fdnew);
-#endif BSD_X
+#endif /* BSD_X */
#ifdef SYS_V /* from system.h */
{
fdnew = fcntl(fd1, F_DUPFD, fdnew);
}
}
-#endif SYS_V
+#endif /* SYS_V */
dup2_error:;
}
else {
#ifdef BSD_X /* from system.h */
#include <sys/timeb.h>
-#endif BSD_X
+#endif /* BSD_X */
#ifdef SYS_V /* from system.h */
struct timeb { /* non-existing; we use an ad-hoc definition */
long time;
unsigned short millitm;
short timezone, dstflag;
}
-#endif SYS_V
+#endif /* SYS_V */
/******** System to EM memory ********/
mem_stfld(addr, V7t_lnextc, (long) ltcharsb->t_lnextc);
return 1;
}
-#endif V7IOCTL
-#endif BSD_X
+#endif /* V7IOCTL */
+#endif /* BSD_X */
/******** EM memory to system ********/
ltcharsb->t_lnextc = (char) mem_ldfld(addr, V7t_lnextc);
return 1;
}
-#endif V7IOCTL
-#endif BSD_X
+#endif /* V7IOCTL */
+#endif /* BSD_X */
LOG((" r5: proctab[%ld]: nloc = %d, ep = %lu, ff = %lu",
p, pr->pr_nloc, pr->pr_ep, pr->pr_ff));
}
-#endif LOGGING
+#endif /* LOGGING */
}
warn_msg: $(SRC_DIR)/M.warn_msg $(APP_A)
$(SRC_DIR)/M.warn_msg $(APP_A)
-warn.h: $(SRC_DIR)/M.warn_h $(APP_A)
+./warn.h: $(SRC_DIR)/M.warn_h $(APP_A)
$(SRC_DIR)/M.warn_h $(APP_A)
switch/DoCases:
# Auxiliary entries
-lint: $(CFILES) trap_msg warn_msg warn.h switch/DoCases switch/PrCases
+lint: $(CFILES) trap_msg warn_msg ./warn.h switch/DoCases switch/PrCases
$(LINT) $(LINTFLAGS) $(CFILES)
tags: $(HDR) $(CFILES)
bare: clean
(cd switch; make bare)
-depend: warn.h trap_msg warn_msg
+depend: ./warn.h trap_msg warn_msg
sed '/^#DEPENDENCIES/,$$d' Makefile >Makefile.new
echo '#DEPENDENCIES' >>Makefile.new
for i in $(CFILES) ; do \
#ifndef NOFLOAT
extern double str2double();
-#endif NOFLOAT
+#endif /* NOFLOAT */
/************************************************************************
* Read object file contents. *
#ifdef LOGGING
/* copy shadow byte, including protection bit */
dt_sh(pos) = dt_sh(pos - diff);
-#endif LOGGING
+#endif /* LOGGING */
pos++;
}
}
#ifndef NOFLOAT
/* store the float */
dt_stf(pos, str2double(fl_rep), j);
-#else NOFLOAT
+#else /* NOFLOAT */
/* we cannot store the float */
warning(WFLINIT);
-#endif NOFLOAT
+#endif /* NOFLOAT */
pos += j;
break;
default:
if (SP > properSP)
warning(rtt ? WRTTSTS : WRETSTS);
}
-#endif LOGGING
+#endif /* LOGGING */
/* discard stack up to RSB */
newSP(LB);
return s;
}
-#else SEGCHECK
+#else /* SEGCHECK */
init_AB_list() {}
pop_frames() {}
-#endif SEGCHECK
+#endif /* SEGCHECK */
#define ch_dt_prot(a)
#define ch_st_prot(a)
-#endif LOGGING
+#endif /* LOGGING */
#ifdef LOGGING
char *stack_sh; /* stadowbytes */
char *stackML_sh; /* speed up access of stadowbytes */
-#endif LOGGING
+#endif /* LOGGING */
PRIVATE warn_stbits();
stack_sh = Malloc(STACKSIZE, "shadowspace for stack");
stackML_sh = stack_sh + ML;
st_clear_area(ML, SL);
-#endif LOGGING
+#endif /* LOGGING */
}
stack_sh = Realloc(stack_sh, (size)(stacksize),
"shadowspace for stack");
stackML_sh = stack_sh + ML;
-#endif LOGGING
+#endif /* LOGGING */
}
#ifdef LOGGING
st_clear_area(SP - 1, p);
-#endif LOGGING
+#endif /* LOGGING */
}
SP = p;
}
stack_loc(addr) = (char) l;
#ifdef LOGGING
st_sh(addr) = sh_flags;
-#endif LOGGING
+#endif /* LOGGING */
l = l>>8;
}
}
stack_loc(addr) = (char) l;
#ifdef LOGGING
st_sh(addr) = sh_flags;
-#endif LOGGING
+#endif /* LOGGING */
l = l>>8;
}
}
st_fl(addr);
}
}
-#endif NOFLOAT
+#endif /* NOFLOAT */
/************************************************************************
* Stack load division. *
warning(WLDPEXP);
warn_stbits(addr, psize);
}
-#endif LOGGING
+#endif /* LOGGING */
p = p_in_stack(addr);
LOG(("@s6 st_lddp() returns %lu", p));
warning(WLIPEXP);
warn_stbits(addr, psize);
}
-#endif LOGGING
+#endif /* LOGGING */
p = p_in_stack(addr);
LOG(("@s6 st_ldip() returns %lu", p));
warning(n == 1 ? WLCEXP : WLIEXP);
warn_stbits(addr, n);
}
-#endif LOGGING
+#endif /* LOGGING */
addr += n-1;
for (i = (int) n-1; i >= 0; i--, addr--) {
warning(WLIEXP);
warn_stbits(addr, wsize);
}
-#endif LOGGING
+#endif /* LOGGING */
addr += wsize - 1;
for (i = (int) wsize-1; i >= 0; i--, addr--) {
warning(n == 1 ? WLCEXP : WLIEXP);
warn_stbits(addr, n);
}
-#endif LOGGING
+#endif /* LOGGING */
addr += n - 2;
l = btos(stack_loc(addr + 1));
warning(WLIEXP);
warn_stbits(addr, wsize);
}
-#endif LOGGING
+#endif /* LOGGING */
addr += wsize - 2;
l = btos(stack_loc(addr+1));
warning(WLFEXP);
warn_stbits(addr, n);
}
-#endif LOGGING
+#endif /* LOGGING */
for (i = (int) n; i > 0; i--, addr++) {
*(cp++) = stack_loc(addr);
}
return (f);
}
-#endif NOFLOAT
+#endif /* NOFLOAT */
/************************************************************************
* Stack move division *
stack_loc(s2) = stack_loc(s1);
#ifdef LOGGING
st_sh(s2) = st_sh(s1) & ~SH_PROT;
-#endif LOGGING
+#endif /* LOGGING */
}
}
stack_loc(s) = data_loc(d);
#ifdef LOGGING
st_sh(s) = dt_sh(d) & ~SH_PROT;
-#endif LOGGING
+#endif /* LOGGING */
}
}
decSP(n);
return (d);
}
-#endif NOFLOAT
+#endif /* NOFLOAT */
long wpop()
{
incSP(n);
st_stf(SP, f, n);
}
-#endif NOFLOAT
+#endif /* NOFLOAT */
#ifdef LOGGING
warningcont(WWASINSP);
}
-#endif LOGGING
+#endif /* LOGGING */
#ifdef BSD4_1
#define BSD_X
-#endif BSD4_1
+#endif /* BSD4_1 */
#ifdef BSD4_2
#define BSD_X
-#endif BSD4_2
+#endif /* BSD4_2 */
#ifdef SYS_5
#define SYS_V
-#endif SYS_5
+#endif /* SYS_5 */
}
}
-#endif LOGGING
+#endif /* LOGGING */
set_wmask(i)
int i;
.br
The header of an object file has the following structure:
.PP
-#define ushort unsigned\ short
-.PP
.nf
struct outhead {
- ushort oh_magic; /* magic number */
- ushort oh_stamp; /* version stamp */
- ushort oh_flags; /* several format flags */
- ushort oh_nsect; /* number of outsect structures */
- ushort oh_nrelo; /* number of outrelo structures */
- ushort oh_nname; /* number of outname structures */
+ unsigned short oh_magic; /* magic number */
+ unsigned short oh_stamp; /* version stamp */
+ unsigned short oh_flags; /* several format flags */
+ unsigned short oh_nsect; /* number of outsect structures */
+ unsigned short oh_nrelo; /* number of outrelo structures */
+ unsigned short oh_nname; /* number of outname structures */
long oh_nemit; /* length of sections */
long oh_nchar; /* size of string area */
};
struct outrelo {
char or_type; /* type of reference */
char or_sect; /* referencing section */
- ushort or_nami; /* referenced symbol index */
+ unsigned short or_nami; /* referenced symbol index */
long or_addr; /* referencing address */
};
.fi
} on_u;
#define on_mptr on_u.on_ptr
#define on_foff on_u.on_off
- ushort on_type; /* symbol type */
- ushort on_desc; /* debug info */
+ unsigned short on_type; /* symbol type */
+ unsigned short on_desc; /* debug info */
long on_valu; /* symbol value */
};
.fi
#define assert(ex)
-#else NASSERT
+#else /* NASSERT */
#define assert(ex) \
{if (!(ex)) fatal("Assertion failed: file %s, line %d", __FILE__, __LINE__);}
-#endif NASSERT
-#else lint
+#endif /* NASSERT */
+#else /* lint */
#define assert(ex)
-#endif lint
+#endif /* lint */
skip_modul(&head);
}
-ushort NLocals = 0; /* Number of local names to be saved. */
-ushort NGlobals = 0; /* Number of global names. */
+unsigned short NLocals = 0; /* Number of local names to be saved. */
+unsigned short NGlobals = 0; /* Number of global names. */
/*
* Walk through the nametable of this module, counting the locals that must
#include "scan.h"
extern bool incore;
-extern ushort NLocals;
+extern unsigned short NLocals;
extern int flagword;
extern struct outname *searchname();
put_locals(names, head->oh_nname);
#ifdef SYMDBUG
put_dbug(OFF_DBUG(*head));
-#endif SYMDBUG
+#endif /* SYMDBUG */
}
compute_origins(sects, head->oh_nsect);
skip_modul(head);
do_crs(base, count)
struct outname *base;
- unsigned short count;
+ unsigned count;
{
register struct outname *name = base;
static
put_locals(name, nnames)
struct outname *name;
- register ushort nnames;
+ register unsigned nnames;
{
register struct outname *oname = name;
register struct outname *iname = oname;
static
compute_origins(sect, nsect)
register struct outsect *sect;
- register ushort nsect;
+ register unsigned nsect;
{
extern struct orig relorig[];
register struct orig *orig = relorig;
dbugsize -= nbytes;
}
}
-#endif SYMDBUG
+#endif /* SYMDBUG */
mems[ALLOGCHR].mem_left = 16 * K;
#ifdef SYMDBUG
mems[ALLODBUG].mem_left = 32 * K;
-#endif SYMDBUG
+#endif /* SYMDBUG */
mems[ALLOSYMB].mem_left = 8 * K;
mems[ALLOARCH].mem_left = 4 * K;
mems[ALLOMODL].mem_left = 64 * K;
mems[ALLOGCHR].mem_left = 2 * K;
#ifdef SYMDBUG
mems[ALLODBUG].mem_left = 2 * K;
-#endif SYMDBUG
+#endif /* SYMDBUG */
mems[ALLOSYMB].mem_left = 2 * K;
mems[ALLOARCH].mem_left = 1 * K;
mems[ALLOMODL].mem_left = 12 * K;
change_names();
}
-extern ushort NGlobals, NLocals;
+extern unsigned short NGlobals, NLocals;
/*
* Sect_comm[N] is the number of common bytes in section N.
/*
* To transform the various pieces of the output in core to the file format,
- * we must order the bytes in the ushorts and longs as ACK prescribes.
+ * we must order the bytes in the unsigned shorts and longs as ACK prescribes.
*/
write_bytes()
{
- ushort nsect;
+ unsigned short nsect;
long offchar;
register struct memory *mem;
- extern ushort NLocals, NGlobals;
+ extern unsigned short NLocals, NGlobals;
extern long NLChars, NGChars;
extern int flagword;
extern struct outhead outhead;
wr_string(mems[ALLOGCHR].mem_base + 1, (long)NGChars);
#ifdef SYMDBUG
wr_dbug(mems[ALLODBUG].mem_base, mems[ALLODBUG].mem_full);
-#endif SYMDBUG
+#endif /* SYMDBUG */
}
}
namecpy(name, nname, offchar)
register struct outname *name;
- register ushort nname;
+ register unsigned nname;
register long offchar;
{
while (nname--) {
#define ALLOGCHR (ALLOLCHR + 1) /* Strings of global names. */
#ifdef SYMDEBUG
#define ALLODBUG (ALLOGCHR + 1) /* Symbolic debugging info. */
-#else SYMDEBUG
+#else /* SYMDEBUG */
#define ALLODBUG ALLOGCHR
-#endif SYMDEBUG
+#endif /* SYMDEBUG */
#define ALLOSYMB (ALLODBUG + 1) /* Symbol table. */
#define ALLOARCH (ALLOSYMB + 1) /* Archive positions. */
#define ALLOMODL (ALLOARCH + 1) /* Modules. */
#ifdef SYMDEBUG
Symbolic debugging information
-----------------------------------------------
-#endif SYMDEBUG
+#endif /* SYMDEBUG */
Symbol table *
-----------------------------------------------
Archive positions *
*/
beginoutput()
{
- extern ushort NLocals, NGlobals;
+ extern unsigned short NLocals, NGlobals;
extern long NLChars, NGChars;
extern char *outputname;
generate_section_names();
if (!(flagword & (CFLAG|RFLAG)))
- outhead.oh_nrelo = (ushort)0;
+ outhead.oh_nrelo = (unsigned short)0;
if (flagword & SFLAG) {
- outhead.oh_nname = (ushort)0;
+ outhead.oh_nname = (unsigned short)0;
outhead.oh_nchar = (long)0;
} else {
outhead.oh_nname = NLocals + NGlobals + outhead.oh_nsect;
for (sectindex = 0; sectindex < outhead.oh_nsect; sectindex++, name++) {
name->on_foff = (long)0; /* No string name. */
name->on_type = (S_MIN + sectindex) | S_SCT;
- name->on_desc = (ushort)0;
+ name->on_desc = (unsigned short)0;
name->on_valu = outsect[sectindex].os_base;
}
}
char addr[];
char type;
{
- ushort word0, word1;
+ unsigned short word0, word1;
switch (type & RELSZ) {
case RELO1:
char addr[];
char type;
{
- ushort word0, word1;
+ unsigned short word0, word1;
switch (type & RELSZ) {
case RELO1:
}
}
-extern ushort NLocals, NGlobals;
+extern unsigned short NLocals, NGlobals;
extern struct outsect outsect[];
extern struct orig relorig[];
* Second case: we must update the value by the change
* in position of the section of local.
*/
-static ushort
+static unsigned
addrelo(relo, names, valu_out)
struct outrelo *relo;
struct outname *names;
long *valu_out; /* Out variable. */
{
register struct outname *local = &names[relo->or_nami];
- register ushort index = NLocals;
+ register unsigned short index = NLocals;
register long valu = *valu_out;
if ((local->on_type & S_SCT)) {
register struct outname *name;
extern int hash();
extern struct outname *searchname();
- extern ushort indexof();
+ extern unsigned indexof();
extern struct outhead outhead;
name = searchname(local->on_mptr, hash(local->on_mptr));
return;
if ((p = core_alloc(ALLOMODL, (long)sizeof(int))) != (char *)0) {
- *(ushort *)p = AALMAG;
+ *(unsigned short *)p = AALMAG;
core_position += sizeof(int);
}
}
#ifdef SYMDBUG
#include <sys/types.h>
#include <sys/stat.h>
-#endif SYMDBUG
+#endif /* SYMDBUG */
#include <arch.h>
#include <out.h>
#include <ranlib.h>
#define IND_RELO(x) (IND_EMIT(x) + (x).oh_nsect * sizeof(ind_t))
#ifdef SYMDBUG
#define IND_DBUG(x) (IND_RELO(x) + sizeof(ind_t))
-#endif SYMDBUG
+#endif /* SYMDBUG */
extern long lseek();
extern char *core_alloc();
char *modulname; /* Name of object module. */
#ifdef SYMDBUG
long objectsize;
-#endif SYMDBUG
+#endif /* SYMDBUG */
static long align();
static char *modulbase;
static bool putreloindex();
#ifdef SYMDBUG
static bool putdbugindex();
-#endif SYMDBUG
+#endif /* SYMDBUG */
static get_indirect();
static read_modul();
{
unsigned int rd_unsigned2();
struct ar_hdr archive_header;
- ushort magic_number;
+ unsigned short magic_number;
#ifdef SYMDBUG
struct stat statbuf;
extern int fstat();
-#endif SYMDBUG
+#endif /* SYMDBUG */
archname = (char *)0;
modulname = (char *)0;
magic_number = rd_unsigned2(infile);
} else {
modulbase = modulptr((ind_t)0);
- magic_number = *(ushort *)modulbase;
+ magic_number = *(unsigned short *)modulbase;
}
switch (magic_number) {
fatal("cannot stat");
objectsize = statbuf.st_size;
}
-#endif SYMDBUG
+#endif /* SYMDBUG */
seek((long)0);
modulname = filename;
return PLAIN;
}
#ifdef SYMDBUG
objectsize = archive_header.ar_size;
-#endif SYMDBUG
+#endif /* SYMDBUG */
}
get_modul()
ojectsize - OFF_DBUG(*head)
);
}
-#endif SYMDBUG
+#endif /* SYMDBUG */
}
/*
{
ind_t sectindex = IND_SECT(*head);
register struct outsect *sects;
- ushort nsect = head->oh_nsect;
+ unsigned short nsect = head->oh_nsect;
long size, rest;
extern ind_t hard_alloc();
extern ind_t alloc();
#ifdef SYMDBUG
rest = nsect * sizeof(ind_t) + sizeof(ind_t) + sizeof(ind_t);
-#else SYMDBUG
+#else /* SYMDBUG */
rest = nsect * sizeof(ind_t) + sizeof(ind_t);
-#endif SYMDBUG
+#endif /* SYMDBUG */
/*
* We already allocated space for the header, we now need
* the section, name an string table.
struct outhead *head;
{
register int allopiece;
- ushort nsect = head->oh_nsect;
- ushort nrelo = head->oh_nrelo;
+ unsigned short nsect = head->oh_nsect;
+ unsigned short nrelo = head->oh_nrelo;
ind_t sectindex = IND_SECT(*head);
ind_t emitoff = IND_EMIT(*head);
ind_t relooff = IND_RELO(*head);
ind_t dbugoff = IND_DBUG(*head);
extern long objectsize;
long dbugsize = objectsize - OFF_DBUG(*head);
-#endif SYMDBUG
+#endif /* SYMDBUG */
assert(incore);
for (allopiece = ALLOEMIT; allopiece < ALLOEMIT + nsect; allopiece++) {
return putreloindex(relooff, (long)nrelo * sizeof(struct outrelo))
&&
putdbugindex(dbugoff, dbugsize);
-#else SYMDBUG
+#else /* SYMDBUG */
return putreloindex(relooff, (long)nrelo * sizeof(struct outrelo));
-#endif SYMDBUG
+#endif /* SYMDBUG */
}
/*
}
return FALSE;
}
-#endif SYMDBUG
+#endif /* SYMDBUG */
/*
* Compute addresses and read in. Remember that the contents of the sections
struct outname *names;
char *chars;
ind_t sectindex, nameindex, charindex;
- ushort nsect, nname;
+ unsigned short nsect, nname;
long size;
long nchar;
extern ind_t hard_alloc();
nchar = head->oh_nchar; charindex = IND_CHAR(*head);
#ifdef SYMDBUG
size = modulsize(head) - (nsect * sizeof(ind_t) + 2 * sizeof(ind_t));
-#else SYMDBUG
+#else /* SYMDBUG */
size = modulsize(head) - (nsect * sizeof(ind_t) + sizeof(ind_t));
-#endif SYMDBUG
+#endif /* SYMDBUG */
if (hard_alloc(ALLOMODL, size) == BADOFF)
fatal("no space for module");
* 5. the offset of the relocation table.
#ifdef SYMDBUG
* 6. the offset of the debugging information.
-#endif SYMDBUG
+#endif /* SYMDBUG */
*/
static long
modulsize(head)
#ifdef SYMDBUG
sizeof(ind_t) + /* 5 */
sizeof(ind_t); /* 6 */
-#else SYMDBUG
+#else /* SYMDBUG */
sizeof(ind_t); /* 5 */
-#endif SYMDBUG
+#endif /* SYMDBUG */
}
/* ------------------------------------------------------------------------- */
* Return the index of `name' in the symbol table in the order in which
* it was entered. We need a REAL index, not a byte offset.
*/
-ushort
+unsigned
indexof(name)
struct outname *name;
{
{
register struct outname *name;
register int sectindex;
- extern ushort NGlobals;
+ extern unsigned short NGlobals;
extern long NGChars;
assert(!incore);
#ifndef MAGIC
#define MAGIC 07255
-#endif MAGIC
+#endif /* MAGIC */
FILE *load_fp;
int eof;