Replace some uses of isspace() with g_ascii_isspace().
authorOwen Taylor <otaylor@redhat.com>
Sun, 2 Sep 2001 17:14:23 +0000 (17:14 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Sun, 2 Sep 2001 17:14:23 +0000 (17:14 +0000)
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.

12 files changed:
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gstrfuncs.c
glib/gstrfuncs.h
glib/gunicode.h
glib/gutf8.c

index d2a9e13..c3bd76a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index d2a9e13..c3bd76a 100644 (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
index d2a9e13..c3bd76a 100644 (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
index d2a9e13..c3bd76a 100644 (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
index d2a9e13..c3bd76a 100644 (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
index d2a9e13..c3bd76a 100644 (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
index d2a9e13..c3bd76a 100644 (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
index d2a9e13..c3bd76a 100644 (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
index af3b99c..3708248 100644 (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';
 
index 1dfb024..62f0e47 100644 (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)
index c130955..f93f3b1 100644 (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)])
 
index 567fcbc..a858780 100644 (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