[tor-commits] [tor/master] Re-do a cast in order to make old buggy freebsd gcc happy

nickm at torproject.org nickm at torproject.org
Tue Jul 16 18:50:05 UTC 2013


commit c36bdbd53521a9b7d2213cde1f9f0f8fe8ac7441
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Jul 16 14:48:12 2013 -0400

    Re-do a cast in order to make old buggy freebsd gcc happy
    
    Fix for #9254.  Bugfix on 0.2.4.14-alpha.
    
    This is not actually a bug in the Tor code.
---
 changes/bug9254      |    4 ++++
 src/or/circuitlist.c |    6 ++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/changes/bug9254 b/changes/bug9254
new file mode 100644
index 0000000..5179bdc
--- /dev/null
+++ b/changes/bug9254
@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Fix a spurious compilation warning with some older versions of
+      GCC on FreeBSD. Fixes bug 9254; bugfix on 0.2.4.14-alpha.
+
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 3dc362f..daeaa37 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -1518,8 +1518,10 @@ static size_t
 n_cells_in_circ_queues(const circuit_t *c)
 {
   size_t n = c->n_chan_cells.n;
-  if (! CIRCUIT_IS_ORIGIN(c))
-    n += TO_OR_CIRCUIT((circuit_t*)c)->p_chan_cells.n;
+  if (! CIRCUIT_IS_ORIGIN(c)) {
+    circuit_t *cc = (circuit_t *) c;
+    n += TO_OR_CIRCUIT(cc)->p_chan_cells.n;
+  }
   return n;
 }
 





More information about the tor-commits mailing list