Fix two unused-variable compiler warnings.
authorWayne Davison <wayned@samba.org>
Fri, 23 Sep 2011 06:31:18 +0000 (23:31 -0700)
committerWayne Davison <wayned@samba.org>
Fri, 23 Sep 2011 06:33:47 +0000 (23:33 -0700)
io.c
wildtest.c

diff --git a/io.c b/io.c
index b6db8e9dd29b837ecd517b006d8cc43e2af1abf3..b8e52bfef2a0b40b31759473a242ac1049545e00 100644 (file)
--- 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)
index bd1f4cc27a6101d4f605719480d4b60a57ce2f3b..7691b6cdc33c4bcb593b4adcc5df2f4ea3369ff2 100644 (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)