From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com [IPv6:2a00:1450:400c:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id ED06021DF37A9 for ; Sat, 12 Aug 2017 03:11:28 -0700 (PDT) Received: by mail-wm0-x22b.google.com with SMTP id i66so8975135wmg.0 for ; Sat, 12 Aug 2017 03:13:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Oxeo+gkljhC8IR0hGZiSvaqeatYMVhZ1IwPR44gEzMY=; b=GdvttpXx8/Xo6vo82H0UEVUKJOe9ZlLZZxezNyygl3yQfzaPUVIfNuAZ6ohDSPsAFw ogE9iPyAuKqWc1RTFyCZUcs4hUXn9UiMZ5mXgMZEFWhxrYAs6QAi7m/XmTEro033PHhA PIyDIhwUXCzcolAJCdVQEi4sa7bMe587aeTiM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Oxeo+gkljhC8IR0hGZiSvaqeatYMVhZ1IwPR44gEzMY=; b=VhYv6m2QnfMjLGbNp2KuykqjvLXIlgMpbpGYrGTBtwW4BISvXzps3a2T/e0mbslZbI tjB+Jp3N/587gdteouK/uKgldID+xybELYL1cxccOwCzBergyYE/EHxQrdm57V7nuwFa 7sjmjq1qMyrrnCap27QFrXIHx1xmANe7NlebPUt5pvus4M/7T6+X/sw3bOcK44+FSJwg DkE8PyDGxwparFRK0jd9YAFIqtOix6ysHN498wXFVdKRlO1Tv3D0Z4Hn6c0GtHI21X0z XOwbXG7abGfqtkNmTnuZmsqsO9iclCl600cdopGupH4ZAPPVZsCE7ijHZCKfOONdEqL8 SyQQ== X-Gm-Message-State: AHYfb5hEigh3IwAy5SNsYAT8b12/PtY9mtkm3nSEVv9ulnP64twbPX3s 6/6K+iWEm04GPZds X-Received: by 10.28.212.147 with SMTP id l141mr867367wmg.13.1502532829114; Sat, 12 Aug 2017 03:13:49 -0700 (PDT) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id b25sm3129648wrb.79.2017.08.12.03.13.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Aug 2017 03:13:48 -0700 (PDT) Date: Sat, 12 Aug 2017 11:13:46 +0100 From: Leif Lindholm To: Jordan Justen Cc: Laszlo Ersek , edk2-devel-01 , Michael D Kinney , Ard Biesheuvel Message-ID: <20170812101346.6tw7rcs2c7trit2p@bivouac.eciton.net> References: <20170811164851.9466-1-lersek@redhat.com> <20170811164851.9466-3-lersek@redhat.com> <150248431260.29687.8219608274582743547@jljusten-skl> MIME-Version: 1.0 In-Reply-To: <150248431260.29687.8219608274582743547@jljusten-skl> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [edk2-CCodingStandardsSpecification PATCH 2/2] Source Files / Spacing / Multi-line func. calls: allow condensed arguments X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Aug 2017 10:11:29 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Aug 11, 2017 at 01:45:12PM -0700, Jordan Justen wrote: > > +Use this line breaking style especially if it saves a format string or complex > > +argument from being split, or when commenting on individual arguments. > > + > > +##### 5.2.2.4.2 The "condensed arguments" style > > + > > +For most function calls and function-like macro invocations, the "one argument > > +per line" style uses up valuable vertical space without utilizing readily > > +available horizontal space. Such statements are permitted to condense the > > +arguments and the closing parenthesis (or parentheses), up to the allowed line > > +length. The indentation requirements are identical to those of the "one > > +argument per line" style. > > + > > +```c > > +CopyMem (Destination, Source, SIZE_4KB); > > + > > +Status = gBS->AllocatePool (EfiBootServicesData, sizeof (DRIVER_NAME_INSTANCE), > > + &PrivateData); > > I prefer that we just have one style, and just drop the requirement > that multiline param lists can only have one arg per line. I think it > is good to have the first param start on the next line in this case. > > Status = gBS->AllocatePool ( > EfiBootServicesData, sizeof (DRIVER_NAME_INSTANCE), > &PrivateData); I like this one better than Laszlo's proposal, since it keeps the start of each line of parameters in the same column. > This compacts things somewhat, but still keeps the parameter list > aligned horizontally on subsequent lines. > > Regarding the closing parens being on a separate line, I think we > should also remove that as a requirement. I would also support that change. > I think you might want to break out the multiple params per line and > closing parens change out to allow for separate discussion. That would make sense. Laszlo - many thanks to starting this discussion! / Leif