diff options
author | Matthias Clasen <maclas@gmx.de> | 2002-12-15 01:49:01 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2002-12-15 01:49:01 +0000 |
commit | 8ba71578f2898d10641053cc089860b2b8d07266 (patch) | |
tree | 451f9816b2ae6e0a5427b96abac52466a135f633 /gdk-pixbuf | |
parent | d745218d7286bc633870417ca36b33de1f715d70 (diff) | |
download | gdk-pixbuf-8ba71578f2898d10641053cc089860b2b8d07266.tar.gz |
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)
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-csource.c | 54 | ||||
-rw-r--r-- | gdk-pixbuf/make-inline-pixbuf.c | 18 | ||||
-rw-r--r-- | gdk-pixbuf/queryloaders.c | 28 |
3 files changed, 50 insertions, 50 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-csource.c b/gdk-pixbuf/gdk-pixbuf-csource.c index 35f41705f..29669c8a0 100644 --- a/gdk-pixbuf/gdk-pixbuf-csource.c +++ b/gdk-pixbuf/gdk-pixbuf-csource.c @@ -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"); } } diff --git a/gdk-pixbuf/make-inline-pixbuf.c b/gdk-pixbuf/make-inline-pixbuf.c index fbf110233..fea4ea388 100644 --- a/gdk-pixbuf/make-inline-pixbuf.c +++ b/gdk-pixbuf/make-inline-pixbuf.c @@ -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); diff --git a/gdk-pixbuf/queryloaders.c b/gdk-pixbuf/queryloaders.c index 02ee35273..2053a3ae1 100644 --- a/gdk-pixbuf/queryloaders.c +++ b/gdk-pixbuf/queryloaders.c @@ -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 { |