Anti-<ctype.h> patch for Pango



This has been sitting around on my computer for a while, since an
anti-<ctype.h> session a few weeks ago, and I decided I should ask for
permission to commit. OK to do so?

Index: pango/fonts.c
===================================================================
RCS file: /cvs/gnome/pango/pango/fonts.c,v
retrieving revision 1.45
diff -p -u -r1.45 fonts.c
--- pango/fonts.c    2002/01/16 14:27:12    1.45
+++ pango/fonts.c    2002/02/09 17:36:32
@@ -20,7 +20,6 @@
  */
 
 #include <stdlib.h>
-#include <ctype.h>
 #include <math.h>
 #include <string.h>
 
@@ -763,11 +762,11 @@ getword (const char *str, const char *la
 {
   const char *result;
   
-  while (last > str && isspace (*(last - 1)))
+  while (last > str && g_ascii_isspace (*(last - 1)))
     last--;
 
   result = last;
-  while (result > str && !isspace (*(result - 1)))
+  while (result > str && !g_ascii_isspace (*(result - 1)))
     result--;
 
   *wordlen = last - result;
@@ -855,16 +854,16 @@ pango_font_description_from_string (cons
   /* Remainder (str => p) is family list. Trim off trailing commas and
leading and trailing white space
    */
 
-  while (last > str && isspace (*(last - 1)))
+  while (last > str && g_ascii_isspace (*(last - 1)))
     last--;
 
   if (last > str && *(last - 1) == ',')
     last--;
 
-  while (last > str && isspace (*(last - 1)))
+  while (last > str && g_ascii_isspace (*(last - 1)))
     last--;
 
-  while (isspace (*str))
+  while (g_ascii_isspace (*str))
     str++;
 
   if (str != last)
Index: pango/modules.c
===================================================================
RCS file: /cvs/gnome/pango/pango/modules.c,v
retrieving revision 1.34
diff -p -u -r1.34 modules.c
--- pango/modules.c    2001/12/05 02:30:45    1.34
+++ pango/modules.c    2002/02/09 17:36:32
@@ -21,7 +21,6 @@
 
 #include "config.h"
 
-#include <ctype.h>
 #include <stdio.h>
 #include <string.h>
 #include <limits.h>
Index: pango/pango-markup.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-markup.c,v
retrieving revision 1.12
diff -p -u -r1.12 pango-markup.c
--- pango/pango-markup.c    2002/01/29 01:42:56    1.12
+++ pango/pango-markup.c    2002/02/09 17:36:32
@@ -22,7 +22,6 @@
 #include <string.h>
 #include <stdlib.h>
 #include <errno.h>
-#include <ctype.h>
 
 #include <pango/pango-attributes.h>
 #include <pango/pango-font.h>
@@ -614,7 +613,7 @@ pango_parse_markup (const char
 
   p = markup_text;
   end = markup_text + length;
-  while (p != end && isspace (*p))
+  while (p != end && g_ascii_isspace (*p))
     ++p;
 
   if (end - p >= 8 && strncmp (p, "<markup>", 8) == 0)
@@ -955,7 +954,7 @@ span_parse_func     (MarkupData
 
   if (size)
     {
-      if (isdigit (*size))
+      if (g_ascii_isdigit (*size))
         {
           char *end = NULL;
           gulong n;
Index: pango/pango-utils.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-utils.c,v
retrieving revision 1.32
diff -p -u -r1.32 pango-utils.c
--- pango/pango-utils.c    2001/11/24 21:34:57    1.32
+++ pango/pango-utils.c    2002/02/09 17:36:32
@@ -19,7 +19,6 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <ctype.h>
 #include <errno.h>
 #include <string.h>
 #include <stdlib.h>
@@ -73,11 +72,11 @@ pango_trim_string (const char *str)
 
   g_return_val_if_fail (str != NULL, NULL);
   
-  while (*str && isspace (*str))
+  while (*str && g_ascii_isspace (*str))
     str++;
 
   len = strlen (str);
-  while (len > 0 && isspace (str[len-1]))
+  while (len > 0 && g_ascii_isspace (str[len-1]))
     len--;
 
   return g_strndup (str, len);
@@ -264,7 +263,7 @@ pango_skip_space (const char **pos)
 {
   const char *p = *pos;
   
-  while (isspace (*p))
+  while (g_ascii_isspace (*p))
     p++;
 
   *pos = p;
@@ -288,7 +287,7 @@ pango_scan_word (const char **pos, GStri
 {
   const char *p = *pos;
 
-  while (isspace (*p))
+  while (g_ascii_isspace (*p))
     p++;
   
   if (!((*p >= 'A' && *p <= 'Z') ||
@@ -331,7 +330,7 @@ pango_scan_string (const char **pos, GSt
 {
   const char *p = *pos;
   
-  while (isspace (*p))
+  while (g_ascii_isspace (*p))
     p++;
 
   if (!*p)
@@ -390,7 +389,7 @@ pango_scan_string (const char **pos, GSt
     {
       g_string_truncate (out, 0);
 
-      while (*p && !isspace (*p))
+      while (*p && !g_ascii_isspace (*p))
     {
       g_string_append_c (out, *p);
       p++;
@@ -420,7 +419,7 @@ pango_scan_int (const char **pos, int *o
   char buf[32];
   const char *p = *pos;
 
-  while (isspace (*p))
+  while (g_ascii_isspace (*p))
     p++;
   
   if (*p < '0' || *p > '9')
Index: pango/pangoft2-fontmap.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangoft2-fontmap.c,v
retrieving revision 1.29
diff -p -u -r1.29 pangoft2-fontmap.c
--- pango/pangoft2-fontmap.c    2002/01/11 20:09:58    1.29
+++ pango/pangoft2-fontmap.c    2002/02/09 17:36:32
@@ -23,7 +23,6 @@
 #include "config.h"
 
 #include <glib.h>
-#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
Index: pango/pangox-fontmap.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangox-fontmap.c,v
retrieving revision 1.27
diff -p -u -r1.27 pangox-fontmap.c
--- pango/pangox-fontmap.c    2001/11/18 23:23:14    1.27
+++ pango/pangox-fontmap.c    2002/02/09 17:36:32
@@ -19,7 +19,6 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>

===================================================================

    -- Darin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]