CDC1700: Fixing Coverity identified issues
This commit is contained in:
parent
62879beb70
commit
8d8ecc1a5a
3 changed files with 849 additions and 855 deletions
|
@ -657,6 +657,8 @@ static t_bool LoadDiskAddress(UNIT *uptr, struct cdio_unit *iou, uint16 state)
|
||||||
*/
|
*/
|
||||||
static void StartCDDiskIO(UNIT *uptr, struct cdio_unit *iou, uint16 state)
|
static void StartCDDiskIO(UNIT *uptr, struct cdio_unit *iou, uint16 state)
|
||||||
{
|
{
|
||||||
|
uint16 sector;
|
||||||
|
|
||||||
CDdev.CWA = IOAreg;
|
CDdev.CWA = IOAreg;
|
||||||
|
|
||||||
CDdev.STATUS &= IO_ST_READY | IO_1733_ONCYL | IO_ST_PROT | IO_1733_SINGLE;
|
CDdev.STATUS &= IO_ST_READY | IO_1733_ONCYL | IO_ST_PROT | IO_1733_SINGLE;
|
||||||
|
@ -666,28 +668,22 @@ static void StartCDDiskIO(UNIT *uptr, struct cdio_unit *iou, uint16 state)
|
||||||
if ((cd_dev.dctrl & DBG_DTRACE) != 0) {
|
if ((cd_dev.dctrl & DBG_DTRACE) != 0) {
|
||||||
const char *active = "None";
|
const char *active = "None";
|
||||||
|
|
||||||
if (iou != NULL) {
|
if (iou->active != NULL) {
|
||||||
if (iou->active != NULL) {
|
if (iou->active == iou->ondrive[0])
|
||||||
if (iou->active == iou->ondrive[0])
|
active = "0";
|
||||||
active = "0";
|
if (iou->active == iou->ondrive[1])
|
||||||
if (iou->active == iou->ondrive[1])
|
active = "1";
|
||||||
active = "1";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
fprintf(DBGOUT,
|
fprintf(DBGOUT,
|
||||||
"%sCD - Start I/O, drive: %s, disk: %s, cur: %04X, len: %04X, state: %s\r\n",
|
"%sCD - Start I/O, drive: %s, disk: %s, cur: %04X, len: %04X, state: %s\r\n",
|
||||||
INTprefix, iou != NULL ? iou->name : "None", active,
|
INTprefix, iou != NULL ? iou->name : "None", active,
|
||||||
CDdev.CWA, CDdev.BUFLEN, CDstateStr[state]);
|
CDdev.CWA, CDdev.BUFLEN, CDstateStr[state]);
|
||||||
|
|
||||||
if (iou != NULL) {
|
sector = (((2 * iou->cylinder) + iou->surface) * CD_NUMSC) + iou->sector;
|
||||||
uint16 sector;
|
fprintf(DBGOUT,
|
||||||
|
"%sCD - Disk Address: c:%u,s:%c,d:%c,s:%u (0x%04X), Log. Sector %u (0x%04X)\r\n",
|
||||||
sector = (((2 * iou->cylinder) + iou->surface) * CD_NUMSC) + iou->sector;
|
INTprefix, iou->cylinder, '0' + iou->surface, '0' + iou->disk,
|
||||||
fprintf(DBGOUT,
|
iou->sector, iou->sectorAddr, sector, sector);
|
||||||
"%sCD - Disk Address: c:%u,s:%c,d:%c,s:%u (0x%04X), Log. Sector %u (0x%04X)\r\n",
|
|
||||||
INTprefix, iou->cylinder, '0' + iou->surface, '0' + iou->disk,
|
|
||||||
iou->sector, iou->sectorAddr, sector, sector);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CDdev.DCYLSTATUS &= ~iou->seekComplete;
|
CDdev.DCYLSTATUS &= ~iou->seekComplete;
|
||||||
|
|
|
@ -225,7 +225,7 @@ static uint16 luabs(uint16 param, uint16 lu, uint16 a)
|
||||||
static uint16 spabs(uint16 param)
|
static uint16 spabs(uint16 param)
|
||||||
{
|
{
|
||||||
uint16 sa = M[param + 5];
|
uint16 sa = M[param + 5];
|
||||||
uint16 l, sl = param + 5;
|
uint16 sl = param + 5;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the D bit is set, the starting address must be absolute.
|
* If the D bit is set, the starting address must be absolute.
|
||||||
|
@ -326,7 +326,7 @@ static void motion(uint16 param, char *d)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
sprintf(END(d), " Repeat = %s, %u times\r\n",
|
sprintf(END(d), " Repeat = %s, %u times\r\n",
|
||||||
action[(commands & 0x7) >> 12], commands & 0xFFF);
|
action[(commands & 0x7000) >> 12], commands & 0xFFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ char *textRep(uint16 start, uint16 len)
|
||||||
|
|
||||||
text[0] = '\0';
|
text[0] = '\0';
|
||||||
|
|
||||||
for (i = 0; i < (2 * len); i++) {
|
for (i = 0; (i < (2 * len)) && (strlen(text) < MAXTEXT); i++) {
|
||||||
uint16 ch = M[start];
|
uint16 ch = M[start];
|
||||||
|
|
||||||
if ((i & 1) == 0)
|
if ((i & 1) == 0)
|
||||||
|
@ -352,9 +352,6 @@ char *textRep(uint16 start, uint16 len)
|
||||||
ch &= 0x7F;
|
ch &= 0x7F;
|
||||||
|
|
||||||
strcat(text, charRep[ch]);
|
strcat(text, charRep[ch]);
|
||||||
|
|
||||||
if (strlen(text) > MAXTEXT)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
@ -618,12 +615,13 @@ void MSOS5request(uint16 param, uint16 depth)
|
||||||
strcpy(parameters, "Invalid directory scheduling code");
|
strcpy(parameters, "Invalid directory scheduling code");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
request = "*Unknown*";
|
request = "*Unknown*";
|
||||||
sprintf(parameters, "Request code: %d", (M[param] & 0x3E00) >> 9);
|
sprintf(parameters, "Request code: %d", (M[param] & 0x3E00) >> 9);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
done:
|
|
||||||
fprintf(DBGOUT, "%sMSOS5(%06u): [RQ: $%04X]%s%s %s\r\n",
|
fprintf(DBGOUT, "%sMSOS5(%06u): [RQ: $%04X]%s%s %s\r\n",
|
||||||
INTprefix, seqno++, param, indent[depth & 0x7], request, parameters);
|
INTprefix, seqno++, param, indent[depth & 0x7], request, parameters);
|
||||||
if (details[0] != '\0')
|
if (details[0] != '\0')
|
||||||
|
|
Loading…
Add table
Reference in a new issue