diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-05-30 13:57:32 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-06-11 10:11:52 -0400 |
commit | 8f2d2933f912c9952453b17b19636c26579e2323 (patch) | |
tree | 2165851a39ac9517d9328481e230490ddc47f421 /src/test/test_channeltls.c | |
parent | 493499a3399f8a8532b4b2a80006c033e8f64c58 (diff) | |
download | tor-8f2d2933f912c9952453b17b19636c26579e2323.tar.gz tor-8f2d2933f912c9952453b17b19636c26579e2323.zip |
Use -Wdouble-promotion in GCC >= 4.6
This warning triggers on silently promoting a float to a double. In
our code, it's just a sign that somebody used a float by mistake,
since we always prefer double.
Diffstat (limited to 'src/test/test_channeltls.c')
-rw-r--r-- | src/test/test_channeltls.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/test/test_channeltls.c b/src/test/test_channeltls.c index f5fa50c31e..394612f155 100644 --- a/src/test/test_channeltls.c +++ b/src/test/test_channeltls.c @@ -206,31 +206,31 @@ test_channeltls_overhead_estimate(void *arg) ch = channel_tls_connect(&test_addr, 567, test_digest); tt_assert(ch != NULL); - /* First case: silly low ratios should get clamped to 1.0f */ + /* First case: silly low ratios should get clamped to 1.0 */ tlschan = BASE_CHAN_TO_TLS(ch); tt_assert(tlschan != NULL); tlschan->conn->bytes_xmitted = 128; tlschan->conn->bytes_xmitted_by_tls = 64; r = ch->get_overhead_estimate(ch); - tt_assert(fabs(r - 1.0f) < 1E-12); + tt_assert(fabs(r - 1.0) < 1E-12); tlschan->conn->bytes_xmitted_by_tls = 127; r = ch->get_overhead_estimate(ch); - tt_assert(fabs(r - 1.0f) < 1E-12); + tt_assert(fabs(r - 1.0) < 1E-12); /* Now middle of the range */ tlschan->conn->bytes_xmitted_by_tls = 192; r = ch->get_overhead_estimate(ch); - tt_assert(fabs(r - 1.5f) < 1E-12); + tt_assert(fabs(r - 1.5) < 1E-12); - /* Now above the 2.0f clamp */ + /* Now above the 2.0 clamp */ tlschan->conn->bytes_xmitted_by_tls = 257; r = ch->get_overhead_estimate(ch); - tt_assert(fabs(r - 2.0f) < 1E-12); + tt_assert(fabs(r - 2.0) < 1E-12); tlschan->conn->bytes_xmitted_by_tls = 512; r = ch->get_overhead_estimate(ch); - tt_assert(fabs(r - 2.0f) < 1E-12); + tt_assert(fabs(r - 2.0) < 1E-12); done: if (ch) { |