From 2658448f76d9815199f685061424ac626c666d12 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 25 Jul 2002 22:35:17 +0000 Subject: [PATCH] Document the (GIConv)-1 return value on failure. (#87559, Jarek Dukat) Thu Jul 25 17:57:07 2002 Owen Taylor * glib/gconvert.c (g_iconv_open): Document the (GIConv)-1 return value on failure. (#87559, Jarek Dukat) * glib/gconvert.c (g_iconv_open): Fix potential problems with the assumption that (GIConv)(iconv_t)-1 is the same as (GIConv)-1. --- ChangeLog | 10 ++++++++++ ChangeLog.pre-2-10 | 10 ++++++++++ ChangeLog.pre-2-12 | 10 ++++++++++ ChangeLog.pre-2-2 | 10 ++++++++++ ChangeLog.pre-2-4 | 10 ++++++++++ ChangeLog.pre-2-6 | 10 ++++++++++ ChangeLog.pre-2-8 | 10 ++++++++++ glib/gconvert.c | 11 ++++++----- 8 files changed, 76 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 758f220c..b3013a4e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Thu Jul 25 17:57:07 2002 Owen Taylor + + * glib/gconvert.c (g_iconv_open): Document the + (GIConv)-1 return value on failure. (#87559, + Jarek Dukat) + + * glib/gconvert.c (g_iconv_open): Fix potential + problems with the assumption that (GIConv)(iconv_t)-1 + is the same as (GIConv)-1. + 2002-07-15 Matthias Clasen * glib/gmarkup.h: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 758f220c..b3013a4e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +Thu Jul 25 17:57:07 2002 Owen Taylor + + * glib/gconvert.c (g_iconv_open): Document the + (GIConv)-1 return value on failure. (#87559, + Jarek Dukat) + + * glib/gconvert.c (g_iconv_open): Fix potential + problems with the assumption that (GIConv)(iconv_t)-1 + is the same as (GIConv)-1. + 2002-07-15 Matthias Clasen * glib/gmarkup.h: diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 758f220c..b3013a4e 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,13 @@ +Thu Jul 25 17:57:07 2002 Owen Taylor + + * glib/gconvert.c (g_iconv_open): Document the + (GIConv)-1 return value on failure. (#87559, + Jarek Dukat) + + * glib/gconvert.c (g_iconv_open): Fix potential + problems with the assumption that (GIConv)(iconv_t)-1 + is the same as (GIConv)-1. + 2002-07-15 Matthias Clasen * glib/gmarkup.h: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 758f220c..b3013a4e 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,13 @@ +Thu Jul 25 17:57:07 2002 Owen Taylor + + * glib/gconvert.c (g_iconv_open): Document the + (GIConv)-1 return value on failure. (#87559, + Jarek Dukat) + + * glib/gconvert.c (g_iconv_open): Fix potential + problems with the assumption that (GIConv)(iconv_t)-1 + is the same as (GIConv)-1. + 2002-07-15 Matthias Clasen * glib/gmarkup.h: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 758f220c..b3013a4e 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +Thu Jul 25 17:57:07 2002 Owen Taylor + + * glib/gconvert.c (g_iconv_open): Document the + (GIConv)-1 return value on failure. (#87559, + Jarek Dukat) + + * glib/gconvert.c (g_iconv_open): Fix potential + problems with the assumption that (GIConv)(iconv_t)-1 + is the same as (GIConv)-1. + 2002-07-15 Matthias Clasen * glib/gmarkup.h: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 758f220c..b3013a4e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +Thu Jul 25 17:57:07 2002 Owen Taylor + + * glib/gconvert.c (g_iconv_open): Document the + (GIConv)-1 return value on failure. (#87559, + Jarek Dukat) + + * glib/gconvert.c (g_iconv_open): Fix potential + problems with the assumption that (GIConv)(iconv_t)-1 + is the same as (GIConv)-1. + 2002-07-15 Matthias Clasen * glib/gmarkup.h: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 758f220c..b3013a4e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +Thu Jul 25 17:57:07 2002 Owen Taylor + + * glib/gconvert.c (g_iconv_open): Document the + (GIConv)-1 return value on failure. (#87559, + Jarek Dukat) + + * glib/gconvert.c (g_iconv_open): Fix potential + problems with the assumption that (GIConv)(iconv_t)-1 + is the same as (GIConv)-1. + 2002-07-15 Matthias Clasen * glib/gmarkup.h: diff --git a/glib/gconvert.c b/glib/gconvert.c index 2c8d2b7d..939a4176 100644 --- a/glib/gconvert.c +++ b/glib/gconvert.c @@ -102,7 +102,8 @@ extern const char **_g_charset_get_aliases (const char *canonical_name); * GLib provides g_convert() and g_locale_to_utf8() which are likely * more convenient than the raw iconv wrappers. * - * Return value: a "conversion descriptor" + * Return value: a "conversion descriptor", or (GIConv)-1 if + * opening the converter failed. **/ GIConv g_iconv_open (const gchar *to_codeset, @@ -121,20 +122,20 @@ g_iconv_open (const gchar *to_codeset, while (*p) { if (try_conversion (to_codeset, *p, &cd)) - return (GIConv)cd; + goto out; if (try_to_aliases (to_aliases, *p, &cd)) - return (GIConv)cd; + goto out; p++; } } if (try_to_aliases (to_aliases, from_codeset, &cd)) - return (GIConv)cd; + goto out; } - return (GIConv)cd; + return (cd == (iconv_t)-1) ? (GIConv)-1 : (GIConv)cd; } /** -- 2.34.1