summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-01-16 05:45:23 (GMT)
committerThomas Haller <thaller@redhat.com>2018-01-16 05:45:23 (GMT)
commit38baa675cf738df26eac4423a15950d1d0950ca7 (patch)
tree23408ddf38f7c2ce2ddba69e9e3f89d92ef3a0e8 /tests
parent165611034621b0eda1a4747ea382600fed436437 (diff)
downloadlibnl-38baa675cf738df26eac4423a15950d1d0950ca7.zip
libnl-38baa675cf738df26eac4423a15950d1d0950ca7.tar.gz
libnl-38baa675cf738df26eac4423a15950d1d0950ca7.tar.bz2
all: declare all variables at the beginning of scope (-Wdeclaration-after-statement)
Avoid gcc warning: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
Diffstat (limited to 'tests')
-rw-r--r--tests/test-complex-HTB-with-hash-filters.c3
-rw-r--r--tests/test-create-bridge.c3
-rw-r--r--tests/test-u32-filter-with-actions.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/tests/test-complex-HTB-with-hash-filters.c b/tests/test-complex-HTB-with-hash-filters.c
index c2ac783..b1bf36e 100644
--- a/tests/test-complex-HTB-with-hash-filters.c
+++ b/tests/test-complex-HTB-with-hash-filters.c
@@ -517,6 +517,8 @@ int main() {
struct nl_cache *link_cache;
+ uint32_t i;
+
if (!(sock = nl_socket_alloc())) {
printf("Unable to allocate netlink socket\n");
exit(1);
@@ -579,7 +581,6 @@ int main() {
* each entry in hash table match a byte from IP address specified later by a hash key
*/
- uint32_t i;
for (i = 1; i <= 0xf; i++)
u32_add_ht(sock, link, 1, i, 256);
diff --git a/tests/test-create-bridge.c b/tests/test-create-bridge.c
index afd20e1..a9d9f2e 100644
--- a/tests/test-create-bridge.c
+++ b/tests/test-create-bridge.c
@@ -31,6 +31,7 @@ int main(int argc, char *argv[])
struct rtnl_link *link;
struct nl_cache *link_cache;
struct nl_sock *sk;
+ struct rtnl_link *ltap;
int err;
sk = nl_socket_alloc();
@@ -52,7 +53,7 @@ int main(int argc, char *argv[])
nl_cache_refill(sk, link_cache);
link = rtnl_link_get_by_name(link_cache, TEST_BRIDGE_NAME);
- struct rtnl_link *ltap = rtnl_link_get_by_name(link_cache, TEST_INTERFACE_NAME);
+ ltap = rtnl_link_get_by_name(link_cache, TEST_INTERFACE_NAME);
if (!ltap) {
fprintf(stderr, "You should create a tap interface before lunch this test (# tunctl -t %s)\n", TEST_INTERFACE_NAME);
return -1;
diff --git a/tests/test-u32-filter-with-actions.c b/tests/test-u32-filter-with-actions.c
index 0ca216c..e9910e3 100644
--- a/tests/test-u32-filter-with-actions.c
+++ b/tests/test-u32-filter-with-actions.c
@@ -243,6 +243,7 @@ int main(void)
int err;
struct nl_cache *link_cache;
struct rtnl_act *act, *act2;
+ uint32_t i;
if (!(sock = nl_socket_alloc())) {
printf("Unable to allocate netlink socket\n");
@@ -290,7 +291,6 @@ int main(void)
* each entry in hash table match a byte from IP address specified later by a hash key
*/
- uint32_t i;
for (i = 1; i <= 0xf; i++)
u32_add_ht(sock, link, 1, i, 256);