[patch] wiping out <ctype.h> from gtk+



Here's a patch that wipes out all use of <ctype.h> from gtk+. Is it OK to
commit this?

Index: demos/gtk-demo/main.c
===================================================================
RCS file: /cvs/gnome/gtk+/demos/gtk-demo/main.c,v
retrieving revision 1.37
diff -p -u -r1.37 main.c
--- demos/gtk-demo/main.c    2001/12/04 23:42:27    1.37
+++ demos/gtk-demo/main.c    2002/02/08 17:19:07
@@ -2,7 +2,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <ctype.h>
 
 #include <gtk/gtk.h>
 
@@ -460,7 +459,7 @@ load_file (const gchar *filename)
     {
     case 0:
       /* Reading title */
-      while (*p == '/' || *p == '*' || isspace (*p))
+      while (*p == '/' || *p == '*' || g_ascii_isspace (*p))
         p++;
       r = p;
       while (*r != '/' && strlen (r))
@@ -468,7 +467,7 @@ load_file (const gchar *filename)
       if (strlen (r) > 0)
         p = r + 1;
       q = p + strlen (p);
-      while (q > p && isspace (*(q - 1)))
+      while (q > p && g_ascii_isspace (*(q - 1)))
         q--;
 
       if (q > p)
@@ -492,7 +491,7 @@ load_file (const gchar *filename)
         
     case 1:
       /* Reading body of info section */
-      while (isspace (*p))
+      while (g_ascii_isspace (*p))
         p++;
       if (*p == '*' && *(p + 1) == '/')
         {
@@ -503,11 +502,11 @@ load_file (const gchar *filename)
         {
           int len;
           
-          while (*p == '*' || isspace (*p))
+          while (*p == '*' || g_ascii_isspace (*p))
         p++;
 
           len = strlen (p);
-          while (isspace (*(p + len - 1)))
+          while (g_ascii_isspace (*(p + len - 1)))
         len--;
           
           if (len > 0)
@@ -529,7 +528,7 @@ load_file (const gchar *filename)
 
     case 2:
       /* Skipping blank lines */
-      while (isspace (*p))
+      while (g_ascii_isspace (*p))
         p++;
       if (*p)
         {
Index: gdk/x11/gdkim-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkim-x11.c,v
retrieving revision 1.26
diff -p -u -r1.26 gdkim-x11.c
--- gdk/x11/gdkim-x11.c    2001/10/16 23:28:44    1.26
+++ gdk/x11/gdkim-x11.c    2002/02/08 17:19:07
@@ -25,10 +25,10 @@
  */
 
 #include <locale.h>
+#include <stdlib.h>
 
 #include "gdk.h"        /* For gdk_flush() */
 #include "gdkpixmap.h"
-#include "gdki18n.h"
 #include "gdkinternals.h"
 #include "gdkprivate-x11.h"
 
Index: gdk/x11/gdkkeys-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkkeys-x11.c,v
retrieving revision 1.13
diff -p -u -r1.13 gdkkeys-x11.c
--- gdk/x11/gdkkeys-x11.c    2002/01/10 02:02:59    1.13
+++ gdk/x11/gdkkeys-x11.c    2002/02/08 17:19:07
@@ -24,7 +24,6 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  */
 
-#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
Index: gdk/x11/gdkmain-x11.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/x11/gdkmain-x11.c,v
retrieving revision 1.142
diff -p -u -r1.142 gdkmain-x11.c
--- gdk/x11/gdkmain-x11.c    2002/01/17 20:45:21    1.142
+++ gdk/x11/gdkmain-x11.c    2002/02/08 17:19:07
@@ -26,7 +26,6 @@
 
 #include "config.h"
 
-#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
Index: gdk-pixbuf/io-xbm.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk-pixbuf/io-xbm.c,v
retrieving revision 1.7
diff -p -u -r1.7 io-xbm.c
--- gdk-pixbuf/io-xbm.c    2001/12/13 21:22:11    1.7
+++ gdk-pixbuf/io-xbm.c    2002/02/08 17:19:07
@@ -33,7 +33,6 @@
 #include <string.h>
 #include <unistd.h>
 #include <stdio.h>
-#include <ctype.h>
 #include <errno.h>
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-io.h"
@@ -129,8 +128,8 @@ next_int (FILE *fstream)
         } else {
             /* trim high bits, check type and accumulate */
             ch &= 0xff;
-            if (isascii (ch) && isxdigit (ch)) {
-                value = (value << 4) + hex_table[ch];
+            if (g_ascii_isxdigit (ch)) {
+                value = (value << 4) + g_ascii_xdigit_value (ch);
                 gotone++;
             } else if ((hex_table[ch]) < 0 && gotone) {
                 done++;
Index: gtk/fnmatch.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/fnmatch.c,v
retrieving revision 1.12
diff -p -u -r1.12 fnmatch.c
--- gtk/fnmatch.c    2001/02/02 22:19:31    1.12
+++ gtk/fnmatch.c    2002/02/08 17:19:07
@@ -38,7 +38,6 @@
 
 /* We need glib.h for G_DIR_SEPARATOR and G_OS_WIN32 */
 #include <glib.h>
-#include <ctype.h>
 
 
 /* Comment out all this code if we are using the GNU C Library, and are not
Index: gtk/gtkaccelgroup.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkaccelgroup.c,v
retrieving revision 1.38
diff -p -u -r1.38 gtkaccelgroup.c
--- gtk/gtkaccelgroup.c    2002/02/02 22:52:22    1.38
+++ gtk/gtkaccelgroup.c    2002/02/08 17:19:07
@@ -29,7 +29,6 @@
 #include "gtkmarshalers.h"
 #include "gtksignal.h"
 
-#include <ctype.h>
 #include <string.h>
 #include <stdlib.h>
 
Index: gtk/gtkaccellabel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkaccellabel.c,v
retrieving revision 1.41
diff -p -u -r1.41 gtkaccellabel.c
--- gtk/gtkaccellabel.c    2002/01/30 22:29:02    1.41
+++ gtk/gtkaccellabel.c    2002/02/08 17:19:07
@@ -33,7 +33,6 @@
 #include "gtkintl.h"
 
 #include <string.h>
-#include <ctype.h>
 
 enum {
   PROP_0,
@@ -532,7 +531,7 @@ gtk_accel_label_refetch (GtkAccelLabel *
           g_string_append (gstring, "Backslash");
           break;
         default:
-          g_string_append_unichar (gstring, toupper (key->accel_key));
+          g_string_append_unichar (gstring, g_unichar_toupper
(key->accel_key));
           break;
         }
         }
@@ -542,7 +541,7 @@ gtk_accel_label_refetch (GtkAccelLabel *
           
           tmp = gtk_accelerator_name (key->accel_key, 0);
           if (tmp[0] != 0 && tmp[1] == 0)
-        tmp[0] = toupper (tmp[0]);
+        tmp[0] = g_unichar_totitle (tmp[0]);
           g_string_append (gstring, tmp);
           g_free (tmp);
         }
Index: gtk/gtkbindings.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkbindings.c,v
retrieving revision 1.29
diff -p -u -r1.29 gtkbindings.c
--- gtk/gtkbindings.c    2002/01/30 22:29:02    1.29
+++ gtk/gtkbindings.c    2002/02/08 17:19:07
@@ -27,7 +27,6 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  */
 
-#include <ctype.h>
 #include <string.h>
 #include <stdarg.h>
 #include "gtkbindings.h"
Index: gtk/gtkfontsel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkfontsel.c,v
retrieving revision 1.65
diff -p -u -r1.65 gtkfontsel.c
--- gtk/gtkfontsel.c    2002/01/29 21:29:55    1.65
+++ gtk/gtkfontsel.c    2002/02/08 17:19:07
@@ -32,7 +32,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <ctype.h>
 
 #include "gdk/gdk.h"
 #include "gdk/gdkkeysyms.h"
Index: gtk/gtkiconfactory.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkiconfactory.c,v
retrieving revision 1.30
diff -p -u -r1.30 gtkiconfactory.c
--- gtk/gtkiconfactory.c    2002/01/08 00:04:54    1.30
+++ gtk/gtkiconfactory.c    2002/02/08 17:19:07
@@ -30,7 +30,6 @@
 #include "gtkintl.h"
 #include <stdlib.h>
 #include <errno.h>
-#include <ctype.h>
 #include <string.h>
 
 static GSList *all_icon_factories = NULL;
Index: gtk/gtkinputdialog.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkinputdialog.c,v
retrieving revision 1.31
diff -p -u -r1.31 gtkinputdialog.c
--- gtk/gtkinputdialog.c    2002/02/02 04:26:48    1.31
+++ gtk/gtkinputdialog.c    2002/02/08 17:19:07
@@ -34,7 +34,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <ctype.h>
 #include "gdk/gdkkeysyms.h"
 #include "gtkbutton.h"
 #include "gtkentry.h"
Index: gtk/gtklabel.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtklabel.c,v
retrieving revision 1.120
diff -p -u -r1.120 gtklabel.c
--- gtk/gtklabel.c    2002/01/28 18:52:46    1.120
+++ gtk/gtklabel.c    2002/02/08 17:19:07
@@ -32,7 +32,6 @@
 #include "gtkwindow.h"
 #include "gdk/gdkkeysyms.h"
 #include "gtkclipboard.h"
-#include "gdk/gdki18n.h"
 #include <pango/pango.h>
 #include "gtkimagemenuitem.h"
 #include "gtkintl.h"
Index: gtk/gtkmain.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmain.c,v
retrieving revision 1.193
diff -p -u -r1.193 gtkmain.c
--- gtk/gtkmain.c    2002/02/01 14:15:56    1.193
+++ gtk/gtkmain.c    2002/02/08 17:19:08
@@ -59,7 +59,6 @@
 #include "gtkwidget.h"
 #include "gtkwindow.h"
 #include "gtkprivate.h"
-#include "gdk/gdki18n.h"
 #include "config.h"
 #include "gtkdebug.h"
 #include "gtkintl.h"
Index: gtk/gtkmenu.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmenu.c,v
retrieving revision 1.89
diff -p -u -r1.89 gtkmenu.c
--- gtk/gtkmenu.c    2002/02/04 17:46:33    1.89
+++ gtk/gtkmenu.c    2002/02/08 17:19:08
@@ -24,7 +24,6 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  */
 
-#include <ctype.h>
 #include <string.h> /* memset */
 #include "gdk/gdkkeysyms.h"
 #include "gtkaccelmap.h"
Index: gtk/gtkoldeditable.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkoldeditable.c,v
retrieving revision 1.13
diff -p -u -r1.13 gtkoldeditable.c
--- gtk/gtkoldeditable.c    2002/01/14 23:24:01    1.13
+++ gtk/gtkoldeditable.c    2002/02/08 17:19:08
@@ -24,7 +24,6 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
  */
 
-#include <ctype.h>
 #include <string.h>
 #include "gdk/gdkkeysyms.h"
 #include "gdk/gdki18n.h"
Index: gtk/gtkrc.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkrc.c,v
retrieving revision 1.114
diff -p -u -r1.114 gtkrc.c
--- gtk/gtkrc.c    2002/02/05 22:50:30    1.114
+++ gtk/gtkrc.c    2002/02/08 17:19:08
@@ -27,7 +27,6 @@
 #include "config.h"
 
 #include <locale.h>
-#include <ctype.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
Index: gtk/gtktextbtree.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextbtree.c,v
retrieving revision 1.55
diff -p -u -r1.55 gtktextbtree.c
--- gtk/gtktextbtree.c    2002/01/29 04:55:48    1.55
+++ gtk/gtktextbtree.c    2002/02/08 17:19:08
@@ -55,7 +55,6 @@
 #define GTK_TEXT_USE_INTERNAL_UNSUPPORTED_API
 #include "gtktextbtree.h"
 #include <string.h>
-#include <ctype.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include "gtksignal.h"
Index: gtk/gtktextiter.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextiter.c,v
retrieving revision 1.67
diff -p -u -r1.67 gtktextiter.c
--- gtk/gtktextiter.c    2002/01/02 03:49:08    1.67
+++ gtk/gtktextiter.c    2002/02/08 17:19:09
@@ -30,7 +30,6 @@
 #include "gtktextiterprivate.h"
 #include "gtkdebug.h"
 #include <string.h>
-#include <ctype.h>
 
 #define FIX_OVERFLOWS(varname) if ((varname) == G_MININT) (varname) =
G_MININT + 1
 
Index: gtk/gtktextsegment.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktextsegment.c,v
retrieving revision 1.11
diff -p -u -r1.11 gtktextsegment.c
--- gtk/gtktextsegment.c    2001/10/22 21:52:47    1.11
+++ gtk/gtktextsegment.c    2002/02/08 17:19:09
@@ -53,7 +53,6 @@
 #define GTK_TEXT_USE_INTERNAL_UNSUPPORTED_API
 #include "gtktextbtree.h"
 #include <string.h>
-#include <ctype.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include "gtktexttag.h"
===================================================================

    -- Darin




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