1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-02-14 19:56:54 +00:00

IBM360: Fixed Coverity errors.

This commit is contained in:
Richard Cornwell
2017-10-18 23:44:36 -04:00
parent 5b4f4c2be0
commit 6620cd2f6c
5 changed files with 12 additions and 9 deletions

View File

@@ -170,8 +170,10 @@ cdp_srv(UNIT *uptr) {
/* If we get here, something is wrong */
case SCPE_IOERR:
chan_end(addr, SNS_DEVEND|SNS_UNITCHK);
break;
default:
chan_end(addr, SNS_DEVEND);
break;
}
}

View File

@@ -196,15 +196,17 @@ cdr_srv(UNIT *uptr) {
if ((uptr->u3 & CDR_CMDMSK) == CDR_RD) {
struct _card_data *data;
int u = uptr-cdr_unit;
uint16 xlat;
uint8 ch = 0;
data = (struct _card_data *)uptr->up7;
ch = sim_hol_to_ebcdic(data->image[uptr->u4]);
xlat = sim_hol_to_ebcdic(data->image[uptr->u4]);
if (ch == 0x100) {
if (xlat == 0x100) {
uptr->u5 |= SNS_DATCHK;
ch = 0x00;
}
} else
ch = (uint8)(xlat&0xff);
if (chan_write_byte(addr, &ch)) {
uptr->u3 &= ~(CDR_CMDMSK);
chan_end(addr, SNS_CHNEND|SNS_DEVEND|(uptr->u5 ? SNS_UNITCHK:0));

View File

@@ -680,7 +680,6 @@ opr:
hst[hst_p].addr2 = addr2;
hst[hst_p].src1 = src1;
hst[hst_p].src2 = src2;
hst[hst_p].dest = dest;
}
/* Preform opcode */
@@ -1618,10 +1617,10 @@ save_dbl:
while(reg != 0) {
uint8 t;
uint32 temp;
ReadByte(addr1, &temp);
(void)ReadByte(addr1, &temp);
t = temp;
if (src1) {
ReadByte(addr2, &dest);
(void)ReadByte(addr2, &dest);
addr2--;
reg --;
}

View File

@@ -1186,7 +1186,7 @@ dasd_attach(UNIT * uptr, CONST char *file)
return SCPE_ARG;
}
sim_fseek(uptr->fileref, sizeof(struct dasd_header), SEEK_SET);
sim_fread(data->cbuf, 1, tsize * hdr.heads, uptr->fileref);
sim_fread(data->cbuf, 1, tsize, uptr->fileref);
data->cpos = sizeof(struct dasd_header);
data->ccyl = 0;
data->cyl = 2000;

View File

@@ -232,13 +232,13 @@ uint8 mt_startcmd(UNIT *uptr, uint16 chan, uint8 cmd) {
uint8 ch;
if (mt_busy[GET_DEV_BUF(dptr->flags)] != 0 || (uptr->u3 & MT_CMDMSK) != 0) {
sim_debug(DEBUG_CMD, dptr, "CMD busy unit=%d %x", unit, cmd);
sim_debug(DEBUG_CMD, dptr, "CMD busy unit=%d %x\n", unit, cmd);
uptr->flags |= MT_BUSY; /* Flag we need to send CUE */
mt_busy[GET_DEV_BUF(dptr->flags)] |= 2;
return SNS_BSY;
}
sim_debug(DEBUG_CMD, dptr, "CMD unit=%d %x", unit, cmd);
sim_debug(DEBUG_CMD, dptr, "CMD unit=%d %x\n", unit, cmd);
switch (cmd & 0xF) {
case 0x7: /* Tape motion */