summaryrefslogtreecommitdiff
path: root/print-ntp.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-09-14 15:06:33 -0700
committerGuy Harris <guy@alum.mit.edu>2015-09-14 15:06:33 -0700
commit9883c76d127f71c8ed4a193ea34afa1b1cbf177e (patch)
treed87912fed0018a4c43a79b440227e4c1a860f2ed /print-ntp.c
parent2be6e0e953295bb5886a9592ee94c881b796ee76 (diff)
downloadtcpdump-9883c76d127f71c8ed4a193ea34afa1b1cbf177e.tar.gz
Consistently use float constants.
Diffstat (limited to 'print-ntp.c')
-rw-r--r--print-ntp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/print-ntp.c b/print-ntp.c
index ffbdd8f6..908c5360 100644
--- a/print-ntp.c
+++ b/print-ntp.c
@@ -330,12 +330,12 @@ p_sfix(netdissect_options *ndo,
i = EXTRACT_16BITS(&sfp->int_part);
f = EXTRACT_16BITS(&sfp->fraction);
- ff = f / 65536.0; /* shift radix point by 16 bits */
- f = ff * 1000000.0; /* Treat fraction as parts per million */
+ ff = f / 65536.0f; /* shift radix point by 16 bits */
+ f = ff * 1000000.0f; /* Treat fraction as parts per million */
ND_PRINT((ndo, "%d.%06d", i, f));
}
-#define FMAXINT (4294967296.0) /* floating point rep. of MAXINT */
+#define FMAXINT (4294967296.0f) /* floating point rep. of MAXINT */
static void
p_ntp_time(netdissect_options *ndo,
@@ -349,10 +349,10 @@ p_ntp_time(netdissect_options *ndo,
i = EXTRACT_32BITS(&lfp->int_part);
uf = EXTRACT_32BITS(&lfp->fraction);
ff = uf;
- if (ff < 0.0) /* some compilers are buggy */
+ if (ff < 0.0f) /* some compilers are buggy */
ff += FMAXINT;
ff = ff / FMAXINT; /* shift radix point by 32 bits */
- f = ff * 1000000000.0; /* treat fraction as parts per billion */
+ f = ff * 1000000000.0f; /* treat fraction as parts per billion */
ND_PRINT((ndo, "%u.%09d", i, f));
#ifdef HAVE_STRFTIME
@@ -417,10 +417,10 @@ p_ntp_delta(netdissect_options *ndo,
}
ff = f;
- if (ff < 0.0) /* some compilers are buggy */
+ if (ff < 0.0f) /* some compilers are buggy */
ff += FMAXINT;
ff = ff / FMAXINT; /* shift radix point by 32 bits */
- f = ff * 1000000000.0; /* treat fraction as parts per billion */
+ f = ff * 1000000000.0f; /* treat fraction as parts per billion */
ND_PRINT((ndo, "%s%d.%09d", signbit ? "-" : "+", i, f));
}