mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-28 05:02:10 +01:00
unicode: Fix a few issues with G_UNICHAR_MAX_DECOMPOSITION_LENGTH
Raised by Matthias in bgo#665685 but which I didn't spot until after pushing commit 3ac7c35656649b1d1fcf2ccaa670b854809d4cd8. Renames G_UNICHAR_MAX_DECOMPOSITION_LEN to G_UNICHAR_MAX_DECOMPOSITION_LENGTH and fixes a few documentation issues. See: bgo#665685
This commit is contained in:
parent
3ac7c35656
commit
386bb0faad
@ -2694,6 +2694,7 @@ g_unichar_xdigit_value
|
|||||||
g_unichar_compose
|
g_unichar_compose
|
||||||
g_unichar_decompose
|
g_unichar_decompose
|
||||||
g_unichar_fully_decompose
|
g_unichar_fully_decompose
|
||||||
|
G_UNICHAR_MAX_DECOMPOSITION_LENGTH
|
||||||
GUnicodeType
|
GUnicodeType
|
||||||
G_UNICODE_COMBINING_MARK
|
G_UNICODE_COMBINING_MARK
|
||||||
g_unichar_type
|
g_unichar_type
|
||||||
|
@ -552,7 +552,7 @@ gsize g_unichar_fully_decompose (gunichar ch,
|
|||||||
gsize result_len);
|
gsize result_len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* G_UNICHAR_MAX_COMPAT_DECOMPOSITION_LEN:
|
* G_UNICHAR_MAX_DECOMPOSITION_LENGTH:
|
||||||
*
|
*
|
||||||
* The maximum length (in codepoints) of a compatibility or canonical
|
* The maximum length (in codepoints) of a compatibility or canonical
|
||||||
* decomposition of a single Unicode character.
|
* decomposition of a single Unicode character.
|
||||||
@ -561,7 +561,7 @@ gsize g_unichar_fully_decompose (gunichar ch,
|
|||||||
*
|
*
|
||||||
* Since: 2.31.3
|
* Since: 2.31.3
|
||||||
*/
|
*/
|
||||||
#define G_UNICHAR_MAX_DECOMPOSITION_LEN 18 /* codepoints */
|
#define G_UNICHAR_MAX_DECOMPOSITION_LENGTH 18 /* codepoints */
|
||||||
|
|
||||||
/* Compute canonical ordering of a string in-place. This rearranges
|
/* Compute canonical ordering of a string in-place. This rearranges
|
||||||
decomposed characters in the string according to their combining
|
decomposed characters in the string according to their combining
|
||||||
|
@ -700,8 +700,9 @@ g_unichar_compose (gunichar a,
|
|||||||
* currently all decompositions are of length at most 4, but
|
* currently all decompositions are of length at most 4, but
|
||||||
* this may change in the future (very unlikely though).
|
* this may change in the future (very unlikely though).
|
||||||
* At any rate, Unicode does guarantee that a buffer of length
|
* At any rate, Unicode does guarantee that a buffer of length
|
||||||
* %G_UNICHAR_MAX_DECOMPOSITION_LEN is always enough for both compatibility and
|
* 18 is always enough for both compatibility and canonical
|
||||||
* canonical decompositions, so that is the size recommended.
|
* decompositions, so that is the size recommended. This is provided
|
||||||
|
* as %G_UNICHAR_MAX_DECOMPOSITION_LENGTH.
|
||||||
*
|
*
|
||||||
* See <ulink url="http://unicode.org/reports/tr15/">UAX#15</ulink>
|
* See <ulink url="http://unicode.org/reports/tr15/">UAX#15</ulink>
|
||||||
* for details.
|
* for details.
|
||||||
|
@ -855,7 +855,7 @@ real_toupper (const gchar *str,
|
|||||||
* which could simplify this considerably.
|
* which could simplify this considerably.
|
||||||
*/
|
*/
|
||||||
gsize decomp_len, i;
|
gsize decomp_len, i;
|
||||||
gunichar decomp[G_UNICHAR_MAX_DECOMPOSITION_LEN];
|
gunichar decomp[G_UNICHAR_MAX_DECOMPOSITION_LENGTH];
|
||||||
|
|
||||||
decomp_len = g_unichar_fully_decompose (c, FALSE, decomp, G_N_ELEMENTS (decomp));
|
decomp_len = g_unichar_fully_decompose (c, FALSE, decomp, G_N_ELEMENTS (decomp));
|
||||||
for (i=0; i < decomp_len; i++)
|
for (i=0; i < decomp_len; i++)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user