From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8LyoMXAj5WBVHQAAgWs5BA (envelope-from ) for ; Wed, 07 Jul 2021 05:45:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yLZTLXAj5WB+aQAAbx9fmQ (envelope-from ) for ; Wed, 07 Jul 2021 03:45:52 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (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 640AC188C6 for ; Wed, 7 Jul 2021 05:45:52 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 2C934290E7; Tue, 6 Jul 2021 23:45:44 -0400 (EDT) Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) by mail.notmuchmail.org (Postfix) with ESMTPS id B1A48290DF for ; Tue, 6 Jul 2021 23:45:39 -0400 (EDT) Received: by mail-oi1-x22d.google.com with SMTP id l26so1849191oic.7 for ; Tue, 06 Jul 2021 20:45:39 -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=HhIrPL3sKO3JamXM/PSWcSmNF3dC6Bx1S64m9MEOQxs=; b=InGWXCs90DwYXVZK58I8ArAUSMqb2SofRuZ3zN9QXglo/nxCDd8a9FYelmOQvSvoyt q67UKplTppVbv36gcxHTRjTBYeptMNNqw74v/+7ocowbaxEu2yK5NcgHHK+E6f4RRZZ+ yOl7eATP44dI1uJ0C2QPvHO73v8uXNobaEQdDofNg/ZSCwMctFSb7oT3NH2Ek+c3jdfY p1Q+vvcrj81uvI4R9dsKYYmYzGc2PzZtYFSR+boz60P3S2HPeBrndWlQG7PRZdQo7Kfj 86jgpyteOl1/v/6vX51e6DDVTL9BEJ4Y46e+/Ve5a0grfqRMU8TpKDy23OjMQxZZFOI5 ry2A== 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=HhIrPL3sKO3JamXM/PSWcSmNF3dC6Bx1S64m9MEOQxs=; b=UrxCqMTC6o3Po5ziiuyFaHGoBuf2ZPbJWxHqrlL+enPZlCzqT+1R8vMR6+UI9Eeczo 5qSZdWNSj/uKcvDDV1vkugHwnXCZRaWUlBoMO4oQz+rFzGrLta9TPfR6qhIa0XHtOGZc 7r8eBgEOhvP84OSW4nqliHGepz+Lu/LTXHyyF0mHYXXM+nRwMHpakKeNXRcpTPH/o9iS d9yTEPV+0GSxNnr24y5pghZnHVKn5zZQgenpmRRhlGWzznUvuItuxMz+Tvy3PZifWmS5 Z2sBEAlSi6cfaGjqPbjyZYIS+M+3gQfmfQVyYQXwHEDVe4lV7fPIWbc2z+F+Du4eUFbo 5Lpw== X-Gm-Message-State: AOAM531jpubxr9K7HNGz2mF1iqc3dnvtVrY5QrjgfAvRHmnjqFY9ZHZz fRheojDkyIWcC+YelFVl6qgFFvD3LII= X-Google-Smtp-Source: ABdhPJyPW65es/IGIA7CNO4pUA1v6R1Y3qu7h9hzBBc+faMDTrdC0GtHSIw1mWomjpfTvzKOR02DtA== X-Received: by 2002:aca:d455:: with SMTP id l82mr20215oig.12.1625629538813; Tue, 06 Jul 2021 20:45:38 -0700 (PDT) Received: from localhost (fixed-187-189-163-231.totalplay.net. [187.189.163.231]) by smtp.gmail.com with ESMTPSA id o189sm3924688oif.54.2021.07.06.20.45.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jul 2021 20:45:38 -0700 (PDT) From: Felipe Contreras To: notmuch@notmuchmail.org Cc: David Bremner , Felipe Contreras Subject: [PATCH 2/2] ruby: cleanup object_destroy() Date: Tue, 6 Jul 2021 22:45:33 -0500 Message-Id: <20210707034533.3137309-3-felipe.contreras@gmail.com> X-Mailer: git-send-email 2.32.0.36.g70aac2b1aa In-Reply-To: <20210707034533.3137309-1-felipe.contreras@gmail.com> References: <20210707034533.3137309-1-felipe.contreras@gmail.com> MIME-Version: 1.0 Message-ID-Hash: 5SCLQNZHDG6EITSZWPPQR6CEM476EZ3H X-Message-ID-Hash: 5SCLQNZHDG6EITSZWPPQR6CEM476EZ3H 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=1625629552; 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=CrrnvjqL6wl8g2pCS6n0ngUWOqRbNx+Fc9CnhuLs710=; b=LXRx55/5FjIVXc5UjaDYlizDOp1hVofvjFcGUsAKjdMmXZyKdiWHsjWBM6PWcGmjj2N6Yw xqVHe7mwvTN5XMk7lBv7KzqptcUoGJ4hFEmsXAppSqn2xkeXGpqNYllQdpmqag1MwqLesK 4jvLMmcQzxJ/mUDBwqBxNoQPA1tkDum3JIX7cvBmuTN8KpwvCk76/QpCdyWHvOw4jtqvgg 8vVLwgKjaVmct9FHS3gUAhs76r3Ub7IJLVDIARoxExFQmum0XsHMlexorOEIdjxV8L8d56 26Gur4bOMFG5zlcIsvBzXyR7SZi0MjeFJeLb80dY6Dn4ud15+CRWnH+cHWVziQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1625629552; a=rsa-sha256; cv=none; b=JaQR3/cGaPs19ZCw5SrLBMzb98dKxTQkBAWCWWvbQVgJWe9c1nuUK9UA/Nat2O88p8XuVL 5jhW08f2wImMAvhVolOl7XyGY0R7psJhBJ5TKSMVsq7VQhsPZlajfIUlKRVDcCAhRebwrN YfmbOtGjS+YIdHPL1yovstIZxbQyCxDga1xRQiuzH+YX98WuM619CQm3Wm3jbb2OHFOGhR 6FcfI/fplX1u+qLpM90GBnpQet5jSW6dTLT10ELJdnjzKuH5PDf6SqIUFoq1T7BJf5isnC dbc4RFHXD5yrpwADcQ/fKmY8BBA6X5oCuQ95gMjpaatcldPgwMflDC1seDyM6g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=InGWXCs9; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.96 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20161025 header.b=InGWXCs9; 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 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 640AC188C6 X-Spam-Score: -0.96 X-Migadu-Scanner: scn0.migadu.com X-TUID: w0LyDR2tMQYM 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 --- 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 daac13ab..b3f0621c 100644 --- a/bindings/ruby/defs.h +++ b/bindings/ruby/defs.h @@ -105,19 +105,16 @@ extern const rb_data_type_t notmuch_rb_tags_type; #define Data_Get_Notmuch_Tags(obj, ptr) \ Data_Get_Notmuch_Object ((obj), ¬much_rb_tags_type, (ptr)) -static inline notmuch_status_t +static inline void notmuch_rb_object_destroy (VALUE rb_object, const rb_data_type_t *type) { void *nm_object; - notmuch_status_t ret; Data_Get_Notmuch_Object (rb_object, type, nm_object); /* Call the corresponding notmuch_*_destroy function */ - ret = ((notmuch_status_t (*)(void *)) type->data) (nm_object); + ((void (*)(void *)) type->data) (nm_object); DATA_PTR (rb_object) = NULL; - - return ret; } /* status.c */ -- 2.32.0.36.g70aac2b1aa