Commit 8ba71578 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen
Browse files

Use g_printf instead of system printf. (#99327)

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)
parent d745218d
2002-12-15 Matthias Clasen <maclas@gmx.de> 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/gtkcontainer.c (gtk_container_class_install_child_property):
(gtk_container_child_get_valist): (gtk_container_child_get_valist):
(gtk_container_child_get_property): (gtk_container_child_get_property):
......
2002-12-15 Matthias Clasen <maclas@gmx.de> 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/gtkcontainer.c (gtk_container_class_install_child_property):
(gtk_container_child_get_valist): (gtk_container_child_get_valist):
(gtk_container_child_get_property): (gtk_container_child_get_property):
......
2002-12-15 Matthias Clasen <maclas@gmx.de> 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/gtkcontainer.c (gtk_container_class_install_child_property):
(gtk_container_child_get_valist): (gtk_container_child_get_valist):
(gtk_container_child_get_property): (gtk_container_child_get_property):
......
2002-12-15 Matthias Clasen <maclas@gmx.de> 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/gtkcontainer.c (gtk_container_class_install_child_property):
(gtk_container_child_get_valist): (gtk_container_child_get_valist):
(gtk_container_child_get_property): (gtk_container_child_get_property):
......
2002-12-15 Matthias Clasen <maclas@gmx.de> 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/gtkcontainer.c (gtk_container_class_install_child_property):
(gtk_container_child_get_valist): (gtk_container_child_get_valist):
(gtk_container_child_get_property): (gtk_container_child_get_property):
......
2002-12-15 Matthias Clasen <maclas@gmx.de> 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/gtkcontainer.c (gtk_container_class_install_child_property):
(gtk_container_child_get_valist): (gtk_container_child_get_valist):
(gtk_container_child_get_property): (gtk_container_child_get_property):
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "../gtk/gtkversion.h" /* versioning */ #include "../gtk/gtkversion.h" /* versioning */
#include "gdk-pixbuf.h" #include "gdk-pixbuf.h"
#include "gdk-pixdata.h" #include "gdk-pixdata.h"
#include <stdio.h> #include <glib/gprintf.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
...@@ -64,7 +64,7 @@ print_csource (FILE *f_out, ...@@ -64,7 +64,7 @@ print_csource (FILE *f_out,
gen_type | gen_ctype | gen_type | gen_ctype |
(with_decoder ? GDK_PIXDATA_DUMP_RLE_DECODER : 0)); (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); g_free (free_me);
} }
...@@ -93,7 +93,7 @@ main (int argc, ...@@ -93,7 +93,7 @@ main (int argc,
pixbuf = gdk_pixbuf_new_from_file (argv[1], &error); pixbuf = gdk_pixbuf_new_from_file (argv[1], &error);
if (!pixbuf) if (!pixbuf)
{ {
fprintf (stderr, "failed to load \"%s\": %s\n", g_fprintf (stderr, "failed to load \"%s\": %s\n",
argv[1], argv[1],
error->message); error->message);
g_error_free (error); g_error_free (error);
...@@ -118,7 +118,7 @@ main (int argc, ...@@ -118,7 +118,7 @@ main (int argc,
pixbuf = gdk_pixbuf_new_from_file (*p, &error); pixbuf = gdk_pixbuf_new_from_file (*p, &error);
if (!pixbuf) if (!pixbuf)
{ {
fprintf (stderr, "failed to load \"%s\": %s\n", g_fprintf (stderr, "failed to load \"%s\": %s\n",
*p, *p,
error->message); error->message);
g_error_free (error); g_error_free (error);
...@@ -255,32 +255,32 @@ print_blurb (FILE *bout, ...@@ -255,32 +255,32 @@ print_blurb (FILE *bout,
{ {
if (!print_help) if (!print_help)
{ {
fprintf (bout, "%s version ", PRG_NAME); g_fprintf (bout, "%s version ", PRG_NAME);
fprintf (bout, "%u.%u.%u", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); g_fprintf (bout, "%u.%u.%u", GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
fprintf (bout, "\n"); g_fprintf (bout, "\n");
fprintf (bout, "%s comes with ABSOLUTELY NO WARRANTY.\n", PRG_NAME); g_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); g_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"); g_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); g_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, "information are available at %s\n", PKG_HTTP_HOME);
} }
else else
{ {
fprintf (bout, "Usage: %s [options] [image]\n", PRG_NAME); g_fprintf (bout, "Usage: %s [options] [image]\n", PRG_NAME);
fprintf (bout, " %s [options] --build-list [[name image]...]\n", PRG_NAME); g_fprintf (bout, " %s [options] --build-list [[name image]...]\n", PRG_NAME);
fprintf (bout, " --stream generate pixbuf data stream\n"); g_fprintf (bout, " --stream generate pixbuf data stream\n");
fprintf (bout, " --struct generate GdkPixdata structure\n"); g_fprintf (bout, " --struct generate GdkPixdata structure\n");
fprintf (bout, " --macros generate image size/pixel macros\n"); g_fprintf (bout, " --macros generate image size/pixel macros\n");
fprintf (bout, " --rle use one byte run-length-encoding\n"); g_fprintf (bout, " --rle use one byte run-length-encoding\n");
fprintf (bout, " --raw provide raw image data copy\n"); g_fprintf (bout, " --raw provide raw image data copy\n");
fprintf (bout, " --extern generate extern symbols\n"); g_fprintf (bout, " --extern generate extern symbols\n");
fprintf (bout, " --static generate static symbols\n"); g_fprintf (bout, " --static generate static symbols\n");
fprintf (bout, " --decoder provide rle decoder\n"); g_fprintf (bout, " --decoder provide rle decoder\n");
fprintf (bout, " --name=identifier C macro/variable name\n"); g_fprintf (bout, " --name=identifier C macro/variable name\n");
fprintf (bout, " --build-list parse (name, image) pairs\n"); g_fprintf (bout, " --build-list parse (name, image) pairs\n");
fprintf (bout, " -h, --help show this help message\n"); g_fprintf (bout, " -h, --help show this help message\n");
fprintf (bout, " -v, --version print version informations\n"); g_fprintf (bout, " -v, --version print version informations\n");
fprintf (bout, " --g-fatal-warnings make warnings fatal (abort)\n"); g_fprintf (bout, " --g-fatal-warnings make warnings fatal (abort)\n");
} }
} }
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <config.h> #include <config.h>
#include "gdk-pixbuf-private.h" #include "gdk-pixbuf-private.h"
#include <stdio.h> #include <glib/gprintf.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -38,7 +38,7 @@ output_int (FILE *outfile, guint32 num, const char *comment) ...@@ -38,7 +38,7 @@ output_int (FILE *outfile, guint32 num, const char *comment)
bytes[2] = num >> 8; bytes[2] = num >> 8;
bytes[3] = num; 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, comment, num,
bytes[0], bytes[1], bytes[2], bytes[3]); bytes[0], bytes[1], bytes[2], bytes[3]);
} }
...@@ -46,7 +46,7 @@ output_int (FILE *outfile, guint32 num, const char *comment) ...@@ -46,7 +46,7 @@ output_int (FILE *outfile, guint32 num, const char *comment)
void void
output_bool (FILE *outfile, gboolean val, const char *comment) 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, comment,
val ? "TRUE" : "FALSE", val ? "TRUE" : "FALSE",
val ? 1 : 0); val ? 1 : 0);
...@@ -67,7 +67,7 @@ output_pixbuf (FILE *outfile, gboolean ext_symbols, ...@@ -67,7 +67,7 @@ output_pixbuf (FILE *outfile, gboolean ext_symbols,
if (ext_symbols) if (ext_symbols)
modifier = ""; modifier = "";
fprintf (outfile, "%sconst guchar ", modifier); g_fprintf (outfile, "%sconst guchar ", modifier);
fputs (varname, outfile); fputs (varname, outfile);
fputs ("[] =\n", outfile); fputs ("[] =\n", outfile);
fputs ("{\n", outfile); fputs ("{\n", outfile);
...@@ -117,9 +117,9 @@ output_pixbuf (FILE *outfile, gboolean ext_symbols, ...@@ -117,9 +117,9 @@ output_pixbuf (FILE *outfile, gboolean ext_symbols,
if (has_alpha) 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 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) if (p != end)
fputs (",", outfile); fputs (",", outfile);
...@@ -141,7 +141,7 @@ output_pixbuf (FILE *outfile, gboolean ext_symbols, ...@@ -141,7 +141,7 @@ output_pixbuf (FILE *outfile, gboolean ext_symbols,
void void
usage (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); exit (1);
} }
...@@ -171,7 +171,7 @@ main (int argc, char **argv) ...@@ -171,7 +171,7 @@ main (int argc, char **argv)
outfile = fopen (argv[i], "w"); outfile = fopen (argv[i], "w");
if (outfile == NULL) 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)); argv[i], strerror (errno));
exit (1); exit (1);
} }
...@@ -199,7 +199,7 @@ main (int argc, char **argv) ...@@ -199,7 +199,7 @@ main (int argc, char **argv)
if (pixbuf == NULL) if (pixbuf == NULL)
{ {
fprintf (stderr, "%s\n", error->message); g_fprintf (stderr, "%s\n", error->message);
fclose (outfile); fclose (outfile);
remove (outfilename); remove (outfilename);
exit (1); exit (1);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <config.h> #include <config.h>
#include <glib.h> #include <glib.h>
#include <glib/gprintf.h>
#include <gmodule.h> #include <gmodule.h>
#include <errno.h> #include <errno.h>
...@@ -32,7 +33,6 @@ ...@@ -32,7 +33,6 @@
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <stdio.h>
#include "gdk-pixbuf/gdk-pixbuf.h" #include "gdk-pixbuf/gdk-pixbuf.h"
#include "gdk-pixbuf/gdk-pixbuf-private.h" #include "gdk-pixbuf/gdk-pixbuf-private.h"
...@@ -49,7 +49,7 @@ static void ...@@ -49,7 +49,7 @@ static void
print_escaped (const char *str) print_escaped (const char *str)
{ {
gchar *tmp = g_strescape (str, ""); gchar *tmp = g_strescape (str, "");
printf ("\"%s\" ", tmp); g_printf ("\"%s\" ", tmp);
g_free (tmp); g_free (tmp);
} }
...@@ -78,30 +78,30 @@ query_module (const char *dir, const char *file) ...@@ -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_info", (gpointer *) &fill_info) &&
g_module_symbol (module, "fill_vtable", (gpointer *) &fill_vtable)) { g_module_symbol (module, "fill_vtable", (gpointer *) &fill_vtable)) {
GdkPixbufFormat *info; GdkPixbufFormat *info;
printf("\"%s\"\n", path); g_printf("\"%s\"\n", path);
info = g_new0 (GdkPixbufFormat, 1); info = g_new0 (GdkPixbufFormat, 1);
(*fill_info) (info); (*fill_info) (info);
printf("\"%s\" %d \"%s\" \"%s\"\n", g_printf ("\"%s\" %d \"%s\" \"%s\"\n",
info->name, info->flags, info->name, info->flags,
info->domain ? info->domain : GETTEXT_PACKAGE, info->description); info->domain ? info->domain : GETTEXT_PACKAGE, info->description);
for (mime = info->mime_types; *mime; mime++) { 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++) { 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++) { for (pattern = info->signature; pattern->prefix; pattern++) {
print_escaped (pattern->prefix); print_escaped (pattern->prefix);
print_escaped (pattern->mask ? (const char *)pattern->mask : ""); 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); g_free (info);
} }
else { else {
fprintf (stderr, "Cannot load loader %s\n", path); g_fprintf (stderr, "Cannot load loader %s\n", path);
} }
if (module) if (module)
g_module_close (module); g_module_close (module);
...@@ -112,7 +112,7 @@ int main (int argc, char **argv) ...@@ -112,7 +112,7 @@ int main (int argc, char **argv)
{ {
gint i; gint i;
printf ("# GdkPixbuf Image Loader Modules file\n" g_printf ("# GdkPixbuf Image Loader Modules file\n"
"# Automatically generated file, do not edit\n" "# Automatically generated file, do not edit\n"
"#\n"); "#\n");
...@@ -125,7 +125,7 @@ int main (int argc, char **argv) ...@@ -125,7 +125,7 @@ int main (int argc, char **argv)
if (path == NULL || *path == '\0') if (path == NULL || *path == '\0')
path = PIXBUF_LIBDIR; path = PIXBUF_LIBDIR;
printf ("# LoaderDir = %s\n#\n", path); g_printf ("# LoaderDir = %s\n#\n", path);
dir = g_dir_open (path, 0, NULL); dir = g_dir_open (path, 0, NULL);
if (dir) { if (dir) {
...@@ -141,7 +141,7 @@ int main (int argc, char **argv) ...@@ -141,7 +141,7 @@ int main (int argc, char **argv)
g_dir_close (dir); g_dir_close (dir);
} }
#else #else
printf ("# dynamic loading of modules not supported\n"); g_printf ("# dynamic loading of modules not supported\n");
#endif #endif
} }
else { else {
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* GTK+ at ftp://ftp.gtk.org/pub/gtk/. * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/ */
#include <stdio.h> #include <glib/gprintf.h>
#include <stdlib.h> #include <stdlib.h>
#include "gdkkeysyms.h" #include "gdkkeysyms.h"
...@@ -1360,7 +1360,7 @@ gdk_keyval_name (guint keyval) ...@@ -1360,7 +1360,7 @@ gdk_keyval_name (guint keyval)
/* Check for directly encoded 24-bit UCS characters: */ /* Check for directly encoded 24-bit UCS characters: */
if ((keyval & 0xff000000) == 0x01000000) if ((keyval & 0xff000000) == 0x01000000)
{ {
sprintf (buf, "U+%.04X", (keyval & 0x00ffffff)); g_sprintf (buf, "U+%.04X", (keyval & 0x00ffffff));
return buf; return buf;
} }
...@@ -1378,7 +1378,7 @@ gdk_keyval_name (guint keyval) ...@@ -1378,7 +1378,7 @@ gdk_keyval_name (guint keyval)
} }
else if (keyval != 0) else if (keyval != 0)
{ {
sprintf (buf, "%#x", keyval); g_sprintf (buf, "%#x", keyval);
return buf; return buf;
} }
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include "gdkrgb.h" #include "gdkrgb.h"
#include "gdkscreen.h" #include "gdkscreen.h"
#include <glib/gprintf.h>
typedef struct _GdkRgbInfo GdkRgbInfo; typedef struct _GdkRgbInfo GdkRgbInfo;
typedef struct _GdkRgbCmapInfo GdkRgbCmapInfo; typedef struct _GdkRgbCmapInfo GdkRgbCmapInfo;
...@@ -283,7 +284,7 @@ gdk_rgb_try_colormap (GdkRgbInfo *image_info, gboolean force, ...@@ -283,7 +284,7 @@ gdk_rgb_try_colormap (GdkRgbInfo *image_info, gboolean force,
{ {
char tmp_str[80]; char tmp_str[80];
sprintf (tmp_str, g_snprintf (tmp_str, 80,
"%d %d %d colormap failed (in gdk_colors_alloc)\n", "%d %d %d colormap failed (in gdk_colors_alloc)\n",
nr, ng, nb); nr, ng, nb);
return gdk_rgb_cmap_fail (tmp_str, cmap, pixels); return gdk_rgb_cmap_fail (tmp_str, cmap, pixels);
...@@ -312,7 +313,7 @@ gdk_rgb_try_colormap (GdkRgbInfo *image_info, gboolean force, ...@@ -312,7 +313,7 @@ gdk_rgb_try_colormap (GdkRgbInfo *image_info, gboolean force,
{ {
char tmp_str[80]; char tmp_str[80];
sprintf (tmp_str,