[tor-commits] [tor/release-0.2.2] Switch a SMARTLIST_FOREACH in circuitbuild.c to BEGIN/END

arma at torproject.org arma at torproject.org
Fri Sep 9 17:20:10 UTC 2011


commit 561ab14a5ed64dd3994fe23073e74efa3498e589
Author: Nick Mathewson <nickm at torproject.org>
Date:   Tue Aug 30 20:35:17 2011 -0400

    Switch a SMARTLIST_FOREACH in circuitbuild.c to BEGIN/END
    
    It had some cpp stuff inside, and older GCCs don't like preprocessor
    directives inside macro arguments.
    
    Found by grarpamp.
---
 src/or/circuitbuild.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index a63e89b..3c1f63a 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -4095,7 +4095,7 @@ choose_random_entry(cpath_build_state_t *state)
 
  retry:
   smartlist_clear(live_entry_guards);
-  SMARTLIST_FOREACH(entry_guards, entry_guard_t *, entry,
+  SMARTLIST_FOREACH_BEGIN(entry_guards, entry_guard_t *, entry)
     {
       const char *msg;
       r = entry_is_live(entry, need_uptime, need_capacity, 0, &msg);
@@ -4131,7 +4131,8 @@ choose_random_entry(cpath_build_state_t *state)
       }
       if (smartlist_len(live_entry_guards) >= options->NumEntryGuards)
         break; /* we have enough */
-    });
+    }
+  SMARTLIST_FOREACH_END(entry);
 
   if (entry_list_is_constrained(options)) {
     /* If we prefer the entry nodes we've got, and we have at least





More information about the tor-commits mailing list