diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-08-21 10:19:26 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-08-21 10:19:26 -0400 |
commit | 2a0a5fe6123bd87f996814991641cc404601ea55 (patch) | |
tree | 3f9511c9cbb39231850881bf970fbb9d09c27807 /src/or/routerlist.c | |
parent | b6a725c67e46d274a518b6c5243fffdf1730a23f (diff) | |
download | tor-2a0a5fe6123bd87f996814991641cc404601ea55.tar.gz tor-2a0a5fe6123bd87f996814991641cc404601ea55.zip |
Explicitly cast when dividing ints then implicitly casting to double.
Coverity thinks that when we do "double x = int1/int2;", we probably
meant "double x = ((double)int1) / int2;". In these cases, we
didn't.
[Coverity CID 1232089 and 1232090]
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 12ed71d01e..14451c0cd8 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -1809,7 +1809,7 @@ scale_array_elements_to_u64(u64_dbl_t *entries, int n_entries, double scale_factor; int i; /* big, but far away from overflowing an int64_t */ -#define SCALE_TO_U64_MAX (INT64_MAX / 4) +#define SCALE_TO_U64_MAX ((int64_t) (INT64_MAX / 4)) for (i = 0; i < n_entries; ++i) total += entries[i].dbl; |