#include <vppinfra/dlist.h>
-typedef struct {
- dlist_elt_t * test_pool;
+typedef struct
+{
+ dlist_elt_t *test_pool;
u32 head_index;
} test_main_t;
test_main_t test_main;
-int test_dlist_main (unformat_input_t * input)
+int
+test_dlist_main (unformat_input_t * input)
{
- test_main_t * tm = &test_main;
- dlist_elt_t * head, * elt;
+ test_main_t *tm = &test_main;
+ dlist_elt_t *head, *elt;
u32 elt_index, head_index;
u32 value;
int i;
-
+
pool_get (tm->test_pool, head);
head_index = head - tm->test_pool;
clib_dlist_init (tm->test_pool, head - tm->test_pool);
while (value != ~0)
{
elt = pool_elt_at_index (tm->test_pool, elt_index);
- fformat(stdout, "elt %d value %d\n",
- i++, elt->value);
+ fformat (stdout, "elt %d value %d\n", i++, elt->value);
elt_index = elt->next;
value = elt->value;
}
while (value != ~0)
{
elt = pool_elt_at_index (tm->test_pool, elt_index);
- fformat(stdout, "elt %d value %d\n",
- i++, elt->value);
+ fformat (stdout, "elt %d value %d\n", i++, elt->value);
elt_index = elt->prev;
value = elt->value;
}
while (value != ~0)
{
elt = pool_elt_at_index (tm->test_pool, elt_index);
- fformat(stdout, "elt %d value %d\n",
- i++, elt->value);
+ fformat (stdout, "elt %d value %d\n", i++, elt->value);
elt_index = elt->next;
value = elt->value;
}
while (value != ~0)
{
elt = pool_elt_at_index (tm->test_pool, elt_index);
- fformat(stdout, "elt %d value %d\n",
- i++, elt->value);
+ fformat (stdout, "elt %d value %d\n", i++, elt->value);
elt_index = elt->prev;
value = elt->value;
}
while (value != ~0)
{
elt = pool_elt_at_index (tm->test_pool, elt_index);
- fformat(stdout, "elt %d value %d\n",
- i++, elt->value);
+ fformat (stdout, "elt %d value %d\n", i++, elt->value);
elt_index = elt->next;
value = elt->value;
}
while (value != ~0)
{
elt = pool_elt_at_index (tm->test_pool, elt_index);
- fformat(stdout, "elt %d value %d\n",
- i++, elt->value);
+ fformat (stdout, "elt %d value %d\n", i++, elt->value);
elt_index = elt->prev;
value = elt->value;
}
elt = pool_elt_at_index (tm->test_pool, 2);
fformat (stdout, "removed index %d value %d\n", elt_index, elt->value);
-
+
fformat (stdout, "Dump forward links\n");
elt_index = head->next;
i = 1;
while (value != ~0)
{
elt = pool_elt_at_index (tm->test_pool, elt_index);
- fformat(stdout, "elt %d value %d\n",
- i++, elt->value);
+ fformat (stdout, "elt %d value %d\n", i++, elt->value);
elt_index = elt->next;
value = elt->value;
}
while (value != ~0)
{
elt = pool_elt_at_index (tm->test_pool, elt_index);
- fformat(stdout, "elt %d value %d\n",
- i++, elt->value);
+ fformat (stdout, "elt %d value %d\n", i++, elt->value);
elt_index = elt->prev;
value = elt->value;
}
}
#ifdef CLIB_UNIX
-int main (int argc, char * argv[])
+int
+main (int argc, char *argv[])
{
unformat_input_t i;
int ret;
- clib_mem_init (0, 3ULL<<30);
+ clib_mem_init (0, 3ULL << 30);
unformat_init_command_line (&i, argv);
ret = test_dlist_main (&i);
return ret;
}
#endif /* CLIB_UNIX */
+
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Variables:
+ * eval: (c-set-style "gnu")
+ * End:
+ */