diff options
author | Ben Smith <binji@chromium.org> | 2020-01-08 11:46:46 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-08 11:46:46 -0800 |
commit | 7816cb16849ba5298c147e3ae7f6c139207fdcb6 (patch) | |
tree | 345920b7fa60a9670a5d67fbe967ffd4fa102a13 /src/test-hexfloat.cc | |
parent | e2e1d1d7fc6e78bfcf98b5b1a6390d3ab534929a (diff) | |
download | wabt-7816cb16849ba5298c147e3ae7f6c139207fdcb6.tar.gz wabt-7816cb16849ba5298c147e3ae7f6c139207fdcb6.tar.bz2 wabt-7816cb16849ba5298c147e3ae7f6c139207fdcb6.zip |
Fix warning in test-hexfloat.cc (#1201)
A float can't always fit a uint32_t, but a double can.
Diffstat (limited to 'src/test-hexfloat.cc')
-rw-r--r-- | src/test-hexfloat.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/test-hexfloat.cc b/src/test-hexfloat.cc index daf5a51d..f77d7746 100644 --- a/src/test-hexfloat.cc +++ b/src/test-hexfloat.cc @@ -35,15 +35,15 @@ for (; bits >= last_bits; \ last_bits = bits, bits += num_threads_ * FOREACH_UINT32_MULTIPLIER) -#define LOG_COMPLETION(bits) \ - if (shard == 0) { \ - int top_byte = bits >> 24; \ - if (top_byte != last_top_byte) { \ - printf("value: 0x%08x (%d%%)\r", bits, \ - static_cast<int>(static_cast<float>(bits) * 100 / UINT32_MAX)); \ - fflush(stdout); \ - last_top_byte = top_byte; \ - } \ +#define LOG_COMPLETION(bits) \ + if (shard == 0) { \ + int top_byte = bits >> 24; \ + if (top_byte != last_top_byte) { \ + printf("value: 0x%08x (%d%%)\r", bits, \ + static_cast<int>(static_cast<double>(bits) * 100 / UINT32_MAX)); \ + fflush(stdout); \ + last_top_byte = top_byte; \ + } \ } #define LOG_DONE() \ |