summaryrefslogtreecommitdiffstats
path: root/src/lib/util/chdcd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/chdcd.cpp')
-rw-r--r--src/lib/util/chdcd.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/lib/util/chdcd.cpp b/src/lib/util/chdcd.cpp
index 76da08b6b9e..f6176cd4cd9 100644
--- a/src/lib/util/chdcd.cpp
+++ b/src/lib/util/chdcd.cpp
@@ -76,7 +76,7 @@ static std::string get_file_path(std::string &path)
-------------------------------------------------*/
/**
- * @fn static UINT64 get_file_size(const char *filename)
+ * @fn static uint64_t get_file_size(const char *filename)
*
* @brief Gets file size.
*
@@ -85,7 +85,7 @@ static std::string get_file_path(std::string &path)
* @return The file size.
*/
-static UINT64 get_file_size(const char *filename)
+static uint64_t get_file_size(const char *filename)
{
osd_file::ptr file;
std::uint64_t filesize = 0;
@@ -120,7 +120,7 @@ static int tokenize( const char *linebuffer, int i, int linebuffersize, char *to
int singlequote = 0;
int doublequote = 0;
- while ((i < linebuffersize) && isspace((UINT8)linebuffer[i]))
+ while ((i < linebuffersize) && isspace((uint8_t)linebuffer[i]))
{
i++;
}
@@ -135,7 +135,7 @@ static int tokenize( const char *linebuffer, int i, int linebuffersize, char *to
{
singlequote = !singlequote;
}
- else if (!singlequote && !doublequote && isspace((UINT8)linebuffer[i]))
+ else if (!singlequote && !doublequote && isspace((uint8_t)linebuffer[i]))
{
break;
}
@@ -196,24 +196,24 @@ static int msf_to_frames( char *token )
-------------------------------------------------*/
/**
- * @fn static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs)
+ * @fn static uint32_t parse_wav_sample(const char *filename, uint32_t *dataoffs)
*
* @brief Parse WAV sample.
*
* @param filename Filename of the file.
* @param [in,out] dataoffs If non-null, the dataoffs.
*
- * @return An UINT32.
+ * @return An uint32_t.
*/
-static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs)
+static uint32_t parse_wav_sample(const char *filename, uint32_t *dataoffs)
{
unsigned long offset = 0;
- UINT32 length, rate, filesize;
- UINT16 bits, temp16;
+ uint32_t length, rate, filesize;
+ uint16_t bits, temp16;
char buf[32];
osd_file::ptr file;
- UINT64 fsize = 0;
+ uint64_t fsize = 0;
std::uint32_t actual;
osd_file::error filerr = osd_file::open(filename, OPEN_FLAG_READ, file, fsize);
@@ -361,7 +361,7 @@ static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs)
}
/**
- * @fn UINT16 read_uint16(FILE *infile)
+ * @fn uint16_t read_uint16(FILE *infile)
*
* @brief Reads uint 16.
*
@@ -370,9 +370,9 @@ static UINT32 parse_wav_sample(const char *filename, UINT32 *dataoffs)
* @return The uint 16.
*/
-UINT16 read_uint16(FILE *infile)
+uint16_t read_uint16(FILE *infile)
{
- UINT16 res = 0;
+ uint16_t res = 0;
unsigned char buffer[2];
fread(buffer, 2, 1, infile);
@@ -383,7 +383,7 @@ UINT16 read_uint16(FILE *infile)
}
/**
- * @fn UINT32 read_uint32(FILE *infile)
+ * @fn uint32_t read_uint32(FILE *infile)
*
* @brief Reads uint 32.
*
@@ -392,9 +392,9 @@ UINT16 read_uint16(FILE *infile)
* @return The uint 32.
*/
-UINT32 read_uint32(FILE *infile)
+uint32_t read_uint32(FILE *infile)
{
- UINT32 res = 0;
+ uint32_t res = 0;
unsigned char buffer[4];
fread(buffer, 4, 1, infile);
@@ -405,7 +405,7 @@ UINT32 read_uint32(FILE *infile)
}
/**
- * @fn UINT64 read_uint64(FILE *infile)
+ * @fn uint64_t read_uint64(FILE *infile)
*
* @brief Reads uint 64.
*
@@ -414,10 +414,10 @@ UINT32 read_uint32(FILE *infile)
* @return The uint 64.
*/
-UINT64 read_uint64(FILE *infile)
+uint64_t read_uint64(FILE *infile)
{
- UINT64 res0 = U64(0), res1 = U64(0);
- UINT64 res;
+ uint64_t res0 = U64(0), res1 = U64(0);
+ uint64_t res;
unsigned char buffer[8];
fread(buffer, 8, 1, infile);
@@ -450,7 +450,7 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_
{
FILE *infile;
unsigned char buffer[12];
- UINT32 chain_offs, chunk_size;
+ uint32_t chain_offs, chunk_size;
int done = 0;
std::string path = std::string(tocfname);
@@ -491,8 +491,8 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_
while (!done)
{
- UINT32 offset;
- UINT8 start, end;
+ uint32_t offset;
+ uint8_t start, end;
int track;
fseek(infile, chain_offs, SEEK_SET);
@@ -518,8 +518,8 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_
offset = 0;
for (track = start; track <= end; track++)
{
- UINT32 size, mode;
- UINT64 index0, index1, track_end;
+ uint32_t size, mode;
+ uint64_t index0, index1, track_end;
fseek(infile, 12, SEEK_CUR); // skip ISRC code
size = read_uint16(infile);
@@ -529,9 +529,9 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_
index1 = read_uint64(infile);
track_end = read_uint64(infile);
-// printf("Track %d: sector size %d mode %x index0 %llx index1 %llx track_end %llx (pregap %d sectors, length %d sectors)\n", track, size, mode, index0, index1, track_end, (UINT32)(index1-index0)/size, (UINT32)(track_end-index1)/size);
+// printf("Track %d: sector size %d mode %x index0 %llx index1 %llx track_end %llx (pregap %d sectors, length %d sectors)\n", track, size, mode, index0, index1, track_end, (uint32_t)(index1-index0)/size, (uint32_t)(track_end-index1)/size);
outinfo.track[track-1].fname.assign(tocfname);
- outinfo.track[track-1].offset = offset + (UINT32)(index1-index0);
+ outinfo.track[track-1].offset = offset + (uint32_t)(index1-index0);
outinfo.track[track-1].idx0offs = 0;
outinfo.track[track-1].idx1offs = 0;
@@ -588,8 +588,8 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_
outtoc.tracks[track-1].subtype = CD_SUB_NONE;
outtoc.tracks[track-1].subsize = 0;
- outtoc.tracks[track-1].pregap = (UINT32)(index1-index0)/size;
- outtoc.tracks[track-1].frames = (UINT32)(track_end-index1)/size;
+ outtoc.tracks[track-1].pregap = (uint32_t)(index1-index0)/size;
+ outtoc.tracks[track-1].frames = (uint32_t)(track_end-index1)/size;
outtoc.tracks[track-1].postgap = 0;
outtoc.tracks[track-1].pgtype = 0;
outtoc.tracks[track-1].pgsub = CD_SUB_NONE;
@@ -597,7 +597,7 @@ chd_error chdcd_parse_nero(const char *tocfname, cdrom_toc &outtoc, chdcd_track_
outtoc.tracks[track-1].pgsubsize = 0;
outtoc.tracks[track-1].padframes = 0;
- offset += (UINT32)track_end-index1;
+ offset += (uint32_t)track_end-index1;
}
}
@@ -649,7 +649,7 @@ chd_error chdcd_parse_iso(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
memset(&outtoc, 0, sizeof(outtoc));
outinfo.reset();
- UINT64 size = get_file_size(tocfname);
+ uint64_t size = get_file_size(tocfname);
fclose(infile);
@@ -846,7 +846,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
int i, trknum;
static char token[512];
std::string lastfname;
- UINT32 wavlen, wavoffs;
+ uint32_t wavlen, wavoffs;
std::string path = std::string(tocfname);
infile = fopen(tocfname, "rt");
@@ -1039,7 +1039,7 @@ chd_error chdcd_parse_cue(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
/* now go over the files again and set the lengths */
for (trknum = 0; trknum < outtoc.numtrks; trknum++)
{
- UINT64 tlen = 0;
+ uint64_t tlen = 0;
// this is true for cue/bin and cue/iso, and we need it for cue/wav since .WAV is little-endian
if (outtoc.tracks[trknum].trktype == CD_TRACK_AUDIO)
@@ -1226,7 +1226,7 @@ chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
/* it's a decimal offset, use it */
f = strtoul(&token[1], nullptr, 10);
}
- else if (isdigit((UINT8)token[0]))
+ else if (isdigit((uint8_t)token[0]))
{
/* convert the time to an offset */
f = msf_to_frames( token );
@@ -1242,14 +1242,14 @@ chd_error chdcd_parse_toc(const char *tocfname, cdrom_toc &outtoc, chdcd_track_i
TOKENIZE
- if (isdigit((UINT8)token[0]))
+ if (isdigit((uint8_t)token[0]))
{
// this could be the length or an offset from the previous field.
f = msf_to_frames( token );
TOKENIZE
- if (isdigit((UINT8)token[0]))
+ if (isdigit((uint8_t)token[0]))
{
// it was an offset.
f *= (outtoc.tracks[trknum].datasize + outtoc.tracks[trknum].subsize);