summaryrefslogtreecommitdiffstats
path: root/.clang-format
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2017-09-15 17:47:35 +0200
committerRenato Westphal <renato@opensourcerouting.org>2017-09-15 19:53:46 +0200
commita2addae8fe172f04f4d8ac99aa123a7d2dd64604 (patch)
treec58663b6654a9bec64ac4c26e11d158fd48b34ad /.clang-format
parentMerge pull request #1178 from donaldsharp/pim_obfuscation (diff)
downloadfrr-a2addae8fe172f04f4d8ac99aa123a7d2dd64604.tar.xz
frr-a2addae8fe172f04f4d8ac99aa123a7d2dd64604.zip
*: use clang's 'ForEachMacros' format style option
This fixes the broken indentation of several foreach loops throughout the code. From clang's documentation[1]: ForEachMacros: A vector of macros that should be interpreted as foreach loops instead of as function calls. [1] http://clang.llvm.org/docs/ClangFormatStyleOptions.html Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format32
1 files changed, 32 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
index 07f558d92..2710d844e 100644
--- a/.clang-format
+++ b/.clang-format
@@ -23,3 +23,35 @@ IncludeCategories:
Priority: 0
CommentPragmas: '\$(FRR|clippy)'
ContinuationIndentWidth: 8
+ForEachMacros:
+ # lib
+ - LIST_FOREACH
+ - LIST_FOREACH_SAFE
+ - SLIST_FOREACH
+ - SLIST_FOREACH_SAFE
+ - SLIST_FOREACH_PREVPTR
+ - STAILQ_FOREACH
+ - STAILQ_FOREACH_SAFE
+ - TAILQ_FOREACH
+ - TAILQ_FOREACH_SAFE
+ - TAILQ_FOREACH_REVERSE
+ - TAILQ_FOREACH_REVERSE_SAFE
+ - RB_FOREACH
+ - RB_FOREACH_SAFE
+ - RB_FOREACH_REVERSE
+ - RB_FOREACH_REVERSE_SAFE
+ - SPLAY_FOREACH
+ # zebra
+ - RE_DEST_FOREACH_ROUTE
+ - RE_DEST_FOREACH_ROUTE_SAFE
+ - RNODE_FOREACH_RE
+ - RNODE_FOREACH_RE_SAFE
+ # bgpd
+ - UPDGRP_FOREACH_SUBGRP
+ - UPDGRP_FOREACH_SUBGRP_SAFE
+ - SUBGRP_FOREACH_PEER
+ - SUBGRP_FOREACH_PEER_SAFE
+ - SUBGRP_FOREACH_ADJ
+ - SUBGRP_FOREACH_ADJ_SAFE
+ - AF_FOREACH
+ - FOREACH_AFI_SAFI