List Info

Thread: Re: Coding guidelines change (proposed)




Re: Coding guidelines change (proposed)
user name
2008-02-26 14:36:51
Tzafrir Cohen пишет:
> On Tue, Feb 26, 2008 at 11:06:31PM +0300, Sergey
Tamkovich wrote:
>   
>> Tzafrir Cohen пишет:
>>     
>>> On Tue, Feb 26, 2008 at 11:46:37AM -0600,
Tilghman Lesher wrote:
>>>   
>>>       
>
>   
>>>> While this
>>>> is legal C, it has caused a number of
issues in the past, where another
>>>> statement was added at that indentation
level, but without adding the
>>>> necessary braces.
>>>>         
>>> Could you please point to one or two such
cases?
>>>
>>> Current coding guidelines already require that
a nested block will have
>>> braces. I wonder if those issues are related to
bad indentation.
>>>
>>>       
>> micron:/usr/src/asterisk-1.4 # grep if */*.c | grep
-v "{"
>>
>> apps/app_dial.c
>>
>> 435 if (option_verbose > 2)
>> 436 ast_verbose( VERBOSE_PREFIX_2 "Everyone is
busy/congested at this 
>> time (%d:%d/%d/%d)n", numlines, numbusy,
numcongestion, numnochan);
>>     
>
> So you're saying that there's bad indentation here?
>
> Bad indentation is something that should be fixed
regardless.
>
> Is the following code clear to you?
>
> #ifdef WE_CAN_DO_FOO
> if (!foo->bar) {
> #endif
> 	a()
> 	b()
> 	c()
> #ifdef WE_CAN_DO_FOO
> }
> #endif
>
>   
Sorry, my previous message was useless, i thought i want an
example of 
code where braces are missing.


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )