Use G_N_ELEMENTS(). (unicode_classify): Don't fail with an assertion on

2001-12-28  Tor Lillqvist  <tml@iki.fi>

	* gdk/win32/gdkfont-win32.c: Use G_N_ELEMENTS().
	(unicode_classify): Don't fail with an assertion on encountering
	an unclassified character, but punt and return U_BASIC_LATIN.
This commit is contained in:
Tor Lillqvist
2001-12-28 21:40:58 +00:00
committed by Tor Lillqvist
parent 663b69cfa2
commit 293cde2040
8 changed files with 48 additions and 6 deletions

View File

@@ -1,3 +1,9 @@
2001-12-28 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c: Use G_N_ELEMENTS().
(unicode_classify): Don't fail with an assertion on encountering
an unclassified character, but punt and return U_BASIC_LATIN.
2001-12-23 Tor Lillqvist <tml@iki.fi>
* gdk/win32/*.c: Lint cleanup.

View File

@@ -1,3 +1,9 @@
2001-12-28 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c: Use G_N_ELEMENTS().
(unicode_classify): Don't fail with an assertion on encountering
an unclassified character, but punt and return U_BASIC_LATIN.
2001-12-23 Tor Lillqvist <tml@iki.fi>
* gdk/win32/*.c: Lint cleanup.

View File

@@ -1,3 +1,9 @@
2001-12-28 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c: Use G_N_ELEMENTS().
(unicode_classify): Don't fail with an assertion on encountering
an unclassified character, but punt and return U_BASIC_LATIN.
2001-12-23 Tor Lillqvist <tml@iki.fi>
* gdk/win32/*.c: Lint cleanup.

View File

@@ -1,3 +1,9 @@
2001-12-28 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c: Use G_N_ELEMENTS().
(unicode_classify): Don't fail with an assertion on encountering
an unclassified character, but punt and return U_BASIC_LATIN.
2001-12-23 Tor Lillqvist <tml@iki.fi>
* gdk/win32/*.c: Lint cleanup.

View File

@@ -1,3 +1,9 @@
2001-12-28 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c: Use G_N_ELEMENTS().
(unicode_classify): Don't fail with an assertion on encountering
an unclassified character, but punt and return U_BASIC_LATIN.
2001-12-23 Tor Lillqvist <tml@iki.fi>
* gdk/win32/*.c: Lint cleanup.

View File

@@ -1,3 +1,9 @@
2001-12-28 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c: Use G_N_ELEMENTS().
(unicode_classify): Don't fail with an assertion on encountering
an unclassified character, but punt and return U_BASIC_LATIN.
2001-12-23 Tor Lillqvist <tml@iki.fi>
* gdk/win32/*.c: Lint cleanup.

View File

@@ -1,3 +1,9 @@
2001-12-28 Tor Lillqvist <tml@iki.fi>
* gdk/win32/gdkfont-win32.c: Use G_N_ELEMENTS().
(unicode_classify): Don't fail with an assertion on encountering
an unclassified character, but punt and return U_BASIC_LATIN.
2001-12-23 Tor Lillqvist <tml@iki.fi>
* gdk/win32/*.c: Lint cleanup.

View File

@@ -710,12 +710,12 @@ static void
print_unicode_subranges (FONTSIGNATURE *fsp)
{
int i;
gboolean checked[sizeof (utab) / sizeof (utab[0])];
gboolean checked[G_N_ELEMENTS (utab)];
gboolean need_comma = FALSE;
memset (checked, 0, sizeof (checked));
for (i = 0; i < sizeof (utab) / sizeof (utab[0]); i++)
for (i = 0; i < G_N_ELEMENTS (utab); i++)
if (!checked[i]
&& (fsp->fsUsb[utab[i].bit/32] & (1 << (utab[i].bit % 32))))
{
@@ -1725,7 +1725,7 @@ static int
unicode_classify (wchar_t wc)
{
int min = 0;
int max = sizeof (utab) / sizeof (utab[0]) - 1;
int max = G_N_ELEMENTS (utab) - 1;
int mid;
while (max >= min)
@@ -1738,10 +1738,10 @@ unicode_classify (wchar_t wc)
else if (utab[mid].low <= wc && wc <= utab[mid].high)
return utab[mid].bit;
else
return -1;
break;
}
g_assert_not_reached ();
return -1;
/* Punt */
return U_BASIC_LATIN;
}
static GdkWin32SingleFont*