]> Pileus Git - ~andy/gtk/commitdiff
Use g_printf instead of system printf. (#99327)
authorMatthias Clasen <maclas@gmx.de>
Sun, 15 Dec 2002 01:49:01 +0000 (01:49 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 15 Dec 2002 01:49:01 +0000 (01:49 +0000)
2002-12-15  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkcalendar.c:
* gtk/gtkfilesel.c:
* gtk/gtkfontsel.c:
* gtk/gtkhruler.c:
* gtk/gtkinputdialog.c:
* gtk/gtkprogress.c:
* gtk/gtktreemodel.c:
* gtk/gtkvruler.c:
* gtk/queryimmodules.c:
* gtk/theme-bits/decompose-bits.c:
* gdk-pixbuf/gdk-pixbuf-csource.c:
* gdk-pixbuf/make-inline-pixbuf.c:
* gdk-pixbuf/queryloaders.c:
* gdk/gdkkeynames.c:
* gdk/gdkrgb.c:
* gdk/linux-fb/gdkfbmanager.c:
* gdk/win32/gdkevents-win32.c:
* gdk/win32/gdkmain-win32.c:
* gdk/win32/gdkproperty-win32.c:
* gdk/x11/gdkmain-x11.c: Use g_printf instead of system
printf.  (#99327)

26 files changed:
ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk-pixbuf/gdk-pixbuf-csource.c
gdk-pixbuf/make-inline-pixbuf.c
gdk-pixbuf/queryloaders.c
gdk/gdkkeynames.c
gdk/gdkrgb.c
gdk/linux-fb/gdkfbmanager.c
gdk/win32/gdkevents-win32.c
gdk/win32/gdkmain-win32.c
gdk/win32/gdkproperty-win32.c
gdk/x11/gdkmain-x11.c
gtk/gtkcalendar.c
gtk/gtkfilesel.c
gtk/gtkfontsel.c
gtk/gtkhruler.c
gtk/gtkinputdialog.c
gtk/gtkprogress.c
gtk/gtktreemodel.c
gtk/gtkvruler.c
gtk/queryimmodules.c
gtk/theme-bits/decompose-bits.c

index 8341e6a6570633878fe9aa4cd6f27d6259d8d6c9..c462519c05a470ebea28132fee73c6c74766672d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,27 @@
 2002-12-15  Matthias Clasen  <maclas@gmx.de>
 
+       * gtk/gtkcalendar.c:
+       * gtk/gtkfilesel.c:
+       * gtk/gtkfontsel.c:
+       * gtk/gtkhruler.c:
+       * gtk/gtkinputdialog.c:
+       * gtk/gtkprogress.c:
+       * gtk/gtktreemodel.c:
+       * gtk/gtkvruler.c:
+       * gtk/queryimmodules.c:
+       * gtk/theme-bits/decompose-bits.c:
+       * gdk-pixbuf/gdk-pixbuf-csource.c:
+       * gdk-pixbuf/make-inline-pixbuf.c:
+       * gdk-pixbuf/queryloaders.c:
+       * gdk/gdkkeynames.c:
+       * gdk/gdkrgb.c:
+       * gdk/linux-fb/gdkfbmanager.c:
+       * gdk/win32/gdkevents-win32.c:
+       * gdk/win32/gdkmain-win32.c:
+       * gdk/win32/gdkproperty-win32.c:
+       * gdk/x11/gdkmain-x11.c: Use g_printf instead of system 
+       printf.  (#99327)  
+
        * gtk/gtkcontainer.c (gtk_container_class_install_child_property): 
        (gtk_container_child_get_valist): 
        (gtk_container_child_get_property): 
index 8341e6a6570633878fe9aa4cd6f27d6259d8d6c9..c462519c05a470ebea28132fee73c6c74766672d 100644 (file)
@@ -1,5 +1,27 @@
 2002-12-15  Matthias Clasen  <maclas@gmx.de>
 
+       * gtk/gtkcalendar.c:
+       * gtk/gtkfilesel.c:
+       * gtk/gtkfontsel.c:
+       * gtk/gtkhruler.c:
+       * gtk/gtkinputdialog.c:
+       * gtk/gtkprogress.c:
+       * gtk/gtktreemodel.c:
+       * gtk/gtkvruler.c:
+       * gtk/queryimmodules.c:
+       * gtk/theme-bits/decompose-bits.c:
+       * gdk-pixbuf/gdk-pixbuf-csource.c:
+       * gdk-pixbuf/make-inline-pixbuf.c:
+       * gdk-pixbuf/queryloaders.c:
+       * gdk/gdkkeynames.c:
+       * gdk/gdkrgb.c:
+       * gdk/linux-fb/gdkfbmanager.c:
+       * gdk/win32/gdkevents-win32.c:
+       * gdk/win32/gdkmain-win32.c:
+       * gdk/win32/gdkproperty-win32.c:
+       * gdk/x11/gdkmain-x11.c: Use g_printf instead of system 
+       printf.  (#99327)  
+
        * gtk/gtkcontainer.c (gtk_container_class_install_child_property): 
        (gtk_container_child_get_valist): 
        (gtk_container_child_get_property): 
index 8341e6a6570633878fe9aa4cd6f27d6259d8d6c9..c462519c05a470ebea28132fee73c6c74766672d 100644 (file)
@@ -1,5 +1,27 @@
 2002-12-15  Matthias Clasen  <maclas@gmx.de>
 
+       * gtk/gtkcalendar.c:
+       * gtk/gtkfilesel.c:
+       * gtk/gtkfontsel.c:
+       * gtk/gtkhruler.c:
+       * gtk/gtkinputdialog.c:
+       * gtk/gtkprogress.c:
+       * gtk/gtktreemodel.c:
+       * gtk/gtkvruler.c:
+       * gtk/queryimmodules.c:
+       * gtk/theme-bits/decompose-bits.c:
+       * gdk-pixbuf/gdk-pixbuf-csource.c:
+       * gdk-pixbuf/make-inline-pixbuf.c:
+       * gdk-pixbuf/queryloaders.c:
+       * gdk/gdkkeynames.c:
+       * gdk/gdkrgb.c:
+       * gdk/linux-fb/gdkfbmanager.c:
+       * gdk/win32/gdkevents-win32.c:
+       * gdk/win32/gdkmain-win32.c:
+       * gdk/win32/gdkproperty-win32.c:
+       * gdk/x11/gdkmain-x11.c: Use g_printf instead of system 
+       printf.  (#99327)  
+
        * gtk/gtkcontainer.c (gtk_container_class_install_child_property): 
        (gtk_container_child_get_valist): 
        (gtk_container_child_get_property): 
index 8341e6a6570633878fe9aa4cd6f27d6259d8d6c9..c462519c05a470ebea28132fee73c6c74766672d 100644 (file)
@@ -1,5 +1,27 @@
 2002-12-15  Matthias Clasen  <maclas@gmx.de>
 
+       * gtk/gtkcalendar.c:
+       * gtk/gtkfilesel.c:
+       * gtk/gtkfontsel.c:
+       * gtk/gtkhruler.c:
+       * gtk/gtkinputdialog.c:
+       * gtk/gtkprogress.c:
+       * gtk/gtktreemodel.c:
+       * gtk/gtkvruler.c:
+       * gtk/queryimmodules.c:
+       * gtk/theme-bits/decompose-bits.c:
+       * gdk-pixbuf/gdk-pixbuf-csource.c:
+       * gdk-pixbuf/make-inline-pixbuf.c:
+       * gdk-pixbuf/queryloaders.c:
+       * gdk/gdkkeynames.c:
+       * gdk/gdkrgb.c:
+       * gdk/linux-fb/gdkfbmanager.c:
+       * gdk/win32/gdkevents-win32.c:
+       * gdk/win32/gdkmain-win32.c:
+       * gdk/win32/gdkproperty-win32.c:
+       * gdk/x11/gdkmain-x11.c: Use g_printf instead of system 
+       printf.  (#99327)  
+
        * gtk/gtkcontainer.c (gtk_container_class_install_child_property): 
        (gtk_container_child_get_valist): 
        (gtk_container_child_get_property): 
index 8341e6a6570633878fe9aa4cd6f27d6259d8d6c9..c462519c05a470ebea28132fee73c6c74766672d 100644 (file)
@@ -1,5 +1,27 @@
 2002-12-15  Matthias Clasen  <maclas@gmx.de>
 
+       * gtk/gtkcalendar.c:
+       * gtk/gtkfilesel.c:
+       * gtk/gtkfontsel.c:
+       * gtk/gtkhruler.c:
+       * gtk/gtkinputdialog.c:
+       * gtk/gtkprogress.c:
+       * gtk/gtktreemodel.c:
+       * gtk/gtkvruler.c:
+       * gtk/queryimmodules.c:
+       * gtk/theme-bits/decompose-bits.c:
+       * gdk-pixbuf/gdk-pixbuf-csource.c:
+       * gdk-pixbuf/make-inline-pixbuf.c:
+       * gdk-pixbuf/queryloaders.c:
+       * gdk/gdkkeynames.c:
+       * gdk/gdkrgb.c:
+       * gdk/linux-fb/gdkfbmanager.c:
+       * gdk/win32/gdkevents-win32.c:
+       * gdk/win32/gdkmain-win32.c:
+       * gdk/win32/gdkproperty-win32.c:
+       * gdk/x11/gdkmain-x11.c: Use g_printf instead of system 
+       printf.  (#99327)  
+
        * gtk/gtkcontainer.c (gtk_container_class_install_child_property): 
        (gtk_container_child_get_valist): 
        (gtk_container_child_get_property): 
index 8341e6a6570633878fe9aa4cd6f27d6259d8d6c9..c462519c05a470ebea28132fee73c6c74766672d 100644 (file)
@@ -1,5 +1,27 @@
 2002-12-15  Matthias Clasen  <maclas@gmx.de>
 
+       * gtk/gtkcalendar.c:
+       * gtk/gtkfilesel.c:
+       * gtk/gtkfontsel.c:
+       * gtk/gtkhruler.c:
+       * gtk/gtkinputdialog.c:
+       * gtk/gtkprogress.c:
+       * gtk/gtktreemodel.c:
+       * gtk/gtkvruler.c:
+       * gtk/queryimmodules.c:
+       * gtk/theme-bits/decompose-bits.c:
+       * gdk-pixbuf/gdk-pixbuf-csource.c:
+       * gdk-pixbuf/make-inline-pixbuf.c:
+       * gdk-pixbuf/queryloaders.c:
+       * gdk/gdkkeynames.c:
+       * gdk/gdkrgb.c:
+       * gdk/linux-fb/gdkfbmanager.c:
+       * gdk/win32/gdkevents-win32.c:
+       * gdk/win32/gdkmain-win32.c:
+       * gdk/win32/gdkproperty-win32.c:
+       * gdk/x11/gdkmain-x11.c: Use g_printf instead of system 
+       printf.  (#99327)  
+
        * gtk/gtkcontainer.c (gtk_container_class_install_child_property): 
        (gtk_container_child_get_valist): 
        (gtk_container_child_get_property): 
index 35f41705f0f12b3351e1ab2554b1c4ebc0c73eff..29669c8a09e419feed007b9220ddf5182376cce0 100644 (file)
@@ -21,7 +21,7 @@
 #include "../gtk/gtkversion.h" /* versioning */
 #include "gdk-pixbuf.h"
 #include "gdk-pixdata.h"
-#include <stdio.h>
+#include <glib/gprintf.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -64,7 +64,7 @@ print_csource (FILE *f_out,
                                    gen_type | gen_ctype |
                                    (with_decoder ? GDK_PIXDATA_DUMP_RLE_DECODER : 0));
 
-  fprintf (f_out, "%s\n", gstring->str);
+  g_fprintf (f_out, "%s\n", gstring->str);
 
   g_free (free_me);
 }
@@ -93,7 +93,7 @@ main (int   argc,
       pixbuf = gdk_pixbuf_new_from_file (argv[1], &error);
       if (!pixbuf)
        {
-         fprintf (stderr, "failed to load \"%s\": %s\n",
+         g_fprintf (stderr, "failed to load \"%s\": %s\n",
                   argv[1],
                   error->message);
          g_error_free (error);
@@ -118,7 +118,7 @@ main (int   argc,
              pixbuf = gdk_pixbuf_new_from_file (*p, &error);
              if (!pixbuf)
                {
-                 fprintf (stderr, "failed to load \"%s\": %s\n",
+                 g_fprintf (stderr, "failed to load \"%s\": %s\n",
                           *p,
                           error->message);
                  g_error_free (error);
@@ -255,32 +255,32 @@ print_blurb (FILE    *bout,
 {
   if (!print_help)
     {
-      fprintf (bout, "%s version ", PRG_NAME);
-      fprintf (bout, "%u.%u.%u", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
-      fprintf (bout, "\n");
-      fprintf (bout, "%s comes with ABSOLUTELY NO WARRANTY.\n", PRG_NAME);
-      fprintf (bout, "You may redistribute copies of %s under the terms of\n", PRG_NAME);
-      fprintf (bout, "the GNU Lesser General Public License which can be found in the\n");
-      fprintf (bout, "%s source package. Sources, examples and contact\n", PKG_NAME);
-      fprintf (bout, "information are available at %s\n", PKG_HTTP_HOME);
+      g_fprintf (bout, "%s version ", PRG_NAME);
+      g_fprintf (bout, "%u.%u.%u", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
+      g_fprintf (bout, "\n");
+      g_fprintf (bout, "%s comes with ABSOLUTELY NO WARRANTY.\n", PRG_NAME);
+      g_fprintf (bout, "You may redistribute copies of %s under the terms of\n", PRG_NAME);
+      g_fprintf (bout, "the GNU Lesser General Public License which can be found in the\n");
+      g_fprintf (bout, "%s source package. Sources, examples and contact\n", PKG_NAME);
+      g_fprintf (bout, "information are available at %s\n", PKG_HTTP_HOME);
     }
   else
     {
-      fprintf (bout, "Usage: %s [options] [image]\n", PRG_NAME);
-      fprintf (bout, "       %s [options] --build-list [[name image]...]\n", PRG_NAME);
-      fprintf (bout, "  --stream                   generate pixbuf data stream\n");
-      fprintf (bout, "  --struct                   generate GdkPixdata structure\n");
-      fprintf (bout, "  --macros                   generate image size/pixel macros\n");
-      fprintf (bout, "  --rle                      use one byte run-length-encoding\n");
-      fprintf (bout, "  --raw                      provide raw image data copy\n");
-      fprintf (bout, "  --extern                   generate extern symbols\n");
-      fprintf (bout, "  --static                   generate static symbols\n");
-      fprintf (bout, "  --decoder                  provide rle decoder\n");
-      fprintf (bout, "  --name=identifier          C macro/variable name\n");
-      fprintf (bout, "  --build-list               parse (name, image) pairs\n");
-      fprintf (bout, "  -h, --help                 show this help message\n");
-      fprintf (bout, "  -v, --version              print version informations\n");
-      fprintf (bout, "  --g-fatal-warnings         make warnings fatal (abort)\n");
+      g_fprintf (bout, "Usage: %s [options] [image]\n", PRG_NAME);
+      g_fprintf (bout, "       %s [options] --build-list [[name image]...]\n", PRG_NAME);
+      g_fprintf (bout, "  --stream                   generate pixbuf data stream\n");
+      g_fprintf (bout, "  --struct                   generate GdkPixdata structure\n");
+      g_fprintf (bout, "  --macros                   generate image size/pixel macros\n");
+      g_fprintf (bout, "  --rle                      use one byte run-length-encoding\n");
+      g_fprintf (bout, "  --raw                      provide raw image data copy\n");
+      g_fprintf (bout, "  --extern                   generate extern symbols\n");
+      g_fprintf (bout, "  --static                   generate static symbols\n");
+      g_fprintf (bout, "  --decoder                  provide rle decoder\n");
+      g_fprintf (bout, "  --name=identifier          C macro/variable name\n");
+      g_fprintf (bout, "  --build-list               parse (name, image) pairs\n");
+      g_fprintf (bout, "  -h, --help                 show this help message\n");
+      g_fprintf (bout, "  -v, --version              print version informations\n");
+      g_fprintf (bout, "  --g-fatal-warnings         make warnings fatal (abort)\n");
     }
 }
 
index fbf1102335fb8f3427a9e7bffea810f1516c6628..fea4ea388ae27c7d973042104831b87c76b6666c 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <config.h>
 #include "gdk-pixbuf-private.h"
-#include <stdio.h>
+#include <glib/gprintf.h>
 #include <errno.h>
 #include <string.h>
 #include <stdlib.h>
@@ -38,7 +38,7 @@ output_int (FILE *outfile, guint32 num, const char *comment)
   bytes[2] = num >> 8;
   bytes[3] = num;
 
-  fprintf(outfile, "  /* %s (%u) */\n  0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x,\n",
+  g_fprintf (outfile, "  /* %s (%u) */\n  0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x,\n",
           comment, num,
           bytes[0], bytes[1], bytes[2], bytes[3]);  
 }
@@ -46,7 +46,7 @@ output_int (FILE *outfile, guint32 num, const char *comment)
 void
 output_bool (FILE *outfile, gboolean val, const char *comment)
 {
-  fprintf(outfile, "  /* %s (%s) */\n  0x%.2x,\n",
+  g_fprintf (outfile, "  /* %s (%s) */\n  0x%.2x,\n",
           comment,
           val ? "TRUE" : "FALSE",
           val ? 1 : 0);
@@ -67,7 +67,7 @@ output_pixbuf (FILE *outfile, gboolean ext_symbols,
   if (ext_symbols)
     modifier = "";
   
-  fprintf (outfile, "%sconst guchar ", modifier);
+  g_fprintf (outfile, "%sconst guchar ", modifier);
   fputs (varname, outfile);
   fputs ("[] =\n", outfile);
   fputs ("{\n", outfile);
@@ -117,9 +117,9 @@ output_pixbuf (FILE *outfile, gboolean ext_symbols,
 
       
       if (has_alpha)
-        fprintf(outfile, "  0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x", r, g, b, a);
+        g_fprintf (outfile, "  0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x", r, g, b, a);
       else
-        fprintf(outfile, "  0x%.2x, 0x%.2x, 0x%.2x", r, g, b);
+        g_fprintf (outfile, "  0x%.2x, 0x%.2x, 0x%.2x", r, g, b);
 
       if (p != end)
         fputs (",", outfile);
@@ -141,7 +141,7 @@ output_pixbuf (FILE *outfile, gboolean ext_symbols,
 void
 usage (void)
 {
-  fprintf (stderr, "Usage: make-inline-pixbuf [--extern-symbols] OUTFILE varname1 imagefile1 varname2 imagefile2 ...\n");
+  g_fprintf (stderr, "Usage: make-inline-pixbuf [--extern-symbols] OUTFILE varname1 imagefile1 varname2 imagefile2 ...\n");
   exit (1);
 }
 
@@ -171,7 +171,7 @@ main (int argc, char **argv)
   outfile = fopen (argv[i], "w");
   if (outfile == NULL)
     {
-      fprintf (stderr, "Failed to open output file `%s': %s\n",
+      g_fprintf (stderr, "Failed to open output file `%s': %s\n",
                argv[i], strerror (errno));
       exit (1);
     }
@@ -199,7 +199,7 @@ main (int argc, char **argv)
 
       if (pixbuf == NULL)
         {
-          fprintf (stderr, "%s\n", error->message);
+          g_fprintf (stderr, "%s\n", error->message);
           fclose (outfile);
           remove (outfilename);
           exit (1);
index 02ee35273d6f400a6f4916c42f705f7fff8e7307..2053a3ae1b8d7c680a680a4265223bfb30d4646a 100644 (file)
@@ -25,6 +25,7 @@
 #include <config.h>
 
 #include <glib.h>
+#include <glib/gprintf.h>
 #include <gmodule.h>
 
 #include <errno.h>
@@ -32,7 +33,6 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#include <stdio.h>
 
 #include "gdk-pixbuf/gdk-pixbuf.h"
 #include "gdk-pixbuf/gdk-pixbuf-private.h"
@@ -49,7 +49,7 @@ static void
 print_escaped (const char *str)
 {
        gchar *tmp = g_strescape (str, "");
-       printf ("\"%s\" ", tmp);
+       g_printf ("\"%s\" ", tmp);
        g_free (tmp);
 }
 
@@ -78,30 +78,30 @@ query_module (const char *dir, const char *file)
            g_module_symbol (module, "fill_info", (gpointer *) &fill_info) &&
            g_module_symbol (module, "fill_vtable", (gpointer *) &fill_vtable)) {
                GdkPixbufFormat *info;
-               printf("\"%s\"\n", path);
+               g_printf("\"%s\"\n", path);
                info = g_new0 (GdkPixbufFormat, 1);
                (*fill_info) (info);
-               printf("\"%s\" %d \"%s\" \"%s\"\n", 
+               g_printf ("\"%s\" %d \"%s\" \"%s\"\n", 
                       info->name, info->flags, 
                       info->domain ? info->domain : GETTEXT_PACKAGE, info->description);
                for (mime = info->mime_types; *mime; mime++) {
-                       printf("\"%s\" ", *mime);
+                       g_printf ("\"%s\" ", *mime);
                }
-               printf("\"\"\n");
+               g_printf ("\"\"\n");
                for (ext = info->extensions; *ext; ext++) {
-                       printf("\"%s\" ", *ext);
+                       g_printf ("\"%s\" ", *ext);
                }
-               printf("\"\"\n");
+               g_printf ("\"\"\n");
                for (pattern = info->signature; pattern->prefix; pattern++) {
                        print_escaped (pattern->prefix);
                        print_escaped (pattern->mask ? (const char *)pattern->mask : "");
-                       printf ("%d\n", pattern->relevance);
+                       g_printf ("%d\n", pattern->relevance);
                }
-               printf ("\n");
+               g_printf ("\n");
                g_free (info);
        }
        else {
-               fprintf (stderr, "Cannot load loader %s\n", path);
+               g_fprintf (stderr, "Cannot load loader %s\n", path);
        }
        if (module)
                g_module_close (module);
@@ -112,7 +112,7 @@ int main (int argc, char **argv)
 {
        gint i;
 
-       printf ("# GdkPixbuf Image Loader Modules file\n"
+       g_printf ("# GdkPixbuf Image Loader Modules file\n"
                "# Automatically generated file, do not edit\n"
                "#\n");
   
@@ -125,7 +125,7 @@ int main (int argc, char **argv)
                if (path == NULL || *path == '\0')
                        path = PIXBUF_LIBDIR;
 
-               printf ("# LoaderDir = %s\n#\n", path);
+               g_printf ("# LoaderDir = %s\n#\n", path);
 
                dir = g_dir_open (path, 0, NULL);
                if (dir) {
@@ -141,7 +141,7 @@ int main (int argc, char **argv)
                        g_dir_close (dir);
                }
 #else
-               printf ("# dynamic loading of modules not supported\n");
+               g_printf ("# dynamic loading of modules not supported\n");
 #endif
        }
        else {
index ed8384c82d416b3436dae2ef25656c60704675d3..3789e23bf2e71a1dc08adfec8ae79354d6d1c03a 100644 (file)
@@ -24,7 +24,7 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
-#include <stdio.h>
+#include <glib/gprintf.h>
 #include <stdlib.h>
 
 #include "gdkkeysyms.h"
@@ -1360,7 +1360,7 @@ gdk_keyval_name (guint keyval)
   /* Check for directly encoded 24-bit UCS characters: */
   if ((keyval & 0xff000000) == 0x01000000)
     {
-      sprintf (buf, "U+%.04X", (keyval & 0x00ffffff));
+      g_sprintf (buf, "U+%.04X", (keyval & 0x00ffffff));
       return buf;
     }
 
@@ -1378,7 +1378,7 @@ gdk_keyval_name (guint keyval)
     }
   else if (keyval != 0)
     {
-      sprintf (buf, "%#x", keyval);
+      g_sprintf (buf, "%#x", keyval);
       return buf;
     }
 
index 825abd07d866ae59d9e3b9217ac35443e126bb63..2d376e0dd9d63f82906ba1caa4466496aa27e4a8 100644 (file)
@@ -52,6 +52,7 @@
 
 #include "gdkrgb.h"
 #include "gdkscreen.h"
+#include <glib/gprintf.h>
 
 typedef struct _GdkRgbInfo     GdkRgbInfo;
 typedef struct _GdkRgbCmapInfo GdkRgbCmapInfo;
@@ -283,7 +284,7 @@ gdk_rgb_try_colormap (GdkRgbInfo *image_info, gboolean force,
        {
          char tmp_str[80];
          
-         sprintf (tmp_str,
+         g_snprintf (tmp_str, 80,
                   "%d %d %d colormap failed (in gdk_colors_alloc)\n",
                   nr, ng, nb);
          return gdk_rgb_cmap_fail (tmp_str, cmap, pixels);
@@ -312,7 +313,7 @@ gdk_rgb_try_colormap (GdkRgbInfo *image_info, gboolean force,
                {
                  char tmp_str[80];
 
-                 sprintf (tmp_str, "%d %d %d colormap failed\n",
+                 g_snprintf (tmp_str, 80, "%d %d %d colormap failed\n",
                           nr, ng, nb);
                  return gdk_rgb_cmap_fail (tmp_str,
                                            cmap, pixels);
index 23cc49501dace3dcce086cd3d96915fa66175b94..3c8263a504d247514ab4c78a4678891fd29f34c9 100644 (file)
@@ -1,4 +1,5 @@
 #include <glib.h>
+#include <glib/gprintf.h>
 
 #include <sys/types.h>
 #include <sys/socket.h>
@@ -9,7 +10,6 @@
 #include <errno.h>
 #include <unistd.h>
 #include <fcntl.h>
-#include <stdio.h>
 
 #include "gdkfbmanager.h"
 
@@ -33,7 +33,7 @@ int create_master_socket (void)
 
   if (fd < 0) 
     {
-      printf ("Error creating socket: %s\n", strerror(errno));
+      g_fprintf (stderr, "Error creating socket: %s\n", strerror(errno));
       return -1;
     }
 
@@ -44,7 +44,7 @@ int create_master_socket (void)
 
   if (bind(fd, (struct sockaddr *)&addr, sizeof (addr)) < 0)
     {
-      printf ("Unable to bind socket: %s\n", strerror(errno));
+      g_fprintf (stderr, "Unable to bind socket: %s\n", strerror (errno));
       close (fd);
       return -1;
     }
@@ -52,7 +52,7 @@ int create_master_socket (void)
 
   if (listen (fd, 10) < 0)
     {
-      printf ("Unable to listen on socket: %s\n", strerror(errno));
+      g_fprintf (stderr, "Unable to listen on socket: %s\n", strerror (errno));
       close (fd);
       return -1;
     }
index 6724a13a8fff1b14c10457ddc83705628675a760..7ae4739ff261e1471c5fa655349318e99555de39 100644 (file)
@@ -36,7 +36,7 @@
 /* Do use SetCapture, it works now. Thanks to jpe@archaeopteryx.com */
 #define USE_SETCAPTURE 1
 
-#include <stdio.h>
+#include <glib/gprintf.h>
 
 #include "gdk.h"
 #include "gdkprivate-win32.h"
@@ -318,7 +318,7 @@ _gdk_events_init (void)
       while (latin_locale == NULL && i < G_N_ELEMENTS (latin_languages))
        {
          char id[9];
-         sprintf (id, "%08x", MAKELANGID (latin_languages[i++], SUBLANG_DEFAULT));
+         g_sprintf (id, "%08x", MAKELANGID (latin_languages[i++], SUBLANG_DEFAULT));
          latin_locale = LoadKeyboardLayout (id, KLF_NOTELLSHELL|KLF_SUBSTITUTE_OK);
        }
     }
@@ -451,7 +451,7 @@ event_mask_string (GdkEventMask mask)
   *p = '\0';
 #define BIT(x) \
   if (mask & GDK_##x##_MASK) \
-    p += sprintf (p, "%s" #x, (p > bfr ? " " : ""))
+    p += g_sprintf (p, "%s" #x, (p > bfr ? " " : ""))
   BIT (EXPOSURE);
   BIT (POINTER_MOTION);
   BIT (POINTER_MOTION_HINT);
@@ -1613,14 +1613,14 @@ decode_key_lparam (LPARAM lParam)
   char *p = buf;
 
   if (HIWORD (lParam) & KF_UP)
-    p += sprintf (p, "KF_UP ");
+    p += g_sprintf (p, "KF_UP ");
   if (HIWORD (lParam) & KF_REPEAT)
-    p += sprintf (p, "KF_REPEAT ");
+    p += g_sprintf (p, "KF_REPEAT ");
   if (HIWORD (lParam) & KF_ALTDOWN)
-    p += sprintf (p, "KF_ALTDOWN ");
+    p += g_sprintf (p, "KF_ALTDOWN ");
   if (HIWORD (lParam) & KF_EXTENDED)
-    p += sprintf (p, "KF_EXTENDED ");
-  p += sprintf (p, "sc:%d rep:%d", LOBYTE (HIWORD (lParam)), LOWORD (lParam));
+    p += g_sprintf (p, "KF_EXTENDED ");
+  p += g_sprintf (p, "sc:%d rep:%d", LOBYTE (HIWORD (lParam)), LOWORD (lParam));
 
   return buf;
 }
index 521d478fbae890769360586b043a12b71256f48a..ba54cf72d5ed14cca71d4d2c03b614028d12078f 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "config.h"
 
-#include <stdio.h>
+#include <glib/gprintf.h>
 #include <stdlib.h>
 #include <string.h>
 #include <limits.h>
@@ -294,7 +294,7 @@ _gdk_win32_print_paletteentries (const PALETTEENTRY *pep,
              (pep[i].peFlags == PC_EXPLICIT ? " PC_EXPLICIT" :
               (pep[i].peFlags == PC_NOCOLLAPSE ? " PC_NOCOLLAPSE" :
                (pep[i].peFlags == PC_RESERVED ? " PC_RESERVED" :
-                (sprintf (buf, " %d", pep[i].peFlags), buf))))));
+                (g_sprintf (buf, " %d", pep[i].peFlags), buf))))));
 }
 
 void
@@ -497,7 +497,7 @@ _gdk_win32_gcvalues_mask_to_string (GdkGCValuesMask mask)
 
 #define BIT(x)                                                 \
   if (mask & GDK_GC_##x)                               \
-    (bufp += sprintf (bufp, "%s" #x, s), s = "|")
+    (bufp += g_sprintf (bufp, "%s" #x, s), s = "|")
 
   BIT (FOREGROUND);
   BIT (BACKGROUND);
index 5e543b818a7d81dc891f525e3dfc9e858e76cc07..d4ef994653dd7fefb00c292d3fe06ba536acb9f0 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <string.h>
 #include <stdlib.h>
-#include <stdio.h>
+#include <glib/gprintf.h>
 
 #include "gdkscreen.h"
 #include "gdkproperty.h"
@@ -359,7 +359,7 @@ gdk_property_change (GdkWindow    *window,
                  rtf = g_string_append (rtf, "\\uNNNNN ");
                  rtf->len -= 6; /* five digits and a space */
                  q = rtf->str + rtf->len;
-                 n = sprintf (q, "%d ", g_utf8_get_char (p));
+                 n = g_sprintf (q, "%d ", g_utf8_get_char (p));
                  g_assert (n <= 6);
                  rtf->len += n;
                  
index 2d8828db350627f0186fb26f827710fb630d0432..3c5f7de8af7f1082dda4f57ab4b803c657a8be8d 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "config.h"
 
-#include <stdio.h>
+#include <glib/gprintf.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
@@ -531,9 +531,9 @@ gdk_x_error (Display         *display,
 #ifdef G_ENABLE_DEBUG    
          g_error ("%s", msg);
 #else /* !G_ENABLE_DEBUG */
-         fprintf (stderr, "%s\n", msg);
+         g_fprintf (stderr, "%s\n", msg);
 
-         exit(1);
+         exit (1);
 #endif /* G_ENABLE_DEBUG */
        }
       _gdk_error_code = error->error_code;
@@ -572,7 +572,7 @@ gdk_x_io_error (Display *display)
    */
   if (errno == EPIPE)
     {
-      fprintf (stderr,
+      g_fprintf (stderr,
                "The application '%s' lost its connection to the display %s;\n"
                "most likely the X server was shut down or you killed/destroyed\n"
                "the application.\n",
@@ -581,7 +581,7 @@ gdk_x_io_error (Display *display)
     }
   else
     {
-      fprintf (stderr, "%s: Fatal IO error %d (%s) on X server %s.\n",
+      g_fprintf (stderr, "%s: Fatal IO error %d (%s) on X server %s.\n",
                g_get_prgname (),
               errno, g_strerror (errno),
               display ? DisplayString (display) : gdk_get_display_arg_name ());
index e6a39ec1f10404788454fd80a7c5cdcb2d224b96..cccdc35c5ab1a724a8035e1c94e8851d0028d123 100644 (file)
@@ -37,7 +37,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <time.h>
-#include <stdio.h>
+#include <glib/gprintf.h>
 
 #include "gtkcalendar.h"
 #include "gtkmarshalers.h"
@@ -1211,7 +1211,7 @@ gtk_calendar_size_request (GtkWidget        *widget,
       private_data->max_year_width = 0;
       for (i=0; i<10; i++)
        {
-         sprintf (buffer, "%d%d%d%d", i,i,i,i);
+         g_snprintf (buffer, sizeof (buffer), "%d%d%d%d", i,i,i,i);
          pango_layout_set_text (layout, buffer, -1);     
          pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
          private_data->max_year_width = MAX (private_data->max_year_width,
@@ -1243,7 +1243,7 @@ gtk_calendar_size_request (GtkWidget        *widget,
 
   for (i = 0; i < 9; i++)
     {
-      sprintf (buffer, "%d%d", i, i);
+      g_snprintf (buffer, sizeof (buffer), "%d%d", i, i);
       pango_layout_set_text (layout, buffer, -1);        
       pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
       private_data->min_day_width = MAX (private_data->min_day_width,
@@ -1274,7 +1274,7 @@ gtk_calendar_size_request (GtkWidget        *widget,
   if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
     for (i = 0; i < 9; i++)
       {
-       sprintf (buffer, "%d%d", i, i);
+       g_snprintf (buffer, sizeof (buffer), "%d%d", i, i);
        pango_layout_set_text (layout, buffer, -1);       
        pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
        private_data->max_week_char_width = MAX (private_data->max_week_char_width,
@@ -1496,7 +1496,7 @@ gtk_calendar_paint_header (GtkWidget *widget)
                    0, 0, header_width, private_data->header_h);
   
   
-  sprintf (buffer, "%d", calendar->year);
+  g_snprintf (buffer, sizeof (buffer), "%d", calendar->year);
   layout = gtk_widget_create_pango_layout (widget, buffer);
   pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
   
@@ -1517,7 +1517,7 @@ gtk_calendar_paint_header (GtkWidget *widget)
   gdk_draw_layout (private_data->header_win, gc, x, y, layout);
   
   /* Draw month */
-  sprintf (buffer, "%s", default_monthname[calendar->month]);
+  g_snprintf (buffer, sizeof (buffer), "%s", default_monthname[calendar->month]);
   pango_layout_set_text (layout, buffer, -1);
   pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
 
@@ -1617,7 +1617,7 @@ gtk_calendar_paint_day_names (GtkWidget *widget)
        day = i;
       if (calendar->display_flags & GTK_CALENDAR_WEEK_START_MONDAY)
        day= (day+1)%7;
-      sprintf (buffer, "%s", default_abbreviated_dayname[day]);
+      g_snprintf (buffer, sizeof (buffer), "%s", default_abbreviated_dayname[day]);
 
       pango_layout_set_text (layout, buffer, -1);
       pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
@@ -1714,7 +1714,7 @@ gtk_calendar_paint_week_numbers (GtkWidget *widget)
                                      ((calendar->day[row][6] < 15 && row > 3 ? 1 : 0)
                                       + calendar->month) % 12 + 1, calendar->day[row][6]));
 
-      sprintf (buffer, "%d", week);
+      g_snprintf (buffer, sizeof (buffer), "%d", week);
       pango_layout_set_text (layout, buffer, -1);
       pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
 
@@ -1850,7 +1850,7 @@ gtk_calendar_paint_day (GtkWidget *widget,
     }
     
 
-  sprintf (buffer, "%d", day);
+  g_snprintf (buffer, sizeof (buffer), "%d", day);
   layout = gtk_widget_create_pango_layout (widget, buffer);
   pango_layout_get_pixel_extents (layout, NULL, &logical_rect);
   
index cbe031ac314a566bbf22cdc68c4ee18c115ccc92..7bbafa89a86e31b9470acdaf026bcdd994cdf844 100644 (file)
@@ -803,7 +803,7 @@ gtk_file_selection_init (GtkFileSelection *filesel)
     {
       gchar err_buf[256];
 
-      sprintf (err_buf, _("Folder unreadable: %s"), cmpl_strerror (cmpl_errno));
+      g_snprintf (err_buf, sizeof (err_buf), _("Folder unreadable: %s"), cmpl_strerror (cmpl_errno));
 
       gtk_label_set_text (GTK_LABEL (filesel->selection_text), err_buf);
     }
@@ -2023,7 +2023,7 @@ win32_gtk_add_drives_to_dir_list (GtkListStore *model)
       if ((tolower (textPtr[0]) != 'a') && (tolower (textPtr[0]) != 'b'))
        {
          /* Build the actual displayable string */
-         sprintf (formatBuffer, "%c:\\", toupper (textPtr[0]));
+         g_snprintf (formatBuffer, sizeof (formatBuffer), "%c:\\", toupper (textPtr[0]));
 
          /* Add to the list */
          gtk_list_store_append (model, &iter);
@@ -2201,7 +2201,7 @@ gtk_file_selection_abort (GtkFileSelection *fs)
 {
   gchar err_buf[256];
 
-  sprintf (err_buf, _("Folder unreadable: %s"), cmpl_strerror (cmpl_errno));
+  g_snprintf (err_buf, sizeof (err_buf), _("Folder unreadable: %s"), cmpl_strerror (cmpl_errno));
 
   /*  BEEP gdk_beep();  */
 
@@ -2835,7 +2835,7 @@ open_ref_dir (gchar           *text_to_complete,
   if (text_to_complete[0] == '/' && text_to_complete[1] == '/')
     {
       char root_dir[5];
-      sprintf (root_dir, "//%c", text_to_complete[2]);
+      g_snprintf (root_dir, sizeof (root_dir), "//%c", text_to_complete[2]);
 
       new_dir = open_dir (root_dir, cmpl_state);
 
index b7047f85f2381b650cd992e0a0aeb9ed5786cdc9..293d0bb03cbaba6ba6abba53dc4d61148e4c12ed 100644 (file)
@@ -30,7 +30,7 @@
  */
 
 #include <stdlib.h>
-#include <stdio.h>
+#include <glib/gprintf.h>
 #include <string.h>
 
 #include "gdk/gdk.h"
@@ -907,7 +907,7 @@ gtk_font_selection_show_available_sizes (GtkFontSelection *fontsel,
   /* Set the entry to the new size, rounding to 1 digit,
    * trimming of trailing 0's and a trailing period
    */
-  sprintf (buffer, "%.1f", fontsel->size / (1.0 * PANGO_SCALE));
+  g_snprintf (buffer, sizeof (buffer), "%.1f", fontsel->size / (1.0 * PANGO_SCALE));
   if (strchr (buffer, '.'))
     {
       p = buffer + strlen (buffer) - 1;
index 8e6dc2ad2f1bdfc0a4ce2b3856062fc9914d87b9..31d6775a5b7a20ba35118d8e5556614f6ea105c2 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #include <math.h>
-#include <stdio.h>
+#include <glib/gprintf.h>
 #include <string.h>
 #include "gtkhruler.h"
 
@@ -201,7 +201,7 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
    *  for the scale looks consistent with an accompanying vruler
    */
   scale = ceil (ruler->max_size / ruler->metric->pixels_per_unit);
-  sprintf (unit_str, "%d", scale);
+  g_snprintf (unit_str, sizeof (unit_str), "%d", scale);
   text_width = strlen (unit_str) * digit_height + 1;
 
   for (scale = 0; scale < MAXIMUM_SCALES; scale++)
@@ -250,7 +250,7 @@ gtk_hruler_draw_ticks (GtkRuler *ruler)
          /* draw label */
          if (i == 0)
            {
-             sprintf (unit_str, "%d", (int) cur);
+             g_snprintf (unit_str, sizeof (unit_str), "%d", (int) cur);
              
              pango_layout_set_text (layout, unit_str, -1);
              pango_layout_get_extents (layout, &logical_rect, NULL);
index ffb35e807f1619a3a501b992ba0711ae97bf9496..2577dbabfdfca9c2853bb8fc57bed155818573a0 100644 (file)
@@ -32,7 +32,7 @@
  */
 
 
-#include <stdio.h>
+#include <glib/gprintf.h>
 #include <stdlib.h>
 #include "gdk/gdkkeysyms.h"
 #include "gtkbutton.h"
@@ -602,7 +602,7 @@ gtk_input_dialog_fill_axes(GtkInputDialog *inputd, GdkDevice *info)
            menu_item = gtk_menu_item_new_with_label (_("none"));
          else
            {
-             sprintf (buffer,"%d",j+1);
+             g_snprintf (buffer, sizeof (buffer), "%d", j+1);
              menu_item = gtk_menu_item_new_with_label (buffer);
            }
          g_signal_connect (menu_item, "activate",
@@ -731,7 +731,7 @@ gtk_input_dialog_fill_keys(GtkInputDialog *inputd, GdkDevice *info)
 
       /* create the label */
 
-      sprintf (buffer, "%d", i+1);
+      g_snprintf (buffer, sizeof (buffer), "%d", i+1);
       label = gtk_label_new (buffer);
       gtk_table_attach (GTK_TABLE (inputd->keys_list), label, 0, 1, i, i+1, 
                        0, 0, 2, 2);
index 824a370ddbba829ea518e175c5d7590982b93418..85bfbf7a477e995c2011d38a0f0f5f562e9da707 100644 (file)
@@ -24,7 +24,7 @@
  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
  */
 
-#include <stdio.h>
+#include <glib/gprintf.h>
 #include <math.h>
 #include <string.h>
 #include "gtkprogress.h" 
@@ -429,11 +429,11 @@ gtk_progress_build_string (GtkProgress *progress,
            case 'P':
              if (digits)
                {
-                 sprintf (fmt, "%%.%df", digits);
-                 sprintf (tmp, fmt, 100 * percentage);
+                 g_snprintf (fmt, sizeof (fmt), "%%.%df", digits);
+                 g_snprintf (tmp, sizeof (tmp), fmt, 100 * percentage);
                }
              else
-               sprintf (tmp, "%.0f", 100 * percentage);
+               g_snprintf (tmp, sizeof (tmp), "%.0f", 100 * percentage);
              strcat (buf, tmp);
              dest = &(buf[strlen (buf)]);
              src++;
@@ -442,11 +442,11 @@ gtk_progress_build_string (GtkProgress *progress,
            case 'V':
              if (digits)
                {
-                 sprintf (fmt, "%%.%df", digits);
-                 sprintf (tmp, fmt, value);
+                 g_snprintf (fmt, sizeof (fmt), "%%.%df", digits);
+                 g_snprintf (tmp, sizeof (tmp), fmt, value);
                }
              else
-               sprintf (tmp, "%.0f", value);
+               g_snprintf (tmp, sizeof (tmp), "%.0f", value);
              strcat (buf, tmp);
              dest = &(buf[strlen (buf)]);
              src++;
@@ -455,11 +455,11 @@ gtk_progress_build_string (GtkProgress *progress,
            case 'L':
              if (digits)
                {
-                 sprintf (fmt, "%%.%df", digits);
-                 sprintf (tmp, fmt, progress->adjustment->lower);
+                 g_snprintf (fmt, sizeof (fmt), "%%.%df", digits);
+                 g_snprintf (tmp, sizeof (tmp), fmt, progress->adjustment->lower);
                }
              else
-               sprintf (tmp, "%.0f", progress->adjustment->lower);
+               g_snprintf (tmp, sizeof (tmp), "%.0f", progress->adjustment->lower);
              strcat (buf, tmp);
              dest = &(buf[strlen (buf)]);
              src++;
@@ -468,11 +468,11 @@ gtk_progress_build_string (GtkProgress *progress,
            case 'U':
              if (digits)
                {
-                 sprintf (fmt, "%%.%df", digits);
-                 sprintf (tmp, fmt, progress->adjustment->upper);
+                 g_snprintf (fmt, sizeof (fmt), "%%.%df", digits);
+                 g_snprintf (tmp, sizeof (tmp), fmt, progress->adjustment->upper);
                }
              else
-               sprintf (tmp, "%.0f", progress->adjustment->upper);
+               g_snprintf (tmp, sizeof (tmp), "%.0f", progress->adjustment->upper);
              strcat (buf, tmp);
              dest = &(buf[strlen (buf)]);
              src++;
index 2c4a94a5390b68bc2b0193cca3cf9b77539f5bba..dc631aa270e7d8d37d23bcf04b8f69aef39d47d6 100644 (file)
@@ -18,9 +18,9 @@
  */
 
 #include <stdlib.h>
-#include <stdio.h>
 #include <string.h>
 #include <glib.h>
+#include <glib/gprintf.h>
 #include <gobject/gvaluecollector.h>
 #include "gtktreemodel.h"
 #include "gtktreeview.h"
@@ -274,13 +274,13 @@ gtk_tree_path_to_string (GtkTreePath *path)
     return NULL;
 
   ptr = retval = (gchar *) g_new0 (char *, path->depth*8);
-  sprintf (retval, "%d", path->indices[0]);
+  g_sprintf (retval, "%d", path->indices[0]);
   while (*ptr != '\000')
     ptr++;
 
   for (i = 1; i < path->depth; i++)
     {
-      sprintf (ptr, ":%d", path->indices[i]);
+      g_sprintf (ptr, ":%d", path->indices[i]);
       while (*ptr != '\000')
        ptr++;
     }
index 52d8bf2d8a64e2ba1924290e8eb0d2ff5fd022a2..5bb64cce68ecf56ac061b92ad31fd2d862a5de52 100644 (file)
  */
 
 #include <math.h>
-#include <stdio.h>
 #include <string.h>
 #include "gtkvruler.h"
 
+#include <glib/gprintf.h>
+
 
 #define RULER_WIDTH           14
 #define MINIMUM_INCR          5
@@ -198,7 +199,7 @@ gtk_vruler_draw_ticks (GtkRuler *ruler)
    *   leaves sufficient room for drawing the ruler.  
    */
   scale = ceil (ruler->max_size / ruler->metric->pixels_per_unit);
-  sprintf (unit_str, "%d", scale);
+  g_snprintf (unit_str, sizeof (unit_str), "%d", scale);
   text_height = strlen (unit_str) * digit_height + 1;
 
   for (scale = 0; scale < MAXIMUM_SCALES; scale++)
@@ -246,7 +247,7 @@ gtk_vruler_draw_ticks (GtkRuler *ruler)
          /* draw label */
          if (i == 0)
            {
-             sprintf (unit_str, "%d", (int) cur);
+             g_snprintf (unit_str, sizeof (unit_str), "%d", (int) cur);
              
              for (j = 0; j < (int) strlen (unit_str); j++)
                {
index aaff75bac5c469aec9aada3b1a2151ab78fd4a83..d62658dc094b6556b7b71eb7688c5b0f64d5595b 100644 (file)
@@ -22,6 +22,7 @@
 #include "config.h"
 
 #include <glib.h>
+#include <glib/gprintf.h>
 #include <gmodule.h>
 
 #include <errno.h>
@@ -29,7 +30,6 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
-#include <stdio.h>
 
 #ifdef G_OS_WIN32
 #define SOEXT ".dll"
@@ -73,7 +73,7 @@ static void
 print_escaped (const char *str)
 {
   char *tmp = escape_string (str);
-  printf ("\"%s\" ", tmp);
+  g_printf ("\"%s\" ", tmp);
   g_free (tmp);
 }
 
@@ -99,7 +99,7 @@ query_module (const char *dir, const char *name)
 
   if (!module)
     {
-      fprintf(stderr, "Cannot load module %s: %s\n", path, g_module_error());
+      g_fprintf (stderr, "Cannot load module %s: %s\n", path, g_module_error());
       error = TRUE;
     }
          
@@ -131,8 +131,8 @@ query_module (const char *dir, const char *name)
     }
   else
     {
-      fprintf (stderr, "%s does not export GTK+ IM module API: %s\n", path,
-              g_module_error());
+      g_fprintf (stderr, "%s does not export GTK+ IM module API: %s\n", path,
+                g_module_error ());
       error = TRUE;
     }
 
@@ -150,7 +150,7 @@ int main (int argc, char **argv)
   char *path;
   gboolean error = FALSE;
 
-  printf ("# GTK+ Input Method Modules file\n"
+  g_printf ("# GTK+ Input Method Modules file\n"
          "# Automatically generated file, do not edit\n"
          "#\n");
 
@@ -161,7 +161,7 @@ int main (int argc, char **argv)
 
       path = gtk_rc_get_im_module_path ();
 
-      printf ("# ModulesPath = %s\n#\n", path);
+      g_printf ("# ModulesPath = %s\n#\n", path);
 
       dirs = pango_split_file_list (path);
 
index 69f27a8ebeac4e637d5f4c29da2bf7baf22ab0b3..d6b08f59f3b066d7f220b92f079155ba09cc182a 100644 (file)
@@ -1,5 +1,5 @@
 #include <gdk-pixbuf/gdk-pixbuf.h>
-#include <stdio.h>
+#include <glib/gprintf.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -11,15 +11,15 @@ output_byte (guchar byte,
 {
   if (online == BYTES_PER_OUTPUT_LINE)
     {
-      printf (",\n  ");
+      g_printf (",\n  ");
       online = 0;
     }
   else if (online)
     {
-      printf (",");
+      g_printf (",");
     }
 
-  printf ("0x%02x", byte);
+  g_printf ("0x%02x", byte);
   return online + 1;
 }
 
@@ -46,8 +46,8 @@ do_part (GdkPixbuf  *pixbuf,
   color3 = pixels + part3_index * n_channels;
   pixels += rowstride;
   
-  printf ("static const guchar %s_%s_bits[] = {\n", base_name, part_name);
-  printf ("  ");
+  g_printf ("static const guchar %s_%s_bits[] = {\n", base_name, part_name);
+  g_printf ("  ");
 
   while (height--)
     {
@@ -81,7 +81,7 @@ do_part (GdkPixbuf  *pixbuf,
       pixels += rowstride;
     }
   
-  printf ("};\n");
+  g_printf ("};\n");
 }
 
 typedef enum {
@@ -114,7 +114,7 @@ int main (int argc, char **argv)
 
   if (argc != 3)
     {
-      fprintf (stderr, "%s: Usage: %s FILE BASE\n", progname, progname);
+      g_fprintf (stderr, "%s: Usage: %s FILE BASE\n", progname, progname);
       exit (1);
     }
 
@@ -123,23 +123,23 @@ int main (int argc, char **argv)
   pixbuf = gdk_pixbuf_new_from_file (argv[1], &error);
   if (!pixbuf)
     {
-      fprintf (stderr, "%s: cannot open file '%s': %s\n", progname, argv[1], error->message);
+      g_fprintf (stderr, "%s: cannot open file '%s': %s\n", progname, argv[1], error->message);
       exit (1);
     }
   
   if (gdk_pixbuf_get_width (pixbuf) < PART_LAST)
     {
-      fprintf (stderr, "%s: source image must be at least %d pixels wide\n", progname, PART_LAST);
+      g_fprintf (stderr, "%s: source image must be at least %d pixels wide\n", progname, PART_LAST);
       exit (1);
     }
 
   if (gdk_pixbuf_get_height (pixbuf) < 1)
     {
-      fprintf (stderr, "%s: source image must be at least 1 pixel height\n", progname);
+      g_fprintf (stderr, "%s: source image must be at least 1 pixel height\n", progname);
       exit (1);
     }
 
-  printf ("/*\n * Extracted from %s, width=%d, height=%d\n */\n", argv[1],
+  g_printf ("/*\n * Extracted from %s, width=%d, height=%d\n */\n", argv[1],
          gdk_pixbuf_get_width (pixbuf), gdk_pixbuf_get_height (pixbuf) - 1);
 
   for (i = 0; i < PART_LAST; i++)