Fix two unused-variable compiler warnings.

This commit is contained in:
Wayne Davison
2011-09-22 23:31:18 -07:00
parent 510c5ab7ff
commit 53a46d9e09
2 changed files with 9 additions and 6 deletions

2
io.c
View File

@@ -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)

View File

@@ -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)