diff options
Diffstat (limited to 'lib/unigbrk')
| -rw-r--r-- | lib/unigbrk/u-grapheme-breaks.h | 2 | ||||
| -rw-r--r-- | lib/unigbrk/u-grapheme-next.h | 2 | ||||
| -rw-r--r-- | lib/unigbrk/u-grapheme-prev.h | 18 | ||||
| -rw-r--r-- | lib/unigbrk/u16-grapheme-breaks.c | 2 | ||||
| -rw-r--r-- | lib/unigbrk/u16-grapheme-next.c | 2 | ||||
| -rw-r--r-- | lib/unigbrk/u16-grapheme-prev.c | 2 | ||||
| -rw-r--r-- | lib/unigbrk/u32-grapheme-breaks.c | 2 | ||||
| -rw-r--r-- | lib/unigbrk/u32-grapheme-next.c | 2 | ||||
| -rw-r--r-- | lib/unigbrk/u32-grapheme-prev.c | 2 | ||||
| -rw-r--r-- | lib/unigbrk/u8-grapheme-breaks.c | 2 | ||||
| -rw-r--r-- | lib/unigbrk/u8-grapheme-next.c | 2 | ||||
| -rw-r--r-- | lib/unigbrk/u8-grapheme-prev.c | 2 | ||||
| -rw-r--r-- | lib/unigbrk/uc-gbrk-prop.c | 2 | ||||
| -rw-r--r-- | lib/unigbrk/uc-grapheme-breaks.c | 2 | ||||
| -rw-r--r-- | lib/unigbrk/uc-is-grapheme-break.c | 8 | ||||
| -rw-r--r-- | lib/unigbrk/ulc-grapheme-breaks.c | 17 |
16 files changed, 27 insertions, 42 deletions
diff --git a/lib/unigbrk/u-grapheme-breaks.h b/lib/unigbrk/u-grapheme-breaks.h index 30d5853a..2bea51c4 100644 --- a/lib/unigbrk/u-grapheme-breaks.h +++ b/lib/unigbrk/u-grapheme-breaks.h @@ -1,5 +1,5 @@ /* Grapheme cluster break function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". diff --git a/lib/unigbrk/u-grapheme-next.h b/lib/unigbrk/u-grapheme-next.h index 9ca07436..edd377e8 100644 --- a/lib/unigbrk/u-grapheme-next.h +++ b/lib/unigbrk/u-grapheme-next.h @@ -1,5 +1,5 @@ /* Grapheme cluster break function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". diff --git a/lib/unigbrk/u-grapheme-prev.h b/lib/unigbrk/u-grapheme-prev.h index 0894d599..0fa234b4 100644 --- a/lib/unigbrk/u-grapheme-prev.h +++ b/lib/unigbrk/u-grapheme-prev.h @@ -1,5 +1,5 @@ /* Grapheme cluster break function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". @@ -43,10 +43,8 @@ ends_with_incb_consonant_extended_linker_extended (const UNIT *s, while (s > s_start) { - const UNIT *prev_s; ucs4_t uc; - - prev_s = U_PREV (&uc, s, s_start); + const UNIT *prev_s = U_PREV (&uc, s, s_start); if (prev_s == NULL) /* Ill-formed UTF-8 encoding. */ break; @@ -73,10 +71,8 @@ ends_with_emoji_modifier_sequence (const UNIT *s, const UNIT *s_start) { while (s > s_start) { - const UNIT *prev_s; ucs4_t uc; - - prev_s = U_PREV (&uc, s, s_start); + const UNIT *prev_s = U_PREV (&uc, s, s_start); if (prev_s == NULL) /* Ill-formed UTF-8 encoding. */ break; @@ -102,10 +98,8 @@ ends_with_ri_count (const UNIT *s, const UNIT *s_start) while (s > s_start) { - const UNIT *prev_s; ucs4_t uc; - - prev_s = U_PREV (&uc, s, s_start); + const UNIT *prev_s = U_PREV (&uc, s, s_start); if (prev_s == NULL) /* Ill-formed UTF-8 encoding. */ break; @@ -143,10 +137,8 @@ FUNC (const UNIT *s, const UNIT *s_start) do { - const UNIT *prev_s; ucs4_t uc; - - prev_s = U_PREV (&uc, s, s_start); + const UNIT *prev_s = U_PREV (&uc, s, s_start); if (prev_s == NULL) { /* Ill-formed UTF-8 encoding. */ diff --git a/lib/unigbrk/u16-grapheme-breaks.c b/lib/unigbrk/u16-grapheme-breaks.c index bae4bcb2..692f570c 100644 --- a/lib/unigbrk/u16-grapheme-breaks.c +++ b/lib/unigbrk/u16-grapheme-breaks.c @@ -1,5 +1,5 @@ /* Grapheme cluster breaks function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. Written by Ben Pfaff <blp@cs.stanford.edu>, 2010. This file is free software. diff --git a/lib/unigbrk/u16-grapheme-next.c b/lib/unigbrk/u16-grapheme-next.c index 5e7a783d..6397301f 100644 --- a/lib/unigbrk/u16-grapheme-next.c +++ b/lib/unigbrk/u16-grapheme-next.c @@ -1,5 +1,5 @@ /* Next grapheme cluster function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". diff --git a/lib/unigbrk/u16-grapheme-prev.c b/lib/unigbrk/u16-grapheme-prev.c index 4c70e118..72a3198b 100644 --- a/lib/unigbrk/u16-grapheme-prev.c +++ b/lib/unigbrk/u16-grapheme-prev.c @@ -1,5 +1,5 @@ /* Previous grapheme cluster function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". diff --git a/lib/unigbrk/u32-grapheme-breaks.c b/lib/unigbrk/u32-grapheme-breaks.c index 66c64445..669abd68 100644 --- a/lib/unigbrk/u32-grapheme-breaks.c +++ b/lib/unigbrk/u32-grapheme-breaks.c @@ -1,5 +1,5 @@ /* Grapheme cluster breaks function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. Written by Ben Pfaff <blp@cs.stanford.edu>, 2010. This file is free software. diff --git a/lib/unigbrk/u32-grapheme-next.c b/lib/unigbrk/u32-grapheme-next.c index 1c9adfa6..212dfbf1 100644 --- a/lib/unigbrk/u32-grapheme-next.c +++ b/lib/unigbrk/u32-grapheme-next.c @@ -1,5 +1,5 @@ /* Next grapheme cluster function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". diff --git a/lib/unigbrk/u32-grapheme-prev.c b/lib/unigbrk/u32-grapheme-prev.c index 977a1977..e893c0d8 100644 --- a/lib/unigbrk/u32-grapheme-prev.c +++ b/lib/unigbrk/u32-grapheme-prev.c @@ -1,5 +1,5 @@ /* Previous grapheme cluster function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". diff --git a/lib/unigbrk/u8-grapheme-breaks.c b/lib/unigbrk/u8-grapheme-breaks.c index 04708695..951ad1f0 100644 --- a/lib/unigbrk/u8-grapheme-breaks.c +++ b/lib/unigbrk/u8-grapheme-breaks.c @@ -1,5 +1,5 @@ /* Grapheme cluster breaks function. - Copyright (C) 2001-2003, 2006-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2006-2026 Free Software Foundation, Inc. Written by Ben Pfaff <blp@cs.stanford.edu>, 2010, based on code written by Bruno Haible <bruno@clisp.org>, 2009. diff --git a/lib/unigbrk/u8-grapheme-next.c b/lib/unigbrk/u8-grapheme-next.c index 2ec094da..105ebc37 100644 --- a/lib/unigbrk/u8-grapheme-next.c +++ b/lib/unigbrk/u8-grapheme-next.c @@ -1,5 +1,5 @@ /* Next grapheme cluster function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". diff --git a/lib/unigbrk/u8-grapheme-prev.c b/lib/unigbrk/u8-grapheme-prev.c index a2d872f0..f4df1892 100644 --- a/lib/unigbrk/u8-grapheme-prev.c +++ b/lib/unigbrk/u8-grapheme-prev.c @@ -1,5 +1,5 @@ /* Previous grapheme cluster function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. This file is free software. It is dual-licensed under "the GNU LGPLv3+ or the GNU GPLv2+". diff --git a/lib/unigbrk/uc-gbrk-prop.c b/lib/unigbrk/uc-gbrk-prop.c index 8158fa0c..32b9ec1c 100644 --- a/lib/unigbrk/uc-gbrk-prop.c +++ b/lib/unigbrk/uc-gbrk-prop.c @@ -1,5 +1,5 @@ /* Grapheme cluster break property function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. Written by Ben Pfaff <blp@cs.stanford.edu>, 2010. This file is free software. diff --git a/lib/unigbrk/uc-grapheme-breaks.c b/lib/unigbrk/uc-grapheme-breaks.c index 4924a97d..08dc5249 100644 --- a/lib/unigbrk/uc-grapheme-breaks.c +++ b/lib/unigbrk/uc-grapheme-breaks.c @@ -1,5 +1,5 @@ /* Grapheme cluster breaks function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. Written by Ben Pfaff <blp@cs.stanford.edu>, 2010. This file is free software. diff --git a/lib/unigbrk/uc-is-grapheme-break.c b/lib/unigbrk/uc-is-grapheme-break.c index 1451efa8..33ad20f0 100644 --- a/lib/unigbrk/uc-is-grapheme-break.c +++ b/lib/unigbrk/uc-is-grapheme-break.c @@ -1,5 +1,5 @@ /* Grapheme cluster break function. - Copyright (C) 2010-2025 Free Software Foundation, Inc. + Copyright (C) 2010-2026 Free Software Foundation, Inc. Written by Ben Pfaff <blp@cs.stanford.edu>, 2010. This file is free software. @@ -118,15 +118,13 @@ static const unsigned long int gb_table[18] = bool uc_is_grapheme_break (ucs4_t a, ucs4_t b) { - int a_gcp, b_gcp; - if ((a | b) < 0x300) { /* GB3 is the only relevant rule for this case. */ return a != '\r' || b != '\n'; } - a_gcp = uc_graphemeclusterbreak_property (a); - b_gcp = uc_graphemeclusterbreak_property (b); + int a_gcp = uc_graphemeclusterbreak_property (a); + int b_gcp = uc_graphemeclusterbreak_property (b); return (gb_table[a_gcp] >> b_gcp) & 1; } diff --git a/lib/unigbrk/ulc-grapheme-breaks.c b/lib/unigbrk/ulc-grapheme-breaks.c index 779a59f0..87c45f37 100644 --- a/lib/unigbrk/ulc-grapheme-breaks.c +++ b/lib/unigbrk/ulc-grapheme-breaks.c @@ -1,5 +1,5 @@ /* Grapheme cluster breaks function. - Copyright (C) 2001-2003, 2006-2025 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2006-2026 Free Software Foundation, Inc. Written by Ben Pfaff <blp@cs.stanford.edu>, 2010, based on code written by Bruno Haible <bruno@clisp.org>, 2009. @@ -51,10 +51,8 @@ is_utf8_encoding (const char *encoding) static void ascii_grapheme_breaks (const char *s, size_t n, char *p) { - size_t i; - p[0] = 1; - for (i = 1; i < n; i++) + for (size_t i = 1; i < n; i++) { bool is_ascii = c_isprint (s[i]) || c_isspace (s[i]); p[i] = is_ascii && (s[i] != '\n' || s[i - 1] != '\r'); @@ -92,25 +90,22 @@ ulc_grapheme_breaks (const char *s, size_t n, char *p) if (offsets != NULL) { - uint8_t *t; size_t m; - - t = u8_conv_from_encoding (encoding, iconveh_question_mark, - s, n, offsets, NULL, &m); + uint8_t *t = + u8_conv_from_encoding (encoding, iconveh_question_mark, + s, n, offsets, NULL, &m); if (t != NULL) { char *q = (char *) (m > 0 ? malloc (m) : NULL); if (m == 0 || q != NULL) { - size_t i; - /* Determine the grapheme breaks of the UTF-8 string. */ u8_grapheme_breaks (t, m, q); /* Translate the result back to the original string. */ memset (p, 0, n); - for (i = 0; i < n; i++) + for (size_t i = 0; i < n; i++) if (offsets[i] != (size_t)(-1)) p[i] = q[offsets[i]]; |
