diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2022-04-18 07:22:29 +0900 |
---|---|---|
committer | 坂本 貴史 <o-takashi@sakamocchi.jp> | 2022-04-18 07:25:16 +0900 |
commit | 815e6ce478890e4eb0734be18a6942f68f746c27 (patch) | |
tree | 4d4f8edb3d79eb91adb0fa341f0c79096cae54f3 | |
parent | 4f0e1fec361e75c71967f36ca5f7e681f0ad1ef0 (diff) | |
download | libhinoko-815e6ce478890e4eb0734be18a6942f68f746c27.tar.gz |
fw_iso_resource: fix GError override warning at error case
Unless local variable is not NULL, g_set_error() generates warning.
This commit fixes the bug.
Fixes: ba2ccbe77cfa ("fw_iso_resource: add GObject signal for allocation and deallocation")
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
-rw-r--r-- | src/fw_iso_resource.c | 11 | ||||
-rw-r--r-- | src/fw_iso_resource.h | 8 |
2 files changed, 9 insertions, 10 deletions
diff --git a/src/fw_iso_resource.c b/src/fw_iso_resource.c index 28ff2cf..b4cfb39 100644 --- a/src/fw_iso_resource.c +++ b/src/fw_iso_resource.c @@ -94,8 +94,8 @@ static void hinoko_fw_iso_resource_class_init(HinokoFwIsoResourceClass *klass) * @self: A [class@FwIsoResource]. * @channel: The deallocated channel number. * @bandwidth: The deallocated amount of bandwidth. - * @error: A [struct@GLib.Error]. Error can be generated with domain of - * Hinoko.FwIsoResourceError and its EVENT code. + * @error: (transfer none) (nullable): A [struct@GLib.Error]. Error can be generated with + * domain of Hinoko.FwIsoResourceError and its EVENT code. * * Emitted when allocation of isochronous resource finishes. */ @@ -114,8 +114,8 @@ static void hinoko_fw_iso_resource_class_init(HinokoFwIsoResourceClass *klass) * @self: A [class@FwIsoResource]. * @channel: The deallocated channel number. * @bandwidth: The deallocated amount of bandwidth. - * @error: A [struct@GLib.Error]. Error can be generated with domain of - * Hinoko.FwIsoResourceError and its EVENT code. + * @error: (transfer none) (nullable): A [struct@GLib.Error]. Error can be generated with + * domain of Hinoko.FwIsoResourceError and its EVENT code. * * Emitted when deallocation of isochronous resource finishes. */ @@ -447,7 +447,7 @@ static void handle_iso_resource_event(HinokoFwIsoResource *self, guint channel; guint bandwidth; int sig_type; - GError *error; + GError *error = NULL; // To change state machine for auto mode. if (HINOKO_IS_FW_ISO_RESOURCE_AUTO(self)) { @@ -458,7 +458,6 @@ static void handle_iso_resource_event(HinokoFwIsoResource *self, if (ev->channel >= 0) { channel = ev->channel; bandwidth = ev->bandwidth; - error = NULL; } else { channel = 0; bandwidth = 0; diff --git a/src/fw_iso_resource.h b/src/fw_iso_resource.h index 9f8a2fa..1d70dce 100644 --- a/src/fw_iso_resource.h +++ b/src/fw_iso_resource.h @@ -23,8 +23,8 @@ struct _HinokoFwIsoResourceClass { * @self: A [class@FwIsoResource]. * @channel: The deallocated channel number. * @bandwidth: The deallocated amount of bandwidth. - * @error: A [struct@GLib.Error]. Error can be generated with domain of - * Hinoko.FwIsoResourceError and its EVENT code. + * @error: (transfer none) (nullable): A [struct@GLib.Error]. Error can be generated with + * domain of Hinoko.FwIsoResourceError and its EVENT code. * * Class closure for the [signal@FwIsoResource::allocated] signal. */ @@ -36,8 +36,8 @@ struct _HinokoFwIsoResourceClass { * @self: A [class@FwIsoResource]. * @channel: The deallocated channel number. * @bandwidth: The deallocated amount of bandwidth. - * @error: A [struct@GLib.Error]. Error can be generated with domain of - * Hinoko.FwIsoResourceError and its EVENT code. + * @error: (transfer none) (nullable): A [struct@GLib.Error]. Error can be generated with + * domain of Hinoko.FwIsoResourceError and its EVENT code. * * Class closure for the [signal@FwIsoResource::deallocated] signal. */ |