mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-31 22:23:39 +02:00
Patch from Andrew Taylor to optimize the decomposition table to eliminate
Tue Nov 20 20:54:25 2001 Owen Taylor <otaylor@redhat.com> * glib/gunidecomp.[ch] glib/gen-unicode-tables.pl: Patch from Andrew Taylor to optimize the decomposition table to eliminate relocations and save space. (#64982)
This commit is contained in:
@@ -83,7 +83,7 @@ g_unicode_canonical_ordering (gunichar *string,
|
||||
}
|
||||
}
|
||||
|
||||
static guchar *
|
||||
static const guchar *
|
||||
find_decomposition (gunichar ch,
|
||||
gboolean compat)
|
||||
{
|
||||
@@ -113,7 +113,7 @@ find_decomposition (gunichar ch,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return decomp_table[half].expansion + offset;
|
||||
return &(decomp_expansion_string[decomp_table[half].expansion_offset + offset]);
|
||||
}
|
||||
else if (half == start)
|
||||
break;
|
||||
@@ -141,7 +141,7 @@ gunichar *
|
||||
g_unicode_canonical_decomposition (gunichar ch,
|
||||
gsize *result_len)
|
||||
{
|
||||
guchar *decomp = find_decomposition (ch, FALSE);
|
||||
const guchar *decomp = find_decomposition (ch, FALSE);
|
||||
gunichar *r;
|
||||
|
||||
if (decomp)
|
||||
@@ -251,7 +251,7 @@ _g_utf8_normalize_wc (const gchar *str,
|
||||
{
|
||||
gunichar wc = g_utf8_get_char (p);
|
||||
|
||||
guchar *decomp = find_decomposition (wc, do_compat);
|
||||
const guchar *decomp = find_decomposition (wc, do_compat);
|
||||
|
||||
if (decomp)
|
||||
{
|
||||
@@ -276,7 +276,7 @@ _g_utf8_normalize_wc (const gchar *str,
|
||||
while ((max_len < 0 || p < str + max_len) && *p)
|
||||
{
|
||||
gunichar wc = g_utf8_get_char (p);
|
||||
guchar *decomp;
|
||||
const guchar *decomp;
|
||||
int cc;
|
||||
gsize old_n_wc = n_wc;
|
||||
|
||||
|
Reference in New Issue
Block a user