DISK: Fix Coverity warnings
This commit is contained in:
parent
09bbcb29d2
commit
56ab8260f2
1 changed files with 7 additions and 3 deletions
10
sim_disk.c
10
sim_disk.c
|
@ -1404,7 +1404,7 @@ int part;
|
||||||
uint32 base;
|
uint32 base;
|
||||||
uint32 dir_sec;
|
uint32 dir_sec;
|
||||||
uint16 dir_seg;
|
uint16 dir_seg;
|
||||||
uint16 version;
|
uint16 version = 0;
|
||||||
t_offset ret_val = (t_offset)-1;
|
t_offset ret_val = (t_offset)-1;
|
||||||
|
|
||||||
if ((dptr = find_dev_from_unit (uptr)) == NULL)
|
if ((dptr = find_dev_from_unit (uptr)) == NULL)
|
||||||
|
@ -1480,7 +1480,7 @@ for (part = 0; part < RT11_MAXPARTITIONS; part++) {
|
||||||
goto Next_Partition;
|
goto Next_Partition;
|
||||||
} while (dir_seg != 0);
|
} while (dir_seg != 0);
|
||||||
|
|
||||||
ret_val = (t_offset)((base + highest) * 512);
|
ret_val = (t_offset)((base + highest) * (t_offset)512);
|
||||||
version = Home.hb_w_sysver;
|
version = Home.hb_w_sysver;
|
||||||
|
|
||||||
if (type == RT11_SINGLEPART)
|
if (type == RT11_SINGLEPART)
|
||||||
|
@ -1493,7 +1493,7 @@ Next_Partition:
|
||||||
Return_Cleanup:
|
Return_Cleanup:
|
||||||
if (partitions) {
|
if (partitions) {
|
||||||
if (!sim_quiet) {
|
if (!sim_quiet) {
|
||||||
const char *parttype = "???";
|
const char *parttype;
|
||||||
|
|
||||||
switch (version) {
|
switch (version) {
|
||||||
case HB_C_SYSVER_V3A:
|
case HB_C_SYSVER_V3A:
|
||||||
|
@ -1507,6 +1507,10 @@ if (partitions) {
|
||||||
case HB_C_SYSVER_V05:
|
case HB_C_SYSVER_V05:
|
||||||
parttype = "V05";
|
parttype = "V05";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
parttype = "???";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
sim_printf ("%s%d: '%s' Contains RT11 partitions\n", sim_dname (dptr), (int)(uptr-dptr->units), uptr->filename);
|
sim_printf ("%s%d: '%s' Contains RT11 partitions\n", sim_dname (dptr), (int)(uptr-dptr->units), uptr->filename);
|
||||||
sim_printf ("%d valid partition%s, Type: %s, Sectors On Disk: %u\n", partitions, partitions == 1 ? "" : "s", parttype, (uint32)(ret_val / 512));
|
sim_printf ("%d valid partition%s, Type: %s, Sectors On Disk: %u\n", partitions, partitions == 1 ? "" : "s", parttype, (uint32)(ret_val / 512));
|
||||||
|
|
Loading…
Add table
Reference in a new issue