summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--pango/pango-script-table.h4
-rw-r--r--pango/pango-script.c2
-rw-r--r--tests/testscript.c9
-rwxr-xr-xtools/gen-script-table.pl2
5 files changed, 17 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index f78e26ec..14a7e942 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2006-09-18 Behdad Esfahbod <behdad@gnome.org>
+ * tools/gen-script-table.pl:
+ * pango/pango-script-table.h:
+ * pango/pango-script.c (pango_script_for_unichar): Minor
+ simplification.
+
+ * tests/testscript.c (test_script_lookup): Update to pass.
+
+2006-09-18 Behdad Esfahbod <behdad@gnome.org>
+
* pango/pangoft2-render.c (pango_ft2_font_render_glyph): Remove a
couple of unnecessary static variables.
diff --git a/pango/pango-script-table.h b/pango/pango-script-table.h
index 79aa583a..abe7e866 100644
--- a/pango/pango-script-table.h
+++ b/pango/pango-script-table.h
@@ -1,13 +1,11 @@
/* pango-script-table.h: Generated by gen-script-table.pl
*
- * Date: Tue Jul 25 01:42:49 2006
+ * Date: Mon Sep 18 21:07:42 2006
* Source: Scripts-5.0.0.txt
*
* Do not edit.
*/
-#define PANGO_EASY_SCRIPTS_RANGE 8192
-
static const guchar pango_script_easy_table[8192] = {
PANGO_SCRIPT_COMMON, PANGO_SCRIPT_COMMON, PANGO_SCRIPT_COMMON,
diff --git a/pango/pango-script.c b/pango/pango-script.c
index 52824799..a3e95ece 100644
--- a/pango/pango-script.c
+++ b/pango/pango-script.c
@@ -127,7 +127,7 @@ pango_script_for_unichar_bsearch (gunichar ch)
PangoScript
pango_script_for_unichar (gunichar ch)
{
- if (ch < PANGO_EASY_SCRIPTS_RANGE)
+ if (ch < G_N_ELEMENTS (pango_script_easy_table))
return pango_script_easy_table[ch];
else
return pango_script_for_unichar_bsearch (ch);
diff --git a/tests/testscript.c b/tests/testscript.c
index 79c8471c..ebe6891d 100644
--- a/tests/testscript.c
+++ b/tests/testscript.c
@@ -142,15 +142,18 @@ unescape (const char *text)
static void
test_script_lookup (void)
{
- gunichar ch = 0;
+ gunichar ch;
unsigned int i;
int j;
+ for (ch = 0; ch < G_N_ELEMENTS (pango_script_easy_table); ch++)
+ ASSERT (pango_script_for_unichar (ch) == pango_script_easy_table[ch]);
+
for (i = 0; i < G_N_ELEMENTS (pango_script_table); i++)
{
while (ch < pango_script_table[i].start)
{
- ASSERT (pango_script_for_unichar (ch) == PANGO_SCRIPT_COMMON);
+ ASSERT (pango_script_for_unichar (ch) == PANGO_SCRIPT_UNKNOWN);
ch++;
}
@@ -161,7 +164,7 @@ test_script_lookup (void)
}
}
- ASSERT (pango_script_for_unichar (ch) == PANGO_SCRIPT_COMMON);
+ ASSERT (pango_script_for_unichar (ch) == PANGO_SCRIPT_UNKNOWN);
}
static void
diff --git a/tools/gen-script-table.pl b/tools/gen-script-table.pl
index da181f87..f3af7ce2 100755
--- a/tools/gen-script-table.pl
+++ b/tools/gen-script-table.pl
@@ -55,8 +55,6 @@ EOT
$easy_range = 0x2000;
print <<"EOT";
-#define PANGO_EASY_SCRIPTS_RANGE $easy_range
-
static const guchar pango_script_easy_table[$easy_range] = {
EOT