1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-03-29 02:55:02 +00:00

KA10: Clean up coverity warnings and windows warnings.

This commit is contained in:
Richard Cornwell
2022-02-17 19:01:10 -05:00
parent b25226009c
commit 677d6d161f
5 changed files with 12 additions and 31 deletions

View File

@@ -874,7 +874,7 @@ if (!tmxr_tpbusyln(&dup_ldsc[dup])) { /* Not Busy sending? */
dup_xmtpacket[dup] = (uint8 *)realloc (dup_xmtpacket[dup], dup_xmtpksize[dup]);
}
/* Strip sync bytes at the beginning of a message */
while (len && (dup_xmtpkoffset[dup] == 0) && (bytes[0] == DDCMP_SYN)) {
while (len > 0 && (dup_xmtpkoffset[dup] == 0) && (bytes[0] == DDCMP_SYN)) {
--len;
++bytes;
}

View File

@@ -443,7 +443,6 @@ t_stat dz_svc (UNIT *uptr)
void
dz_checkirq(struct pdp_dib *dibp)
{
int j;
int i;
int ln;
int stop;

View File

@@ -343,13 +343,6 @@ static DEBTAB kmc_debug[] = {
{0}
};
/* These count the total pending interrupts for each vector
* across all KMCs.
*/
static int32 AintPending = 0;
static int32 BintPending = 0;
/* Per-KMC state */
/* To help make the code more readable, by convention the symbol 'k'
@@ -757,8 +750,8 @@ static t_stat kmc_reset(DEVICE* dptr) {
sel2 = 0xa5a5;
sel4 = 0xdead;
sel6 = 0x5a5a;
memset (ucode, 0xcc, sizeof ucode);
memset (dram, 0xdd, sizeof dram);
memset ((uint8 *)&ucode[0], 0xcc, sizeof ucode);
memset ((uint8 *)&dram[0], 0xdd, sizeof dram);
gflags |= FLG_INIT;
gflags &= ~FLG_UCINI;
sim_register_internal_device (&kmc_int_rxdev);
@@ -1302,7 +1295,7 @@ static t_stat kmc_rxService (UNIT *rxup) {
dupstate *d = line2dup[rxup->unit_line];
BDL *bdl;
t_stat r;
uint16 xrem, seglen;
uint16 seglen;
int i;
t_addr ba;
@@ -2474,7 +2467,6 @@ static t_bool kmc_bufferAddressOut (int32 k, uint16 flags, uint16 rx, uint8 line
*/
static int32 kmc_updateBDCount(uint32 bda, uint16 *bd) {
int i;
bda+=2;
if (uba_write_npr_word(bda, kmc_dib.uba_ctl, bd[1]) == 0) {
return 1;

View File

@@ -116,7 +116,7 @@
int lp20_write(DEVICE *dptr, t_addr addr, uint16 data, int32 access);
int lp20_read(DEVICE *dptr, t_addr addr, uint16 *data, int32 access);
void lp20_printline(UNIT *uptr, int nl);
void lp20_output(UNIT *uptr, char c);
void lp20_output(UNIT *uptr, uint8 c);
void lp20_update_chkirq (UNIT *uptr, int done, int irq);
void lp20_update_ready(UNIT *uptr, uint16 setrdy, uint16 clrrdy);
t_stat lp20_svc (UNIT *uptr);
@@ -138,7 +138,7 @@ uint32 lp20_ba;
uint16 lp20_wcnt;
uint8 lp20_col;
uint8 lp20_chksum;
uint16 lp20_buf;
uint8 lp20_buf;
uint8 lp20_data;
int lp20_odd = 0;
int lp20_duvfa_state = 0;
@@ -285,7 +285,6 @@ int
lp20_write(DEVICE *dptr, t_addr addr, uint16 data, int32 access)
{
struct pdp_dib *dibp = (DIB *)dptr->ctxt;
int base;
uint16 temp;
addr &= dibp->uba_mask;
@@ -401,7 +400,6 @@ int
lp20_read(DEVICE *dptr, t_addr addr, uint16 *data, int32 access)
{
struct pdp_dib *dibp = (DIB *)dptr->ctxt;
int base;
uint16 temp;
int par;
@@ -432,7 +430,7 @@ lp20_read(DEVICE *dptr, t_addr addr, uint16 *data, int32 access)
break;
case 012: /* LPRDAT */
temp = lp20_ram[lp20_buf] & 07777;
temp = lp20_ram[(int)lp20_buf] & 07777;
par = (temp >> 8) ^ (temp >> 4) ^ temp;
par = (par >> 2) ^ par;
par ^= par >> 1;
@@ -442,7 +440,7 @@ lp20_read(DEVICE *dptr, t_addr addr, uint16 *data, int32 access)
case 014: /* LPCOL/LPCBUF */
*data = ((uint16)lp20_col) << 8;
*data |= lp20_buf;
*data |= (uint16)lp20_buf;
break;
case 016: /* LPCSUM/LPPDAT */
@@ -496,7 +494,7 @@ lp20_printline(UNIT *uptr, int nl) {
/* Unit service */
void
lp20_output(UNIT *uptr, char c) {
lp20_output(UNIT *uptr, uint8 c) {
if (c == 0)
return;
@@ -588,7 +586,6 @@ lp20_svc (UNIT *uptr)
char ch;
int fnc = (lp20_cs1 >> CS1_V_FNC) & CS1_M_FNC;
uint16 ram_ch;
uint16 par;
uint8 data;
if (fnc == FNC_PRINT && (uptr->flags & UNIT_ATT) == 0) {
@@ -607,13 +604,13 @@ lp20_svc (UNIT *uptr)
return SCPE_OK;
}
lp20_buf = (uint16)(data & 0377);
lp20_buf = data;
lp20_ba = (lp20_ba + 1) & 0777777;
lp20_wcnt = (lp20_wcnt + 1) & 07777;
if (lp20_wcnt == 0) {
lp20_cs1 &= ~CS1_GO;
}
lp20_chksum += (uint8)(lp20_buf & 0377);
lp20_chksum += lp20_buf;
sim_debug(DEBUG_DETAIL, &lp20_dev, "LP npr %08o %06o %03o %d\n", lp20_ba, lp20_wcnt,
lp20_buf, fnc);
switch(fnc) {
@@ -633,7 +630,7 @@ lp20_svc (UNIT *uptr)
}
/* Check if translate flag set */
if (ram_ch & LP20_RAM_TRN) {
lp20_buf = ram_ch & 0377;
lp20_buf = (uint8)(ram_ch & 0377);
}
/* Check if paper motion */
if (ram_ch & LP20_RAM_PI) {

View File

@@ -364,13 +364,7 @@ uba_set_irq(DIB *dibp, int vect)
void
uba_clr_irq(DIB *idev, int vect)
{
DEVICE *dptr;
int ubm = uba_device[idev->uba_ctl];
int pi;
int i;
int j;
int lvl;
int high = 0;
if (ubm < 0)
return;
@@ -383,7 +377,6 @@ uba_clr_irq(DIB *idev, int vect)
void
uba_reset()
{
DEVICE *dptr;
int i;
/* Clear the Unibus map */