From e2d36e6f735a1f10cb80726a4691f225e66233ed Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Tue, 14 Oct 2014 10:57:28 +0200 Subject: Fix warning: for loop has empty body MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Example of warning: src/ldb_modules/memberof.c:4203:536: error: for loop has empty body [-Werror,-Wempty-body] src/ldb_modules/memberof.c:4203:536: note: put the semicolon on a separate line to silence this warning Reviewed-by: Pavel Březina --- src/util/dlinklist.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/util/dlinklist.h b/src/util/dlinklist.h index fa4b7225..41308488 100644 --- a/src/util/dlinklist.h +++ b/src/util/dlinklist.h @@ -66,7 +66,9 @@ do { \ (p)->next = (p)->prev = NULL; \ } else { \ type tmp; \ - for (tmp = (list); tmp->next; tmp = tmp->next) ; \ + for (tmp = (list); tmp->next; tmp = tmp->next) { \ + /* no op */ \ + } \ tmp->next = (p); \ (p)->next = NULL; \ (p)->prev = tmp; \ @@ -102,7 +104,9 @@ do { \ (list1) = (list2); \ } else { \ type tmp; \ - for (tmp = (list1); tmp->next; tmp = tmp->next) ; \ + for (tmp = (list1); tmp->next; tmp = tmp->next) { \ + /* no op */ \ + } \ tmp->next = (list2); \ if (list2) { \ (list2)->prev = tmp; \ @@ -118,7 +122,9 @@ do { \ DLIST_CONCATENATE(list1, list2, type); \ } else { \ type tmp; \ - for (tmp = (list2); tmp->next; tmp = tmp->next) ; \ + for (tmp = (list2); tmp->next; tmp = tmp->next) { \ + /* no op */ \ + } \ (list2)->prev = (el); \ tmp->next = (el)->next; \ (el)->next = (list2); \ -- cgit