diff options
author | Guy Harris <guy@alum.mit.edu> | 2020-02-04 19:53:11 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2020-02-04 19:53:11 -0800 |
commit | 52561ff05323cc5aae2bf836ecccf62c878b7690 (patch) | |
tree | 4644f3f853b645b8ba5f048e99e442018daf4913 /tcpdump.c | |
parent | aa2650ec0e9f4146a4f3c4dc9c3c58d231bbfef9 (diff) | |
download | tcpdump-52561ff05323cc5aae2bf836ecccf62c878b7690.tar.gz |
Push the floating-point test into a separate file.
Hopefully, that will make sure we don't optimize away anything that
will, for example, cause us not to do things differently on 32-bit x86
using the x87 instructions.
Diffstat (limited to 'tcpdump.c')
-rw-r--r-- | tcpdump.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -150,6 +150,8 @@ 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 @@ -1901,14 +1903,7 @@ main(int argc, char **argv) * may differ (e.g., it might be 32-bit, 64-bit, * or 80-bit). */ - { - union { /* int to float conversion buffer */ - float f; - uint32_t i; - } f; - f.i = 0x4e93312d; - printf("%.3f\n", f.f*8/1000000); - } + float_type_check(0x4e93312d); return 0; default: |