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 4qT2K2j6nGAmoQAAgWs5BA (envelope-from ) for ; Thu, 13 May 2021 12:07:36 +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 WCPlJmj6nGBPdAAAbx9fmQ (envelope-from ) for ; Thu, 13 May 2021 10:07:36 +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 5D2BF2FC03 for ; Thu, 13 May 2021 12:07:36 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 85390271E9; Thu, 13 May 2021 06:07:22 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 08BF62717B for ; Thu, 13 May 2021 06:07:16 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 4F94C6081C; Thu, 13 May 2021 06:07:16 -0400 (EDT) Received: (nullmailer pid 1460744 invoked by uid 1000); Thu, 13 May 2021 10:07:13 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: David Bremner Subject: [PATCH 7/7] CLI/notmuch: make immutable tables const Date: Thu, 13 May 2021 07:07:10 -0300 Message-Id: <20210513100710.1460566-8-david@tethera.net> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210513100710.1460566-1-david@tethera.net> References: <20210513100710.1460566-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: JR2RZ344EK25PKWOIFZC643JVUJPGCUC X-Message-ID-Hash: JR2RZ344EK25PKWOIFZC643JVUJPGCUC X-MailFrom: bremner@tethera.net 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=1620900456; 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; bh=RAnBomR5wEfeTFlJkRolr6cqNniWYSws2gtXW+nlkQ8=; b=p+8/af2OetBd23iDxtCAhF1CBqqznZjCv2zrXLr2LaMbdORT5KntNG9+47HRL4eyvAaXDX TCzhb7d/LYkXo88vuPoFd1g21KnM3liwcTPPaLIZJsUf4eV/kiBA/AV8YPhjR6DYK2rlQU Us//0Yk9pUn1dAqYg9A9b3bwlRcpOGZWBYGpQ9J/3CuzGYtQzUVvAFw+KG5wK42DIwVT8J TdRjK9IO0dWz+R5W+Zm50FHTTXId/4Y5ZoHEx0oQOm4VDl24+j1C8UL5UfNdteEpRw7uft gw6tnbir7BuZ6+ojMLUV4vOG0S/Am7Mrp2kIoYZWU1Qig60meWIjpMB6rQ0NXQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620900456; a=rsa-sha256; cv=none; b=l3X2NLpTRfC4WnlAq0JxisrbQO0VKOWahLUY0+GvwEXbLIYUCS9P/AtlwZiAKR9h1XlaYJ bWWLzNvZHSYScx+iNDDy2XPc6YWfvp9CKu2DGBC2qDZAF0Z5JXOUlUptoII+smoNZU9Rnv G9QJTIfZ7OhFh1zoDN/1ENgpr3886Nyuk42kcFZtmitQAHs6/yo/IvSbsLngMuCmOcAGqy mVBdJVybrfMa9IlOSVZxl1Uphr8YjtbBiSiETkBOjhGpDynPMBiVGuHTlRIMoJ/bJHLbfM tA47X+UFRp/tc0+M65BXpJsBjd/5o/85z15r8GHngrpSpUCULQGHBjwEEuX+Pw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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-Spam-Score: 0.43 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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: 5D2BF2FC03 X-Spam-Score: 0.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: q44VvVD6QhQV Let the compiler enforce the immutability. --- notmuch.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/notmuch.c b/notmuch.c index 9ca3a4be..d0a94fc2 100644 --- a/notmuch.c +++ b/notmuch.c @@ -139,7 +139,7 @@ notmuch_process_shared_indexing_options (notmuch_database_t *notmuch) } -static command_t commands[] = { +static const command_t commands[] = { { NULL, notmuch_command, NOTMUCH_COMMAND_CONFIG_CREATE | NOTMUCH_COMMAND_CONFIG_LOAD, "Notmuch main command." }, { "setup", notmuch_setup_command, NOTMUCH_COMMAND_CONFIG_CREATE | NOTMUCH_COMMAND_CONFIG_LOAD, @@ -189,7 +189,7 @@ typedef struct help_topic { const char *summary; } help_topic_t; -static help_topic_t help_topics[] = { +static const help_topic_t help_topics[] = { { "search-terms", "Common search term syntax." }, { "hooks", @@ -198,7 +198,7 @@ static help_topic_t help_topics[] = { "Message property conventions and documentation." }, }; -static command_t * +static const command_t * find_command (const char *name) { size_t i; @@ -216,8 +216,8 @@ int notmuch_format_version; static void usage (FILE *out) { - command_t *command; - help_topic_t *topic; + const command_t *command; + const help_topic_t *topic; unsigned int i; fprintf (out, @@ -308,8 +308,8 @@ exec_man (const char *page) static int _help_for (const char *topic_name) { - command_t *command; - help_topic_t *topic; + const command_t *command; + const help_topic_t *topic; unsigned int i; if (! topic_name) { @@ -452,7 +452,7 @@ main (int argc, char *argv[]) void *local; char *talloc_report; const char *command_name = NULL; - command_t *command; + const command_t *command; const char *config_file_name = NULL; notmuch_database_t *notmuch = NULL; int opt_index; -- 2.30.2