Replace some uses of isspace() with g_ascii_isspace().

Sun Sep  2 13:05:53 2001  Owen Taylor  <otaylor@redhat.com>

        * glib/gstrfuncs.c (g_strchomp): Replace some uses
        of isspace() with g_ascii_isspace().

        * glib/gutf8.c glib/gunicode.h glib/gstrfuncs.[ch]: Add
        extra indirections to g_utf8_skip and g_ascii_table to
        avoid great whopping copy relocs.
This commit is contained in:
Owen Taylor 2001-09-02 17:14:23 +00:00 committed by Owen Taylor
parent b24544c0bc
commit 49fb6c6cc2
12 changed files with 82 additions and 8 deletions

View File

@ -1,3 +1,12 @@
Sun Sep 2 13:05:53 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strchomp): Replace some uses
of isspace() with g_ascii_isspace().
* glib/gutf8.c glib/gunicode.h glib/gstrfuncs.[ch]: Add
extra indirections to g_utf8_skip and g_ascii_table to
avoid great whopping copy relocs.
Sun Sep 2 11:10:42 2001 Owen Taylor <otaylor@redhat.com>
* glib/gen-unicode-tables.pl glib/gunicomp.h

View File

@ -1,3 +1,12 @@
Sun Sep 2 13:05:53 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strchomp): Replace some uses
of isspace() with g_ascii_isspace().
* glib/gutf8.c glib/gunicode.h glib/gstrfuncs.[ch]: Add
extra indirections to g_utf8_skip and g_ascii_table to
avoid great whopping copy relocs.
Sun Sep 2 11:10:42 2001 Owen Taylor <otaylor@redhat.com>
* glib/gen-unicode-tables.pl glib/gunicomp.h

View File

@ -1,3 +1,12 @@
Sun Sep 2 13:05:53 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strchomp): Replace some uses
of isspace() with g_ascii_isspace().
* glib/gutf8.c glib/gunicode.h glib/gstrfuncs.[ch]: Add
extra indirections to g_utf8_skip and g_ascii_table to
avoid great whopping copy relocs.
Sun Sep 2 11:10:42 2001 Owen Taylor <otaylor@redhat.com>
* glib/gen-unicode-tables.pl glib/gunicomp.h

View File

@ -1,3 +1,12 @@
Sun Sep 2 13:05:53 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strchomp): Replace some uses
of isspace() with g_ascii_isspace().
* glib/gutf8.c glib/gunicode.h glib/gstrfuncs.[ch]: Add
extra indirections to g_utf8_skip and g_ascii_table to
avoid great whopping copy relocs.
Sun Sep 2 11:10:42 2001 Owen Taylor <otaylor@redhat.com>
* glib/gen-unicode-tables.pl glib/gunicomp.h

View File

@ -1,3 +1,12 @@
Sun Sep 2 13:05:53 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strchomp): Replace some uses
of isspace() with g_ascii_isspace().
* glib/gutf8.c glib/gunicode.h glib/gstrfuncs.[ch]: Add
extra indirections to g_utf8_skip and g_ascii_table to
avoid great whopping copy relocs.
Sun Sep 2 11:10:42 2001 Owen Taylor <otaylor@redhat.com>
* glib/gen-unicode-tables.pl glib/gunicomp.h

View File

@ -1,3 +1,12 @@
Sun Sep 2 13:05:53 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strchomp): Replace some uses
of isspace() with g_ascii_isspace().
* glib/gutf8.c glib/gunicode.h glib/gstrfuncs.[ch]: Add
extra indirections to g_utf8_skip and g_ascii_table to
avoid great whopping copy relocs.
Sun Sep 2 11:10:42 2001 Owen Taylor <otaylor@redhat.com>
* glib/gen-unicode-tables.pl glib/gunicomp.h

View File

@ -1,3 +1,12 @@
Sun Sep 2 13:05:53 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strchomp): Replace some uses
of isspace() with g_ascii_isspace().
* glib/gutf8.c glib/gunicode.h glib/gstrfuncs.[ch]: Add
extra indirections to g_utf8_skip and g_ascii_table to
avoid great whopping copy relocs.
Sun Sep 2 11:10:42 2001 Owen Taylor <otaylor@redhat.com>
* glib/gen-unicode-tables.pl glib/gunicomp.h

View File

@ -1,3 +1,12 @@
Sun Sep 2 13:05:53 2001 Owen Taylor <otaylor@redhat.com>
* glib/gstrfuncs.c (g_strchomp): Replace some uses
of isspace() with g_ascii_isspace().
* glib/gutf8.c glib/gunicode.h glib/gstrfuncs.[ch]: Add
extra indirections to g_utf8_skip and g_ascii_table to
avoid great whopping copy relocs.
Sun Sep 2 11:10:42 2001 Owen Taylor <otaylor@redhat.com>
* glib/gen-unicode-tables.pl glib/gunicomp.h

View File

@ -56,7 +56,7 @@
#if defined(G_PLATFORM_WIN32) && defined(__GNUC__)
__declspec(dllexport)
#endif
const guint16 g_ascii_table[256] = {
static const guint16 ascii_table_data[256] = {
0x004, 0x004, 0x004, 0x004, 0x004, 0x004, 0x004, 0x004,
0x004, 0x104, 0x104, 0x004, 0x104, 0x104, 0x004, 0x004,
0x004, 0x004, 0x004, 0x004, 0x004, 0x004, 0x004, 0x004,
@ -76,6 +76,8 @@ const guint16 g_ascii_table[256] = {
/* the upper 128 are all zeroes */
};
const guint16 * const g_ascii_table = ascii_table_data;
gchar*
g_strdup (const gchar *str)
{
@ -1521,7 +1523,7 @@ g_strchug (gchar *string)
g_return_val_if_fail (string != NULL, NULL);
for (start = (guchar*) string; *start && isspace (*start); start++)
for (start = (guchar*) string; *start && g_ascii_isspace (*start); start++)
;
g_memmove (string, start, strlen ((gchar *) start) + 1);
@ -1539,7 +1541,7 @@ g_strchomp (gchar *string)
if (!*string)
return string;
for (s = string + strlen (string) - 1; s >= string && isspace ((guchar)*s);
for (s = string + strlen (string) - 1; s >= string && g_ascii_isspace ((guchar)*s);
s--)
*s = '\0';

View File

@ -47,7 +47,7 @@ typedef enum {
G_ASCII_XDIGIT = 1 << 10
} GAsciiType;
GLIB_VAR const guint16 g_ascii_table[256];
GLIB_VAR const guint16 * const g_ascii_table;
#define g_ascii_isalnum(c) \
((g_ascii_table[(guchar) (c)] & G_ASCII_ALNUM) != 0)

View File

@ -160,10 +160,8 @@ gunichar *g_unicode_canonical_decomposition (gunichar ch,
gsize *result_len);
/* Array of skip-bytes-per-initial character.
* We prefix variable declarations so they can
* properly get exported in Windows DLLs.
*/
GLIB_VAR char g_utf8_skip[256];
GLIB_VAR const gchar * const g_utf8_skip;
#define g_utf8_next_char(p) (char *)((p) + g_utf8_skip[*(guchar *)(p)])

View File

@ -99,7 +99,7 @@
(Char) != 0xFFFE && (Char) != 0xFFFF)
gchar g_utf8_skip[256] = {
static const gchar utf8_skip_data[256] = {
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
@ -110,6 +110,8 @@ gchar g_utf8_skip[256] = {
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,0,0
};
const gchar * const g_utf8_skip = utf8_skip_data;
/**
* g_utf8_find_prev_char:
* @str: pointer to the beginning of a UTF-8 string