Remove warning about g_print, etc, encoding.
authorOwen Taylor <otaylor@redhat.com>
Thu, 28 Mar 2002 23:24:23 +0000 (23:24 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Thu, 28 Mar 2002 23:24:23 +0000 (23:24 +0000)
Thu Mar 28 18:22:53 2002  Owen Taylor  <otaylor@redhat.com>

        * README: Remove warning about g_print, etc, encoding.

        * NEWS: Updates.

        * glib/gmessages.c (g_log_default_handler): Use %lu
        (plus a cast) when printing out pid_t arguments.
        (#76770, Morten Welinder)

        * glib/gstrfuncs.c (g_strdup_vprintf): Check the
        result of vasprintf(), return NULL on failure.
        (#76802, Akira Tagoh)

        * tests/testglib.c (TEST): Supress a warning with
        some GCC versions.

12 files changed:
ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
NEWS
README
glib/gmessages.c
glib/gstrfuncs.c
tests/testglib.c

index e98ae11..5940890 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+Thu Mar 28 18:22:53 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * README: Remove warning about g_print, etc, encoding.
+
+       * NEWS: Updates.
+
+       * glib/gmessages.c (g_log_default_handler): Use %lu
+       (plus a cast) when printing out pid_t arguments.
+       (#76770, Morten Welinder)
+
+       * glib/gstrfuncs.c (g_strdup_vprintf): Check the
+       result of vasprintf(), return NULL on failure.
+       (#76802, Akira Tagoh)
+
+       * tests/testglib.c (TEST): Supress a warning with
+       some GCC versions. 
+
 Thu Mar 28 20:31:51 2002  Tim Janik  <timj@gtk.org>
 
        * glib/gmessages.c:
index e98ae11..5940890 100644 (file)
@@ -1,3 +1,20 @@
+Thu Mar 28 18:22:53 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * README: Remove warning about g_print, etc, encoding.
+
+       * NEWS: Updates.
+
+       * glib/gmessages.c (g_log_default_handler): Use %lu
+       (plus a cast) when printing out pid_t arguments.
+       (#76770, Morten Welinder)
+
+       * glib/gstrfuncs.c (g_strdup_vprintf): Check the
+       result of vasprintf(), return NULL on failure.
+       (#76802, Akira Tagoh)
+
+       * tests/testglib.c (TEST): Supress a warning with
+       some GCC versions. 
+
 Thu Mar 28 20:31:51 2002  Tim Janik  <timj@gtk.org>
 
        * glib/gmessages.c:
index e98ae11..5940890 100644 (file)
@@ -1,3 +1,20 @@
+Thu Mar 28 18:22:53 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * README: Remove warning about g_print, etc, encoding.
+
+       * NEWS: Updates.
+
+       * glib/gmessages.c (g_log_default_handler): Use %lu
+       (plus a cast) when printing out pid_t arguments.
+       (#76770, Morten Welinder)
+
+       * glib/gstrfuncs.c (g_strdup_vprintf): Check the
+       result of vasprintf(), return NULL on failure.
+       (#76802, Akira Tagoh)
+
+       * tests/testglib.c (TEST): Supress a warning with
+       some GCC versions. 
+
 Thu Mar 28 20:31:51 2002  Tim Janik  <timj@gtk.org>
 
        * glib/gmessages.c:
index e98ae11..5940890 100644 (file)
@@ -1,3 +1,20 @@
+Thu Mar 28 18:22:53 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * README: Remove warning about g_print, etc, encoding.
+
+       * NEWS: Updates.
+
+       * glib/gmessages.c (g_log_default_handler): Use %lu
+       (plus a cast) when printing out pid_t arguments.
+       (#76770, Morten Welinder)
+
+       * glib/gstrfuncs.c (g_strdup_vprintf): Check the
+       result of vasprintf(), return NULL on failure.
+       (#76802, Akira Tagoh)
+
+       * tests/testglib.c (TEST): Supress a warning with
+       some GCC versions. 
+
 Thu Mar 28 20:31:51 2002  Tim Janik  <timj@gtk.org>
 
        * glib/gmessages.c:
index e98ae11..5940890 100644 (file)
@@ -1,3 +1,20 @@
+Thu Mar 28 18:22:53 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * README: Remove warning about g_print, etc, encoding.
+
+       * NEWS: Updates.
+
+       * glib/gmessages.c (g_log_default_handler): Use %lu
+       (plus a cast) when printing out pid_t arguments.
+       (#76770, Morten Welinder)
+
+       * glib/gstrfuncs.c (g_strdup_vprintf): Check the
+       result of vasprintf(), return NULL on failure.
+       (#76802, Akira Tagoh)
+
+       * tests/testglib.c (TEST): Supress a warning with
+       some GCC versions. 
+
 Thu Mar 28 20:31:51 2002  Tim Janik  <timj@gtk.org>
 
        * glib/gmessages.c:
index e98ae11..5940890 100644 (file)
@@ -1,3 +1,20 @@
+Thu Mar 28 18:22:53 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * README: Remove warning about g_print, etc, encoding.
+
+       * NEWS: Updates.
+
+       * glib/gmessages.c (g_log_default_handler): Use %lu
+       (plus a cast) when printing out pid_t arguments.
+       (#76770, Morten Welinder)
+
+       * glib/gstrfuncs.c (g_strdup_vprintf): Check the
+       result of vasprintf(), return NULL on failure.
+       (#76802, Akira Tagoh)
+
+       * tests/testglib.c (TEST): Supress a warning with
+       some GCC versions. 
+
 Thu Mar 28 20:31:51 2002  Tim Janik  <timj@gtk.org>
 
        * glib/gmessages.c:
index e98ae11..5940890 100644 (file)
@@ -1,3 +1,20 @@
+Thu Mar 28 18:22:53 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * README: Remove warning about g_print, etc, encoding.
+
+       * NEWS: Updates.
+
+       * glib/gmessages.c (g_log_default_handler): Use %lu
+       (plus a cast) when printing out pid_t arguments.
+       (#76770, Morten Welinder)
+
+       * glib/gstrfuncs.c (g_strdup_vprintf): Check the
+       result of vasprintf(), return NULL on failure.
+       (#76802, Akira Tagoh)
+
+       * tests/testglib.c (TEST): Supress a warning with
+       some GCC versions. 
+
 Thu Mar 28 20:31:51 2002  Tim Janik  <timj@gtk.org>
 
        * glib/gmessages.c:
diff --git a/NEWS b/NEWS
index 5f68bae..2675ba2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,28 @@
+Overview of Changes in GLib 2.0.1
+=================================
+
+* Portability fixes for Sun's Forte compiler [Erwann Chenede]
+* Performance improvements for GObject parameter lookup, 
+  g_filename_to/from_utf8() [Alex Larsson]
+* Actually check interface prerequisites [Matthias Clasen,
+  Miroslaw Dobrzanski-Neumann]
+* Fix problem with glib-mkenums taking huge amounts of stack. [Owen Taylor]
+* Fix g_signal_handlers_disconnect_by_func() for C++ [Damien Sandras]
+* Fixes for g_log() and threading.
+  [Sebastian Wilhelmi, Miroslaw Dobrzanski-Neumann, Tim Janik]
+* Make g_print(), g_printerr(), g_warning(), etc, convert from
+  UTF-8 to the encoding of the locale [Sebastain Wilhelmi, Tim]
+* Fixes for GIOChannel on windows. [Tor Lillquist]
+* Fix gsize/gint mismatches in giochannel.c [Miroslaw Dobrzanski-Neumann]
+* Fix file descriptor leak in g_file_get_contents() [Matthias]
+* Workaround iconv() problems on older Solaris [Lauri Alanko]
+* Fix warnings with gcc-3.1 about asm const [Cody Russel]
+* Minor bug fixes.
+
+Other contributors: Hans Breuer, LEE Sau Dan, Sven Neumann, Salmaso Raffaele,
+  Akira Tagoh, Morten Welinder
+
+
 Overview of Changes in GLib 2.0.0
 =================================
 
diff --git a/README b/README
index 5116c89..ac8ba03 100644 (file)
--- a/README
+++ b/README
@@ -24,23 +24,16 @@ Installation
 
 See the file 'INSTALL'
 
-Notes about GLib-2.0.0
+Notes about GLib-2.0.1
 ======================
 
 * On systems without the libintl from GNU gettext() or a recent version
   of the GNU C library, the encoding of translated error messages will be 
   incorrect (they should be in UTF-8). A workaround for this is to install 
-  GNU gettext and use that libintl. This is expected to be fixed in GLib-2.0.1.
+  GNU gettext and use that libintl. This is expected to be fixed in GLib-2.0.2.
   Application programmers should not call g_locale_to_utf8() on these
   strings.
 
-* Similarly, the GLib error logging functions such as g_print(), g_warning(),
-  g_error(), currently do not convert the strings they are passed from
-  UTF-8 to the encoding of the locale, or check that the strings they
-  are passed are valid UTF-8. They should, despite this, be assumed to take
-  UTF-8 arguments.
-
-
 How to report bugs
 ==================
 
index 4a72be5..da8959a 100644 (file)
@@ -747,9 +747,9 @@ g_log_default_handler (const gchar   *log_domain,
       const gchar *prg_name = g_get_prgname ();
       
       if (!prg_name)
-       g_string_append_printf (gstring, "(process:%u): ", getpid ());
+       g_string_append_printf (gstring, "(process:%lu): ", (gulong)getpid ());
       else
-       g_string_append_printf (gstring, "(%s:%u): ", prg_name, getpid ());
+       g_string_append_printf (gstring, "(%s:%lu): ", prg_name, (gulong)getpid ());
     }
 
   if (log_domain)
index 08c3e55..ba72664 100644 (file)
@@ -183,8 +183,9 @@ g_strdup_vprintf (const gchar *format,
 {
   gchar *buffer;
 #ifdef HAVE_VASPRINTF
-  vasprintf (&buffer, format, args1);
-  if (!g_mem_is_system_malloc ()) 
+  if (vasprintf (&buffer, format, args1) < 0)
+    buffer = NULL;
+  else if (!g_mem_is_system_malloc ()) 
     {
       gchar *buffer1 = g_strdup (buffer);
       free (buffer);
index c447834..1c8de8d 100644 (file)
 static int array[10000];
 static gboolean failed = FALSE;
 
+/* We write (m ? m : "") even in the m != NULL case to suppress a warning with GCC-3.1
+ */
 #define        TEST(m,cond)    G_STMT_START { failed = !(cond); \
 if (failed) \
   { if (!m) \
       g_print ("\n(%s:%d) failed for: %s\n", __FILE__, __LINE__, ( # cond )); \
     else \
-      g_print ("\n(%s:%d) failed for: %s: (%s)\n", __FILE__, __LINE__, ( # cond ), (gchar*)m); \
+      g_print ("\n(%s:%d) failed for: %s: (%s)\n", __FILE__, __LINE__, ( # cond ), (gchar*)(m ? m : "")); \
   } \
 else \
   g_print ("."); fflush (stdout); \