[or-cvs] r11981: Backport warning-suppression for gcc 4.2. (in tor/branches/tor-0_1_2-patches: . src/or)

nickm at seul.org nickm at seul.org
Tue Oct 16 13:59:34 UTC 2007


Author: nickm
Date: 2007-10-16 09:59:34 -0400 (Tue, 16 Oct 2007)
New Revision: 11981

Modified:
   tor/branches/tor-0_1_2-patches/
   tor/branches/tor-0_1_2-patches/src/or/circuitlist.c
Log:
 r15842 at catbus:  nickm | 2007-10-16 09:58:33 -0400
 Backport warning-suppression for gcc 4.2.



Property changes on: tor/branches/tor-0_1_2-patches
___________________________________________________________________
 svk:merge ticket from /tor/012 [r15842] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/branches/tor-0_1_2-patches/src/or/circuitlist.c
===================================================================
--- tor/branches/tor-0_1_2-patches/src/or/circuitlist.c	2007-10-16 13:59:32 UTC (rev 11980)
+++ tor/branches/tor-0_1_2-patches/src/or/circuitlist.c	2007-10-16 13:59:34 UTC (rev 11981)
@@ -1056,10 +1056,15 @@
   tor_assert(c->purpose >= _CIRCUIT_PURPOSE_MIN &&
              c->purpose <= _CIRCUIT_PURPOSE_MAX);
 
-  if (CIRCUIT_IS_ORIGIN(c))
-    origin_circ = TO_ORIGIN_CIRCUIT((circuit_t*)c);
-  else
-    or_circ = TO_OR_CIRCUIT((circuit_t*)c);
+  {
+    /* Having a separate variable for this pleases GCC 4.2 in ways I hope I
+     * never understand. -NM. */
+    circuit_t *nonconst_circ = (circuit_t*) c;
+    if (CIRCUIT_IS_ORIGIN(c))
+      origin_circ = TO_ORIGIN_CIRCUIT(nonconst_circ);
+    else
+      or_circ = TO_OR_CIRCUIT(nonconst_circ);
+  }
 
   if (c->n_conn) {
     tor_assert(!memcmp(c->n_conn->identity_digest, c->n_conn_id_digest,



More information about the tor-commits mailing list