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):
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):
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):
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):
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):
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):
#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>
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);
}
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);
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);
{
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");
}
}
#include <config.h>
#include "gdk-pixbuf-private.h"
-#include <stdio.h>
+#include <glib/gprintf.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
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]);
}
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);
if (ext_symbols)
modifier = "";
- fprintf (outfile, "%sconst guchar ", modifier);
+ g_fprintf (outfile, "%sconst guchar ", modifier);
fputs (varname, outfile);
fputs ("[] =\n", outfile);
fputs ("{\n", outfile);
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);
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);
}
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);
}
if (pixbuf == NULL)
{
- fprintf (stderr, "%s\n", error->message);
+ g_fprintf (stderr, "%s\n", error->message);
fclose (outfile);
remove (outfilename);
exit (1);
#include <config.h>
#include <glib.h>
+#include <glib/gprintf.h>
#include <gmodule.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdio.h>
#include "gdk-pixbuf/gdk-pixbuf.h"
#include "gdk-pixbuf/gdk-pixbuf-private.h"
print_escaped (const char *str)
{
gchar *tmp = g_strescape (str, "");
- printf ("\"%s\" ", tmp);
+ g_printf ("\"%s\" ", tmp);
g_free (tmp);
}
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);
{
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");
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) {
g_dir_close (dir);
}
#else
- printf ("# dynamic loading of modules not supported\n");
+ g_printf ("# dynamic loading of modules not supported\n");
#endif
}
else {
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include <stdio.h>
+#include <glib/gprintf.h>
#include <stdlib.h>
#include "gdkkeysyms.h"
/* 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;
}
}
else if (keyval != 0)
{
- sprintf (buf, "%#x", keyval);
+ g_sprintf (buf, "%#x", keyval);
return buf;
}
#include "gdkrgb.h"
#include "gdkscreen.h"
+#include <glib/gprintf.h>
typedef struct _GdkRgbInfo GdkRgbInfo;
typedef struct _GdkRgbCmapInfo GdkRgbCmapInfo;
{
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);
{
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);
#include <glib.h>
+#include <glib/gprintf.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
-#include <stdio.h>
#include "gdkfbmanager.h"
if (fd < 0)
{
- printf ("Error creating socket: %s\n", strerror(errno));
+ g_fprintf (stderr, "Error creating socket: %s\n", strerror(errno));
return -1;
}
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;
}
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;
}
/* 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"
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);
}
}
*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);
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;
}
#include "config.h"
-#include <stdio.h>
+#include <glib/gprintf.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
(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
#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);
#include <string.h>
#include <stdlib.h>
-#include <stdio.h>
+#include <glib/gprintf.h>
#include "gdkscreen.h"
#include "gdkproperty.h"
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;
#include "config.h"
-#include <stdio.h>
+#include <glib/gprintf.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#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;
*/
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",
}
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 ());
#include <string.h>
#include <stdlib.h>
#include <time.h>
-#include <stdio.h>
+#include <glib/gprintf.h>
#include "gtkcalendar.h"
#include "gtkmarshalers.h"
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,
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,
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,
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);
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);
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);
((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);
}
- 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);
{
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);
}
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);
{
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(); */
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);
*/
#include <stdlib.h>
-#include <stdio.h>
+#include <glib/gprintf.h>
#include <string.h>
#include "gdk/gdk.h"
/* 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;
*/
#include <math.h>
-#include <stdio.h>
+#include <glib/gprintf.h>
#include <string.h>
#include "gtkhruler.h"
* 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++)
/* 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);
*/
-#include <stdio.h>
+#include <glib/gprintf.h>
#include <stdlib.h>
#include "gdk/gdkkeysyms.h"
#include "gtkbutton.h"
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",
/* 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);
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
-#include <stdio.h>
+#include <glib/gprintf.h>
#include <math.h>
#include <string.h>
#include "gtkprogress.h"
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++;
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++;
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++;
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++;
*/
#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"
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++;
}
*/
#include <math.h>
-#include <stdio.h>
#include <string.h>
#include "gtkvruler.h"
+#include <glib/gprintf.h>
+
#define RULER_WIDTH 14
#define MINIMUM_INCR 5
* 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++)
/* 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++)
{
#include "config.h"
#include <glib.h>
+#include <glib/gprintf.h>
#include <gmodule.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdio.h>
#ifdef G_OS_WIN32
#define SOEXT ".dll"
print_escaped (const char *str)
{
char *tmp = escape_string (str);
- printf ("\"%s\" ", tmp);
+ g_printf ("\"%s\" ", tmp);
g_free (tmp);
}
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;
}
}
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;
}
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");
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);
#include <gdk-pixbuf/gdk-pixbuf.h>
-#include <stdio.h>
+#include <glib/gprintf.h>
#include <stdlib.h>
#include <string.h>
{
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;
}
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--)
{
pixels += rowstride;
}
- printf ("};\n");
+ g_printf ("};\n");
}
typedef enum {
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);
}
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++)