diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-05-30 12:54:31 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-06-11 10:11:52 -0400 |
commit | 493499a3399f8a8532b4b2a80006c033e8f64c58 (patch) | |
tree | fb1965c627838137ecd4634fba00cbcccd253372 /src/or/confparse.c | |
parent | 2ff20c93a5ec753a0c46ca5ecd991b8e2020f7d0 (diff) | |
download | tor-493499a3399f8a8532b4b2a80006c033e8f64c58.tar.gz tor-493499a3399f8a8532b4b2a80006c033e8f64c58.zip |
Add -Wfloat-conversion for GCC >= 4.9
This caught quite a few minor issues in our unit tests and elsewhere
in our code.
Diffstat (limited to 'src/or/confparse.c')
-rw-r--r-- | src/or/confparse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/confparse.c b/src/or/confparse.c index 4f446d07c3..3532b39d93 100644 --- a/src/or/confparse.c +++ b/src/or/confparse.c @@ -1238,7 +1238,7 @@ config_parse_units(const char *val, struct unit_table_t *u, int *ok) v = tor_parse_uint64(val, 10, 0, UINT64_MAX, ok, &cp); if (!*ok || (cp && *cp == '.')) { - d = tor_parse_double(val, 0, UINT64_MAX, ok, &cp); + d = tor_parse_double(val, 0, (double)UINT64_MAX, ok, &cp); if (!*ok) goto done; use_float = 1; @@ -1255,7 +1255,7 @@ config_parse_units(const char *val, struct unit_table_t *u, int *ok) for ( ;u->unit;++u) { if (!strcasecmp(u->unit, cp)) { if (use_float) - v = u->multiplier * d; + v = (uint64_t)(u->multiplier * d); else v *= u->multiplier; *ok = 1; |