From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cCw1AcKOCWH8ywAAgWs5BA (envelope-from ) for ; Tue, 03 Aug 2021 20:45:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id uK50OMGOCWE2WgAAB5/wlQ (envelope-from ) for ; Tue, 03 Aug 2021 18:45:21 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id AD4891A0E for ; Tue, 3 Aug 2021 20:45:21 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 7F20D2C09A; Tue, 3 Aug 2021 14:45:17 -0400 (EDT) Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by mail.notmuchmail.org (Postfix) with ESMTPS id 4F8FA2C098 for ; Tue, 3 Aug 2021 14:45:16 -0400 (EDT) Received: by mail-ot1-x32e.google.com with SMTP id h63-20020a9d14450000b02904ce97efee36so10943493oth.7 for ; Tue, 03 Aug 2021 11:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uJpVUjOzhn1K00oq/owIVy76EAyFOASx5PYzKy+Rfag=; b=offKyXStfDNr3SmGajW7lo0s9nHjm0JwSn6VKRCcfw3CGEzDhk6Dc1DCW08Xx+yQ1o kFzlcz/KWQ+qQvf0cB8cm2lsMH4uYoC1CP5OugB54b2qrlbhpv3/mG+NfvxKGQZPEq4a BfrFTiNUXAsR6XKq9RNACWjlDRwORJiedY+QaQVUEUArBJOedvCjJV1KEHscOs0AqesI DxYPWpAxU/U6zlqLMAdTj6N9B7VjhlsFtJY8QMw6pXS9u/fEcn0NT+1KqAnDiTjk4w0D D+gpGq9mqHYro1zMq+zqN4OJtAR7L9JfFgewif+pmXtDJxEYwCx8uzdfnilFRC4durvC pLeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uJpVUjOzhn1K00oq/owIVy76EAyFOASx5PYzKy+Rfag=; b=Y+ofnUKJKH5SiyDgd/AKS7hGNyX+XavserEeOSV3K8PdkHxmrVJhETFYRVX9oZSoUu UUfulhhyWMuCS2LxFrBCc6IMhHgLaw3TsjGY7kv8LdKRTC2Mrgx3NVGIFvCcksU58gHU MkcLkXHl/05axvqLClI8hJQDAGldAtyVU0iEbxWESTyeAFsfVjnGaWZr0SkXbYEvFtyi lGbqVuTxy/7WJ3PJ0n6OEKQAHfGG1NKEkCEpg1k7/Q3vVErskEs5WknVS/emAC1eVbd8 rQ64Zu1O/2lwl4MP9OP7NM92S/4Z85yFEhtdIIE3dcmRWeMGlgPBeMQk5Ed4MCXz4sMX BN6w== X-Gm-Message-State: AOAM533+BUqP/DgkJz0jETA2lCBXUhYtVVHppBF4gjgBYjLfi6HPH27i fjTOdtLvKrxHApskqpKjlwlX1SHk0d7SKA== X-Google-Smtp-Source: ABdhPJyb6KinE5iBq2ymM1FPL00Be62+9yNEP5KpxGUKNA/JotzU6nuCF1moBJA9ylPjBqXzqnPoGw== X-Received: by 2002:a05:6830:1455:: with SMTP id w21mr16654754otp.365.1628016311945; Tue, 03 Aug 2021 11:45:11 -0700 (PDT) Received: from localhost (fixed-187-190-78-172.totalplay.net. [187.190.78.172]) by smtp.gmail.com with ESMTPSA id r1sm2419318ooi.21.2021.08.03.11.45.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 11:45:11 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Cc: David Bremner , Felipe Contreras Subject: [PATCH v2] ruby: cleanup object_destroy() Date: Tue, 3 Aug 2021 13:44:57 -0500 Message-Id: <20210803184457.6807-1-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.40.gb9b36f9b52 In-Reply-To: <87fsvrzrml.fsf@tethera.net> References: <87fsvrzrml.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: GG4BAAWDROAR7YDDFDZZZ2NMVMEYAGHM X-Message-ID-Hash: GG4BAAWDROAR7YDDFDZZZ2NMVMEYAGHM X-MailFrom: felipe.contreras@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628016321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=84m5r7QUDSA87slNtGFpXXw8gKXHngjAvMyO2WDIhn0=; b=EzVhEktNDZmV4tPPXEcmTpSW4IY97OntcHfsSST8drONk2engoIvL8Lq5rNx09pgWRPzRO TAb3Bw8+GyHZU4quN90GihVNaaS3qEN2CsrGX4o2Eyuugr8iReFb7cGpLjI7Gj+ahCV6yq YInMVDlwxvFCFvA08Nt8PicvPYvSj+x5cqe1kj7duuNwHNkuhcAfnauOLNbsNKAu68HLBI dLFSOYmx0XkJvbRt3qA1unWO/z37R/KRvHF8kNj2oe4BETn14tzM5pbIKdiDifzAqDYuz9 8Am5S4SXex0v9lhSawzk8dKDjGfZJAvMgWB4zQI/y+x/Ag/d+tAg72UPkhFT9g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628016321; a=rsa-sha256; cv=none; b=iJ/LO/ce+wNhHLIbuiM7wE79hi6sMhlyMwqq+W4RwX9gMJqk/M7WoqbMAgavovQpkRkseK Rp4gLYdNONgJmQEytshFdDEN1xNWwmYo1XM8xZt5VvYGrqUG28pKBH/DcYYGFkcjuW2HZn FH1rLsXGqytU3MkexBB6AHG6+qDRBDjQ+N9MxdYPB+BvExJNQpT4x2atdWwpZ5j06PusFU zUEkOF86U+9G5j1lQuOvdugIFuL0KYWJwwkIf6Bv2AHaUVVy8kDa12vi+CYI59yfwNYJL0 QVzzI6WOeAQqJ67QcR7BprmX17xlQttxXQIqVVWAmXJDR5UZmzbPFIhQOSmOug== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=offKyXSt; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.87 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=offKyXSt; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: AD4891A0E X-Spam-Score: -0.87 X-Migadu-Scanner: scn1.migadu.com X-TUID: eY/mU9hsv6Wb It was assumed the destructor of notmuch_rb_database_type did return a notmuch_status_t because that's what notmuch_database_close returns, and that value was checked by notmuch_rb_database_close in order to decide if to raise an exception. It turns out notmuch_database_destroy was called instead, so nothing was returned (void). All the destroy functions are void, and that's what we want. Signed-off-by: Felipe Contreras --- Rebased on top of latest master. bindings/ruby/defs.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bindings/ruby/defs.h b/bindings/ruby/defs.h index a33ef0da..e2541e8f 100644 --- a/bindings/ruby/defs.h +++ b/bindings/ruby/defs.h @@ -136,20 +136,17 @@ notmuch_rb_object_free (void *rb_wrapper) talloc_free (rb_wrapper); } -static inline notmuch_status_t +static inline void notmuch_rb_object_destroy (VALUE rb_object, const rb_data_type_t *type) { notmuch_rb_object_t *rb_wrapper; - notmuch_status_t ret; Data_Get_Notmuch_Rb_Object (rb_object, type, rb_wrapper); /* Call the corresponding notmuch_*_destroy function */ - ret = ((notmuch_status_t (*)(void *)) type->data) (rb_wrapper->nm_object); + ((void (*)(void *)) type->data) (rb_wrapper->nm_object); notmuch_rb_object_free (rb_wrapper); DATA_PTR (rb_object) = NULL; - - return ret; } /* status.c */ -- 2.32.0.40.gb9b36f9b52