diff options
author | Jon Loeliger <jdl@netgate.com> | 2017-01-31 15:27:19 -0600 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-02-02 17:32:03 +0000 |
commit | 1f9191f6efa5f2e0284c194f920093201b27ef81 (patch) | |
tree | f55bd27e2b6d4e25101f650c009c43805d36fd32 /src/plugins | |
parent | 7bc770ceb62ede18414b7bb5788692e32477e373 (diff) |
Localize the timeout variable within the W message macro.
Rather than rely on an unbound variable, explicitly introduce
the timeout variable within the 'do { ... } while (0)' construct
as a block-local variable.
Change-Id: I6e78635290f9b5ab3f56b7f116c5fa762c88c9e9
Signed-off-by: Jon Loeliger <jdl@netgate.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/acl/acl_test.c | 12 | ||||
-rw-r--r-- | src/plugins/flowperpkt/flowperpkt_test.c | 1 | ||||
-rw-r--r-- | src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c | 1 | ||||
-rw-r--r-- | src/plugins/ioam/export/ioam_export_test.c | 1 | ||||
-rw-r--r-- | src/plugins/ioam/lib-pot/pot_test.c | 4 | ||||
-rw-r--r-- | src/plugins/ioam/lib-trace/trace_test.c | 4 | ||||
-rw-r--r-- | src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c | 6 | ||||
-rw-r--r-- | src/plugins/lb/lb_test.c | 3 | ||||
-rw-r--r-- | src/plugins/snat/snat_test.c | 12 |
9 files changed, 1 insertions, 43 deletions
diff --git a/src/plugins/acl/acl_test.c b/src/plugins/acl/acl_test.c index 70fd6959594..39d7e1c4848 100644 --- a/src/plugins/acl/acl_test.c +++ b/src/plugins/acl/acl_test.c @@ -267,7 +267,6 @@ static int api_acl_plugin_get_version (vat_main_t * vam) acl_test_main_t * sm = &acl_test_main; vl_api_acl_plugin_get_version_t * mp; u32 msg_size = sizeof(*mp); - f64 timeout; vam->result_ready = 0; mp = vl_msg_api_alloc_as_if_client(msg_size); @@ -289,7 +288,6 @@ static int api_macip_acl_interface_get (vat_main_t * vam) acl_test_main_t * sm = &acl_test_main; vl_api_acl_plugin_get_version_t * mp; u32 msg_size = sizeof(*mp); - f64 timeout; vam->result_ready = 0; mp = vl_msg_api_alloc_as_if_client(msg_size); @@ -321,7 +319,6 @@ static int api_acl_add_replace (vat_main_t * vam) { acl_test_main_t * sm = &acl_test_main; unformat_input_t * i = vam->input; - f64 timeout; vl_api_acl_add_replace_t * mp; u32 acl_index = ~0; u32 msg_size = sizeof (*mp); /* without the rules */ @@ -488,7 +485,6 @@ static int api_acl_add_replace (vat_main_t * vam) static int api_acl_del (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_acl_del_t * mp; u32 acl_index = ~0; @@ -511,7 +507,6 @@ static int api_acl_del (vat_main_t * vam) static int api_macip_acl_del (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_acl_del_t * mp; u32 acl_index = ~0; @@ -534,7 +529,6 @@ static int api_macip_acl_del (vat_main_t * vam) static int api_acl_interface_add_del (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_acl_interface_add_del_t * mp; u32 sw_if_index = ~0; u32 acl_index = ~0; @@ -601,7 +595,6 @@ static int api_acl_interface_add_del (vat_main_t * vam) static int api_macip_acl_interface_add_del (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_macip_acl_interface_add_del_t * mp; u32 sw_if_index = ~0; u32 acl_index = ~0; @@ -651,7 +644,6 @@ static int api_macip_acl_interface_add_del (vat_main_t * vam) static int api_acl_interface_set_acl_list (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_acl_interface_set_acl_list_t * mp; u32 sw_if_index = ~0; u32 acl_index = ~0; @@ -709,7 +701,6 @@ static int api_acl_interface_set_acl_list (vat_main_t * vam) static int api_acl_interface_list_dump (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; u32 sw_if_index = ~0; vl_api_acl_interface_list_dump_t * mp; @@ -737,7 +728,6 @@ static int api_acl_interface_list_dump (vat_main_t * vam) static int api_acl_dump (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; u32 acl_index = ~0; vl_api_acl_dump_t * mp; @@ -763,7 +753,6 @@ static int api_acl_dump (vat_main_t * vam) static int api_macip_acl_dump (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; u32 acl_index = ~0; vl_api_acl_dump_t * mp; @@ -799,7 +788,6 @@ static int api_macip_acl_add (vat_main_t * vam) { acl_test_main_t * sm = &acl_test_main; unformat_input_t * i = vam->input; - f64 timeout; vl_api_macip_acl_add_t * mp; u32 msg_size = sizeof (*mp); /* without the rules */ diff --git a/src/plugins/flowperpkt/flowperpkt_test.c b/src/plugins/flowperpkt/flowperpkt_test.c index d5edc4ad1c2..4cc1cfb7589 100644 --- a/src/plugins/flowperpkt/flowperpkt_test.c +++ b/src/plugins/flowperpkt/flowperpkt_test.c @@ -95,7 +95,6 @@ static int api_flowperpkt_tx_interface_add_del (vat_main_t * vam) { unformat_input_t *i = vam->input; - f64 timeout; int enable_disable = 1; u8 which = 0; /* ipv4 by default */ u32 sw_if_index = ~0; diff --git a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c index 161b5241624..a7938219fb4 100644 --- a/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c +++ b/src/plugins/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c @@ -92,7 +92,6 @@ static int api_vxlan_gpe_ioam_export_enable_disable (vat_main_t * vam) { unformat_input_t *i = vam->input; - f64 timeout; int is_disable = 0; vl_api_vxlan_gpe_ioam_export_enable_disable_t *mp; diff --git a/src/plugins/ioam/export/ioam_export_test.c b/src/plugins/ioam/export/ioam_export_test.c index 45c4ca56ff7..2cb036a5568 100644 --- a/src/plugins/ioam/export/ioam_export_test.c +++ b/src/plugins/ioam/export/ioam_export_test.c @@ -94,7 +94,6 @@ static int api_ioam_export_ip6_enable_disable (vat_main_t * vam) { unformat_input_t *i = vam->input; - f64 timeout; int is_disable = 0; vl_api_ioam_export_ip6_enable_disable_t *mp; diff --git a/src/plugins/ioam/lib-pot/pot_test.c b/src/plugins/ioam/lib-pot/pot_test.c index 4f049be8e8a..d896eb2ff88 100644 --- a/src/plugins/ioam/lib-pot/pot_test.c +++ b/src/plugins/ioam/lib-pot/pot_test.c @@ -132,7 +132,6 @@ static int api_pot_profile_add (vat_main_t *vam) u64 secret_key = 0; u32 bits = MAX_BITS; u64 lpc = 0, poly2 = 0; - f64 timeout; u8 id = 0; int rv = 0; @@ -204,7 +203,6 @@ static int api_pot_profile_activate (vat_main_t *vam) u8 *name = NULL; u8 id = 0; int rv = 0; - f64 timeout; while (unformat_check_input(input) != UNFORMAT_END_OF_INPUT) { @@ -241,7 +239,6 @@ OUT: static int api_pot_profile_del (vat_main_t *vam) { vl_api_pot_profile_del_t *mp; - f64 timeout; M(POT_PROFILE_DEL, mp); mp->list_name_len = 0; @@ -254,7 +251,6 @@ static int api_pot_profile_show_config_dump (vat_main_t *vam) { unformat_input_t *input = vam->input; vl_api_pot_profile_show_config_dump_t *mp; - f64 timeout; u8 id = 0; while(unformat_check_input(input) != UNFORMAT_END_OF_INPUT) diff --git a/src/plugins/ioam/lib-trace/trace_test.c b/src/plugins/ioam/lib-trace/trace_test.c index 5093f33086e..d1fb7205ad2 100644 --- a/src/plugins/ioam/lib-trace/trace_test.c +++ b/src/plugins/ioam/lib-trace/trace_test.c @@ -129,7 +129,6 @@ api_trace_profile_add (vat_main_t * vam) u32 node_id = 0; u32 app_data = 0; u8 trace_tsp = 0; - f64 timeout; while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) { @@ -169,7 +168,6 @@ static int api_trace_profile_del (vat_main_t * vam) { vl_api_trace_profile_del_t *mp; - f64 timeout; M (TRACE_PROFILE_DEL, mp); S (mp); @@ -181,7 +179,7 @@ static int api_trace_profile_show_config (vat_main_t * vam) { vl_api_trace_profile_show_config_t *mp; - f64 timeout; + M (TRACE_PROFILE_SHOW_CONFIG, mp); S (mp); W; diff --git a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c index ee25a874918..3e7300f5dd2 100644 --- a/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c +++ b/src/plugins/ioam/lib-vxlan-gpe/vxlan_gpe_test.c @@ -104,7 +104,6 @@ api_vxlan_gpe_ioam_enable (vat_main_t * vam) { unformat_input_t *input = vam->input; vl_api_vxlan_gpe_ioam_enable_t *mp; - f64 timeout; u32 id = 0; int has_trace_option = 0; int has_pow_option = 0; @@ -143,7 +142,6 @@ static int api_vxlan_gpe_ioam_disable (vat_main_t * vam) { vl_api_vxlan_gpe_ioam_disable_t *mp; - f64 timeout; M (VXLAN_GPE_IOAM_DISABLE, mp); S (mp); @@ -163,7 +161,6 @@ api_vxlan_gpe_ioam_vni_enable (vat_main_t * vam) u8 remote_set = 0; u32 vni; u8 vni_set = 0; - f64 timeout; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -258,7 +255,6 @@ api_vxlan_gpe_ioam_vni_disable (vat_main_t * vam) u8 remote_set = 0; u32 vni; u8 vni_set = 0; - f64 timeout; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -351,7 +347,6 @@ api_vxlan_gpe_ioam_transit_enable (vat_main_t * vam) u8 ipv4_set = 0, ipv6_set = 0; u8 local_set = 0; u32 outer_fib_index = 0; - f64 timeout; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) @@ -421,7 +416,6 @@ api_vxlan_gpe_ioam_transit_disable (vat_main_t * vam) u8 ipv4_set = 0, ipv6_set = 0; u8 local_set = 0; u32 outer_fib_index = 0; - f64 timeout; while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) diff --git a/src/plugins/lb/lb_test.c b/src/plugins/lb/lb_test.c index f553a93e4dc..a811079ea75 100644 --- a/src/plugins/lb/lb_test.c +++ b/src/plugins/lb/lb_test.c @@ -133,7 +133,6 @@ foreach_standard_reply_retval_handler; static int api_lb_conf (vat_main_t * vam) { unformat_input_t *i = vam->input; - f64 timeout; vl_api_lb_conf_t mps, *mp; if (!unformat(i, "%U %U %u %u", @@ -156,7 +155,6 @@ static int api_lb_conf (vat_main_t * vam) static int api_lb_add_del_vip (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_lb_add_del_vip_t mps, *mp; mps.is_del = 0; mps.is_gre4 = 0; @@ -195,7 +193,6 @@ static int api_lb_add_del_vip (vat_main_t * vam) static int api_lb_add_del_as (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_lb_add_del_as_t mps, *mp; mps.is_del = 0; diff --git a/src/plugins/snat/snat_test.c b/src/plugins/snat/snat_test.c index c0913f37d4f..8bab00c11ab 100644 --- a/src/plugins/snat/snat_test.c +++ b/src/plugins/snat/snat_test.c @@ -109,7 +109,6 @@ _(SNAT_IPFIX_ENABLE_DISABLE_REPLY, \ static int api_snat_add_address_range (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; ip4_address_t start_addr, end_addr; u32 start_host_order, end_host_order; vl_api_snat_add_address_range_t * mp; @@ -169,7 +168,6 @@ static int api_snat_add_address_range (vat_main_t * vam) static int api_snat_interface_add_del_feature (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_snat_interface_add_del_feature_t * mp; u32 sw_if_index; u8 sw_if_index_set = 0; @@ -215,7 +213,6 @@ static int api_snat_interface_add_del_feature (vat_main_t * vam) static int api_snat_add_static_mapping(vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_snat_add_static_mapping_t * mp; u8 external_addr_set = 0; u8 local_addr_set; @@ -320,7 +317,6 @@ static void vl_api_snat_static_mapping_details_t_handler static int api_snat_static_mapping_dump(vat_main_t * vam) { - f64 timeout; vl_api_snat_static_mapping_dump_t * mp; if (vam->json_output) @@ -379,7 +375,6 @@ static void vl_api_snat_show_config_reply_t_handler static int api_snat_show_config(vat_main_t * vam) { - f64 timeout; vl_api_snat_show_config_t * mp; if (vam->json_output) @@ -406,7 +401,6 @@ static void vl_api_snat_address_details_t_handler static int api_snat_address_dump(vat_main_t * vam) { - f64 timeout; vl_api_snat_address_dump_t * mp; if (vam->json_output) @@ -440,7 +434,6 @@ static void vl_api_snat_interface_details_t_handler static int api_snat_interface_dump(vat_main_t * vam) { - f64 timeout; vl_api_snat_interface_dump_t * mp; if (vam->json_output) @@ -465,7 +458,6 @@ static int api_snat_interface_dump(vat_main_t * vam) static int api_snat_set_workers (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_snat_set_workers_t * mp; uword *bitmap; @@ -502,7 +494,6 @@ static void vl_api_snat_worker_details_t_handler static int api_snat_worker_dump(vat_main_t * vam) { - f64 timeout; vl_api_snat_worker_dump_t * mp; if (vam->json_output) @@ -527,7 +518,6 @@ static int api_snat_worker_dump(vat_main_t * vam) static int api_snat_ipfix_enable_disable (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_snat_add_del_interface_addr_t * mp; u32 sw_if_index; u8 sw_if_index_set = 0; @@ -575,7 +565,6 @@ static void vl_api_snat_interface_addr_details_t_handler static int api_snat_interface_addr_dump(vat_main_t * vam) { - f64 timeout; vl_api_snat_interface_addr_dump_t * mp; if (vam->json_output) @@ -600,7 +589,6 @@ static int api_snat_interface_addr_dump(vat_main_t * vam) static int api_snat_add_del_interface_addr (vat_main_t * vam) { unformat_input_t * i = vam->input; - f64 timeout; vl_api_snat_ipfix_enable_disable_t * mp; u32 domain_id = 0; u32 src_port = 0; |