diff options
author | Guy Harris <guy@alum.mit.edu> | 2020-02-04 19:45:41 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2020-02-04 19:45:41 -0800 |
commit | aa2650ec0e9f4146a4f3c4dc9c3c58d231bbfef9 (patch) | |
tree | a6a86a7006785f7d0f4399026773eba95efd6afe /tcpdump.c | |
parent | 565131d8e7d181b3de15c6762f3cec52f2fbd1e1 (diff) | |
download | tcpdump-aa2650ec0e9f4146a4f3c4dc9c3c58d231bbfef9.tar.gz |
Do the floating-point tests closer to what we need.
It's All Very Complicated, so mirror what print-lmp.c does - just do a
calculation based on a particular input value and print the result using
the same format print-lmp.c does, and have tests/TESTrun see what that
result is.
Just do that inside tcpdump.c, so we don't need the fptype stuff.
Diffstat (limited to 'tcpdump.c')
-rw-r--r-- | tcpdump.c | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -150,8 +150,6 @@ The Regents of the University of California. All rights reserved.\n"; #include "print.h" -#include "fptype.h" - #ifndef PATH_MAX #define PATH_MAX 1024 #endif @@ -1903,15 +1901,13 @@ main(int argc, char **argv) * may differ (e.g., it might be 32-bit, 64-bit, * or 80-bit). */ - switch (float_type_check(0x4e93312d)) { - - case 0x461a5794: - printf("FPTYPE1\n"); - break; - - default: - printf("FPTYPE2\n"); - break; + { + union { /* int to float conversion buffer */ + float f; + uint32_t i; + } f; + f.i = 0x4e93312d; + printf("%.3f\n", f.f*8/1000000); } return 0; |