]> Savannah Git Hosting - gnulib.git/commitdiff
tests: Fix some "unused variable" warnings.
authorBruno Haible <bruno@clisp.org>
Sun, 27 Jan 2019 11:24:47 +0000 (12:24 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 27 Jan 2019 11:51:22 +0000 (12:51 +0100)
* tests/test-fts.c (fts_dealloc): Remove unused variable.
* tests/unigbrk/test-uc-grapheme-breaks.c (main): Likewise.
* tests/test-striconveh.c (main): Move some variable into the
'#if HAVE_ICONV'.
* tests/test-striconveha.c (main): Likewise.
* tests/uniconv/test-u8-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u16-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u32-conv-from-enc.c (main): Likewise.
* tests/uniconv/test-u8-conv-to-enc.c (main): Likewise.
* tests/uniconv/test-u16-conv-to-enc.c (main): Likewise.
* tests/uniconv/test-u32-conv-to-enc.c (main): Likewise.
* tests/uniconv/test-u8-strconv-from-enc.c (main): Likewise.
* tests/uniconv/test-u16-strconv-from-enc.c (main): Likewise.
* tests/uniconv/test-u32-strconv-from-enc.c (main): Likewise.
* tests/uniconv/test-u8-strconv-to-enc.c (main): Likewise.
* tests/uniconv/test-u16-strconv-to-enc.c (main): Likewise.
* tests/uniconv/test-u32-strconv-to-enc.c (main): Likewise.
* tests/test-tsearch.c (main): Move some variable into the
'#if HAVE_INITSTATE'.

18 files changed:
ChangeLog
tests/test-fts.c
tests/test-striconveh.c
tests/test-striconveha.c
tests/test-tsearch.c
tests/uniconv/test-u16-conv-from-enc.c
tests/uniconv/test-u16-conv-to-enc.c
tests/uniconv/test-u16-strconv-from-enc.c
tests/uniconv/test-u16-strconv-to-enc.c
tests/uniconv/test-u32-conv-from-enc.c
tests/uniconv/test-u32-conv-to-enc.c
tests/uniconv/test-u32-strconv-from-enc.c
tests/uniconv/test-u32-strconv-to-enc.c
tests/uniconv/test-u8-conv-from-enc.c
tests/uniconv/test-u8-conv-to-enc.c
tests/uniconv/test-u8-strconv-from-enc.c
tests/uniconv/test-u8-strconv-to-enc.c
tests/unigbrk/test-uc-grapheme-breaks.c

index 2f23c644cb331bd8d7430c6519c044955474cb68..d7d1f81d555b42de535ff8a095b1de89997ced31 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2019-01-27  Bruno Haible  <bruno@clisp.org>
+
+       tests: Fix some "unused variable" warnings.
+       * tests/test-fts.c (fts_dealloc): Remove unused variable.
+       * tests/unigbrk/test-uc-grapheme-breaks.c (main): Likewise.
+       * tests/test-striconveh.c (main): Move some variable into the
+       '#if HAVE_ICONV'.
+       * tests/test-striconveha.c (main): Likewise.
+       * tests/uniconv/test-u8-conv-from-enc.c (main): Likewise.
+       * tests/uniconv/test-u16-conv-from-enc.c (main): Likewise.
+       * tests/uniconv/test-u32-conv-from-enc.c (main): Likewise.
+       * tests/uniconv/test-u8-conv-to-enc.c (main): Likewise.
+       * tests/uniconv/test-u16-conv-to-enc.c (main): Likewise.
+       * tests/uniconv/test-u32-conv-to-enc.c (main): Likewise.
+       * tests/uniconv/test-u8-strconv-from-enc.c (main): Likewise.
+       * tests/uniconv/test-u16-strconv-from-enc.c (main): Likewise.
+       * tests/uniconv/test-u32-strconv-from-enc.c (main): Likewise.
+       * tests/uniconv/test-u8-strconv-to-enc.c (main): Likewise.
+       * tests/uniconv/test-u16-strconv-to-enc.c (main): Likewise.
+       * tests/uniconv/test-u32-strconv-to-enc.c (main): Likewise.
+       * tests/test-tsearch.c (main): Move some variable into the
+       '#if HAVE_INITSTATE'.
+
 2019-01-27  Bruno Haible  <bruno@clisp.org>
 
        unigbrk/uc-grapheme-breaks: Fix build failure.
index 4c6bdb6e947eee1bed9783b873435c3f07f97430..2938550db3b692a563f2a02fc554aea69954941d 100644 (file)
@@ -44,7 +44,6 @@ fts_dealloc (void)
 {
   static char dir[] = "./";
   static char *const curr_dir[2] = { dir, 0 };
-  FTSENT *e;
   FTS *ftsp = fts_open (curr_dir, FTS_NOSTAT | FTS_PHYSICAL | FTS_CWDFD, 0);
   if (ftsp)
     {
index f6fb60b7886da2e1123c37269f77f83aa1a18f82..6cb7f1f8cfc5b47cf949cf0853d28e24600404e7 100644 (file)
@@ -44,6 +44,7 @@ new_offsets (size_t n)
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t indirect;
@@ -51,7 +52,6 @@ main ()
   size_t o;
   size_t i;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
   iconv_t cd_ascii_to_88591 = iconv_open ("ISO-8859-1", "ASCII");
index ba32e053582629b2d70938adbcc1aa1315fc7657..930c97a3cfb5c185db887b5daf4236a8e468a748 100644 (file)
@@ -45,13 +45,13 @@ new_offsets (size_t n)
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t h;
   size_t o;
   size_t i;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
 
index a546cf7df3c06f7e3caa15e97f20e9f39eeca8c7..808a82700369f6527e588f5ee8782f2ae088f672 100644 (file)
@@ -264,11 +264,12 @@ int
 main (int argc, char **argv)
 {
   int total_error = 0;
-  static char state[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
   void *root = NULL;
   int i, j;
 
 #if HAVE_INITSTATE
+  static char state[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
+
   initstate (SEED, state, 8);
 #endif
 
index 76ab740cbe9d1f5a74112eba80ca50ae4b663ad9..50983fa63e12d01327ab1bea72a77ad179a0904d 100644 (file)
@@ -41,13 +41,13 @@ new_offsets (size_t n)
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t h;
   size_t o;
   size_t i;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
 
index a6cf189cfc466171b85f159129fbe35793417e0b..0d34816ed3ed78e8808ad3c5fdc143366d1237d4 100644 (file)
@@ -40,13 +40,13 @@ new_offsets (size_t n)
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t h;
   size_t o;
   size_t i;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
 
index c890dfd3389994a71f7642fb644674be1fb0302e..f7972c2570b74297a5e4dc2f48d62a2ba4f57b0c 100644 (file)
@@ -29,11 +29,11 @@ extern int iconv_supports_encoding (const char *encoding);
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t h;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
 
index 55bc71ec6918b638e36d223e56b1a16be68aba0b..c29f19a7c2ec4ea88aa8648e98057be8f3882e70 100644 (file)
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t h;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
 
index 0a4552f7f16f04a2503e4f57fb83e9c8f0446589..d41201a202eb5c3b5974c195b80cf11a359a4649 100644 (file)
@@ -41,13 +41,13 @@ new_offsets (size_t n)
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t h;
   size_t o;
   size_t i;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
 
index 7cf06ee485a1535de6d201d9e757ef4e029d751b..b2d48cef90a157ec1500feb42353c38ec7518abf 100644 (file)
@@ -40,13 +40,13 @@ new_offsets (size_t n)
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t h;
   size_t o;
   size_t i;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
 
index 30e5a7270657d5d56af6376462b9621a97c9808f..94bab31fec8ce38f7e05b5c2adeeb69f148526a5 100644 (file)
@@ -29,11 +29,11 @@ extern int iconv_supports_encoding (const char *encoding);
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t h;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
 
index 68ec0dde8e8e9468378aa7c595b970ecdfe172e3..615c61e83d77387c5fcaa5cf422ad0efd38426ca 100644 (file)
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t h;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
 
index 68b927a4039114e60b8a72a3db62d5176c5bad0f..de9fef348601af76f7d3b427a5cfe73e642d39e0 100644 (file)
@@ -41,13 +41,13 @@ new_offsets (size_t n)
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t h;
   size_t o;
   size_t i;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
 
index 5440820de8a61c60466f708694d36d50aba46262..9e2b09891510fed88ad767f1a3d21836184aab2f 100644 (file)
@@ -41,13 +41,13 @@ new_offsets (size_t n)
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t h;
   size_t o;
   size_t i;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
 
index 5a5924b9e39d8e5c6bdf9c197876562e7d148780..14a6e87057ff2cc3bf148c3b396208a804e7c3a6 100644 (file)
@@ -29,11 +29,11 @@ extern int iconv_supports_encoding (const char *encoding);
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t h;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
 
index 7eeff5e438e7093e3bf65af588698ef89e804d88..8d9d86785afee1b4084d8e245dcd36d46c358708 100644 (file)
 int
 main ()
 {
+#if HAVE_ICONV
   static enum iconv_ilseq_handler handlers[] =
     { iconveh_error, iconveh_question_mark, iconveh_escape_sequence };
   size_t h;
 
-#if HAVE_ICONV
   /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
      ISO-8859-2, and UTF-8.  */
 
index 7716f8b7601eaa56cca5ab9ec9ad2f95026f0a7b..af21902bfe4ab761ee4881fd458c9415b158e568 100644 (file)
@@ -139,8 +139,6 @@ main (int argc, char *argv[])
       p = line;
       do
         {
-          ucs4_t next;
-
           p += strspn (p, " \t\r\n");
           if (!strncmp (p, "\303\267" /* รท */, 2))
             {