From 393e4fb5b5529c666438ef04ebd076f90dd287fa Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 30 Aug 2011 20:42:51 -0400 Subject: Use %f with printf-style formatting, not %lf For printf, %f and %lf are synonymous, since floats are promoted to doubles when passed as varargs. It's only for scanf that we need to say "%lf" for doubles and "%f" for floats. Apparenly, some older compilers think it's naughty to say %lf and like to spew warnings about it. Found by grarpamp. --- src/test/test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/test') diff --git a/src/test/test.c b/src/test/test.c index 9b24a99b58..b5b744eba7 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -455,7 +455,7 @@ test_circuit_timeout(void) timeout1 = circuit_build_times_calculate_timeout(&estimate, CBT_DEFAULT_QUANTILE_CUTOFF/100.0); circuit_build_times_set_timeout(&estimate); - log_notice(LD_CIRC, "Timeout1 is %lf, Xm is %d", timeout1, estimate.Xm); + log_notice(LD_CIRC, "Timeout1 is %f, Xm is %d", timeout1, estimate.Xm); /* 2% error */ } while (fabs(circuit_build_times_cdf(&initial, timeout0) - circuit_build_times_cdf(&initial, timeout1)) > 0.02); @@ -470,7 +470,7 @@ test_circuit_timeout(void) CBT_DEFAULT_QUANTILE_CUTOFF/100.0); circuit_build_times_set_timeout(&final); - log_notice(LD_CIRC, "Timeout2 is %lf, Xm is %d", timeout2, final.Xm); + log_notice(LD_CIRC, "Timeout2 is %f, Xm is %d", timeout2, final.Xm); /* 5% here because some accuracy is lost due to histogram conversion */ test_assert(fabs(circuit_build_times_cdf(&initial, timeout0) - -- cgit v1.2.3-54-g00ecf