aboutsummaryrefslogtreecommitdiff
path: root/changes/smartlist_foreach
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-07-17 09:33:38 -0400
committerNick Mathewson <nickm@torproject.org>2012-07-17 10:34:08 -0400
commit7faf115dfffaf12cdae98eac71fc6811059c6657 (patch)
tree61d42ba38202e6cb233cc89082228abbd55a4b56 /changes/smartlist_foreach
parent21c6c8485367ce66ab0791c153177c17bccd25c5 (diff)
downloadtor-7faf115dfffaf12cdae98eac71fc6811059c6657.tar.gz
tor-7faf115dfffaf12cdae98eac71fc6811059c6657.zip
Change all SMARTLIST_FOREACH loops of >=10 lines to use BEGIN/END
The SMARTLIST_FOREACH macro is more convenient than BEGIN/END when you have a nice short loop body, but using it for long bodies makes your preprocessor tell the compiler that all the code is on the same line. That causes grief, since compiler warnings and debugger lines will all refer to that one line. So, here's a new style rule: SMARTLIST_FOREACH blocks need to be short.
Diffstat (limited to 'changes/smartlist_foreach')
-rw-r--r--changes/smartlist_foreach4
1 files changed, 4 insertions, 0 deletions
diff --git a/changes/smartlist_foreach b/changes/smartlist_foreach
new file mode 100644
index 0000000000..d1e3505468
--- /dev/null
+++ b/changes/smartlist_foreach
@@ -0,0 +1,4 @@
+ o Code simplification and refactoring:
+ - Do not allow the body of any SMARTLIST_FOREACH block to exceed
+ 10 lines. Doing so in the past has led to hard-to-debug code.
+ The new style is to use the SMARTLIST_FOREACH_{BEGIN,END} pair.