[U-Boot] Continuation line alignment

Scott Wood scottwood at freescale.com
Tue Nov 8 00:44:28 CET 2011


On 11/07/2011 05:32 PM, Gerlando Falauto wrote:
> On 11/08/2011 12:02 AM, Scott Wood wrote:
>> Documentation/CodingStyle calls for something like this:
>>
>> 	if (himport_ex(&env_htab, (char *)default_environment,
>> 				sizeof(default_environment), '\0',
>> 				0, 0, NULL, apply_function) == 0) {
> 
> I would have thought this would make more sense (offset by 1, not 9):
> 
> 	if (himport_ex(&env_htab, (char *)default_environment,
> 			sizeof(default_environment), '\0',
> 			0, 0, NULL, apply_function) == 0) {

Documentation/CodingStyle simply says continuation lines "are always
substantially shorter than the parent and are placed substantially to
the right".

> Or maybe even:
> 
> 	if (himport_ex(&env_htab, (char *)default_environment,
> 		sizeof(default_environment), '\0',
> 		0, 0, NULL, apply_function) == 0) {
> 
> which would save a lot of screen real estate.

It would also make it harder to distinguish the continuation lines from
the if-body:

	if (himport_ex(...
		sizeof(...
		0, 0, ...) {
		body goes here, at the same column
		have to look for the brace to distinguish
	}

-Scott



More information about the U-Boot mailing list