summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-12-06 23:17:41 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-12-06 23:17:41 +0000
commit41bd5bb015197c84cbd7065fd6ef95675966f259 (patch)
tree020818c458470ab3b510cfbf510ea37d9ee58627 /pango
parent03e6a3893c2f590f28b1816ae80bea49cf03b451 (diff)
downloadpango-41bd5bb015197c84cbd7065fd6ef95675966f259.tar.gz
Convert [sf]printf to g_[sf]printf, or, where appropriate g_printerr().
Fri Dec 6 18:07:48 2002 Owen Taylor <otaylor@redhat.com> * modules/indic/devanagari-x.c, pango/modules.c pango/pango-utils.c pango/pangoft2.c pango/querymodules.c: Convert [sf]printf to g_[sf]printf, or, where appropriate g_printerr(). (Based on patch from Matthias Clasen, #99321) * configure.in: Require glib-2.1.3.
Diffstat (limited to 'pango')
-rw-r--r--pango/modules.c15
-rw-r--r--pango/pango-utils.c8
-rw-r--r--pango/pangoft2.c4
-rw-r--r--pango/querymodules.c24
4 files changed, 25 insertions, 26 deletions
diff --git a/pango/modules.c b/pango/modules.c
index 32ae2533..fd36243a 100644
--- a/pango/modules.c
+++ b/pango/modules.c
@@ -21,7 +21,6 @@
#include "config.h"
-#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <errno.h>
@@ -157,16 +156,16 @@ pango_engine_pair_get_engine (PangoEnginePair *pair)
module = g_module_open (module_name, 0);
if (!module)
{
- fprintf(stderr, "Cannot load module %s: %s\n",
- module_name, g_module_error());
+ g_printerr ("Cannot load module %s: %s\n",
+ module_name, g_module_error());
return NULL;
}
g_module_symbol (module, "script_engine_load", (gpointer *) &load);
if (!load)
{
- fprintf(stderr, "cannot retrieve script_engine_load from %s: %s\n",
- module_name, g_module_error());
+ g_printerr ("cannot retrieve script_engine_load from %s: %s\n",
+ module_name, g_module_error());
g_module_close (module);
return NULL;
}
@@ -279,14 +278,14 @@ process_module_file (FILE *module_file)
range = g_new (PangoEngineRange, 1);
if (sscanf(tmp_buf->str, "%d-%d:", &start, &end) != 2)
{
- fprintf(stderr, "Error reading modules file");
+ g_printerr ("Error reading modules file");
have_error = TRUE;
goto error;
}
q = strchr (tmp_buf->str, ':');
if (!q)
{
- fprintf(stderr, "Error reading modules file");
+ g_printerr ( "Error reading modules file");
have_error = TRUE;
goto error;
}
@@ -306,7 +305,7 @@ process_module_file (FILE *module_file)
if (i<3)
{
- fprintf(stderr, "Error reading modules file");
+ g_printerr ("Error reading modules file");
have_error = TRUE;
goto error;
}
diff --git a/pango/pango-utils.c b/pango/pango-utils.c
index 29593ea2..0189328d 100644
--- a/pango/pango-utils.c
+++ b/pango/pango-utils.c
@@ -462,8 +462,8 @@ read_config_file (const char *filename, gboolean enoent_error)
if (!file)
{
if (errno != ENOENT || enoent_error)
- fprintf (stderr, "Pango:%s: Error opening config file: %s\n",
- filename, g_strerror (errno));
+ g_printerr ("Pango:%s: Error opening config file: %s\n",
+ filename, g_strerror (errno));
return;
}
@@ -573,7 +573,7 @@ read_config_file (const char *filename, gboolean enoent_error)
if (errstring)
{
- fprintf (stderr, "Pango:%s:%d: %s\n", filename, line, errstring);
+ g_printerr ("Pango:%s:%d: %s\n", filename, line, errstring);
g_free (errstring);
}
@@ -1415,7 +1415,7 @@ read_alias_file (const char *filename)
if (errstring)
{
- fprintf (stderr, "Pango:%s:%d: %s\n", filename, line, errstring);
+ g_printerr ("Pango:%s:%d: %s\n", filename, line, errstring);
g_free (errstring);
}
diff --git a/pango/pangoft2.c b/pango/pangoft2.c
index b84232ae..b404eb98 100644
--- a/pango/pangoft2.c
+++ b/pango/pangoft2.c
@@ -24,9 +24,9 @@
#include <string.h>
#include <stdlib.h>
-#include <stdio.h>
#include <math.h>
#include <glib.h>
+#include <glib/gprintf.h>
#include <freetype/freetype.h>
@@ -1088,7 +1088,7 @@ _pango_ft2_ft_strerror (FT_Error error)
{
static char default_msg[100];
- sprintf (default_msg, "Unknown FreeType2 error %#x", error);
+ g_sprintf (default_msg, "Unknown FreeType2 error %#x", error);
return default_msg;
}
}
diff --git a/pango/querymodules.c b/pango/querymodules.c
index 95c67d89..6b126409 100644
--- a/pango/querymodules.c
+++ b/pango/querymodules.c
@@ -33,7 +33,7 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#include <stdio.h>
+#include <glib/gprintf.h>
#if USE_LA_MODULES
#define SOEXT ".la"
@@ -102,7 +102,7 @@ query_module (const char *dir, const char *name)
module = g_module_open (path, 0);
if (!module)
- fprintf(stderr, "Cannot load module %s: %s\n", path, g_module_error());
+ g_printerr ("Cannot load module %s: %s\n", path, g_module_error ());
if (module &&
g_module_symbol (module, "script_engine_list", (gpointer *) &list) &&
@@ -131,25 +131,25 @@ query_module (const char *dir, const char *name)
quoted_path = g_strdup (path);
}
- printf ("%s%s%s %s %s %s ", quote, quoted_path, quote,
- engines[i].id, engines[i].engine_type, engines[i].render_type);
+ g_printf ("%s%s%s %s %s %s ", quote, quoted_path, quote,
+ engines[i].id, engines[i].engine_type, engines[i].render_type);
g_free (quoted_path);
for (j=0; j < engines[i].n_ranges; j++)
{
if (j != 0)
- printf (" ");
- printf ("%d-%d:%s",
+ g_printf (" ");
+ g_printf ("%d-%d:%s",
engines[i].ranges[j].start,
engines[i].ranges[j].end,
engines[i].ranges[j].langs);
}
- printf ("\n");
+ g_printf ("\n");
}
}
else
{
- fprintf (stderr, "%s does not export Pango module API\n", path);
+ g_printerr ("%s does not export Pango module API\n", path);
}
g_free (path);
@@ -163,9 +163,9 @@ int main (int argc, char **argv)
int i;
char *path;
- printf ("# Pango Modules file\n"
- "# Automatically generated file, do not edit\n"
- "#\n");
+ g_printf ("# Pango Modules file\n"
+ "# Automatically generated file, do not edit\n"
+ "#\n");
if (argc == 1) /* No arguments given */
{
@@ -179,7 +179,7 @@ int main (int argc, char **argv)
"modules",
NULL);
- printf ("# ModulesPath = %s\n#\n", path);
+ g_printf ("# ModulesPath = %s\n#\n", path);
dirs = pango_split_file_list (path);