Several warnings fixed, but still many to go.

This commit is contained in:
waltje
2018-03-27 23:53:26 -04:00
parent 419bfa89d1
commit 58668a8612
28 changed files with 194 additions and 187 deletions

View File

@@ -8,7 +8,7 @@
*
* Driver for the ESDI controller (WD1007-vse1) for PC/AT.
*
* Version: @(#)hdc_esdi_at.c 1.0.3 2018/03/15
* Version: @(#)hdc_esdi_at.c 1.0.4 2018/03/27
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -779,9 +779,9 @@ loadhd(esdi_t *esdi, int hdd_num, int d, const wchar_t *fn)
return;
}
drive->cfg_spt = drive->real_spt = hdd[d].spt;
drive->cfg_hpc = drive->real_hpc = hdd[d].hpc;
drive->real_tracks = hdd[d].tracks;
drive->cfg_spt = drive->real_spt = (uint8_t)hdd[d].spt;
drive->cfg_hpc = drive->real_hpc = (uint8_t)hdd[d].hpc;
drive->real_tracks = (uint8_t)hdd[d].tracks;
drive->hdd_num = d;
drive->present = 1;
}

View File

@@ -52,7 +52,7 @@
* however, are auto-configured by the system software as
* shown above.
*
* Version: @(#)hdc_esdi_mca.c 1.0.2 2018/03/15
* Version: @(#)hdc_esdi_mca.c 1.0.3 2018/03/27
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Sarah Walker, <tommowalker@tommowalker.co.uk>
@@ -111,11 +111,12 @@
typedef struct esdi_drive {
int spt, hpc;
int tracks;
int sectors;
int present;
int hdd_num;
uint8_t spt,
hpc;
uint16_t tracks;
uint32_t sectors;
int8_t present;
int8_t hdd_num;
} drive_t;
typedef struct esdi {
@@ -1095,10 +1096,10 @@ esdi_init(const device_t *info)
}
/* OK, so fill in geometry info. */
drive->spt = hdd[i].spt;
drive->hpc = hdd[i].hpc;
drive->tracks = hdd[i].tracks;
drive->sectors = hdd[i].spt*hdd[i].hpc*hdd[i].tracks;
drive->spt = (uint8_t)hdd[i].spt;
drive->hpc = (uint8_t)hdd[i].hpc;
drive->tracks = (uint16_t)hdd[i].tracks;
drive->sectors = (uint32_t)(hdd[i].spt*hdd[i].hpc*hdd[i].tracks);
drive->hdd_num = i;
/* Mark drive as present. */

View File

@@ -8,7 +8,7 @@
*
* Emulation of hard disk, CD-ROM and ZIP IDE/ATAPI devices.
*
* Version: @(#)hdc_ide.c 1.0.12 2018/03/20
* Version: @(#)hdc_ide.c 1.0.13 2018/03/27
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Sarah Walker, <tommowalker@tommowalker.co.uk>
@@ -600,8 +600,8 @@ static off64_t ide_get_sector(IDE *ide)
}
else
{
uint32_t heads = ide->t_hpc;
uint32_t sectors = ide->t_spt;
uint32_t heads = (uint32_t)ide->t_hpc;
uint32_t sectors = (uint32_t)ide->t_spt;
return ((((off64_t) ide->cylinder * heads) + ide->head) *
sectors) + (ide->sector - 1) + ide->skip512;
@@ -640,8 +640,8 @@ static void loadhd(IDE *ide, int d, const wchar_t *fn)
return;
}
ide->spt = hdd[d].spt;
ide->hpc = hdd[d].hpc;
ide->spt = (uint8_t)hdd[d].spt;
ide->hpc = (uint8_t)hdd[d].hpc;
ide->tracks = hdd[d].tracks;
ide->type = IDE_HDD;
ide->hdd_num = d;
@@ -808,9 +808,9 @@ void ide_set_sector(IDE *ide, int sector_num)
{
cyl = sector_num / (hdd[ide->hdd_num].hpc * hdd[ide->hdd_num].spt);
r = sector_num % (hdd[ide->hdd_num].hpc * hdd[ide->hdd_num].spt);
ide->cylinder = cyl;
ide->cylinder = (int)cyl;
ide->head = ((r / hdd[ide->hdd_num].spt) & 0x0f);
ide->sector = (r % hdd[ide->hdd_num].spt) + 1;
ide->sector = (int)(r % hdd[ide->hdd_num].spt) + 1;
}
}
@@ -2525,7 +2525,7 @@ void callbackide(int ide_board)
snum = hdd[ide->hdd_num].spt;
snum *= hdd[ide->hdd_num].hpc;
snum *= hdd[ide->hdd_num].tracks;
ide_set_sector(ide, snum - 1);
ide_set_sector(ide, (int)(snum - 1));
ide->atastat = READY_STAT | DSC_STAT;
ide_irq_raise(ide);
return;

View File

@@ -8,7 +8,7 @@
*
* Definitions for the IDE module.
*
* Version: @(#)hdc_ide.h 1.0.3 2018/03/20
* Version: @(#)hdc_ide.h 1.0.4 2018/03/27
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -41,47 +41,54 @@
typedef struct {
int type;
int board;
uint8_t atastat;
uint8_t error;
int secount,sector,cylinder,head,drive,cylprecomp;
uint8_t command;
uint8_t fdisk;
int pos;
int packlen;
uint64_t spt,hpc;
uint64_t t_spt,t_hpc;
uint64_t tracks;
int packetstatus;
uint8_t asc;
int reset;
uint16_t *buffer;
int irqstat;
int service;
int lba;
int channel;
uint32_t lba_addr;
int skip512;
int blocksize, blockcount;
uint16_t dma_identify_data[3];
int hdi,base;
int hdd_num;
uint8_t specify_success;
int mdma_mode;
uint8_t *sector_buffer;
int do_initial_read;
int sector_pos;
int8_t type;
int8_t board;
uint8_t atastat;
uint8_t error;
int secount,
sector,
cylinder,
head,
drive,
cylprecomp;
uint8_t command;
uint8_t fdisk;
int pos;
int packlen;
uint8_t spt,
hpc;
uint64_t t_spt,
t_hpc;
uint64_t tracks;
int packetstatus;
uint8_t asc;
int reset;
uint16_t *buffer;
int irqstat;
int service;
int lba;
int channel;
uint32_t lba_addr;
int skip512;
int blocksize,
blockcount;
uint16_t dma_identify_data[3];
int hdi,
base;
int hdd_num;
uint8_t specify_success;
int mdma_mode;
uint8_t *sector_buffer;
int do_initial_read;
int sector_pos;
} IDE;
extern int ideboard;
extern int ide_enable[5];
extern int ide_irq[5];
extern IDE ide_drives[IDE_NUM + XTIDE_NUM];
extern int64_t idecallback[5];
extern int ideboard;
extern int ide_enable[5];
extern int ide_irq[5];
extern IDE ide_drives[IDE_NUM + XTIDE_NUM];
extern int64_t idecallback[5];
extern void ide_irq_raise(IDE *ide);

View File

@@ -12,7 +12,7 @@
* based design. Most cards were WD1003-WA2 or -WAH, where the
* -WA2 cards had a floppy controller as well (to save space.)
*
* Version: @(#)hdc_mfm_at.c 1.0.2 2018/03/15
* Version: @(#)hdc_mfm_at.c 1.0.3 2018/03/27
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Sarah Walker, <tommowalker@tommowalker.co.uk>
@@ -716,9 +716,9 @@ loadhd(mfm_t *mfm, int c, int d, const wchar_t *fn)
return;
}
drive->spt = hdd[d].spt;
drive->hpc = hdd[d].hpc;
drive->tracks = hdd[d].tracks;
drive->spt = (uint8_t)hdd[d].spt;
drive->hpc = (uint8_t)hdd[d].hpc;
drive->tracks = (uint8_t)hdd[d].tracks;
drive->hdd_num = d;
drive->present = 1;
}

View File

@@ -41,7 +41,7 @@
* Since all controllers (including the ones made by DTC) use
* (mostly) the same API, we keep them all in this module.
*
* Version: @(#)hdc_mfm_xt.c 1.0.2 2018/03/15
* Version: @(#)hdc_mfm_xt.c 1.0.3 2018/03/27
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Sarah Walker, <tommowalker@tommowalker.co.uk>
@@ -780,9 +780,9 @@ loadhd(mfm_t *mfm, int c, int d, const wchar_t *fn)
return;
}
drive->spt = hdd[c].spt;
drive->hpc = hdd[c].hpc;
drive->tracks = hdd[c].tracks;
drive->spt = (uint8_t)hdd[c].spt;
drive->hpc = (uint8_t)hdd[c].hpc;
drive->tracks = (uint8_t)hdd[c].tracks;
drive->hdd_num = c;
drive->present = 1;
}

View File

@@ -8,7 +8,7 @@
*
* Handling of hard disk image files.
*
* Version: @(#)hdd_image.c 1.0.1 2018/02/14
* Version: @(#)hdd_image.c 1.0.2 2018/03/27
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -303,7 +303,7 @@ int hdd_image_load(int id)
}
fseeko64(hdd_images[id].file, 0, SEEK_END);
if (ftello64(hdd_images[id].file) < (full_size + hdd_images[id].base)) {
if (ftello64(hdd_images[id].file) < (int64_t)(full_size + hdd_images[id].base)) {
s = (full_size + hdd_images[id].base) - ftello64(hdd_images[id].file);
prepare_new_hard_disk:
s >>= 9;
@@ -398,7 +398,7 @@ int hdd_image_write_ex(uint8_t id, uint32_t sector, uint32_t count, uint8_t *buf
void hdd_image_zero(uint8_t id, uint32_t sector, uint32_t count)
{
int i = 0;
uint32_t i;
fseeko64(hdd_images[id].file, ((uint64_t)sector * 512) + hdd_images[id].base, SEEK_SET);
for (i = 0; i < count; i++)
@@ -407,7 +407,7 @@ void hdd_image_zero(uint8_t id, uint32_t sector, uint32_t count)
int hdd_image_zero_ex(uint8_t id, uint32_t sector, uint32_t count)
{
int i = 0;
uint32_t i;
uint32_t transfer_sectors = count;
uint32_t sectors = hdd_sectors(id);

View File

@@ -9,7 +9,7 @@
* Implementation of the Iomega ZIP drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage.
*
* Version: @(#)zip.c 1.0.8 2018/03/21
* Version: @(#)zip.c 1.0.9 2018/03/27
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -1392,7 +1392,7 @@ void zip_set_buf_len(uint8_t id, int32_t *BufLen, uint32_t *src_len)
if (*BufLen == -1)
*BufLen = *src_len;
else {
*BufLen = MIN(*src_len, *BufLen);
*BufLen = MIN(*src_len, (uint32_t)*BufLen);
*src_len = *BufLen;
}
zip_log("ZIP %i: Actual transfer length: %i\n", id, *BufLen);
@@ -2573,7 +2573,7 @@ void zip_write(uint8_t channel, uint32_t val, int length)
}
return;
} else if (zip[id].packet_status == ZIP_PHASE_IDLE) {
if (zip[id].pos >= zip[id].cdb_len) {
if (zip[id].pos >= (uint32_t)zip[id].cdb_len) {
zip[id].pos=0;
zip[id].status = BUSY_STAT;
zip[id].packet_status = ZIP_PHASE_COMMAND;