]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Define FMAXINT only once and use it properly.
authorDenis Ovsienko <[email protected]>
Tue, 28 Jul 2020 15:02:07 +0000 (16:02 +0100)
committerDenis Ovsienko <[email protected]>
Tue, 28 Jul 2020 15:02:07 +0000 (16:02 +0100)
[skip ci]

netdissect.h
ntp.h
print-udp.c
print-zep.c

index bb1483a43af353ee7d4e4b2985d268af39eca331..6c384439c61c5bb41c550166a9c8c99332482c01 100644 (file)
@@ -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 6b5ff95f3858e7b67d390524f2bbb095f0596207..78644e28215625fbdd7b68d75282cc3801ffdba4 100644 (file)
--- 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 *);
index 75c4fb911c78b47d22434cdbce0679e00769f1a7..96d827ccaa020b4e3a90384099419f98a33a8779 100644 (file)
@@ -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);
index f6be3a64ce26ef85c0d2ff183928536f8b84fd64..017049d49da93764d463e7722f69f3fb0a2a13ce 100644 (file)
@@ -57,7 +57,6 @@
  *------------------------------------------------------------
  */
 
-#define     FMAXINT (4294967296.0)  /* floating point rep. of MAXINT */
 #define     JAN_1970        2208988800U
 
 /* Print timestamp */