summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@users.noreply.github.com>2017-09-17 19:23:16 -0400
committerGitHub <noreply@github.com>2017-09-17 19:23:16 -0400
commita7dd519b58c9f68d0b74bd6fb5daaf88e84ece63 (patch)
treef92c696d8b17e153953d0c3123d03bc7e41c09f3 /lib
parentaf34a65a62efc13310facf054ac388d45e9c2e01 (diff)
parenta2addae8fe172f04f4d8ac99aa123a7d2dd64604 (diff)
Merge pull request #1188 from opensourcerouting/foreach_indentation
*: use clang's 'ForEachMacros' format style option
Diffstat (limited to 'lib')
-rw-r--r--lib/if.c17
-rw-r--r--lib/ns.c3
-rw-r--r--lib/vrf.c3
-rw-r--r--lib/workqueue.c2
4 files changed, 10 insertions, 15 deletions
diff --git a/lib/if.c b/lib/if.c
index 43c382beaa..7d27229656 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -249,8 +249,7 @@ struct interface *if_lookup_by_name_all_vrf(const char *name)
struct vrf *vrf;
struct interface *ifp;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
ifp = if_lookup_by_name(name, vrf->vrf_id);
if (ifp)
return ifp;
@@ -386,8 +385,7 @@ struct interface *if_get_by_name_len(const char *name, size_t namelen,
return ifp;
/* Didn't find the interface on that vrf. Defined on a different one? */
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- {
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
for (ALL_LIST_ELEMENTS_RO(vrf_iflist(vrf->vrf_id), node, ifp)) {
if (!memcmp(name, ifp->name, namelen)
&& (ifp->name[namelen] == '\0')) {
@@ -541,10 +539,10 @@ void if_dump_all(void)
struct listnode *node;
void *p;
- RB_FOREACH(vrf, vrf_id_head, &vrfs_by_id)
- if (vrf->iflist != NULL)
- for (ALL_LIST_ELEMENTS_RO(vrf->iflist, node, p))
- if_dump(p);
+ RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
+ if (vrf->iflist != NULL)
+ for (ALL_LIST_ELEMENTS_RO(vrf->iflist, node, p))
+ if_dump(p);
}
DEFUN (interface_desc,
@@ -1053,8 +1051,7 @@ static void if_autocomplete(vector comps, struct cmd_token *token)
struct listnode *ln;
struct vrf *vrf = NULL;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
for (ALL_LIST_ELEMENTS_RO(vrf->iflist, ln, ifp))
vector_set(comps, XSTRDUP(MTYPE_COMPLETION, ifp->name));
}
diff --git a/lib/ns.c b/lib/ns.c
index ba920e31b9..fdf93d0742 100644
--- a/lib/ns.c
+++ b/lib/ns.c
@@ -378,8 +378,7 @@ static int ns_config_write(struct vty *vty)
struct ns *ns;
int write = 0;
- RB_FOREACH(ns, ns_head, &ns_tree)
- {
+ RB_FOREACH (ns, ns_head, &ns_tree) {
if (ns->ns_id == NS_DEFAULT || ns->name == NULL)
continue;
diff --git a/lib/vrf.c b/lib/vrf.c
index 6e70609b78..0a4969dfac 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -356,8 +356,7 @@ static void vrf_autocomplete(vector comps, struct cmd_token *token)
{
struct vrf *vrf = NULL;
- RB_FOREACH(vrf, vrf_name_head, &vrfs_by_name)
- {
+ RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (vrf->vrf_id != 0)
vector_set(comps, XSTRDUP(MTYPE_COMPLETION, vrf->name));
}
diff --git a/lib/workqueue.c b/lib/workqueue.c
index b76b73b367..643ed2d2b8 100644
--- a/lib/workqueue.c
+++ b/lib/workqueue.c
@@ -258,7 +258,7 @@ int work_queue_run(struct thread *thread)
if (wq->cycles.granularity == 0)
wq->cycles.granularity = WORK_QUEUE_MIN_GRANULARITY;
- STAILQ_FOREACH_SAFE(item, &wq->items, wq, titem) {
+ STAILQ_FOREACH_SAFE (item, &wq->items, wq, titem) {
assert(item && item->data);
/* dont run items which are past their allowed retries */