From 858ca7a453fa13cf0ca88ed30509206ab1427441 Mon Sep 17 00:00:00 2001 From: Richard Cornwell Date: Fri, 11 Mar 2022 11:25:33 -0500 Subject: [PATCH] KA10: Clean up coverity errors. --- PDP10/kx10_cpu.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/PDP10/kx10_cpu.c b/PDP10/kx10_cpu.c index 1202c13..c97e57a 100644 --- a/PDP10/kx10_cpu.c +++ b/PDP10/kx10_cpu.c @@ -1306,7 +1306,7 @@ t_stat dev_mtr(uint32 dev, uint64 *data) { *data = mtr_irq; if (mtr_enable) *data |= 02000; - *data |= (uint64)(mtr_flags << 12); + *data |= (uint64)mtr_flags << 12; sim_debug(DEBUG_CONI, &cpu_dev, "CONI MTR %012llo\n", *data); break; @@ -4581,7 +4581,7 @@ in_loop: else AR = get_reg(ix); if ((AR & SMASK) != 0 || (AR & SECTM) == 0) { /* Local index word */ - AR = AB + (((AR & RSIGN) ? 0: 0)|(AR & RMASK)); + AR = AB + (AR & RMASK); } else AR = AR + AB; AR &= FMASK; @@ -5787,8 +5787,12 @@ dpnorm: goto last; AR = MB; AB = (AB + 1) & RMASK; +#if KI + FLAGS |= BYTI; +#endif if (Mem_read(0, 0, 0, 0)) goto last; + FLAGS &= ~BYTI; MQ = MB; set_reg(AC, AR); set_reg(AC+1, MQ); @@ -5799,8 +5803,12 @@ dpnorm: goto last; AR = MB; AB = (AB + 1) & RMASK; +#if KI + FLAGS |= BYTI; +#endif if (Mem_read(0, 0, 0, 0)) goto last; + FLAGS &= ~BYTI; MQ = CCM(MB) + 1; /* Low */ /* High */ #if KL | KS @@ -5878,6 +5886,9 @@ dpnorm: if ((FLAGS & BYTI)) { AB = (AB + 1) & RMASK; MB = MQ; +#if KL + FLAGS &= ~BYTI; +#endif if (Mem_write(0, 0)) goto last; FLAGS &= ~BYTI; @@ -12262,7 +12273,7 @@ do_byte_setup(int n, int wr, int *pos, int *sz) if (ix) { temp = get_reg(ix); if ((temp & SMASK) != 0 || (temp & SECTM) == 0) { /* Local index word */ - temp = AB + (((temp & RSIGN) ? 0: 0)|(temp & RMASK)); + temp = AB + (temp & RMASK); } else temp = temp + AB; temp &= FMASK;