diff options
Diffstat (limited to 'src/tools/split.cpp')
-rw-r--r-- | src/tools/split.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tools/split.cpp b/src/tools/split.cpp index 586264283d7..31c95ad41a8 100644 --- a/src/tools/split.cpp +++ b/src/tools/split.cpp @@ -32,16 +32,16 @@ hash over a buffer and return a string -------------------------------------------------*/ -static void compute_hash_as_string(std::string &buffer, void *data, UINT32 length) +static void compute_hash_as_string(std::string &buffer, void *data, uint32_t length) { char expanded[SHA1_DIGEST_SIZE * 2]; - UINT8 sha1digest[SHA1_DIGEST_SIZE]; + uint8_t sha1digest[SHA1_DIGEST_SIZE]; struct sha1_ctx sha1; int ch; // compute the SHA1 sha1_init(&sha1); - sha1_update(&sha1, length, (const UINT8 *)data); + sha1_update(&sha1, length, (const uint8_t *)data); sha1_final(&sha1); sha1_digest(&sha1, sizeof(sha1digest), sha1digest); @@ -61,14 +61,14 @@ static void compute_hash_as_string(std::string &buffer, void *data, UINT32 lengt split_file - split a file into multiple parts -------------------------------------------------*/ -static int split_file(const char *filename, const char *basename, UINT32 splitsize) +static int split_file(const char *filename, const char *basename, uint32_t splitsize) { std::string outfilename, basefilename, splitfilename; util::core_file::ptr outfile, infile, splitfile; std::string computedhash; void *splitbuffer = nullptr; int index, partnum; - UINT64 totallength; + uint64_t totallength; osd_file::error filerr; int error = 1; @@ -95,7 +95,7 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi fprintf(stderr, "Fatal error: file is smaller than the split size\n"); goto cleanup; } - if ((UINT64)splitsize * MAX_PARTS < totallength) + if ((uint64_t)splitsize * MAX_PARTS < totallength) { fprintf(stderr, "Fatal error: too many splits (maximum is %d)\n", MAX_PARTS); goto cleanup; @@ -136,7 +136,7 @@ static int split_file(const char *filename, const char *basename, UINT32 splitsi // now iterate until done for (partnum = 0; partnum < 1000; partnum++) { - UINT32 actual, length; + uint32_t actual, length; printf("Reading part %d...", partnum); @@ -220,7 +220,7 @@ static int join_file(const char *filename, const char *outname, int write_output util::core_file::ptr outfile, infile, splitfile; void *splitbuffer = nullptr; osd_file::error filerr; - UINT32 splitsize; + uint32_t splitsize; char buffer[256]; int error = 1; int index; @@ -289,7 +289,7 @@ static int join_file(const char *filename, const char *outname, int write_output // now iterate through each file while (splitfile->gets(buffer, sizeof(buffer))) { - UINT32 length, actual; + uint32_t length, actual; // make sure the hash and filename are in the right place if (strncmp(buffer, "hash=", 5) != 0 || strncmp(buffer + 5 + SHA1_DIGEST_SIZE * 2, " file=", 6) != 0) |