summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ovsienko <denis@ovsienko.info>2020-07-28 16:02:07 +0100
committerDenis Ovsienko <denis@ovsienko.info>2020-07-28 16:02:07 +0100
commit4806d509852dd162efd0669e6d3f75f174f2cb1b (patch)
tree4cae7e1918011bfab2ab14d51d2d2b860731725e
parentcaa364c8ca97f9a338dd7edba4c45b0d65bd90e8 (diff)
downloadtcpdump-4806d509852dd162efd0669e6d3f75f174f2cb1b.tar.gz
Define FMAXINT only once and use it properly.
[skip ci]
-rw-r--r--netdissect.h2
-rw-r--r--ntp.h2
-rw-r--r--print-udp.c2
-rw-r--r--print-zep.c1
4 files changed, 3 insertions, 4 deletions
diff --git a/netdissect.h b/netdissect.h
index bb1483a4..6c384439 100644
--- a/netdissect.h
+++ b/netdissect.h
@@ -61,6 +61,8 @@ typedef signed char nd_int8_t[1];
typedef unsigned char nd_int32_t[4];
typedef unsigned char nd_int64_t[8];
+#define FMAXINT (4294967296.0) /* floating point rep. of MAXINT */
+
/*
* Use this for IPv4 addresses and netmasks.
*
diff --git a/ntp.h b/ntp.h
index 6b5ff95f..78644e28 100644
--- a/ntp.h
+++ b/ntp.h
@@ -51,6 +51,4 @@ struct s_fixedpt {
nd_uint16_t fraction;
};
-#define FMAXINT (4294967296.0) /* floating point rep. of MAXINT */
-
void p_ntp_time(netdissect_options *, const struct l_fixedpt *);
diff --git a/print-udp.c b/print-udp.c
index 75c4fb91..96d827cc 100644
--- a/print-udp.c
+++ b/print-udp.c
@@ -260,7 +260,7 @@ rtcp_print(netdissect_options *ndo, const u_char *hdr, const u_char *ep)
ND_TCHECK_SIZE(sr);
ts = (double)(GET_BE_U_4(sr->sr_ntp.upper)) +
((double)(GET_BE_U_4(sr->sr_ntp.lower)) /
- 4294967296.0);
+ FMAXINT);
ND_PRINT(" @%.2f %u %up %ub", ts, GET_BE_U_4(sr->sr_ts),
GET_BE_U_4(sr->sr_np), GET_BE_U_4(sr->sr_nb));
rr = (const struct rtcp_rr *)(sr + 1);
diff --git a/print-zep.c b/print-zep.c
index f6be3a64..017049d4 100644
--- a/print-zep.c
+++ b/print-zep.c
@@ -57,7 +57,6 @@
*------------------------------------------------------------
*/
-#define FMAXINT (4294967296.0) /* floating point rep. of MAXINT */
#define JAN_1970 2208988800U
/* Print timestamp */