gdataset: drop "key_id" argument from GDataListUpdateAtomicFunc

None of the users actually care about this parameter. And it's unlikely
that they ever will. Also, the passed "key_id" is the argument from
g_datalist_id_update_atomic(). If the caller really cared to know the
"key_id" in the callback, they could pass it as additional user data.
This commit is contained in:
Thomas Haller 2024-03-06 08:06:46 +01:00
parent b4224a5d6d
commit 1f0f5afe20
4 changed files with 4 additions and 8 deletions

View File

@ -1114,7 +1114,7 @@ g_datalist_id_update_atomic (GData **datalist,
new_destroy = NULL; new_destroy = NULL;
} }
result = callback (key_id, &new_data, &new_destroy, user_data); result = callback (&new_data, &new_destroy, user_data);
if (data && !new_data) if (data && !new_data)
{ {

View File

@ -40,7 +40,6 @@ G_BEGIN_DECLS
/*< private > /*< private >
* GDataListUpdateAtomicFunc: * GDataListUpdateAtomicFunc:
* @key_id: ID of the entry to update
* @data: (inout) (nullable) (not optional): the existing data corresponding * @data: (inout) (nullable) (not optional): the existing data corresponding
* to @key_id, and return location for the new value for it * to @key_id, and return location for the new value for it
* @destroy_notify: (inout) (nullable) (not optional): the existing destroy * @destroy_notify: (inout) (nullable) (not optional): the existing destroy
@ -52,8 +51,7 @@ G_BEGIN_DECLS
* *
* Since: 2.80 * Since: 2.80
*/ */
typedef gpointer (*GDataListUpdateAtomicFunc) (GQuark key_id, typedef gpointer (*GDataListUpdateAtomicFunc) (gpointer *data,
gpointer *data,
GDestroyNotify *destroy_notify, GDestroyNotify *destroy_notify,
gpointer user_data); gpointer user_data);

View File

@ -469,8 +469,7 @@ test_datalist_id_remove_multiple_destroy_order (void)
} }
static gpointer static gpointer
_update_atomic_cb (GQuark key_id, _update_atomic_cb (gpointer *data,
gpointer *data,
GDestroyNotify *destroy_notify, GDestroyNotify *destroy_notify,
gpointer user_data) gpointer user_data)
{ {

View File

@ -367,8 +367,7 @@ weak_ref_data_unlock (WeakRefData *wrdata)
} }
static gpointer static gpointer
weak_ref_data_get_or_create_cb (GQuark key_id, weak_ref_data_get_or_create_cb (gpointer *data,
gpointer *data,
GDestroyNotify *destroy_notify, GDestroyNotify *destroy_notify,
gpointer user_data) gpointer user_data)
{ {