+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.
for (; n > 0; s += mblen, p += mblen, n -= mblen)
{
ucs4_t next;
- int i;
mblen = u16_mbtouc (&next, s, n);
u16_grapheme_prev (const uint16_t *s, const uint16_t *start)
{
ucs4_t next;
- int mblen;
if (s == start)
return NULL;
u8_grapheme_prev (const uint8_t *s, const uint8_t *start)
{
ucs4_t next;
- int mblen;
if (s == start)
return NULL;
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);
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);
#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;
int
main (void)
{
- static const char s[] = "abc";
-
/* Standalone 1-unit graphemes. */
test_u8_grapheme_breaks ("a", "#");
test_u8_grapheme_breaks ("ab", "##");
#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)
{
#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)
int
main (void)
{
- static const char s[] = "abc";
+ static const uint8_t s[] = "abc";
/* Empty string. */
ASSERT (u8_grapheme_prev (NULL, NULL) == NULL);
else
{
fprintf (stderr, "%s:%d.%d: syntax error expecting `÷' or `÷'\n",
- filename, lineno, p - line + 1);
+ filename, lineno, (int) (p - line + 1));
exit (1);
}
{
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;