From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gerlando Falauto Date: Tue, 08 Nov 2011 11:20:47 +0100 Subject: [U-Boot] Continuation line alignment In-Reply-To: <4EB8708D.1050405@freescale.com> References: <1319647072-17504-1-git-send-email-gerlando.falauto@keymile.com> <1319647072-17504-2-git-send-email-gerlando.falauto@keymile.com> <20111105160958.F40D11893014@gemini.denx.de> <4EB84859.6000906@keymile.com> <20111107220505.E5386189301B@gemini.denx.de> <4EB86384.7010409@freescale.com> <4EB86AA8.30901@keymile.com> <4EB8708D.1050405@freescale.com> Message-ID: <4EB9027F.808@keymile.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11/08/2011 12:58 AM, Scott Wood wrote: > I like aligning based on which level of nested parens the line break is > in (and removing unnecessary parens when precedence is obvious, to make > it easier to track the relevant ones): > > if ((day_of_week() % 2 == 0&& > (temperature()< 14.4 || temperature()> 15.3)) || > (sky_color() == E_BLUE&& sim_credit() % 100 != 27) || > uptime()< 3600) { > work = 1; > } else if ((received_calls()> 1&& > zenith_angle() == 0) || > call_is_important()) { > work = 0; > } else { > udelay(rand()); > work = ((rand() % 2) == 1); > } I like that too. Anyway... Are there are any guidelines for indenting comments on the right side of the code? Like: if ((day_of_week() % 2 == 0 && /* even days are OK */ (temperature() < 14.4 || temperature() > 15.3)) || /* * but only outside of a * certain temp. range */ (sky_color() == E_BLUE && sim_credit() % 100 != 27) || /* * or, it's a nice a day * but balance does not * have 27 cents as * decimal part */ uptime() < 3600) { /* work 4 the 1st hr! */ work = 1; } else if ((received_calls() > 1 && zenith_angle() == 0) || call_is_important()) { work = 0; } else { udelay(rand()); work = ((rand() % 2) == 1); } ... becuase git-gui will interpret all tabs which are on the right of some non-whitespace text in a very weird way. Is using tabs on the right of text forbidden/not recommended for some reason? Thanks! Gerlando Falauto