1
0
mirror of https://github.com/simh/simh.git synced 2026-05-21 03:21:47 +00:00

Altair8800: Codebase cleanup

fix: eliminate implicit conversions
fix: eliminate C++ keyword usage
This commit is contained in:
Patrick Linstruth
2026-05-17 14:41:11 -04:00
parent de4f01c73b
commit b32a0a2581
6 changed files with 8 additions and 8 deletions

View File

@@ -333,7 +333,7 @@ t_stat dsk_write_track(DSK_INFO *d, int32 track, int32 head, uint8 fill)
ssize = dsk_sector_size(d, track, head);
start = dsk_start_sector(d, track, head);
if ((b = malloc(ssize)) == NULL) {
if ((b = (unsigned char *) malloc(ssize)) == NULL) {
return 0;
}

View File

@@ -370,7 +370,7 @@ static t_stat bram_type_command(UNIT *uptr, int32 value, const char *cptr, void
static t_stat bram_set_banks(int32 banks) {
if (banks > 0 && banks <= MAXBANK) {
M = realloc(M, banks * MAXBANKSIZE);
M = (int32 *) realloc(M, banks * MAXBANKSIZE);
}
else if (M != NULL) {
free(M);

View File

@@ -438,9 +438,9 @@ void s100_bus_memw(t_addr addr, int32 data)
mdev_table[page].routine(addr, S100_IO_WRITE, data);
}
uint32 s100_bus_set_addr(uint32 new)
uint32 s100_bus_set_addr(uint32 addr)
{
bus_addr = new;
bus_addr = addr;
return bus_addr;
}

View File

@@ -120,7 +120,7 @@ extern void s100_bus_get_idev(int32 port, IDEV *idev_in, IDEV *idev_out);
extern void s100_bus_get_mdev(int32 addr, MDEV *mdev);
extern int32 nulldev(const int32 addr, const int32 io, const int32 data);
extern uint32 s100_bus_set_addr(uint32 pc);
extern uint32 s100_bus_set_addr(uint32 addr);
extern uint32 s100_bus_get_addr(void);
extern t_stat s100_bus_console(UNIT *uptr);

View File

@@ -5761,10 +5761,10 @@ static t_stat z80_set_chiptype(UNIT *uptr, int32 value, const char *cptr, void *
{
if (z80_chiptype != value) {
if (z80_unit.flags & UNIT_CPU_VERBOSE) {
sim_printf("CPU changed from %s to %s\n", cpu_get_chipname(z80_chiptype), cpu_get_chipname(value));
sim_printf("CPU changed from %s to %s\n", cpu_get_chipname(z80_chiptype), cpu_get_chipname((ChipType) value));
}
cpu_set_chiptype(value);
cpu_set_chiptype((ChipType) value);
}
return SCPE_OK;

View File

@@ -51,7 +51,7 @@ WD17XX_INFO * wd17xx_init(DEVICE *dptr)
{
WD17XX_INFO *wd;
if ((dptr == NULL) || (wd = malloc(sizeof(WD17XX_INFO))) == NULL) {
if ((dptr == NULL) || (wd = (WD17XX_INFO *) malloc(sizeof(WD17XX_INFO))) == NULL) {
return NULL;
}