From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id CFF4B6DE1050 for ; Sun, 16 Jun 2019 20:57:16 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.201 X-Spam-Level: X-Spam-Status: No, score=-0.201 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2ogbatCTFPtn for ; Sun, 16 Jun 2019 20:57:15 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id 1D6A06DE0F9A for ; Sun, 16 Jun 2019 20:57:14 -0700 (PDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1560743833; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=XqeVGQhL33WMq9sBlIAf2ecoPVjXyUr0C91gzOhcDOA=; b=XxRA3f3m2TSm/16soMjAfRggy7VQwYYazV79Ff+GS1cxyzV0eJIWyxnK 2l0Id3Orl00yW5f2mhuBJUh+9czxCg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1560743833; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=XqeVGQhL33WMq9sBlIAf2ecoPVjXyUr0C91gzOhcDOA=; b=1IHcVRkCCEF9DctP0bUta/wmOV6zMbxUvYsHtL3ymz45jDsNBExD3c7k 7Lj+N2reVd88bmfO61VPnHKB2nLrnuS1O9G+U+TmADio4V/mZsrxiSyTg1 B0lW2vYT5PAObbeYH3zX9E/ouJoME4vQGH84NaaTJtKsqSaZ1v6u/KDJ3e VaX8c2ePFuKXoXsPfBoikwxgpbjmwusp4DwFbLd1DHxKaatVMZs3tUSuh7 1LYkKChG4+2FTuOXpf0eRqUIEarW87f5MqjJPPrDJp003nuIGZkexcjlLI W1/rdWMu9A9Ec3aQQksdgnHkWoPzE89himANXGxfotyUFqLFq4BLUg== Received: from fifthhorseman.net (c-73-196-69-23.hsd1.nj.comcast.net [73.196.69.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id 0492EF99E; Sun, 16 Jun 2019 23:57:12 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 6BAE02045A; Sun, 16 Jun 2019 13:09:48 -0400 (EDT) From: Daniel Kahn Gillmor To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH 3/8] CLI: replace some constructs with more uncrustify friendly ones In-Reply-To: <20190613110837.6256-4-david@tethera.net> References: <20190613110837.6256-1-david@tethera.net> <20190613110837.6256-4-david@tethera.net> Autocrypt: addr=dkg@fifthhorseman.net; prefer-encrypt=mutual; keydata= mDMEXEK/AhYJKwYBBAHaRw8BAQdAr/gSROcn+6m8ijTN0DV9AahoHGafy52RRkhCZVwxhEe0K0Rh bmllbCBLYWhuIEdpbGxtb3IgPGRrZ0BmaWZ0aGhvcnNlbWFuLm5ldD6ImQQTFggAQQIbAQUJA8Jn AAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBMS8Lds4zOlkhevpwvIGkReQOOXGBQJcQsbzAhkB AAoJEPIGkReQOOXG4fkBAO1joRxqAZY57PjdzGieXLpluk9RkWa3ufkt3YUVEpH/AP9c+pgIxtyW +FwMQRjlqljuj8amdN4zuEqaCy4hhz/1DbgzBFxCv4sWCSsGAQQB2kcPAQEHQERSZxSPmgtdw6nN u7uxY7bzb9TnPrGAOp9kClBLRwGfiPUEGBYIACYWIQTEvC3bOMzpZIXr6cLyBpEXkDjlxgUCXEK/ iwIbAgUJAeEzgACBCRDyBpEXkDjlxnYgBBkWCAAdFiEEyQ5tNiAKG5IqFQnndhgZZSmuX/gFAlxC v4sACgkQdhgZZSmuX/iVWgD/fCU4ONzgy8w8UCHGmrmIZfDvdhg512NIBfx+Mz9ls5kA/Rq97vz4 z48MFuBdCuu0W/fVqVjnY7LN5n+CQJwGC0MIA7QA/RyY7Sz2gFIOcrns0RpoHr+3WI+won3xCD8+ sVXSHZvCAP98HCjDnw/b0lGuCR7coTXKLIM44/LFWgXAdZjm1wjODbg4BFxCv50SCisGAQQBl1UB BQEBB0BG4iXnHX/fs35NWKMWQTQoRI7oiAUt0wJHFFJbomxXbAMBCAeIfgQYFggAJhYhBMS8Lds4 zOlkhevpwvIGkReQOOXGBQJcQr+dAhsMBQkB4TOAAAoJEPIGkReQOOXGe/cBAPlek5d9xzcXUn/D kY6jKmxe26CTws3ZkbK6Aa5Ey/qKAP0VuPQSCRxA7RKfcB/XrEphfUFkraL06Xn/xGwJ+D0hCw== Date: Sun, 16 Jun 2019 13:09:47 -0400 Message-ID: <87blyx1mp0.fsf@fifthhorseman.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Mon, 17 Jun 2019 03:57:16 -0000 --=-=-= Content-Type: text/plain On Thu 2019-06-13 08:08:32 -0300, David Bremner wrote: > - add parens in some ternery operators itym "ternary" > @@ -120,13 +120,13 @@ _process_string_arg (const notmuch_opt_desc_t *arg_desc, char next, const char * > static int _opt_set_count (const notmuch_opt_desc_t *opt_desc) > { > return > - !!opt_desc->opt_inherit + > - !!opt_desc->opt_bool + > - !!opt_desc->opt_int + > - !!opt_desc->opt_keyword + > - !!opt_desc->opt_flags + > - !!opt_desc->opt_string + > - !!opt_desc->opt_position; > + (bool) opt_desc->opt_inherit + > + (bool) opt_desc->opt_bool + > + (bool) opt_desc->opt_int + > + (bool) opt_desc->opt_keyword + > + (bool) opt_desc->opt_flags + > + (bool) opt_desc->opt_string + > + (bool) opt_desc->opt_position; > } i find this is deeply weird. It looks like it is coercing various types into bools, and then summing a list of bools. While the spec might well say that the sum of two bools should be an int (i haven't checked), it's not at all obvious to me that the infix + operator should assume that type. (float + float is a float, not an int, for example) in some sense, the !! operator works better here because i know that its output is likely to be an int, so summing makes sense. I can live with this if we need it for making uncrustify nicer, but i just wanted to register that it looks to me like a regression in terms of readability. --dkg --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQTJDm02IAobkioVCed2GBllKa5f+AUCXQZ33AAKCRB2GBllKa5f +O9NAQC9/llkYKomOLCWlajLFafOJSCy6JtL+7cd2SHZ2LjC2wEAu0EH+I1sBwjC s5qobnzsA7RtSu1YR/okQnynCZvPZQA= =9Gat -----END PGP SIGNATURE----- --=-=-=--