diff options
Diffstat (limited to 'wrudf/wrudf-cdr.c')
-rw-r--r-- | wrudf/wrudf-cdr.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/wrudf/wrudf-cdr.c b/wrudf/wrudf-cdr.c index 441325c..8acb0a3 100644 --- a/wrudf/wrudf-cdr.c +++ b/wrudf/wrudf-cdr.c @@ -2,6 +2,8 @@ * */ +#include "config.h" + #include <stddef.h> #include <stdio.h> #include <stdlib.h> @@ -10,7 +12,7 @@ #include "ide-pc.h" #include "bswap.h" -char *blockBuffer; +unsigned char *blockBuffer; uint32_t newVATindex; uint32_t sizeVAT; uint32_t prevVATlbn; @@ -54,7 +56,7 @@ uint32_t getMaxVarPktSize() { return ((bc.freeBufferLength >> 11) - 20) << 11; // - 20 :: keep some spare blocks ??? } -char* readCDR(uint32_t lbn, uint16_t partition) { +unsigned char* readCDR(uint32_t lbn, uint16_t partition) { int stat; uint32_t pbn = getPhysical(lbn, partition); @@ -79,7 +81,7 @@ char* readCDR(uint32_t lbn, uint16_t partition) { } void -writeHD(uint32_t physical, char* src) +writeHD(uint32_t physical, unsigned char* src) { int stat; @@ -197,7 +199,7 @@ flagError(long_ad *extents, long_ad *ext, uint32_t pbn) int verifyCDR(struct fileEntry *fe) { long_ad *ext, *extents; - int processed; + uint32_t processed; int stat, rv = 0; uint32_t pbn, pbnFE, rewriteBlkno; @@ -308,7 +310,8 @@ writeVATtable() { regid *id; struct fileEntry *fe; - int stat, i, retries, size; + uint64_t i; + int stat, retries, size; uint32_t startBlk; short_ad *ext; @@ -316,7 +319,7 @@ writeVATtable() id = (regid*)(&vat[newVATindex]); memset(id, 0, sizeof(regid)); - strcpy(id->ident, UDF_ID_ALLOC); + strcpy((char *)id->ident, UDF_ID_ALLOC); *(uint16_t*)id->identSuffix = 0x150; id->identSuffix[2] = UDF_OS_CLASS_UNIX; id->identSuffix[3] = UDF_OS_ID_LINUX; @@ -358,13 +361,13 @@ writeVATtable() for( i = 0; i <= fe->logicalBlocksRecorded; i++ ) { // "<=" so including FileEntry if( devicetype == DISK_IMAGE ) { - printf("Verify %d\n", startBlk+i); + printf("Verify %llu\n", (unsigned long long int)(startBlk+i)); stat = 0; } else stat = readCD(device, sectortype, startBlk + i, 1, blockBuffer); if( stat != 0 ) { - printf("writeVATtable verifyError %d : %s\n", startBlk + i, get_sense_string()); + printf("writeVATtable verifyError %llu : %s\n", (unsigned long long int)(startBlk + i), get_sense_string()); break; } } |