Document the (GIConv)-1 return value on failure. (#87559, Jarek Dukat)

Thu Jul 25 17:57:07 2002  Owen Taylor  <otaylor@redhat.com>

        * 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.
This commit is contained in:
Owen Taylor 2002-07-25 22:35:17 +00:00 committed by Owen Taylor
parent 0a064bd795
commit 2658448f76
8 changed files with 76 additions and 5 deletions

View File

@ -1,3 +1,13 @@
Thu Jul 25 17:57:07 2002 Owen Taylor <otaylor@redhat.com>
* 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 <maclas@gmx.de> 2002-07-15 Matthias Clasen <maclas@gmx.de>
* glib/gmarkup.h: * glib/gmarkup.h:

View File

@ -1,3 +1,13 @@
Thu Jul 25 17:57:07 2002 Owen Taylor <otaylor@redhat.com>
* 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 <maclas@gmx.de> 2002-07-15 Matthias Clasen <maclas@gmx.de>
* glib/gmarkup.h: * glib/gmarkup.h:

View File

@ -1,3 +1,13 @@
Thu Jul 25 17:57:07 2002 Owen Taylor <otaylor@redhat.com>
* 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 <maclas@gmx.de> 2002-07-15 Matthias Clasen <maclas@gmx.de>
* glib/gmarkup.h: * glib/gmarkup.h:

View File

@ -1,3 +1,13 @@
Thu Jul 25 17:57:07 2002 Owen Taylor <otaylor@redhat.com>
* 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 <maclas@gmx.de> 2002-07-15 Matthias Clasen <maclas@gmx.de>
* glib/gmarkup.h: * glib/gmarkup.h:

View File

@ -1,3 +1,13 @@
Thu Jul 25 17:57:07 2002 Owen Taylor <otaylor@redhat.com>
* 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 <maclas@gmx.de> 2002-07-15 Matthias Clasen <maclas@gmx.de>
* glib/gmarkup.h: * glib/gmarkup.h:

View File

@ -1,3 +1,13 @@
Thu Jul 25 17:57:07 2002 Owen Taylor <otaylor@redhat.com>
* 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 <maclas@gmx.de> 2002-07-15 Matthias Clasen <maclas@gmx.de>
* glib/gmarkup.h: * glib/gmarkup.h:

View File

@ -1,3 +1,13 @@
Thu Jul 25 17:57:07 2002 Owen Taylor <otaylor@redhat.com>
* 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 <maclas@gmx.de> 2002-07-15 Matthias Clasen <maclas@gmx.de>
* glib/gmarkup.h: * glib/gmarkup.h:

View File

@ -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 * GLib provides g_convert() and g_locale_to_utf8() which are likely
* more convenient than the raw iconv wrappers. * 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 GIConv
g_iconv_open (const gchar *to_codeset, g_iconv_open (const gchar *to_codeset,
@ -121,20 +122,20 @@ g_iconv_open (const gchar *to_codeset,
while (*p) while (*p)
{ {
if (try_conversion (to_codeset, *p, &cd)) if (try_conversion (to_codeset, *p, &cd))
return (GIConv)cd; goto out;
if (try_to_aliases (to_aliases, *p, &cd)) if (try_to_aliases (to_aliases, *p, &cd))
return (GIConv)cd; goto out;
p++; p++;
} }
} }
if (try_to_aliases (to_aliases, from_codeset, &cd)) 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;
} }
/** /**