From 92ce4078b1086fcb53fc931fb5a81b9fd54ad509 Mon Sep 17 00:00:00 2001 From: AJR Date: Wed, 15 Sep 2021 22:13:10 -0400 Subject: Fix build on systems where size_t is not the same as uint64_t --- src/lib/util/jedparse.cpp | 4 ++-- src/lib/util/plaparse.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/util/jedparse.cpp b/src/lib/util/jedparse.cpp index f883aa747b9..b667121b7ba 100644 --- a/src/lib/util/jedparse.cpp +++ b/src/lib/util/jedparse.cpp @@ -194,7 +194,7 @@ int jed_parse(util::random_read &src, jed_data *result) { jed_parse_info pinfo; int i; - uint64_t actual; + std::size_t actual; /* initialize the output and the intermediate info struct */ memset(result, 0, sizeof(*result)); @@ -405,7 +405,7 @@ int jedbin_parse(util::read_stream &src, jed_data *result) /* need at least 4 bytes */ uint8_t buf[4]; - uint64_t actual; + std::size_t actual; if (src.read(&buf[0], 4, actual) || actual != 4) return JEDERR_INVALID_DATA; diff --git a/src/lib/util/plaparse.cpp b/src/lib/util/plaparse.cpp index a085a27b635..798abf41c23 100644 --- a/src/lib/util/plaparse.cpp +++ b/src/lib/util/plaparse.cpp @@ -69,7 +69,7 @@ static uint32_t suck_number(util::random_read &src) // find first digit uint8_t ch; - uint64_t actual; + std::size_t actual; bool found = false; while (!src.read(&ch, 1, actual) && actual == 1) { @@ -193,7 +193,7 @@ static bool process_terms(jed_data *data, util::random_read &src, uint8_t &ch, p curoutput = 0; } - uint64_t actual; + std::size_t actual; if (src.read(&ch, 1, actual)) return false; if (actual != 1) @@ -233,7 +233,7 @@ static bool process_field(jed_data *data, util::random_read &src, parse_info *pi int destptr = 0; uint8_t seek; - uint64_t actual; + std::size_t actual; while (!src.read(&seek, 1, actual) && actual == 1 && isalpha(seek)) { dest[destptr++] = tolower(seek); @@ -329,7 +329,7 @@ int pla_parse(util::random_read &src, jed_data *result) memset(result->fusemap, 0, sizeof(result->fusemap)); uint8_t ch; - uint64_t actual; + std::size_t actual; while (!src.read(&ch, 1, actual) && actual == 1) { switch (ch) -- cgit v1.2.3