From e449b2da2d2a61fbed947a6c3d0d423f48cf4e64 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Sun, 30 Dec 2012 00:01:50 +0200 Subject: [PATCH] Re: [PATCH] notmuch.c: run uncrustify --- 53/56a5bf303e4f2b8f8974df649277de1d8447ab | 167 ++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 53/56a5bf303e4f2b8f8974df649277de1d8447ab diff --git a/53/56a5bf303e4f2b8f8974df649277de1d8447ab b/53/56a5bf303e4f2b8f8974df649277de1d8447ab new file mode 100644 index 000000000..91685a7bb --- /dev/null +++ b/53/56a5bf303e4f2b8f8974df649277de1d8447ab @@ -0,0 +1,167 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id C6C91431FB6 + for ; Sat, 29 Dec 2012 14:02:00 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id vTcK6-hQTAXP for ; + Sat, 29 Dec 2012 14:01:57 -0800 (PST) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 1D448431FAF + for ; Sat, 29 Dec 2012 14:01:57 -0800 (PST) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 3F9571000CA; + Sun, 30 Dec 2012 00:01:50 +0200 (EET) +From: Tomi Ollila +To: david@tethera.net, notmuch@notmuchmail.org +Subject: Re: [PATCH] notmuch.c: run uncrustify +In-Reply-To: <1356536434-15179-1-git-send-email-david@tethera.net> +References: <1356536434-15179-1-git-send-email-david@tethera.net> +User-Agent: Notmuch/0.14+216~gd58661f (http://notmuchmail.org) Emacs/24.2.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +Cc: David Bremner +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 29 Dec 2012 22:02:01 -0000 + +On Wed, Dec 26 2012, david@tethera.net wrote: + +> From: David Bremner +> +> In anticipation of doing some updates to this code, it simplifies life +> if the code is "uncrustify clean" to start with +> --- + +About an year ago I did some work to preserve format +type (*funcptr) (args) +... i.e. preserve space between (*funcptr) (args) -- among some +other things uncrustify cannot do. +We could take a closer look to the whole uncrustify business +after 0.15 is out. + +Tomi + + +> notmuch.c | 23 +++++++++++------------ +> 1 file changed, 11 insertions(+), 12 deletions(-) +> +> diff --git a/notmuch.c b/notmuch.c +> index 9516dfb..ee2892e 100644 +> --- a/notmuch.c +> +++ b/notmuch.c +> @@ -22,7 +22,7 @@ +> +> #include "notmuch-client.h" +> +> -typedef int (*command_function_t) (void *ctx, int argc, char *argv[]); +> +typedef int (*command_function_t)(void *ctx, int argc, char *argv[]); +> +> typedef struct command { +> const char *name; +> @@ -39,8 +39,8 @@ typedef struct alias { +> } alias_t; +> +> alias_t aliases[] = { +> - { "part", { "show", "--format=raw"}}, +> - { "search-tags", {"search", "--output=tags", "*"}} +> + { "part", { "show", "--format=raw" } }, +> + { "search-tags", { "search", "--output=tags", "*" } } +> }; +> +> static int +> @@ -66,7 +66,7 @@ static command_t commands[] = { +> "[options...] [...]", +> "Construct a reply template for a set of messages." }, +> { "tag", notmuch_tag_command, +> - "+|- [...] [--] [...]" , +> + "+|- [...] [--] [...]", +> "Add/remove tags for all messages matching the search terms." }, +> { "dump", notmuch_dump_command, +> "[] [--] []", +> @@ -107,8 +107,8 @@ usage (FILE *out) +> +> fprintf (out, "\n"); +> fprintf (out, +> - "Use \"notmuch help \" for more details on each command\n" +> - "and \"notmuch help search-terms\" for the common search-terms syntax.\n\n"); +> + "Use \"notmuch help \" for more details on each command\n" +> + "and \"notmuch help search-terms\" for the common search-terms syntax.\n\n"); +> } +> +> void +> @@ -281,15 +281,14 @@ main (int argc, char *argv[]) +> return notmuch_help_command (NULL, argc - 1, &argv[1]); +> +> if (strcmp (argv[1], "--version") == 0) { +> - printf ("notmuch " STRINGIFY(NOTMUCH_VERSION) "\n"); +> + printf ("notmuch " STRINGIFY (NOTMUCH_VERSION) "\n"); +> return 0; +> } +> +> for (i = 0; i < ARRAY_SIZE (aliases); i++) { +> alias = &aliases[i]; +> +> - if (strcmp (argv[1], alias->name) == 0) +> - { +> + if (strcmp (argv[1], alias->name) == 0) { +> int substitutions; +> +> argv_local = talloc_size (local, sizeof (char *) * +> @@ -304,14 +303,14 @@ main (int argc, char *argv[]) +> for (j = 0; j < MAX_ALIAS_SUBSTITUTIONS; j++) { +> if (alias->substitutions[j] == NULL) +> break; +> - argv_local[j+1] = alias->substitutions[j]; +> + argv_local[j + 1] = alias->substitutions[j]; +> } +> substitutions = j; +> +> /* And copy all original arguments (skipping the argument +> * that matched the alias of course. */ +> for (j = 2; j < (unsigned) argc; j++) { +> - argv_local[substitutions+j-1] = argv[j]; +> + argv_local[substitutions + j - 1] = argv[j]; +> } +> +> argc += substitutions - 1; +> @@ -323,7 +322,7 @@ main (int argc, char *argv[]) +> command = &commands[i]; +> +> if (strcmp (argv[1], command->name) == 0) +> - return (command->function) (local, argc - 1, &argv[1]); +> + return (command->function)(local, argc - 1, &argv[1]); +> } +> +> fprintf (stderr, "Error: Unknown command '%s' (see \"notmuch help\")\n", +> -- +> 1.7.10.4 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2