From cedf84d35ab127dd24f9bcbf8b8339518d0e8928 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 5 Mar 2012 16:36:59 +0800 Subject: [PATCH] Fix -Wempty-body warning from clang clang recently grew a warning on `for (...);`. This patch fixes all two instances of this pattern in libxml. The changes don't modify the code semantic. --- pattern.c | 3 ++- uri.c | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pattern.c b/pattern.c index 0e38c2dd..8cd69ae9 100644 --- a/pattern.c +++ b/pattern.c @@ -305,7 +305,8 @@ xmlNewPatParserContext(const xmlChar *pattern, xmlDictPtr dict, cur->base = pattern; if (namespaces != NULL) { int i; - for (i = 0;namespaces[2 * i] != NULL;i++); + for (i = 0;namespaces[2 * i] != NULL;i++) + ; cur->nb_namespaces = i; } else { cur->nb_namespaces = 0; diff --git a/uri.c b/uri.c index 1ae5768b..bd2e96d7 100644 --- a/uri.c +++ b/uri.c @@ -1604,10 +1604,11 @@ xmlNormalizeURIPath(char *path) { break; } /* Valgrind complained, strcpy(cur, segp + 3); */ - /* string will overlap, do not use strcpy */ - tmp = cur; - segp += 3; - while ((*tmp++ = *segp++) != 0); + /* string will overlap, do not use strcpy */ + tmp = cur; + segp += 3; + while ((*tmp++ = *segp++) != 0) + ; /* If there are no previous segments, then keep going from here. */ segp = cur;