mirror of
https://github.com/PDP-10/klh10.git
synced 2026-01-11 23:52:54 +00:00
clang-suggested changes, mostly wrt -Wparentheses
warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
This commit is contained in:
parent
1105dd0c69
commit
9312579251
@ -985,7 +985,7 @@ arp_init(struct dpimp_s *dpimp)
|
|||||||
/ sizeof(struct arpent)));
|
/ sizeof(struct arpent)));
|
||||||
arptab_lim = &dsh->dpimpsh_arptab[dsh->dpimpsh_arpsiz];
|
arptab_lim = &dsh->dpimpsh_arptab[dsh->dpimpsh_arpsiz];
|
||||||
|
|
||||||
if (at = arp_look(ihost_ip, &ea)) {
|
if ((at = arp_look(ihost_ip, &ea))) {
|
||||||
/* It's now there, ensure it stays there */
|
/* It's now there, ensure it stays there */
|
||||||
at->at_flags |= ARPF_PERM;
|
at->at_flags |= ARPF_PERM;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -95,11 +95,11 @@ int dp_init(register struct dp_s *dp, size_t dpcsiz,
|
|||||||
dp->dp_chpid = 0;
|
dp->dp_chpid = 0;
|
||||||
|
|
||||||
/* Ensure all sizes are aligned to satisfy maximum restrictions */
|
/* Ensure all sizes are aligned to satisfy maximum restrictions */
|
||||||
if (adj = (dpcsiz % sizeof(double)))
|
if ((adj = (dpcsiz % sizeof(double))))
|
||||||
dpcsiz += sizeof(double) - adj;
|
dpcsiz += sizeof(double) - adj;
|
||||||
if (adj = (insiz % sizeof(double)))
|
if ((adj = (insiz % sizeof(double))))
|
||||||
insiz += sizeof(double) - adj;
|
insiz += sizeof(double) - adj;
|
||||||
if (adj = (outsiz % sizeof(double)))
|
if ((adj = (outsiz % sizeof(double))))
|
||||||
outsiz += sizeof(double) - adj;
|
outsiz += sizeof(double) - adj;
|
||||||
|
|
||||||
totsiz = dpcsiz + insiz + outsiz;
|
totsiz = dpcsiz + insiz + outsiz;
|
||||||
@ -306,7 +306,7 @@ int dp_stop(register struct dp_s *dp, int timeout)
|
|||||||
|
|
||||||
switch (dp->dp_type) {
|
switch (dp->dp_type) {
|
||||||
case DP_XT_MSIG:
|
case DP_XT_MSIG:
|
||||||
if (pid = dp->dp_chpid) {
|
if ((pid = dp->dp_chpid)) {
|
||||||
(void) dp_killchild(pid, timeout);
|
(void) dp_killchild(pid, timeout);
|
||||||
|
|
||||||
/* For now, flush pid even if didn't find it when waited. */
|
/* For now, flush pid even if didn't find it when waited. */
|
||||||
|
|||||||
@ -781,7 +781,7 @@ void dptmstat(register struct devmt *d)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (dptm->dptm_mol = d->mta_mol) {
|
if ((dptm->dptm_mol = d->mta_mol)) {
|
||||||
if (d->d_state == DPTM03_STA_HARDOFF) {
|
if (d->d_state == DPTM03_STA_HARDOFF) {
|
||||||
if (1 /*DBGFLG*/)
|
if (1 /*DBGFLG*/)
|
||||||
dbprintln("Tape came online: \"%s\" %s", d->d_path,
|
dbprintln("Tape came online: \"%s\" %s", d->d_path,
|
||||||
|
|||||||
@ -2099,7 +2099,7 @@ static int dte_10qpkt(register struct dte *dt,
|
|||||||
q->q_sdev = sdev;
|
q->q_sdev = sdev;
|
||||||
q->q_swd1 = swd1;
|
q->q_swd1 = swd1;
|
||||||
q->q_bbcnt = bbcnt;
|
q->q_bbcnt = bbcnt;
|
||||||
if (q->q_wbcnt = (bbcnt ? 0 : wbcnt)) /* If sending words, */
|
if ((q->q_wbcnt = (bbcnt ? 0 : wbcnt))) /* If sending words, */
|
||||||
q->q_sfn |= SFN_INDBIT; /* Force msg to use indirect data */
|
q->q_sfn |= SFN_INDBIT; /* Force msg to use indirect data */
|
||||||
if (bbcnt || wbcnt)
|
if (bbcnt || wbcnt)
|
||||||
q->q_dcp = dcp;
|
q->q_dcp = dcp;
|
||||||
|
|||||||
@ -849,7 +849,7 @@ lh_io(register struct lhdh *lh, int wrtf)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; wcnt = (wrtf ? REG(lh, LHR_OWC) : REG(lh, LHR_IWC)); ++loopcnt) {
|
for (; (wcnt = (wrtf ? REG(lh, LHR_OWC) : REG(lh, LHR_IWC))); ++loopcnt) {
|
||||||
|
|
||||||
wcnt = (-(wcnt | ~MASK16))>>1; /* Find # of PDP10 words */
|
wcnt = (-(wcnt | ~MASK16))>>1; /* Find # of PDP10 words */
|
||||||
if (wcnt > 01000) /* One DEC page per pass */
|
if (wcnt > 01000) /* One DEC page per pass */
|
||||||
|
|||||||
@ -564,7 +564,7 @@ rh11_write(struct device *d, uint18 addr, register dvureg_t val)
|
|||||||
|
|
||||||
rh->rh_cs2 = ((rh->rh_cs2)&~RH_YDSK) | drvno;
|
rh->rh_cs2 = ((rh->rh_cs2)&~RH_YDSK) | drvno;
|
||||||
rh->rh_ds = drvno;
|
rh->rh_ds = drvno;
|
||||||
if (rh->rh_dsptr = rh->rh_drive[drvno]) {
|
if ((rh->rh_dsptr = rh->rh_drive[drvno])) {
|
||||||
rh->rh_cs2 &= ~RH_YNED; /* Drive exists */
|
rh->rh_cs2 &= ~RH_YNED; /* Drive exists */
|
||||||
} else {
|
} else {
|
||||||
rh->rh_cs2 |= RH_YNED; /* Non-ex drive */
|
rh->rh_cs2 |= RH_YNED; /* Non-ex drive */
|
||||||
|
|||||||
@ -1806,9 +1806,9 @@ rp_updxfr(register struct rpdev *rp)
|
|||||||
|
|
||||||
/* Check to see if last write completed successfully */
|
/* Check to see if last write completed successfully */
|
||||||
#if KLH10_DEV_DPRPXX
|
#if KLH10_DEV_DPRPXX
|
||||||
if (i = rp->rp_sdprp->dprp_err) {
|
if ((i = rp->rp_sdprp->dprp_err)) {
|
||||||
#else
|
#else
|
||||||
if (i = rp->rp_reserr) {
|
if ((i = rp->rp_reserr)) {
|
||||||
#endif
|
#endif
|
||||||
/* Ugh, what error bit to use?? */
|
/* Ugh, what error bit to use?? */
|
||||||
if (i < 0) { /* If -1 assume addr ovfl */
|
if (i < 0) { /* If -1 assume addr ovfl */
|
||||||
|
|||||||
@ -364,7 +364,7 @@ uba_read(register struct ubctl *ub,
|
|||||||
{
|
{
|
||||||
register struct device *d;
|
register struct device *d;
|
||||||
|
|
||||||
if (d = ub_devfind(ub, addr))
|
if ((d = ub_devfind(ub, addr)))
|
||||||
return (uint32) (*(d->dv_read))(d, addr);
|
return (uint32) (*(d->dv_read))(d, addr);
|
||||||
|
|
||||||
switch (addr) {
|
switch (addr) {
|
||||||
@ -389,7 +389,7 @@ uba_write(register struct ubctl *ub,
|
|||||||
{
|
{
|
||||||
register struct device *d;
|
register struct device *d;
|
||||||
|
|
||||||
if (d = ub_devfind(ub, addr)) {
|
if ((d = ub_devfind(ub, addr))) {
|
||||||
(*(d->dv_write))(d, addr, (dvureg_t)val);
|
(*(d->dv_write))(d, addr, (dvureg_t)val);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1100,7 +1100,7 @@ xildb(register struct cleanbp *bp, register w10_t *wp)
|
|||||||
/* Ugh. Write out BP, then re-compute byte EA. */
|
/* Ugh. Write out BP, then re-compute byte EA. */
|
||||||
register enum xires res;
|
register enum xires res;
|
||||||
xbpupdate(bp);
|
xbpupdate(bp);
|
||||||
if (res = xbpinit(bp, bp->ac, bp->src)) {
|
if ((res = xbpinit(bp, bp->ac, bp->src))) {
|
||||||
xdecbp(bp); /* Failed?? Back up P */
|
xdecbp(bp); /* Failed?? Back up P */
|
||||||
return bp->err = res;
|
return bp->err = res;
|
||||||
}
|
}
|
||||||
@ -1144,7 +1144,7 @@ xidpb(register struct cleanbp *bp, register w10_t *wp)
|
|||||||
/* Ugh. Write out BP, then re-compute byte EA. */
|
/* Ugh. Write out BP, then re-compute byte EA. */
|
||||||
register enum xires res;
|
register enum xires res;
|
||||||
xbpupdate(bp);
|
xbpupdate(bp);
|
||||||
if (res = xbpinit(bp, bp->ac, bp->src)) {
|
if ((res = xbpinit(bp, bp->ac, bp->src))) {
|
||||||
xdecbp(bp); /* Failed?? Back up P */
|
xdecbp(bp); /* Failed?? Back up P */
|
||||||
return bp->err = res;
|
return bp->err = res;
|
||||||
}
|
}
|
||||||
@ -2424,7 +2424,7 @@ xinsdef(ix_edit)
|
|||||||
/* Set up bp for internal use, fail if error result
|
/* Set up bp for internal use, fail if error result
|
||||||
** (most likely MUUO for bogus OWGBP, if extended)
|
** (most likely MUUO for bogus OWGBP, if extended)
|
||||||
*/
|
*/
|
||||||
if (res = xbpinit(&s2, ac_off(ac,4), BPDST)) {
|
if ((res = xbpinit(&s2, ac_off(ac,4), BPDST))) {
|
||||||
/* Note: Not sure if this is correct behavior, since at
|
/* Note: Not sure if this is correct behavior, since at
|
||||||
** this point the AC has already been clobbered, and the
|
** this point the AC has already been clobbered, and the
|
||||||
** rest of the world is probably not in a very good
|
** rest of the world is probably not in a very good
|
||||||
|
|||||||
@ -2255,7 +2255,7 @@ fc_exa(struct cmd_s *cm)
|
|||||||
putchar('/');
|
putchar('/');
|
||||||
putchar(' ');
|
putchar(' ');
|
||||||
|
|
||||||
if (vp = fevm_xmap(ddt_cloc, ddt_clmode)) {
|
if ((vp = fevm_xmap(ddt_cloc, ddt_clmode))) {
|
||||||
ddt_val = vm_pget(vp);
|
ddt_val = vm_pget(vp);
|
||||||
wd1print(stdout, ddt_val);
|
wd1print(stdout, ddt_val);
|
||||||
if (LHGET(ddt_val) & 0777000) { /* Opcode exists? */
|
if (LHGET(ddt_val) & 0777000) { /* Opcode exists? */
|
||||||
@ -2297,7 +2297,7 @@ fc_dep(struct cmd_s *cm)
|
|||||||
}
|
}
|
||||||
ddt_val = wd;
|
ddt_val = wd;
|
||||||
|
|
||||||
if (vp = fevm_xmap(ddt_cloc, ddt_clmode))
|
if ((vp = fevm_xmap(ddt_cloc, ddt_clmode)))
|
||||||
vm_pset(vp, ddt_val);
|
vm_pset(vp, ddt_val);
|
||||||
else {
|
else {
|
||||||
printf("?Cannot map address ");
|
printf("?Cannot map address ");
|
||||||
@ -2929,7 +2929,7 @@ pinstr(FILE *f,
|
|||||||
wd1print(f, w); /* Do first word */
|
wd1print(f, w); /* Do first word */
|
||||||
fprintf(f, " ? ");
|
fprintf(f, " ? ");
|
||||||
va_inc(e); /* Point to next word */
|
va_inc(e); /* Point to next word */
|
||||||
if (vp = fevm_xmap(e, FEVM_CUR))
|
if ((vp = fevm_xmap(e, FEVM_CUR)))
|
||||||
wd1print(f, vm_pget(vp));
|
wd1print(f, vm_pget(vp));
|
||||||
else fprintf(f, "-\?\?-");
|
else fprintf(f, "-\?\?-");
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -318,12 +318,12 @@ clk_usec2tick(int32 usec)
|
|||||||
|
|
||||||
/* Remove from any doubly-linked queue */
|
/* Remove from any doubly-linked queue */
|
||||||
#define clk_2ldelete(e) \
|
#define clk_2ldelete(e) \
|
||||||
if ((e)->cke_prev->cke_next = (e)->cke_next) \
|
if (((e)->cke_prev->cke_next = (e)->cke_next)) \
|
||||||
(e)->cke_next->cke_prev = (e)->cke_prev
|
(e)->cke_next->cke_prev = (e)->cke_prev
|
||||||
|
|
||||||
/* Remove from a clock queue, updating relative ticks */
|
/* Remove from a clock queue, updating relative ticks */
|
||||||
#define clk_qdelete(e) \
|
#define clk_qdelete(e) \
|
||||||
if ((e)->cke_prev->cke_next = (e)->cke_next) \
|
if (((e)->cke_prev->cke_next = (e)->cke_next)) \
|
||||||
((e)->cke_next->cke_ticks += (e)->cke_ticks), \
|
((e)->cke_next->cke_ticks += (e)->cke_ticks), \
|
||||||
(e)->cke_next->cke_prev = (e)->cke_prev
|
(e)->cke_next->cke_prev = (e)->cke_prev
|
||||||
|
|
||||||
@ -366,7 +366,7 @@ clk_init(void)
|
|||||||
** Someday try to make this dynamic by determining whether we're
|
** Someday try to make this dynamic by determining whether we're
|
||||||
** running on a fast or slow machine??
|
** running on a fast or slow machine??
|
||||||
*/
|
*/
|
||||||
if (cpu.clk.clk_ithzfix = KLH10_CLK_ITHZFIX) {
|
if ((cpu.clk.clk_ithzfix = KLH10_CLK_ITHZFIX)) {
|
||||||
cpu.clk.clk_ithzcmreq = cpu.clk.clk_ithzfix;
|
cpu.clk.clk_ithzcmreq = cpu.clk.clk_ithzfix;
|
||||||
cpu.clk.clk_itusfix = CLK_USECS_PER_SEC / cpu.clk.clk_ithzfix;
|
cpu.clk.clk_itusfix = CLK_USECS_PER_SEC / cpu.clk.clk_ithzfix;
|
||||||
} else {
|
} else {
|
||||||
@ -559,7 +559,7 @@ clk_synctimeout(void)
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* Now check for special ITICK callouts */
|
/* Now check for special ITICK callouts */
|
||||||
if (ce = cpu.clk.clk_itickl) {
|
if ((ce = cpu.clk.clk_itickl)) {
|
||||||
do {
|
do {
|
||||||
/* ITICK callouts don't return values and are actually of type void
|
/* ITICK callouts don't return values and are actually of type void
|
||||||
** instead of int, hence funct pointer must be cast.
|
** instead of int, hence funct pointer must be cast.
|
||||||
@ -569,7 +569,7 @@ clk_synctimeout(void)
|
|||||||
*/
|
*/
|
||||||
nce = ce->cke_next;
|
nce = ce->cke_next;
|
||||||
(*(void (*)(void *))(ce->cke_rtn)) (ce->cke_arg);
|
(*(void (*)(void *))(ce->cke_rtn)) (ce->cke_arg);
|
||||||
} while (ce = nce);
|
} while ((ce = nce));
|
||||||
}
|
}
|
||||||
#endif /* KLH10_CLKRES_ITICK */
|
#endif /* KLH10_CLKRES_ITICK */
|
||||||
|
|
||||||
@ -586,7 +586,7 @@ clk_synctimeout(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CLKEVH_RET_KILL: /* Kill, put on freelist */
|
case CLKEVH_RET_KILL: /* Kill, put on freelist */
|
||||||
if (ce->cke_prev->cke_next = nce) /* Take off queue */
|
if ((ce->cke_prev->cke_next = nce)) /* Take off queue */
|
||||||
nce->cke_prev = ce->cke_prev;
|
nce->cke_prev = ce->cke_prev;
|
||||||
ce->cke_state = CLKENT_ST_FREE; /* Add to freelist */
|
ce->cke_state = CLKENT_ST_FREE; /* Add to freelist */
|
||||||
ce->cke_next = cpu.clk.clk_free;
|
ce->cke_next = cpu.clk.clk_free;
|
||||||
@ -594,18 +594,18 @@ clk_synctimeout(void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CLKEVH_RET_QUIET: /* Go quiescent */
|
case CLKEVH_RET_QUIET: /* Go quiescent */
|
||||||
if (ce->cke_prev->cke_next = nce) /* Take off queue */
|
if ((ce->cke_prev->cke_next = nce)) /* Take off queue */
|
||||||
nce->cke_prev = ce->cke_prev;
|
nce->cke_prev = ce->cke_prev;
|
||||||
ce->cke_state = CLKENT_ST_MQUIET; /* Add to quiet list */
|
ce->cke_state = CLKENT_ST_MQUIET; /* Add to quiet list */
|
||||||
ce->cke_prev = (struct clkent *)&cpu.clk.clk_quiet;
|
ce->cke_prev = (struct clkent *)&cpu.clk.clk_quiet;
|
||||||
if (ce->cke_next = cpu.clk.clk_quiet)
|
if ((ce->cke_next = cpu.clk.clk_quiet))
|
||||||
ce->cke_next->cke_prev = ce;
|
ce->cke_next->cke_prev = ce;
|
||||||
cpu.clk.clk_quiet = ce;
|
cpu.clk.clk_quiet = ce;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CLKEVH_RET_REPEAT: /* Put back on queue */
|
case CLKEVH_RET_REPEAT: /* Put back on queue */
|
||||||
if (nce) { /* If other entries exist, */
|
if (nce) { /* If other entries exist, */
|
||||||
if (ce->cke_prev->cke_next = nce) /* Take off queue */
|
if ((ce->cke_prev->cke_next = nce)) /* Take off queue */
|
||||||
nce->cke_prev = ce->cke_prev;
|
nce->cke_prev = ce->cke_prev;
|
||||||
clk_qinsert(ce, &cpu.clk.clk_itickq); /* Put back */
|
clk_qinsert(ce, &cpu.clk.clk_itickq); /* Put back */
|
||||||
} else {
|
} else {
|
||||||
@ -652,7 +652,7 @@ clk_tmrget(int (*rtn)(void *), void *arg, int32 usec)
|
|||||||
{
|
{
|
||||||
register struct clkent *ce;
|
register struct clkent *ce;
|
||||||
|
|
||||||
if (ce = cpu.clk.clk_free) {
|
if ((ce = cpu.clk.clk_free)) {
|
||||||
cpu.clk.clk_free = ce->cke_next;
|
cpu.clk.clk_free = ce->cke_next;
|
||||||
ce->cke_state = CLKENT_ST_MTICK;
|
ce->cke_state = CLKENT_ST_MTICK;
|
||||||
ce->cke_rtn = rtn;
|
ce->cke_rtn = rtn;
|
||||||
@ -692,7 +692,7 @@ clk_itmrget(void (*rtn)(void *), void *arg)
|
|||||||
{
|
{
|
||||||
register struct clkent *ce;
|
register struct clkent *ce;
|
||||||
|
|
||||||
if (ce = cpu.clk.clk_free) { /* Get a free entry */
|
if ((ce = cpu.clk.clk_free)) { /* Get a free entry */
|
||||||
cpu.clk.clk_free = ce->cke_next;
|
cpu.clk.clk_free = ce->cke_next;
|
||||||
ce->cke_rtn = (int (*)(void *)) rtn; /* Set up its value */
|
ce->cke_rtn = (int (*)(void *)) rtn; /* Set up its value */
|
||||||
ce->cke_arg = arg;
|
ce->cke_arg = arg;
|
||||||
@ -700,7 +700,7 @@ clk_itmrget(void (*rtn)(void *), void *arg)
|
|||||||
/* Now add to the itick list */
|
/* Now add to the itick list */
|
||||||
ce->cke_state = CLKENT_ST_ITICK;
|
ce->cke_state = CLKENT_ST_ITICK;
|
||||||
ce->cke_prev = (struct clkent *)&cpu.clk.clk_itickl;
|
ce->cke_prev = (struct clkent *)&cpu.clk.clk_itickl;
|
||||||
if (ce->cke_next = cpu.clk.clk_itickl)
|
if ((ce->cke_next = cpu.clk.clk_itickl))
|
||||||
ce->cke_next->cke_prev = ce;
|
ce->cke_next->cke_prev = ce;
|
||||||
cpu.clk.clk_itickl = ce;
|
cpu.clk.clk_itickl = ce;
|
||||||
}
|
}
|
||||||
@ -781,7 +781,7 @@ clk_tmrquiet(register struct clkent *ce)
|
|||||||
|
|
||||||
/* Add to quiet list */
|
/* Add to quiet list */
|
||||||
ce->cke_prev = (struct clkent *)&cpu.clk.clk_quiet;
|
ce->cke_prev = (struct clkent *)&cpu.clk.clk_quiet;
|
||||||
if (ce->cke_next = cpu.clk.clk_quiet)
|
if ((ce->cke_next = cpu.clk.clk_quiet))
|
||||||
ce->cke_next->cke_prev = ce;
|
ce->cke_next->cke_prev = ce;
|
||||||
cpu.clk.clk_quiet = ce;
|
cpu.clk.clk_quiet = ce;
|
||||||
}
|
}
|
||||||
@ -803,7 +803,7 @@ clk_tmractiv(register struct clkent *ce)
|
|||||||
|
|
||||||
/* Add onto ITICK list */
|
/* Add onto ITICK list */
|
||||||
ce->cke_prev = (struct clkent *)&cpu.clk.clk_itickl;
|
ce->cke_prev = (struct clkent *)&cpu.clk.clk_itickl;
|
||||||
if (ce->cke_next = cpu.clk.clk_itickl)
|
if ((ce->cke_next = cpu.clk.clk_itickl))
|
||||||
ce->cke_next->cke_prev = ce;
|
ce->cke_next->cke_prev = ce;
|
||||||
cpu.clk.clk_itickl = ce;
|
cpu.clk.clk_itickl = ce;
|
||||||
break;
|
break;
|
||||||
@ -878,7 +878,7 @@ clk_qinsert(register struct clkent *ce,
|
|||||||
register struct clkent *nce;
|
register struct clkent *nce;
|
||||||
register clkval_t tim = ce->cke_oticks;
|
register clkval_t tim = ce->cke_oticks;
|
||||||
|
|
||||||
for (nce = pce; nce = nce->cke_next; pce = nce) {
|
for (nce = pce; (nce = nce->cke_next); pce = nce) {
|
||||||
if ((tim -= nce->cke_ticks) < 0) {
|
if ((tim -= nce->cke_ticks) < 0) {
|
||||||
/* Win, must put entry ahead of this one */
|
/* Win, must put entry ahead of this one */
|
||||||
tim += nce->cke_ticks; /* Restore time */
|
tim += nce->cke_ticks; /* Restore time */
|
||||||
@ -891,7 +891,7 @@ clk_qinsert(register struct clkent *ce,
|
|||||||
ce->cke_ticks = tim;
|
ce->cke_ticks = tim;
|
||||||
ce->cke_prev = pce;
|
ce->cke_prev = pce;
|
||||||
pce->cke_next = ce;
|
pce->cke_next = ce;
|
||||||
if (ce->cke_next = nce)
|
if ((ce->cke_next = nce))
|
||||||
nce->cke_prev = ce;
|
nce->cke_prev = ce;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -188,7 +188,7 @@ apr_run(void)
|
|||||||
register int haltval;
|
register int haltval;
|
||||||
|
|
||||||
/* Save return point for APR halt */
|
/* Save return point for APR halt */
|
||||||
if (haltval = _setjmp(aprhaltbuf)) { /* If longjmp back, */
|
if ((haltval = _setjmp(aprhaltbuf))) { /* If longjmp back, */
|
||||||
clk_suspend(); /* stop internal clock */
|
clk_suspend(); /* stop internal clock */
|
||||||
return haltval; /* return from running APR */
|
return haltval; /* return from running APR */
|
||||||
}
|
}
|
||||||
@ -314,7 +314,7 @@ apr_fly(void)
|
|||||||
vp = vm_xeamap(PC_VADDR, VMF_FETCH); /* Do mapping, may fault */
|
vp = vm_xeamap(PC_VADDR, VMF_FETCH); /* Do mapping, may fault */
|
||||||
/* Remember start of page or ac block */
|
/* Remember start of page or ac block */
|
||||||
cpu.mr_cachevp = vp - (pc & PAG_MASK);
|
cpu.mr_cachevp = vp - (pc & PAG_MASK);
|
||||||
if (cachelo = (pc & (H10MASK & ~PAG_MASK))) {
|
if ((cachelo = (pc & (H10MASK & ~PAG_MASK)))) {
|
||||||
/* Normal page reference */
|
/* Normal page reference */
|
||||||
cachehi = cachelo | PAG_MASK;
|
cachehi = cachelo | PAG_MASK;
|
||||||
} else if (pc > AC_17) { /* Page 0, special handling */
|
} else if (pc > AC_17) { /* Page 0, special handling */
|
||||||
@ -493,7 +493,7 @@ apr_check(void)
|
|||||||
/* Check for PI requests */
|
/* Check for PI requests */
|
||||||
{
|
{
|
||||||
register int pilev;
|
register int pilev;
|
||||||
if (pilev = pi_check()) /* If PI interrupt requested, */
|
if ((pilev = pi_check())) /* If PI interrupt requested, */
|
||||||
pi_xct(pilev); /* handle it! */
|
pi_xct(pilev); /* handle it! */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1814,7 +1814,7 @@ tim_klupdate(void *ignored) /* Arg is unused */
|
|||||||
cpu.tim.tim_intcnt = 0; /* Reset countup */
|
cpu.tim.tim_intcnt = 0; /* Reset countup */
|
||||||
|
|
||||||
cpu.tim.tim_flgs |= TIM_RDONE; /* "Timer Interval Done" */
|
cpu.tim.tim_flgs |= TIM_RDONE; /* "Timer Interval Done" */
|
||||||
if (cpu.pi.pilev_timreq |= cpu.tim.tim_lev) /* Add PI if any */
|
if ((cpu.pi.pilev_timreq |= cpu.tim.tim_lev)) /* Add PI if any */
|
||||||
pi_devupd(); /* Check to trigger intrupt */
|
pi_devupd(); /* Check to trigger intrupt */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2364,7 +2364,7 @@ ioinsdef(io_wrpi)
|
|||||||
void
|
void
|
||||||
pi_devupd(void)
|
pi_devupd(void)
|
||||||
{
|
{
|
||||||
if (cpu.pi.pilev_dreq = (cpu.pi.pilev_aprreq
|
if ((cpu.pi.pilev_dreq = (cpu.pi.pilev_aprreq
|
||||||
#if KLH10_CPU_KS
|
#if KLH10_CPU_KS
|
||||||
| cpu.pi.pilev_ub1req | cpu.pi.pilev_ub3req
|
| cpu.pi.pilev_ub1req | cpu.pi.pilev_ub3req
|
||||||
#elif KLH10_CPU_KL
|
#elif KLH10_CPU_KL
|
||||||
@ -2373,7 +2373,7 @@ pi_devupd(void)
|
|||||||
| cpu.pi.pilev_dtereq
|
| cpu.pi.pilev_dtereq
|
||||||
| cpu.pi.pilev_diareq
|
| cpu.pi.pilev_diareq
|
||||||
#endif
|
#endif
|
||||||
)) {
|
))) {
|
||||||
INSBRKSET();
|
INSBRKSET();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -745,7 +745,7 @@ dev_define(FILE *of, char *name, char *sdev, char *sdrv, char *args)
|
|||||||
** Syntax is a bit peculiar, depends on # of components.
|
** Syntax is a bit peculiar, depends on # of components.
|
||||||
** If 2, 1st must be an existing device name and the 2nd a plain number.
|
** If 2, 1st must be an existing device name and the 2nd a plain number.
|
||||||
*/
|
*/
|
||||||
if (cp = strchr(sdev, '.')) {
|
if ((cp = strchr(sdev, '.'))) {
|
||||||
char dnbuf[100];
|
char dnbuf[100];
|
||||||
int i = cp - sdev;
|
int i = cp - sdev;
|
||||||
|
|
||||||
@ -1120,7 +1120,7 @@ dev_debug(FILE *of,
|
|||||||
#if KLH10_DEV_DP
|
#if KLH10_DEV_DP
|
||||||
fprintf(of, " %6s = %d\n", def->dev_name,
|
fprintf(of, " %6s = %d\n", def->dev_name,
|
||||||
def->dev_dv->dv_debug);
|
def->dev_dv->dv_debug);
|
||||||
if (dp = def->dev_dv->dv_dpp) {
|
if ((dp = def->dev_dv->dv_dpp)) {
|
||||||
fprintf(of, " %6s.dp = ", def->dev_name);
|
fprintf(of, " %6s.dp = ", def->dev_name);
|
||||||
if (dp->dp_adr)
|
if (dp->dp_adr)
|
||||||
fprintf(of, "%d\n", dp->dp_adr->dpc_debug);
|
fprintf(of, "%d\n", dp->dp_adr->dpc_debug);
|
||||||
@ -1599,7 +1599,7 @@ dev_evreg(register struct device *d,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Find new entry in evreg table */
|
/* Find new entry in evreg table */
|
||||||
if (evr = evregfree) { /* Pluck from freelist */
|
if ((evr = evregfree)) { /* Pluck from freelist */
|
||||||
evregfree = evr->dver_next; /* Freelist is one-way, no prev */
|
evregfree = evr->dver_next; /* Freelist is one-way, no prev */
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "[dev_evreg: out of table entries!]\r\n");
|
fprintf(stderr, "[dev_evreg: out of table entries!]\r\n");
|
||||||
@ -1642,14 +1642,14 @@ dev_evreg(register struct device *d,
|
|||||||
INTF_INIT(evs->dves_intf);
|
INTF_INIT(evs->dves_intf);
|
||||||
evs->dves_reglist = NULL;
|
evs->dves_reglist = NULL;
|
||||||
evs->dves_prev = NULL;
|
evs->dves_prev = NULL;
|
||||||
if (evs->dves_next = evsiglist) /* Add to head of list */
|
if ((evs->dves_next = evsiglist)) /* Add to head of list */
|
||||||
evsiglist->dves_prev = evs;
|
evsiglist->dves_prev = evs;
|
||||||
evsiglist = evs;
|
evsiglist = evs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now add handler to list for this signal */
|
/* Now add handler to list for this signal */
|
||||||
evr->dver_prev = NULL;
|
evr->dver_prev = NULL;
|
||||||
if (evr->dver_next = evs->dves_reglist) /* Add to head of list */
|
if ((evr->dver_next = evs->dves_reglist))/* Add to head of list */
|
||||||
evr->dver_next->dver_prev = evr;
|
evr->dver_next->dver_prev = evr;
|
||||||
evs->dves_reglist = evr;
|
evs->dves_reglist = evr;
|
||||||
|
|
||||||
|
|||||||
@ -367,8 +367,8 @@ int op10ffo(register w10_t w)
|
|||||||
register int i;
|
register int i;
|
||||||
register uint18 reg; /* Need unsigned for shifting */
|
register uint18 reg; /* Need unsigned for shifting */
|
||||||
|
|
||||||
if (reg = LHGET(w)) i = 17; /* Find right halfword and set up */
|
if ((reg = LHGET(w))) i = 17; /* Find right halfword and set up */
|
||||||
else if (reg = RHGET(w)) i = 17+18;
|
else if ((reg = RHGET(w))) i = 17+18;
|
||||||
else return 36;
|
else return 36;
|
||||||
|
|
||||||
while (reg >>= 1) --i;
|
while (reg >>= 1) --i;
|
||||||
@ -397,10 +397,10 @@ static int adffo(register dw10_t d)
|
|||||||
register int i;
|
register int i;
|
||||||
register uint18 reg; /* Need unsigned for shifting */
|
register uint18 reg; /* Need unsigned for shifting */
|
||||||
|
|
||||||
if (reg = LHGET(d.HI)) i = 17; /* Find right halfword and set up */
|
if ((reg = LHGET(d.HI))) i = 17; /* Find right halfword and set up */
|
||||||
else if (reg = RHGET(d.HI)) i = 17+18;
|
else if ((reg = RHGET(d.HI))) i = 17+18;
|
||||||
else if (reg = (LHGET(d.LO)&H10MAGS)) i = 17+36-1;
|
else if ((reg = (LHGET(d.LO)&H10MAGS))) i = 17+36-1;
|
||||||
else if (reg = RHGET(d.LO)) i = 17+36+18-1;
|
else if ((reg = RHGET(d.LO))) i = 17+36+18-1;
|
||||||
else return 36+36-1;
|
else return 36+36-1;
|
||||||
|
|
||||||
while (reg >>= 1) --i;
|
while (reg >>= 1) --i;
|
||||||
@ -1105,7 +1105,7 @@ w10_t op10imul(register w10_t a, register w10_t b)
|
|||||||
register dw10_t d;
|
register dw10_t d;
|
||||||
register int sign;
|
register int sign;
|
||||||
|
|
||||||
if (sign = wskipl(a)) /* Make args positive, remember signs */
|
if ((sign = wskipl(a))) /* Make args positive, remember signs */
|
||||||
op10m_movn(a);
|
op10m_movn(a);
|
||||||
if (wskipl(b)) {
|
if (wskipl(b)) {
|
||||||
sign = !sign;
|
sign = !sign;
|
||||||
@ -1141,7 +1141,7 @@ dw10_t op10mul(register w10_t a, register w10_t b)
|
|||||||
register dw10_t d;
|
register dw10_t d;
|
||||||
register int sign;
|
register int sign;
|
||||||
|
|
||||||
if (sign = wskipl(a))
|
if ((sign = wskipl(a)))
|
||||||
op10m_movn(a);
|
op10m_movn(a);
|
||||||
if (wskipl(b)) {
|
if (wskipl(b)) {
|
||||||
sign = !sign;
|
sign = !sign;
|
||||||
@ -1275,7 +1275,7 @@ int op10xidiv(dw10_t *ad,
|
|||||||
|
|
||||||
ad->LO = a;
|
ad->LO = a;
|
||||||
ad->HI = wskipl(a) ? w10mask : w10zero;
|
ad->HI = wskipl(a) ? w10mask : w10zero;
|
||||||
if (r = x_div(ad, b))
|
if ((r = x_div(ad, b)))
|
||||||
return r; /* Success */
|
return r; /* Success */
|
||||||
|
|
||||||
/* Failure is only possible if A is 1<<35 and B is 1, 0, or -1.
|
/* Failure is only possible if A is 1<<35 and B is 1, 0, or -1.
|
||||||
@ -1347,9 +1347,9 @@ static int x_div(
|
|||||||
** the result will be that same number. Don't bother checking here
|
** the result will be that same number. Don't bother checking here
|
||||||
** as the initial dividend/divisor comparison test should catch them.
|
** as the initial dividend/divisor comparison test should catch them.
|
||||||
*/
|
*/
|
||||||
if (numsign = wskipl(d.HI))
|
if ((numsign = wskipl(d.HI)))
|
||||||
op10m_dmovn(d); /* Make positive (unless 1<<35) */
|
op10m_dmovn(d); /* Make positive (unless 1<<35) */
|
||||||
if (densign = wskipl(w))
|
if ((densign = wskipl(w)))
|
||||||
op10m_movn(w); /* Get absolute value, ignore max neg */
|
op10m_movn(w); /* Get absolute value, ignore max neg */
|
||||||
|
|
||||||
/* Check for zero divisor, otherwise initial test could pass if
|
/* Check for zero divisor, otherwise initial test could pass if
|
||||||
@ -1587,7 +1587,7 @@ qw10_t op10dmul(register dw10_t da, register dw10_t db)
|
|||||||
{
|
{
|
||||||
register int sign;
|
register int sign;
|
||||||
|
|
||||||
if (sign = wskipl(da.HI))
|
if ((sign = wskipl(da.HI)))
|
||||||
op10m_dneg(da);
|
op10m_dneg(da);
|
||||||
if (wskipl(db.HI)) {
|
if (wskipl(db.HI)) {
|
||||||
sign = !sign;
|
sign = !sign;
|
||||||
@ -1695,9 +1695,9 @@ qw10_t op10ddiv(
|
|||||||
** the result will be that same number. Don't bother checking here
|
** the result will be that same number. Don't bother checking here
|
||||||
** as the initial dividend/divisor comparison test should catch them.
|
** as the initial dividend/divisor comparison test should catch them.
|
||||||
*/
|
*/
|
||||||
if (numsign = wskipl(qw.D0.HI))
|
if ((numsign = wskipl(qw.D0.HI)))
|
||||||
qw = x_qneg(qw);
|
qw = x_qneg(qw);
|
||||||
if (densign = wskipl(d.HI))
|
if ((densign = wskipl(d.HI)))
|
||||||
op10m_dmovn(d);
|
op10m_dmovn(d);
|
||||||
|
|
||||||
/* Check for zero divisor */
|
/* Check for zero divisor */
|
||||||
@ -1793,7 +1793,7 @@ qw10_t op10ddiv(
|
|||||||
|
|
||||||
#define SF_POSSETUP(sign, exp, w) \
|
#define SF_POSSETUP(sign, exp, w) \
|
||||||
exp = SFEGET(w); /* Get sign and exponent */\
|
exp = SFEGET(w); /* Get sign and exponent */\
|
||||||
if (sign = (exp & SFESIGN)) { /* Negative? */\
|
if ((sign = (exp & SFESIGN))) { /* Negative? */\
|
||||||
exp = exp ^ SFEMASK; /* If so, get ones-complement, and */\
|
exp = exp ^ SFEMASK; /* If so, get ones-complement, and */\
|
||||||
op10m_tlo(w, SFELHF); /* propagate sign thru exp */\
|
op10m_tlo(w, SFELHF); /* propagate sign thru exp */\
|
||||||
op10m_movn(w); /* and make positive */\
|
op10m_movn(w); /* and make positive */\
|
||||||
@ -1811,7 +1811,7 @@ qw10_t op10ddiv(
|
|||||||
|
|
||||||
#define SF_DPOSSETUP(sign, exp, d) \
|
#define SF_DPOSSETUP(sign, exp, d) \
|
||||||
exp = SFEGET((d).HI); /* Get sign and exponent */\
|
exp = SFEGET((d).HI); /* Get sign and exponent */\
|
||||||
if (sign = (exp & SFESIGN)) { /* Negative? */\
|
if ((sign = (exp & SFESIGN))) { /* Negative? */\
|
||||||
exp = exp ^ SFEMASK; /* If so, get ones-complement, and */\
|
exp = exp ^ SFEMASK; /* If so, get ones-complement, and */\
|
||||||
op10m_tlo((d).HI, SFELHF); /* propagate sign thru exp */\
|
op10m_tlo((d).HI, SFELHF); /* propagate sign thru exp */\
|
||||||
op10m_dmovn(d); /* and make positive */\
|
op10m_dmovn(d); /* and make positive */\
|
||||||
@ -1876,7 +1876,7 @@ qw10_t op10ddiv(
|
|||||||
|
|
||||||
#define GF_DPOSSETUP(sign, exp, d) \
|
#define GF_DPOSSETUP(sign, exp, d) \
|
||||||
exp = GFEGET((d).HI); /* Get sign and exponent */\
|
exp = GFEGET((d).HI); /* Get sign and exponent */\
|
||||||
if (sign = (exp & GFESIGN)) { /* Negative? */\
|
if ((sign = (exp & GFESIGN))) { /* Negative? */\
|
||||||
exp = exp ^ GFEMASK; /* If so, get ones-complement, and */\
|
exp = exp ^ GFEMASK; /* If so, get ones-complement, and */\
|
||||||
op10m_tlo((d).HI, GFELHF); /* propagate sign thru exp */\
|
op10m_tlo((d).HI, GFELHF); /* propagate sign thru exp */\
|
||||||
op10m_dmovn(d); /* and make positive */\
|
op10m_dmovn(d); /* and make positive */\
|
||||||
@ -2194,7 +2194,7 @@ int op10xfdv(w10_t *aw,
|
|||||||
|
|
||||||
/* Make operands positive and remember sign of result */
|
/* Make operands positive and remember sign of result */
|
||||||
|
|
||||||
if (sign = wskipl(a)) { /* Negative? */
|
if ((sign = wskipl(a))) { /* Negative? */
|
||||||
op10m_movn(a); /* Then make positive */
|
op10m_movn(a); /* Then make positive */
|
||||||
if (wskipl(a)) { /* If numerator is max neg value, */
|
if (wskipl(a)) { /* If numerator is max neg value, */
|
||||||
OP10_PCFSET(PCF_ARO+PCF_TR1+PCF_FOV+PCF_DIV);
|
OP10_PCFSET(PCF_ARO+PCF_TR1+PCF_FOV+PCF_DIV);
|
||||||
@ -2526,7 +2526,7 @@ static w10_t sfnorm(register int exp,
|
|||||||
*/
|
*/
|
||||||
register int sign;
|
register int sign;
|
||||||
|
|
||||||
if (sign = wskipl(w))
|
if ((sign = wskipl(w)))
|
||||||
op10m_movn(w); /* Negate the fraction, max neg is OK. */
|
op10m_movn(w); /* Negate the fraction, max neg is OK. */
|
||||||
i = op10ffo(w);
|
i = op10ffo(w);
|
||||||
|
|
||||||
@ -3858,7 +3858,7 @@ static dw10_t gfnorm(register int exp,
|
|||||||
** shift. This won't work here because ASHC looks at the sign bit,
|
** shift. This won't work here because ASHC looks at the sign bit,
|
||||||
** hence the trickery here to ensure the sign is always 0.
|
** hence the trickery here to ensure the sign is always 0.
|
||||||
*/
|
*/
|
||||||
if (sign = wskipl(d.HI)) {
|
if ((sign = wskipl(d.HI))) {
|
||||||
op10m_dmovn(d); /* Negate the fraction. */
|
op10m_dmovn(d); /* Negate the fraction. */
|
||||||
if (wskipl(d.HI)) { /* If still negative, */
|
if (wskipl(d.HI)) { /* If still negative, */
|
||||||
++exp; /* adjust exponent and value */
|
++exp; /* adjust exponent and value */
|
||||||
|
|||||||
@ -1070,7 +1070,7 @@ insdef(i_map)
|
|||||||
return i_muuo(op, ac, e);
|
return i_muuo(op, ac, e);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (vmp = pag_refill(cpu.vmap.xrw, e, VMF_NOTRAP)) {
|
if ((vmp = pag_refill(cpu.vmap.xrw, e, VMF_NOTRAP))) {
|
||||||
pa = vmp - cpu.physmem; /* Recover physical addr */
|
pa = vmp - cpu.physmem; /* Recover physical addr */
|
||||||
pfent = cpu.pag.pr_flh; /* And fetch access bits for page */
|
pfent = cpu.pag.pr_flh; /* And fetch access bits for page */
|
||||||
|
|
||||||
@ -1547,7 +1547,7 @@ pag_refill(register pment_t *p, /* Page map pointer */
|
|||||||
/* Read-modify-write cycles request VMF_WRITE only, so
|
/* Read-modify-write cycles request VMF_WRITE only, so
|
||||||
** assume ABK_READ hits whether or not VMF_READ is on
|
** assume ABK_READ hits whether or not VMF_READ is on
|
||||||
*/
|
*/
|
||||||
&& ((f & VMF_WRITE) && (cpu.mr_abk_cond & ABK_WRITE)
|
&& (((f & VMF_WRITE) && (cpu.mr_abk_cond & ABK_WRITE))
|
||||||
|| ((f & VMF_IFETCH) ? (cpu.mr_abk_cond & ABK_IFETCH)
|
|| ((f & VMF_IFETCH) ? (cpu.mr_abk_cond & ABK_IFETCH)
|
||||||
: (cpu.mr_abk_cond & ABK_READ)))) {
|
: (cpu.mr_abk_cond & ABK_READ)))) {
|
||||||
cpu.pag.pr_flh = PMF_ADRERR; /* report address break */
|
cpu.pag.pr_flh = PMF_ADRERR; /* report address break */
|
||||||
@ -1565,7 +1565,7 @@ pag_refill(register pment_t *p, /* Page map pointer */
|
|||||||
/* Note page number passed to pag_t20map is the FULL XA page, which on
|
/* Note page number passed to pag_t20map is the FULL XA page, which on
|
||||||
** a KL is 12+9=21 bits, not the supported 5+9=14 virtual.
|
** a KL is 12+9=21 bits, not the supported 5+9=14 virtual.
|
||||||
*/
|
*/
|
||||||
if (vmp = pag_t20map(p, vpag, (f & VMF_ACC))) /* Try mapping */
|
if ((vmp = pag_t20map(p, vpag, (f & VMF_ACC)))) /* Try mapping */
|
||||||
return vmp + va_pagoff(e); /* Won, return mapped ptr! */
|
return vmp + va_pagoff(e); /* Won, return mapped ptr! */
|
||||||
|
|
||||||
/* Ugh, analyze error far enough to build page fail word LH bits,
|
/* Ugh, analyze error far enough to build page fail word LH bits,
|
||||||
|
|||||||
@ -1489,7 +1489,7 @@ os_tmget(register struct tm *tm, int *zone)
|
|||||||
* -1 local time is 1 day behind UTC, offset -24 hours
|
* -1 local time is 1 day behind UTC, offset -24 hours
|
||||||
* -36x local time is January 1, UTC is December 31, offset +24 hours
|
* -36x local time is January 1, UTC is December 31, offset +24 hours
|
||||||
*/
|
*/
|
||||||
if (julian = (tm->tm_yday - julian))
|
if ((julian = (tm->tm_yday - julian)))
|
||||||
zn += ((julian < 0) == (abs(julian) == 1)) ? -24*60 : 24*60;
|
zn += ((julian < 0) == (abs(julian) == 1)) ? -24*60 : 24*60;
|
||||||
|
|
||||||
/* At this point zn contains the numer of minutes east of UTC in local
|
/* At this point zn contains the numer of minutes east of UTC in local
|
||||||
|
|||||||
10
src/prmstr.c
10
src/prmstr.c
@ -394,7 +394,7 @@ s_towd(char *str,
|
|||||||
long num; /* Known to be at least 32 bits */
|
long num; /* Known to be at least 32 bits */
|
||||||
register char *cp;
|
register char *cp;
|
||||||
|
|
||||||
if (cp = strchr(str, ',')) {
|
if ((cp = strchr(str, ','))) {
|
||||||
*cp++ = 0;
|
*cp++ = 0;
|
||||||
if (*cp == ',') cp++;
|
if (*cp == ',') cp++;
|
||||||
if (s_tonum(str, &num))
|
if (s_tonum(str, &num))
|
||||||
@ -464,7 +464,7 @@ prm_next(register struct prmstate_s *p)
|
|||||||
return PRMK_DONE; /* No more tokens, input done! */
|
return PRMK_DONE; /* No more tokens, input done! */
|
||||||
|
|
||||||
/* Split off value, if any */
|
/* Split off value, if any */
|
||||||
if (p->prm_val = strchr(cp, '='))
|
if ((p->prm_val = strchr(cp, '=')))
|
||||||
*(p->prm_val)++ = '\0';
|
*(p->prm_val)++ = '\0';
|
||||||
|
|
||||||
/* Look up name in keyword table */
|
/* Look up name in keyword table */
|
||||||
@ -505,7 +505,7 @@ s_xkeylookup(char *cp, /* Keyword to look up */
|
|||||||
k1 = k2 = NULL;
|
k1 = k2 = NULL;
|
||||||
kx1 = kx2 = PRMK_NONE;
|
kx1 = kx2 = PRMK_NONE;
|
||||||
if (*cp) {
|
if (*cp) {
|
||||||
for (kidx = 0; ts = ((struct prmkey_s *)keytab)->prmk_key;
|
for (kidx = 0; (ts = ((struct prmkey_s *)keytab)->prmk_key);
|
||||||
kidx++,
|
kidx++,
|
||||||
keytab = (voidp_t)(((char *)keytab) + keysiz)) {
|
keytab = (voidp_t)(((char *)keytab) + keysiz)) {
|
||||||
switch (s_match(cp, ts)) {
|
switch (s_match(cp, ts)) {
|
||||||
@ -679,7 +679,7 @@ s_match(register char *s1,
|
|||||||
{
|
{
|
||||||
register int c1, c2;
|
register int c1, c2;
|
||||||
|
|
||||||
while (c1 = *s1++) {
|
while ((c1 = *s1++)) {
|
||||||
if (isupper(c1)) /* Must test with isupper cuz some */
|
if (isupper(c1)) /* Must test with isupper cuz some */
|
||||||
c1 = tolower(c1); /* implementations fuck up otherwise */
|
c1 = tolower(c1); /* implementations fuck up otherwise */
|
||||||
if (isupper(c2 = *s2++))
|
if (isupper(c2 = *s2++))
|
||||||
@ -701,7 +701,7 @@ s_dup(register char *s)
|
|||||||
|
|
||||||
if (!s)
|
if (!s)
|
||||||
return NULL;
|
return NULL;
|
||||||
if (cp = (char *)malloc(strlen(s)+1))
|
if ((cp = (char *)malloc(strlen(s)+1)))
|
||||||
strcpy(cp, s);
|
strcpy(cp, s);
|
||||||
return cp;
|
return cp;
|
||||||
}
|
}
|
||||||
|
|||||||
10
src/tapedd.c
10
src/tapedd.c
@ -394,7 +394,7 @@ main(int argc, char **argv)
|
|||||||
dvo.d_vmt.mt_errhan = errhan;
|
dvo.d_vmt.mt_errhan = errhan;
|
||||||
dvo.d_vmt.mt_errarg = &dvo.d_vmt;
|
dvo.d_vmt.mt_errarg = &dvo.d_vmt;
|
||||||
|
|
||||||
if (ret = cmdsget(argc, argv)) /* Parse and handle command line */
|
if ((ret = cmdsget(argc, argv))) /* Parse and handle command line */
|
||||||
exit(ret);
|
exit(ret);
|
||||||
|
|
||||||
|
|
||||||
@ -673,7 +673,7 @@ cmdsget(int ac, char **av)
|
|||||||
dvi.d_istape = dvo.d_istape = MTYP_NULL;
|
dvi.d_istape = dvo.d_istape = MTYP_NULL;
|
||||||
|
|
||||||
while (--ac > 0 && (cp = *++av)) {
|
while (--ac > 0 && (cp = *++av)) {
|
||||||
if (arg = strchr(cp, '=')) /* If arg furnished for param, */
|
if ((arg = strchr(cp, '='))) /* If arg furnished for param, */
|
||||||
*arg++ = '\0'; /* split arg off */
|
*arg++ = '\0'; /* split arg off */
|
||||||
if ((plen = strlen(cp)) <= 0)
|
if ((plen = strlen(cp)) <= 0)
|
||||||
break; /* Bad param */
|
break; /* Bad param */
|
||||||
@ -992,7 +992,7 @@ int devopen(register struct dev *d, int wrtf)
|
|||||||
|
|
||||||
|
|
||||||
/* Set default buffer length */
|
/* Set default buffer length */
|
||||||
if (d->d_blen = d->d_vmt.mt_tdr.tdmaxrsiz) {
|
if ((d->d_blen = d->d_vmt.mt_tdr.tdmaxrsiz)) {
|
||||||
if (d->d_recsiz) { /* Explicit record size spec? */
|
if (d->d_recsiz) { /* Explicit record size spec? */
|
||||||
if (d->d_blen <= d->d_recsiz) /* If it's bigger, */
|
if (d->d_blen <= d->d_recsiz) /* If it's bigger, */
|
||||||
d->d_blen = d->d_recsiz; /* adjust quietly */
|
d->d_blen = d->d_recsiz; /* adjust quietly */
|
||||||
@ -1096,7 +1096,7 @@ int devread(struct dev *d)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d->d_vmt.mt_frames = d->mta_frms) { /* Read any data? */
|
if ((d->d_vmt.mt_frames = d->mta_frms)) { /* Read any data? */
|
||||||
d->d_buse = d->mta_frms; /* Say this much of buffer used */
|
d->d_buse = d->mta_frms; /* Say this much of buffer used */
|
||||||
d->d_iop = d->d_buff;
|
d->d_iop = d->d_buff;
|
||||||
}
|
}
|
||||||
@ -1131,7 +1131,7 @@ int devwrite(struct dev *d, unsigned char *buff, rsiz_t len)
|
|||||||
|
|
||||||
if (len) {
|
if (len) {
|
||||||
if (d->d_istape == MTYP_VIRT) {
|
if (d->d_istape == MTYP_VIRT) {
|
||||||
if (ret = vmt_rput(&(d->d_vmt), buff, (size_t)len)) {
|
if ((ret = vmt_rput(&(d->d_vmt), buff, (size_t)len))) {
|
||||||
d->d_tloc += len;
|
d->d_tloc += len;
|
||||||
d->d_recs++;
|
d->d_recs++;
|
||||||
d->d_frecs++;
|
d->d_frecs++;
|
||||||
|
|||||||
@ -449,7 +449,7 @@ its2unixfn(register char *cp,
|
|||||||
{
|
{
|
||||||
register int ch;
|
register int ch;
|
||||||
|
|
||||||
while (ch = *itsfn++) {
|
while ((ch = *itsfn++)) {
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case '/': ch = '{'; break;
|
case '/': ch = '{'; break;
|
||||||
case ' ': ch = '~'; break;
|
case ' ': ch = '~'; break;
|
||||||
@ -473,7 +473,7 @@ fn6quot(register char *fn)
|
|||||||
register char *cp = cbuf;
|
register char *cp = cbuf;
|
||||||
register int c;
|
register int c;
|
||||||
|
|
||||||
while (c = *fnp++) {
|
while ((c = *fnp++)) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case ' ': c = '~'; break;
|
case ' ': c = '~'; break;
|
||||||
#if 0
|
#if 0
|
||||||
@ -600,7 +600,7 @@ lread(register FILE *f)
|
|||||||
lp->ltyp = LT_LIST;
|
lp->ltyp = LT_LIST;
|
||||||
if ((head->lval.lvl = lp = lread(f)) == NIL)
|
if ((head->lval.lvl = lp = lread(f)) == NIL)
|
||||||
return head; /* Return empty list */
|
return head; /* Return empty list */
|
||||||
while(lp2 = lread(f)) {
|
while ((lp2 = lread(f))) {
|
||||||
lp->lnxt = lp2;
|
lp->lnxt = lp2;
|
||||||
lp = lp2;
|
lp = lp2;
|
||||||
}
|
}
|
||||||
@ -742,8 +742,8 @@ ustrcmp(register char *s1, register char *s2)
|
|||||||
|
|
||||||
for (; *s1; ++s1, ++s2) {
|
for (; *s1; ++s1, ++s2) {
|
||||||
if (*s1 != *s2) {
|
if (*s1 != *s2) {
|
||||||
if (res = (islower(*s1) ? toupper(*s1) : *s1)
|
if ((res = (islower(*s1) ? toupper(*s1) : *s1)
|
||||||
- (islower(*s2) ? toupper(*s2) : *s2))
|
- (islower(*s2) ? toupper(*s2) : *s2)))
|
||||||
return res; /* Failed */
|
return res; /* Failed */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -267,7 +267,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
dvi.d_fmt = dvo.d_fmt = -1;
|
dvi.d_fmt = dvo.d_fmt = -1;
|
||||||
|
|
||||||
if (ret = cmdsget(argc, argv)) /* Parse and handle command line */
|
if ((ret = cmdsget(argc, argv))) /* Parse and handle command line */
|
||||||
exit(ret);
|
exit(ret);
|
||||||
|
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ main(int argc, char **argv)
|
|||||||
/* Do it! */
|
/* Do it! */
|
||||||
fprintf(logfile, "; Copying from \"%s\" to \"%s\"...\n", dvi.d_path,
|
fprintf(logfile, "; Copying from \"%s\" to \"%s\"...\n", dvi.d_path,
|
||||||
dvo.d_path ? dvo.d_path : NULLDEV);
|
dvo.d_path ? dvo.d_path : NULLDEV);
|
||||||
if (ret = docopy())
|
if ((ret = docopy()))
|
||||||
ret = devclose(&dvo);
|
ret = devclose(&dvo);
|
||||||
else (void) devclose(&dvo);
|
else (void) devclose(&dvo);
|
||||||
|
|
||||||
@ -421,7 +421,7 @@ cmdsget(int ac, char **av)
|
|||||||
dvi.d_isdisk = dvo.d_isdisk = MTYP_NULL;
|
dvi.d_isdisk = dvo.d_isdisk = MTYP_NULL;
|
||||||
|
|
||||||
while (--ac > 0 && (cp = *++av)) {
|
while (--ac > 0 && (cp = *++av)) {
|
||||||
if (arg = strchr(cp, '=')) /* If arg furnished for param, */
|
if ((arg = strchr(cp, '='))) /* If arg furnished for param, */
|
||||||
*arg++ = '\0'; /* split arg off */
|
*arg++ = '\0'; /* split arg off */
|
||||||
if ((plen = strlen(cp)) <= 0)
|
if ((plen = strlen(cp)) <= 0)
|
||||||
break; /* Bad param */
|
break; /* Bad param */
|
||||||
|
|||||||
30
src/vmtape.c
30
src/vmtape.c
@ -738,7 +738,7 @@ vmt_crmount(register struct vmtape *t,
|
|||||||
goto badret;
|
goto badret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (df = fopen(dfn, "rb")) {
|
if ((df = fopen(dfn, "rb"))) {
|
||||||
vmterror(t, "Tape data file \"%.256s\" already exists", dfn);
|
vmterror(t, "Tape data file \"%.256s\" already exists", dfn);
|
||||||
goto badret;
|
goto badret;
|
||||||
}
|
}
|
||||||
@ -823,7 +823,7 @@ vmt_rdmount(register struct vmtape *t,
|
|||||||
/* Unknown at this point implies no explicit format spec AND
|
/* Unknown at this point implies no explicit format spec AND
|
||||||
no recognizable extension.
|
no recognizable extension.
|
||||||
*/
|
*/
|
||||||
if (cf = fopen(ta->vmta_path, "r")) {
|
if ((cf = fopen(ta->vmta_path, "r"))) {
|
||||||
cfn = ta->vmta_path;
|
cfn = ta->vmta_path;
|
||||||
} else {
|
} else {
|
||||||
/* Non-ex file. If no ext in path, try all possible ctl
|
/* Non-ex file. If no ext in path, try all possible ctl
|
||||||
@ -846,7 +846,7 @@ vmt_rdmount(register struct vmtape *t,
|
|||||||
vmterror(t, "malloc failed for tape pathname");
|
vmterror(t, "malloc failed for tape pathname");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
if (cf = fopen(cfn, "r"))
|
if ((cf = fopen(cfn, "r")))
|
||||||
break;
|
break;
|
||||||
free(cfn);
|
free(cfn);
|
||||||
}
|
}
|
||||||
@ -861,7 +861,7 @@ vmt_rdmount(register struct vmtape *t,
|
|||||||
/* Opened cfn with stream f, now verify it specially so if
|
/* Opened cfn with stream f, now verify it specially so if
|
||||||
it doesn't look like a control file we can try something else.
|
it doesn't look like a control file we can try something else.
|
||||||
*/
|
*/
|
||||||
if (fmt = fmtexamine(t, cf, VMT_FMT_CTL)) {
|
if ((fmt = fmtexamine(t, cf, VMT_FMT_CTL))) {
|
||||||
/* Looks like control file! */
|
/* Looks like control file! */
|
||||||
goto havectl;
|
goto havectl;
|
||||||
}
|
}
|
||||||
@ -1083,7 +1083,7 @@ genpath(struct vmtape *t,
|
|||||||
blen = (s - base) - 1; /* then replace sep-char & ext! */
|
blen = (s - base) - 1; /* then replace sep-char & ext! */
|
||||||
else blen = strlen(base); /* No ext, append to whole name */
|
else blen = strlen(base); /* No ext, append to whole name */
|
||||||
|
|
||||||
if (fn = malloc(blen+1+strlen(newext)+1)) {
|
if ((fn = malloc(blen+1+strlen(newext)+1))) {
|
||||||
memcpy(fn, base, blen);
|
memcpy(fn, base, blen);
|
||||||
s = fn + blen;
|
s = fn + blen;
|
||||||
*s++ = OSD_PATH_EXTSEPCHAR;
|
*s++ = OSD_PATH_EXTSEPCHAR;
|
||||||
@ -1198,7 +1198,7 @@ fmtexamine(struct vmtape *t, FILE *f, int fmt)
|
|||||||
|| (fmt == VMT_FMT_TPC)) {
|
|| (fmt == VMT_FMT_TPC)) {
|
||||||
/* Check for TPC */
|
/* Check for TPC */
|
||||||
for (i = 0; i < n; i += 2) {
|
for (i = 0; i < n; i += 2) {
|
||||||
if (cnt = VMT_TPC_COUNT(&buff[i]))
|
if ((cnt = VMT_TPC_COUNT(&buff[i])))
|
||||||
i += (cnt&01) ? (cnt+1) : cnt;
|
i += (cnt&01) ? (cnt+1) : cnt;
|
||||||
}
|
}
|
||||||
if (i == n) /* Verify no overrun */
|
if (i == n) /* Verify no overrun */
|
||||||
@ -1618,7 +1618,7 @@ datf_open(register struct vmtape *t,
|
|||||||
if (!popenquote(cp, VMTPIPECMDQUOT, sizeof(cmdbuf)-VMTPIPECMD_MAX))
|
if (!popenquote(cp, VMTPIPECMDQUOT, sizeof(cmdbuf)-VMTPIPECMD_MAX))
|
||||||
return FALSE; /* Couldn't quote, shouldn't happen */
|
return FALSE; /* Couldn't quote, shouldn't happen */
|
||||||
|
|
||||||
if (t->mt_datf = popen(cmdbuf, (*mode == 'r') ? "r" : "w"))
|
if ((t->mt_datf = popen(cmdbuf, (*mode == 'r') ? "r" : "w")))
|
||||||
t->mt_ispipe = TRUE;
|
t->mt_ispipe = TRUE;
|
||||||
}
|
}
|
||||||
#endif /* VMTAPE_POPEN */
|
#endif /* VMTAPE_POPEN */
|
||||||
@ -3030,7 +3030,7 @@ vmt_rput(register struct vmtape *t,
|
|||||||
unsigned char header[8]; /* For best alignment */
|
unsigned char header[8]; /* For best alignment */
|
||||||
|
|
||||||
case VMT_FMT_TPS:
|
case VMT_FMT_TPS:
|
||||||
if (pad = (len & 01)) { /* Must pad? */
|
if ((pad = (len & 01))) { /* Must pad? */
|
||||||
header[3] = 0;
|
header[3] = 0;
|
||||||
} else {
|
} else {
|
||||||
case VMT_FMT_TPE:
|
case VMT_FMT_TPE:
|
||||||
@ -3225,16 +3225,16 @@ tdr_scan(struct vmtape *t,
|
|||||||
if (fileread(f, &(t->mt_contents), &fsize) <= 0) {
|
if (fileread(f, &(t->mt_contents), &fsize) <= 0) {
|
||||||
TDRERR(t, (t,"Tape-file readin failed: %ld bytes", fsize));
|
TDRERR(t, (t,"Tape-file readin failed: %ld bytes", fsize));
|
||||||
} else
|
} else
|
||||||
for (nline = t->mt_contents; cp = nline; t->mt_lineno++) {
|
for (nline = t->mt_contents; (cp = nline); t->mt_lineno++) {
|
||||||
/* Trim off a line */
|
/* Trim off a line */
|
||||||
if (nline = strchr(nline, '\n'))
|
if ((nline = strchr(nline, '\n')))
|
||||||
*nline++ = '\0'; /* Truncate line, point past EOL */
|
*nline++ = '\0'; /* Truncate line, point past EOL */
|
||||||
line = cp; /* Remember start of line */
|
line = cp; /* Remember start of line */
|
||||||
|
|
||||||
/* Parse line */
|
/* Parse line */
|
||||||
indent = (*cp == ' ') || (*cp == '\t'); /* Remember if indentation */
|
indent = (*cp == ' ') || (*cp == '\t'); /* Remember if indentation */
|
||||||
while (isspace(*cp)) ++cp; /* Flush initial whitespace */
|
while (isspace(*cp)) ++cp; /* Flush initial whitespace */
|
||||||
if (key = strchr(cp, ';')) /* Strip off comments here */
|
if ((key = strchr(cp, ';'))) /* Strip off comments here */
|
||||||
*key = '\0';
|
*key = '\0';
|
||||||
if (!*cp) continue; /* Ignore blank lines */
|
if (!*cp) continue; /* Ignore blank lines */
|
||||||
|
|
||||||
@ -3437,10 +3437,10 @@ filscan(struct vmtape *t,
|
|||||||
vmtpos_t len, cnt, err;
|
vmtpos_t len, cnt, err;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
while (rs = wdscan(&cp)) {
|
while ((rs = wdscan(&cp))) {
|
||||||
char *cs, *es;
|
char *cs, *es;
|
||||||
|
|
||||||
if (res = numscan(rs, &cs, &len)) {
|
if ((res = numscan(rs, &cs, &len))) {
|
||||||
if (res > 0)
|
if (res > 0)
|
||||||
TDRERR(t,(t, "Reclen too large"));
|
TDRERR(t,(t, "Reclen too large"));
|
||||||
else if (strncasecmp(rs, "EOF", 3) == 0) { /* Tapemark? */
|
else if (strncasecmp(rs, "EOF", 3) == 0) { /* Tapemark? */
|
||||||
@ -3450,7 +3450,7 @@ filscan(struct vmtape *t,
|
|||||||
TDRERR(t,(t, "Bad reclen syntax"));
|
TDRERR(t,(t, "Bad reclen syntax"));
|
||||||
}
|
}
|
||||||
if (*cs == '*') {
|
if (*cs == '*') {
|
||||||
if (res = numscan(++cs, &cs, &cnt)) {
|
if ((res = numscan(++cs, &cs, &cnt))) {
|
||||||
if (res > 0)
|
if (res > 0)
|
||||||
TDRERR(t,(t, "Reclen too large"));
|
TDRERR(t,(t, "Reclen too large"));
|
||||||
else
|
else
|
||||||
@ -3799,7 +3799,7 @@ TF-Format: raw %s\n",
|
|||||||
fnam ? fnam : "<none>",
|
fnam ? fnam : "<none>",
|
||||||
td->tdbytes, td->tdrecs, td->tdfils,
|
td->tdbytes, td->tdrecs, td->tdfils,
|
||||||
fnam ? fnam : "");
|
fnam ? fnam : "");
|
||||||
if (rd = td->tdrd) {
|
if ((rd = td->tdrd)) {
|
||||||
do {
|
do {
|
||||||
if (bol) {
|
if (bol) {
|
||||||
fprintf(f, "%" VMTAPE_POS_FMT "u:", rd->rdloc);
|
fprintf(f, "%" VMTAPE_POS_FMT "u:", rd->rdloc);
|
||||||
|
|||||||
@ -503,6 +503,9 @@ wf_get(register struct wfile *wf, w10_t *wp)
|
|||||||
( ((uint18)cbuf[3] << 12) | (cbuf[4] << 6) | cbuf[5] )
|
( ((uint18)cbuf[3] << 12) | (cbuf[4] << 6) | cbuf[5] )
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WFT_U36: /* Can't happen; handled above */
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (feof(f)) {
|
if (feof(f)) {
|
||||||
|
|||||||
@ -262,7 +262,7 @@ tmasks(void)
|
|||||||
register int i, j;
|
register int i, j;
|
||||||
int nerrs = 0;
|
int nerrs = 0;
|
||||||
|
|
||||||
for (i = 0; j = masktab[i].me_bits; ++i) {
|
for (i = 0; (j = masktab[i].me_bits); ++i) {
|
||||||
UINTMAX mask = 1;
|
UINTMAX mask = 1;
|
||||||
/* Generate mask in a particularly stupid way to ensure that the
|
/* Generate mask in a particularly stupid way to ensure that the
|
||||||
clever ways worked.
|
clever ways worked.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user