summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2020-12-13 21:47:40 +0100
committerDave Barach <openvpp@barachs.net>2020-12-14 12:14:21 +0000
commitb2c31b685fd2cf28436ca32bc93e23eb24c74878 (patch)
treedc0a1b1ff784445b2cbb0f9b2c07b5bcb4f5a5d0 /src/vlib
parent62c25abaa3e93be5815172d391295a6ab0390122 (diff)
misc: move to new pool_foreach macros
Type: refactor Change-Id: Ie67dc579e88132ddb1ee4a34cb69f96920101772 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/cli.c6
-rw-r--r--src/vlib/node.c4
-rw-r--r--src/vlib/trace.c12
-rw-r--r--src/vlib/unix/cli.c8
4 files changed, 15 insertions, 15 deletions
diff --git a/src/vlib/cli.c b/src/vlib/cli.c
index c6f71a5bd28..db82dede152 100644
--- a/src/vlib/cli.c
+++ b/src/vlib/cli.c
@@ -1077,11 +1077,11 @@ restart_cmd_fn (vlib_main_t * vm, unformat_input_t * input,
/* Close all known open files */
/* *INDENT-OFF* */
- pool_foreach(f, fm->file_pool,
- ({
+ pool_foreach (f, fm->file_pool)
+ {
if (f->file_descriptor > 2)
close(f->file_descriptor);
- }));
+ }
/* *INDENT-ON* */
/* Exec ourself */
diff --git a/src/vlib/node.c b/src/vlib/node.c
index 2c486433ff8..387b774f305 100644
--- a/src/vlib/node.c
+++ b/src/vlib/node.c
@@ -130,10 +130,10 @@ vlib_node_runtime_update (vlib_main_t * vm, u32 node_index, u32 next_index)
pf->next_frame_index += n_insert;
}
/* *INDENT-OFF* */
- pool_foreach (pf, nm->suspended_process_frames, ({
+ pool_foreach (pf, nm->suspended_process_frames) {
if (pf->next_frame_index != ~0 && pf->next_frame_index >= i)
pf->next_frame_index += n_insert;
- }));
+ }
/* *INDENT-ON* */
r->n_next_nodes = vec_len (node->next_nodes);
diff --git a/src/vlib/trace.c b/src/vlib/trace.c
index f90f275fa87..152744432c5 100644
--- a/src/vlib/trace.c
+++ b/src/vlib/trace.c
@@ -258,15 +258,15 @@ trace_apply_filter (vlib_main_t * vm)
*/
n_accepted = 0;
/* *INDENT-OFF* */
- pool_foreach (h, tm->trace_buffer_pool,
- ({
+ pool_foreach (h, tm->trace_buffer_pool)
+ {
accept = filter_accept(tm, h[0]);
if ((n_accepted == tm->filter_count) || !accept)
vec_add1 (traces_to_remove, h);
else
n_accepted++;
- }));
+ }
/* *INDENT-ON* */
/* remove all traces that we don't want to keep */
@@ -319,10 +319,10 @@ cli_show_trace_buffer (vlib_main_t * vm,
trace_apply_filter(this_vlib_main);
traces = 0;
- pool_foreach (h, tm->trace_buffer_pool,
- ({
+ pool_foreach (h, tm->trace_buffer_pool)
+ {
vec_add1 (traces, h[0]);
- }));
+ }
if (vec_len (traces) == 0)
{
diff --git a/src/vlib/unix/cli.c b/src/vlib/unix/cli.c
index 9d26e6e7e34..8120befef71 100644
--- a/src/vlib/unix/cli.c
+++ b/src/vlib/unix/cli.c
@@ -3575,7 +3575,7 @@ unix_show_files (vlib_main_t * vm,
"Read", "Write", "Error", "File Name", "Description");
/* *INDENT-OFF* */
- pool_foreach (f, fm->file_pool,(
+ pool_foreach (f, fm->file_pool)
{
int rv;
s = format (s, "/proc/self/fd/%d%c", f->file_descriptor, 0);
@@ -3588,7 +3588,7 @@ unix_show_files (vlib_main_t * vm,
f->read_events, f->write_events, f->error_events,
path, f->description);
vec_reset_length (s);
- }));
+ }
/* *INDENT-ON* */
vec_free (s);
@@ -3728,7 +3728,7 @@ unix_cli_show_cli_sessions (vlib_main_t * vm,
#define fl(x, y) ( (x) ? toupper((y)) : tolower((y)) )
/* *INDENT-OFF* */
- pool_foreach (cf, cm->cli_file_pool, ({
+ pool_foreach (cf, cm->cli_file_pool) {
uf = pool_elt_at_index (fm->file_pool, cf->clib_file_index);
n = vlib_get_node (vm, cf->process_node_index);
vlib_cli_output (vm,
@@ -3741,7 +3741,7 @@ unix_cli_show_cli_sessions (vlib_main_t * vm,
fl (cf->line_mode, 'l'),
fl (cf->has_epipe, 'p'),
fl (cf->ansi_capable, 'a'));
- }));
+ }
/* *INDENT-ON* */
#undef fl