unigbrk: Avoid gcc warnings.
authorBruno Haible <bruno@clisp.org>
Sun, 2 Jan 2011 18:34:18 +0000 (19:34 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 2 Jan 2011 18:34:18 +0000 (19:34 +0100)
* lib/unigbrk/u16-grapheme-breaks.c (u16_grapheme_breaks): Remove
unused variable.
* lib/unigbrk/u16-grapheme-prev.c (u16_grapheme_prev): Likewise.
* lib/unigbrk/u8-grapheme-prev.c (u8_grapheme_prev): Likewise.
* tests/unigbrk/test-u16-grapheme-breaks.c (main): Likewise.
* tests/unigbrk/test-u32-grapheme-breaks.c (main): Likewise.
* tests/unigbrk/test-u8-grapheme-breaks.c (test_u8_grapheme_breaks):
Change type of first argument to 'const char *'.
(main): Remove unused variable.
* tests/unigbrk/test-u8-grapheme-next.c (test_u8_grapheme_next): Change
type of first argument to 'const char *'.
* tests/unigbrk/test-u8-grapheme-prev.c (test_u8_grapheme_prev):
Likewise.
(main): Change type of variable 's'.
* tests/unigbrk/test-uc-is-grapheme-break.c (main): Cast column number
to 'int'.

ChangeLog
lib/unigbrk/u16-grapheme-breaks.c
lib/unigbrk/u16-grapheme-prev.c
lib/unigbrk/u8-grapheme-prev.c
tests/unigbrk/test-u16-grapheme-breaks.c
tests/unigbrk/test-u32-grapheme-breaks.c
tests/unigbrk/test-u8-grapheme-breaks.c
tests/unigbrk/test-u8-grapheme-next.c
tests/unigbrk/test-u8-grapheme-prev.c
tests/unigbrk/test-uc-is-grapheme-break.c

index 744340bf91d6a2cadfa35b66c680b18eac808426..9169a7434282f28fb473643ac1c532485c51a980 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2011-01-02  Bruno Haible  <bruno@clisp.org>
+
+       unigbrk: Avoid gcc warnings.
+       * lib/unigbrk/u16-grapheme-breaks.c (u16_grapheme_breaks): Remove
+       unused variable.
+       * lib/unigbrk/u16-grapheme-prev.c (u16_grapheme_prev): Likewise.
+       * lib/unigbrk/u8-grapheme-prev.c (u8_grapheme_prev): Likewise.
+       * tests/unigbrk/test-u16-grapheme-breaks.c (main): Likewise.
+       * tests/unigbrk/test-u32-grapheme-breaks.c (main): Likewise.
+       * tests/unigbrk/test-u8-grapheme-breaks.c (test_u8_grapheme_breaks):
+       Change type of first argument to 'const char *'.
+       (main): Remove unused variable.
+       * tests/unigbrk/test-u8-grapheme-next.c (test_u8_grapheme_next): Change
+       type of first argument to 'const char *'.
+       * tests/unigbrk/test-u8-grapheme-prev.c (test_u8_grapheme_prev):
+       Likewise.
+       (main): Change type of variable 's'.
+       * tests/unigbrk/test-uc-is-grapheme-break.c (main): Cast column number
+       to 'int'.
+
 2011-01-02  Bruno Haible  <bruno@clisp.org>
 
        pwrite: Fix test whether it works and make it work on HP-UX 11.11.
index b79a8a8b5541ad4048edade0f9833a3fe58ca254..b9224348ac9c3f51bb9c7527835e5af1a380d4c8 100644 (file)
@@ -32,7 +32,6 @@ u16_grapheme_breaks (const uint16_t *s, size_t n, char *p)
   for (; n > 0; s += mblen, p += mblen, n -= mblen)
     {
       ucs4_t next;
-      int i;
 
       mblen = u16_mbtouc (&next, s, n);
 
index 437f3db2f87fcc6dd6b4cfd5f4a2a29b9ba91b14..ff7a065b0fc093bd5cd1bb263f59373e9e0469ca 100644 (file)
@@ -26,7 +26,6 @@ const uint16_t *
 u16_grapheme_prev (const uint16_t *s, const uint16_t *start)
 {
   ucs4_t next;
-  int mblen;
 
   if (s == start)
     return NULL;
index ac866b0e4d81ede408c5ede983fd02b4ee8aeacc..d89e1818da10e77b6857a4553078f4b390803862 100644 (file)
@@ -26,7 +26,6 @@ const uint8_t *
 u8_grapheme_prev (const uint8_t *s, const uint8_t *start)
 {
   ucs4_t next;
-  int mblen;
 
   if (s == start)
     return NULL;
index 165ea4e2af2edc7c7ce2e3e5200b0c2efabf452b..988f2ed4fd029f123b93b563b0ee440ab2960e41 100644 (file)
@@ -81,8 +81,6 @@ test_u16_grapheme_breaks (const char *expected, ...)
 int
 main (void)
 {
-  static const char s[] = "abc";
-
   /* Standalone 1-unit graphemes.  */
   test_u16_grapheme_breaks ("#", 'a', -1);
   test_u16_grapheme_breaks ("##", 'a', 'b', -1);
index 1d16604eab215e5fb2550dc33d0c70023f13b9e0..dec7204ff92caf519f68ca7c406365f08a0954cd 100644 (file)
@@ -81,8 +81,6 @@ test_u32_grapheme_breaks (const char *expected, ...)
 int
 main (void)
 {
-  static const char s[] = "abc";
-
   /* Standalone 1-unit graphemes.  */
   test_u32_grapheme_breaks ("#", 'a', -1);
   test_u32_grapheme_breaks ("##", 'a', 'b', -1);
index 3bbebb29bbd752221aa9682e4fd2f59337a9b32a..5b64d2d3affdd8db3a672866b603834df1e993da 100644 (file)
@@ -28,8 +28,9 @@
 #include "macros.h"
 
 static void
-test_u8_grapheme_breaks (const uint8_t *s, const char *expected)
+test_u8_grapheme_breaks (const char *input, const char *expected)
 {
+  const uint8_t *s = (const uint8_t *) input;
   size_t n = strlen (expected);
   char *breaks;
   size_t i;
@@ -71,8 +72,6 @@ test_u8_grapheme_breaks (const uint8_t *s, const char *expected)
 int
 main (void)
 {
-  static const char s[] = "abc";
-
   /* Standalone 1-unit graphemes.  */
   test_u8_grapheme_breaks ("a", "#");
   test_u8_grapheme_breaks ("ab", "##");
index e67178ec7813de5039c90b60fe3812102c1c8462..e4731f80da8c0269f32c42e4229b48830657763c 100644 (file)
@@ -27,8 +27,9 @@
 #include "macros.h"
 
 static void
-test_u8_grapheme_next (const uint8_t *s, size_t n, size_t len)
+test_u8_grapheme_next (const char *input, size_t n, size_t len)
 {
+  const uint8_t *s = (const uint8_t *) input;
   const uint8_t *next = u8_grapheme_next (s, s + n);
   if (next != s + len)
     {
index 2f1090131cd63e7c151bf66808286135d4e446fb..c90d7c4f458b36337bcdfcfcc83caefda726338c 100644 (file)
@@ -27,8 +27,9 @@
 #include "macros.h"
 
 static void
-test_u8_grapheme_prev (const uint8_t *s, size_t n, size_t len)
+test_u8_grapheme_prev (const char *input, size_t n, size_t len)
 {
+  const uint8_t *s = (const uint8_t *) input;
   const uint8_t *end = s + n;
   const uint8_t *prev = u8_grapheme_prev (end, s);
   if (prev != end - len)
@@ -50,7 +51,7 @@ test_u8_grapheme_prev (const uint8_t *s, size_t n, size_t len)
 int
 main (void)
 {
-  static const char s[] = "abc";
+  static const uint8_t s[] = "abc";
 
   /* Empty string. */
   ASSERT (u8_grapheme_prev (NULL, NULL) == NULL);
index 47304f0374cf47000fc9bcbeb9d1ab71b706f999..4df5c3e0a5299d69d91a9586c5478458d65f78ac 100644 (file)
@@ -110,7 +110,7 @@ main (int argc, char *argv[])
           else
             {
               fprintf (stderr, "%s:%d.%d: syntax error expecting `÷' or `÷'\n",
-                       filename, lineno, p - line + 1);
+                       filename, lineno, (int) (p - line + 1));
               exit (1);
             }
 
@@ -126,7 +126,7 @@ main (int argc, char *argv[])
                 {
                   fprintf (stderr, "%s:%d.%d: syntax error at `%s' expecting "
                            "hexadecimal Unicode code point number\n",
-                           filename, lineno, p - line + 1, p);
+                           filename, lineno, (int) (p - line + 1), p);
                   exit (1);
                 }
               p += n;