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.
This commit is contained in:
Nick Mathewson
2012-07-17 09:33:38 -04:00
parent 21c6c84853
commit 7faf115dff
19 changed files with 139 additions and 176 deletions
+4
View File
@@ -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.