+2007-06-17 Behdad Esfahbod <behdad@gnome.org>
+
+ * glib/gdataset.c (g_quark_from_string),
+ (g_quark_from_static_string): Accept NULL and return GQuark
+ value of zero. (#446859)
+
2007-06-16 Mathias Hasselmann <mathias.hasselmann@gmx.de>
* glib/gstring.c: Correctly use g_printf_string_upper_bound
<!-- ##### TYPEDEF GQuark ##### -->
<para>
-A GQuark is an integer which uniquely identifies a particular string.
+A GQuark is a non-zero integer which uniquely identifies a particular string.
+A GQuark value of zero is associated to %NULL.
</para>
</para>
@string: a string.
-@Returns: the #GQuark identifying the string.
+@Returns: the #GQuark identifying the string, or 0 if @string is %NULL.
<!-- ##### FUNCTION g_quark_from_static_string ##### -->
</para>
@string: a string.
-@Returns: the #GQuark identifying the string.
+@Returns: the #GQuark identifying the string, or 0 if @string is %NULL.
<!-- ##### FUNCTION g_quark_to_string ##### -->
<!-- ##### FUNCTION g_quark_try_string ##### -->
<para>
-Gets the #GQuark associated with the given string, or 0 if the string has
-no associated #GQuark.
+Gets the #GQuark associated with the given string, or 0 if string is
+%NULL or it has no associated #GQuark.
</para>
<para>
If you want the GQuark to be created if it doesn't already exist, use
</para>
@string: a string.
-@Returns: the #GQuark associated with the string, or 0 if there is no
-#GQuark associated with the string.
+@Returns: the #GQuark associated with the string, or 0 if @string is
+%NULL or there is no #GQuark associated with it.
<!-- ##### FUNCTION g_intern_string ##### -->
{
GQuark quark;
- g_return_val_if_fail (string != NULL, 0);
+ if (!string)
+ return 0;
G_LOCK (g_quark_global);
quark = g_quark_from_string_internal (string, TRUE);
{
GQuark quark;
- g_return_val_if_fail (string != NULL, 0);
+ if (!string)
+ return 0;
G_LOCK (g_quark_global);
quark = g_quark_from_string_internal (string, FALSE);