From ddb290d5f615019c33c42b8d94e5a5254cabcf33 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 22 Oct 2016 13:13:17 +0200 Subject: NOTICE (TYPE NAME CONSOLIDATION) Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8 --- src/lib/formats/thom_dsk.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'src/lib/formats/thom_dsk.cpp') diff --git a/src/lib/formats/thom_dsk.cpp b/src/lib/formats/thom_dsk.cpp index df4d66c84e3..6249d785705 100644 --- a/src/lib/formats/thom_dsk.cpp +++ b/src/lib/formats/thom_dsk.cpp @@ -23,7 +23,7 @@ static const char sap_header[] = "(c) Alexandre PUKALL Avril 1998"; -static const UINT16 sap_crc[] = +static const uint16_t sap_crc[] = { 0x0000, 0x1081, 0x2102, 0x3183, 0x4204, 0x5285, 0x6306, 0x7387, 0x8408, 0x9489, 0xa50a, 0xb58b, 0xc60c, 0xd68d, 0xe70e, 0xf78f, @@ -36,10 +36,10 @@ struct sap_dsk_tag int sector_pos[80][16]; /* remember sector position in file */ }; -static UINT16 thom_sap_crc( UINT8* data, int size ) +static uint16_t thom_sap_crc( uint8_t* data, int size ) { int i; - UINT16 crc = 0xffff, crc2; + uint16_t crc = 0xffff, crc2; for ( i = 0; i < size; i++ ) { crc2 = ( crc >> 4 ) ^ sap_crc[ ( crc ^ data[i] ) & 15 ]; @@ -79,9 +79,9 @@ static int sap_get_tracks_per_disk(floppy_image_legacy *floppy) } -static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, UINT64 *offset) +static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset) { - UINT64 offs; + uint64_t offs; struct sap_dsk_tag *tag = get_tag(floppy); /* translate the sector to a raw sector */ if (!sector_is_index) @@ -106,16 +106,16 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in static floperr_t internal_sap_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen) { - UINT64 offset; + uint64_t offset; floperr_t err; int i; - UINT8 *buf; + uint8_t *buf; err = get_offset(floppy, head, track, sector, sector_is_index, &offset); if (err) return err; floppy_image_read(floppy, buffer, offset+4, buflen); - buf = (UINT8*)buffer; + buf = (uint8_t*)buffer; for (i=0;i> 8; @@ -172,7 +172,7 @@ static floperr_t sap_write_indexed_sector(floppy_image_legacy *floppy, int head, return internal_sap_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam); } -static floperr_t sap_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length) +static floperr_t sap_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length) { floperr_t err; err = get_offset(floppy, head, track, sector, FALSE, nullptr); @@ -187,11 +187,11 @@ static floperr_t sap_get_sector_length(floppy_image_legacy *floppy, int head, in -static floperr_t sap_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, UINT32 *sector_length, unsigned long *flags) +static floperr_t sap_get_indexed_sector_info(floppy_image_legacy *floppy, int head, int track, int sector_index, int *cylinder, int *side, int *sector, uint32_t *sector_length, unsigned long *flags) { floperr_t err; - UINT8 header[4]; - UINT64 offset = 0; + uint8_t header[4]; + uint64_t offset = 0; sector_index += 1; err = get_offset(floppy, head, track, sector_index, FALSE, &offset); @@ -214,7 +214,7 @@ static floperr_t sap_post_format(floppy_image_legacy *floppy, util::option_resol { int track,sector; int pos; - UINT8 buf[256], header[4]; + uint8_t buf[256], header[4]; struct sap_dsk_tag *tag; tag = (struct sap_dsk_tag *) floppy_create_tag(floppy, sizeof(struct sap_dsk_tag)); @@ -255,7 +255,7 @@ static FLOPPY_CONSTRUCT(sap_dsk_construct) struct FloppyCallbacks *callbacks; struct sap_dsk_tag *tag; int j; - UINT8 fmt; + uint8_t fmt; tag = (struct sap_dsk_tag *) floppy_create_tag(floppy, sizeof(struct sap_dsk_tag)); if (!tag) return FLOPPY_ERROR_OUTOFMEMORY; @@ -271,9 +271,9 @@ static FLOPPY_CONSTRUCT(sap_dsk_construct) tag->sector_pos[i][j] = 0; /* count tracks & fill sector offset table */ - for ( UINT64 i = 0x42; i+4 < floppy_image_size(floppy); i += tag->sector_size + 6 ) // CRC 2 bytes + 4 bytes sector header + for ( uint64_t i = 0x42; i+4 < floppy_image_size(floppy); i += tag->sector_size + 6 ) // CRC 2 bytes + 4 bytes sector header { - UINT8 sector, track; + uint8_t sector, track; floppy_image_read(floppy, &track, i+2, 1); floppy_image_read(floppy, §or, i+3, 1); if ( track >= 80 || sector < 1 || sector > 16 ) continue; -- cgit v1.2.3-70-g09d2