diff options
Diffstat (limited to 'src/tools/imgtool/modules/pc_hard.cpp')
-rw-r--r-- | src/tools/imgtool/modules/pc_hard.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/tools/imgtool/modules/pc_hard.cpp b/src/tools/imgtool/modules/pc_hard.cpp index 9aad12aa319..9973f84e762 100644 --- a/src/tools/imgtool/modules/pc_hard.cpp +++ b/src/tools/imgtool/modules/pc_hard.cpp @@ -69,7 +69,7 @@ static const char fat16_string[8] = { 'F', 'A', 'T', '1', '6', ' ', ' ', ' ' }; //static const char fat32_string[8] = { 'F', 'A', 'T', '3', '2', ' ', ' ', ' ' }; /* imports from fat.c */ -extern void fat_get_info(const imgtool_class *imgclass, UINT32 state, union imgtoolinfo *info); +extern void fat_get_info(const imgtool_class *imgclass, uint32_t state, union imgtoolinfo *info); struct pc_chd_image_info @@ -79,16 +79,16 @@ struct pc_chd_image_info struct { unsigned int corrupt : 1; - UINT8 partition_type; - UINT32 fat_bits; - UINT32 starting_track; - UINT32 starting_head; - UINT32 starting_sector; - UINT32 ending_track; - UINT32 ending_head; - UINT32 ending_sector; - UINT32 sector_index; - UINT32 total_sectors; + uint8_t partition_type; + uint32_t fat_bits; + uint32_t starting_track; + uint32_t starting_head; + uint32_t starting_sector; + uint32_t ending_track; + uint32_t ending_head; + uint32_t ending_sector; + uint32_t sector_index; + uint32_t total_sectors; } partitions[4]; }; @@ -101,7 +101,7 @@ static pc_chd_image_info *pc_chd_get_image_info(imgtool::image &image) -static void pc_chd_locate_block(imgtool::image &image, UINT64 block, UINT32 *cylinder, UINT32 *head, UINT32 *sector) +static void pc_chd_locate_block(imgtool::image &image, uint64_t block, uint32_t *cylinder, uint32_t *head, uint32_t *sector) { pc_chd_image_info *info; const hard_disk_info *hd_info; @@ -116,18 +116,18 @@ static void pc_chd_locate_block(imgtool::image &image, UINT64 block, UINT32 *cyl -static imgtoolerr_t pc_chd_partition_create(imgtool::image &image, int partition_index, UINT64 first_block, UINT64 block_count) +static imgtoolerr_t pc_chd_partition_create(imgtool::image &image, int partition_index, uint64_t first_block, uint64_t block_count) { imgtoolerr_t err; - UINT8 header_block[FAT_SECLEN]; - UINT8 partition_block[FAT_SECLEN]; - UINT8 partition_type; - UINT8 *fat_type; - UINT8 *partition_entry; - UINT32 first_cylinder, first_head, first_sector; - UINT32 last_cylinder, last_head, last_sector; + uint8_t header_block[FAT_SECLEN]; + uint8_t partition_block[FAT_SECLEN]; + uint8_t partition_type; + uint8_t *fat_type; + uint8_t *partition_entry; + uint32_t first_cylinder, first_head, first_sector; + uint32_t last_cylinder, last_head, last_sector; imgtool_class imgclass = { fat_get_info }; - imgtoolerr_t (*fat_partition_create)(imgtool::image &image, UINT64 first_block, UINT64 block_count); + imgtoolerr_t (*fat_partition_create)(imgtool::image &image, uint64_t first_block, uint64_t block_count); /* sanity checks */ assert((partition_index >= 0) && (partition_index <= 3)); @@ -137,7 +137,7 @@ static imgtoolerr_t pc_chd_partition_create(imgtool::image &image, int partition pc_chd_locate_block(image, first_block + block_count - 1, &last_cylinder, &last_head, &last_sector); /* load fat_partition_create */ - fat_partition_create = (imgtoolerr_t (*)(imgtool::image &, UINT64, UINT64)) + fat_partition_create = (imgtoolerr_t (*)(imgtool::image &, uint64_t, uint64_t)) imgtool_get_info_fct(&imgclass, IMGTOOLINFO_PTR_CREATE_PARTITION); /* first create the actual partition */ @@ -194,9 +194,9 @@ static imgtoolerr_t pc_chd_read_partition_header(imgtool::image &image) { imgtoolerr_t err; int i; - const UINT8 *partition_info; + const uint8_t *partition_info; pc_chd_image_info *info; - UINT8 buffer[FAT_SECLEN]; + uint8_t buffer[FAT_SECLEN]; info = pc_chd_get_image_info(image); @@ -235,9 +235,9 @@ static imgtoolerr_t pc_chd_read_partition_header(imgtool::image &image) static imgtoolerr_t pc_chd_image_create(imgtool::image &image, imgtool::stream::ptr &&stream, util::option_resolution *opts) { imgtoolerr_t err; - UINT32 cylinders, heads, sectors; + uint32_t cylinders, heads, sectors; pc_chd_image_info *info; - UINT8 header_block[FAT_SECLEN]; + uint8_t header_block[FAT_SECLEN]; cylinders = opts->lookup_int('T'); heads = opts->lookup_int('H'); @@ -308,7 +308,7 @@ static void pc_chd_image_close(imgtool::image &image) -static imgtoolerr_t pc_chd_image_get_geometry(imgtool::image &image, UINT32 *tracks, UINT32 *heads, UINT32 *sectors) +static imgtoolerr_t pc_chd_image_get_geometry(imgtool::image &image, uint32_t *tracks, uint32_t *heads, uint32_t *sectors) { pc_chd_image_info *info; const hard_disk_info *hd_info; @@ -324,9 +324,9 @@ static imgtoolerr_t pc_chd_image_get_geometry(imgtool::image &image, UINT32 *tra -static UINT32 pc_chd_calc_lbasector(pc_chd_image_info &info, UINT32 track, UINT32 head, UINT32 sector) +static uint32_t pc_chd_calc_lbasector(pc_chd_image_info &info, uint32_t track, uint32_t head, uint32_t sector) { - UINT32 lbasector; + uint32_t lbasector; const hard_disk_info *hd_info; hd_info = imghd_get_header(&info.hard_disk); @@ -340,12 +340,12 @@ static UINT32 pc_chd_calc_lbasector(pc_chd_image_info &info, UINT32 track, UINT3 -static imgtoolerr_t pc_chd_image_readsector(imgtool::image &image, UINT32 track, UINT32 head, UINT32 sector, std::vector<UINT8> &buffer) +static imgtoolerr_t pc_chd_image_readsector(imgtool::image &image, uint32_t track, uint32_t head, uint32_t sector, std::vector<uint8_t> &buffer) { pc_chd_image_info *info = pc_chd_get_image_info(image); // get the sector size and resize the buffer - UINT32 sector_size = imghd_get_header(&info->hard_disk)->sectorbytes; + uint32_t sector_size = imghd_get_header(&info->hard_disk)->sectorbytes; try { buffer.resize(sector_size); } catch (std::bad_alloc const &) { return IMGTOOLERR_OUTOFMEMORY; } @@ -357,7 +357,7 @@ static imgtoolerr_t pc_chd_image_readsector(imgtool::image &image, UINT32 track, -static imgtoolerr_t pc_chd_image_writesector(imgtool::image &image, UINT32 track, UINT32 head, UINT32 sector, const void *buffer, size_t len, int ddam) +static imgtoolerr_t pc_chd_image_writesector(imgtool::image &image, uint32_t track, uint32_t head, uint32_t sector, const void *buffer, size_t len, int ddam) { pc_chd_image_info *info; info = pc_chd_get_image_info(image); @@ -368,7 +368,7 @@ static imgtoolerr_t pc_chd_image_writesector(imgtool::image &image, UINT32 track -static imgtoolerr_t pc_chd_image_readblock(imgtool::image &image, void *buffer, UINT64 block) +static imgtoolerr_t pc_chd_image_readblock(imgtool::image &image, void *buffer, uint64_t block) { pc_chd_image_info *info; info = pc_chd_get_image_info(image); @@ -377,7 +377,7 @@ static imgtoolerr_t pc_chd_image_readblock(imgtool::image &image, void *buffer, -static imgtoolerr_t pc_chd_image_writeblock(imgtool::image &image, const void *buffer, UINT64 block) +static imgtoolerr_t pc_chd_image_writeblock(imgtool::image &image, const void *buffer, uint64_t block) { pc_chd_image_info *info; info = pc_chd_get_image_info(image); @@ -439,7 +439,7 @@ static imgtoolerr_t pc_chd_list_partitions(imgtool::image &image, std::vector<im -void pc_chd_get_info(const imgtool_class *imgclass, UINT32 state, union imgtoolinfo *info) +void pc_chd_get_info(const imgtool_class *imgclass, uint32_t state, union imgtoolinfo *info) { switch(state) { |