]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Silence -Wbad-function-cast warning (when DEBUG_SMARTLIST is on)
authorrl1987 <rl1987@sdf.lonestar.org>
Sun, 3 Jun 2018 13:45:09 +0000 (16:45 +0300)
committerrl1987 <rl1987@sdf.lonestar.org>
Sun, 3 Jun 2018 13:45:09 +0000 (16:45 +0300)
changes/bug26283 [new file with mode: 0644]
src/or/routerlist.c

diff --git a/changes/bug26283 b/changes/bug26283
new file mode 100644 (file)
index 0000000..5ec856a
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes (C correctness):
+    - Avoid casting return value of smartlist_len() to double as
+      compiler does not like it when -Wbad-function-cast is on.
+      Fixes bug 26283; bugfix on 0.2.4.10-alpha.
index 7603eb3ecf66e6774c68e040fe2667f49faf8bf5..8788dc0190eb4e2d87fb22025123c279de78ae0b 100644 (file)
@@ -2764,7 +2764,7 @@ frac_nodes_with_descriptors(const smartlist_t *sl,
       if (node_has_any_descriptor(node))
         n_with_descs++;
     });
-    return ((double)n_with_descs) / (double)smartlist_len(sl);
+    return ((double)n_with_descs) / smartlist_len(sl);
   }
 
   present = 0.0;