summaryrefslogtreecommitdiff
path: root/json-glib/json-gobject.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2022-10-11 11:50:00 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2022-10-11 11:50:00 +0100
commitf6a1279a8e00fa52bb82733cccc633bc09ef83c0 (patch)
tree3091f826794638b2f175aaab6a6a828cc192d0ba /json-glib/json-gobject.c
parentd370ce7ed63ae53c828586f30e6b3f740bc3cbe3 (diff)
downloadjson-glib-f6a1279a8e00fa52bb82733cccc633bc09ef83c0.tar.gz
Drop or mark unused parameters
Avoid compiler warnings when running with `-Wunused-parameter`.
Diffstat (limited to 'json-glib/json-gobject.c')
-rw-r--r--json-glib/json-gobject.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/json-glib/json-gobject.c b/json-glib/json-gobject.c
index 5b7331c..f783209 100644
--- a/json-glib/json-gobject.c
+++ b/json-glib/json-gobject.c
@@ -406,7 +406,7 @@ json_gobject_dump (GObject *gobject)
gboolean
json_deserialize_pspec (GValue *value,
- GParamSpec *pspec,
+ GParamSpec *pspec G_GNUC_UNUSED,
JsonNode *node)
{
GValue node_value = { 0, };
@@ -655,7 +655,7 @@ json_deserialize_pspec (GValue *value,
JsonNode *
json_serialize_pspec (const GValue *real_value,
- GParamSpec *pspec)
+ GParamSpec *pspec G_GNUC_UNUSED)
{
JsonNode *retval = NULL;
JsonNodeType node_type;
@@ -838,11 +838,11 @@ json_gobject_serialize (GObject *gobject)
* json_construct_gobject:
* @gtype: the type of the object to construct
* @data: a JSON data stream
- * @length: length of the data stream
+ * @length: length of the data stream (unused)
* @error: return location for a #GError, or %NULL
*
* Deserializes a JSON data stream and creates an instance of the given
- * type
+ * type.
*
* If the given type implements the [iface@Json.Serializable] interface, it
* will be asked to deserialize all the JSON members into their respective
@@ -851,7 +851,11 @@ json_gobject_serialize (GObject *gobject)
*
* **Note**: the JSON data stream must be an object.
*
- * Return value: (transfer full) (nullable): a new object instance of the given type
+ * For historical reasons, the `length` argument is unused. The given `data`
+ * must be a `NUL`-terminated string.
+ *
+ * Returns: (transfer full) (nullable): a new object instance of the given
+ * type
*
* Since: 0.4
*
@@ -860,7 +864,7 @@ json_gobject_serialize (GObject *gobject)
GObject *
json_construct_gobject (GType gtype,
const gchar *data,
- gsize length,
+ gsize length G_GNUC_UNUSED,
GError **error)
{
return json_gobject_from_data (gtype, data, strlen (data), error);