From: Wayne Davison Date: Fri, 23 Sep 2011 06:31:18 +0000 (-0700) Subject: Fix two unused-variable compiler warnings. X-Git-Tag: v3.0.9~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53a46d9e09fff01aac6978d0d5f70dc550dfe1a4;p=thirdparty%2Frsync.git Fix two unused-variable compiler warnings. --- diff --git a/io.c b/io.c index b6db8e9d..b8e52bfe 100644 --- a/io.c +++ b/io.c @@ -1066,7 +1066,6 @@ static int readfd_unbuffered(int fd, char *buf, size_t len) xbuf outbuf, inbuf; char ibuf[512]; int add_null = 0; - int pos = 0; INIT_CONST_XBUF(outbuf, line); INIT_XBUF(inbuf, ibuf, 0, -1); @@ -1081,7 +1080,6 @@ static int readfd_unbuffered(int fd, char *buf, size_t len) if (iconvbufs(ic_send, &inbuf, &outbuf, ICB_INCLUDE_BAD | ICB_INCLUDE_INCOMPLETE) < 0) goto overflow; - pos = -1; } if (add_null) { if (outbuf.len == outbuf.size) diff --git a/wildtest.c b/wildtest.c index bd1f4cc2..7691b6cd 100644 --- a/wildtest.c +++ b/wildtest.c @@ -50,15 +50,16 @@ static struct poptOption long_options[] = { /* match just at the start of string (anchored tests) */ static void -run_test(int line, bool matches, bool same_as_fnmatch, +run_test(int line, bool matches, +#ifdef COMPARE_WITH_FNMATCH + bool same_as_fnmatch, +#endif const char *text, const char *pattern) { bool matched; #ifdef COMPARE_WITH_FNMATCH bool fn_matched; int flags = strstr(pattern, "**")? 0 : FNM_PATHNAME; -#else - same_as_fnmatch = 0; /* Get rid of unused-variable compiler warning. */ #endif if (explode_mod) { @@ -194,7 +195,11 @@ main(int argc, char **argv) while (*++s == ' ' || *s == '\t') {} } *end[0] = *end[1] = '\0'; - run_test(line, flag[0], flag[1], string[0], string[1]); + run_test(line, flag[0], +#ifdef COMPARE_WITH_FNMATCH + flag[1], +#endif + string[0], string[1]); } if (!wildmatch_errors)