From d5d305193ce527f1cc3022c406de35d9a85d4ccb Mon Sep 17 00:00:00 2001 From: hrxi Date: Sun, 1 Sep 2019 18:18:25 +0200 Subject: Fix some warnings Instances of `RegexError` are just asserted as `assert_not_reached` as they cannot really fail except for allocation failure if the given regex is valid. --- plugins/signal-protocol/vapi/signal-protocol-public.vapi | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'plugins/signal-protocol/vapi') diff --git a/plugins/signal-protocol/vapi/signal-protocol-public.vapi b/plugins/signal-protocol/vapi/signal-protocol-public.vapi index 0a4456ad..1952beb1 100644 --- a/plugins/signal-protocol/vapi/signal-protocol-public.vapi +++ b/plugins/signal-protocol/vapi/signal-protocol-public.vapi @@ -218,9 +218,14 @@ namespace Signal { [CCode (instance_pos = 1, cname = "ec_public_key_serialize")] private int serialize_([CCode (pos = 0)] out Buffer buffer); [CCode (cname = "ec_public_key_serialize_")] - public uint8[] serialize() throws GLib.Error { + public uint8[] serialize() { Buffer buffer; - throw_by_code(serialize_(out buffer)); + try { + throw_by_code(serialize_(out buffer)); + } catch (GLib.Error e) { + // Can only throw for invalid arguments or out of memory. + GLib.assert_not_reached(); + } return buffer.data; } public int compare(ECPublicKey other); @@ -235,7 +240,12 @@ namespace Signal { [CCode (cname = "ec_private_key_serialize_")] public uint8[] serialize() throws GLib.Error { Buffer buffer; - throw_by_code(serialize_(out buffer)); + try { + throw_by_code(serialize_(out buffer)); + } catch (GLib.Error e) { + // Can only throw for invalid arguments or out of memory. + GLib.assert_not_reached(); + } return buffer.data; } public int compare(ECPublicKey other); -- cgit v1.2.3-54-g00ecf