Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2002:
[Freeciv-Dev] Re: (PR#2566) PATCH: clean up handle_upgrade_unittype_requ
Home

[Freeciv-Dev] Re: (PR#2566) PATCH: clean up handle_upgrade_unittype_requ

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Erik.Sigra@xxxxxxxxxxxxxx
Cc: freeciv@xxxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#2566) PATCH: clean up handle_upgrade_unittype_request
From: "Mike Kaufman via RT" <rt@xxxxxxxxxxxxxx>
Date: Thu, 19 Dec 2002 12:34:07 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Thu, Dec 19, 2002 at 12:13:50PM -0800, Guest via RT wrote:
> 
> [jdorje - Thu Dec 19 18:58:36 2002]: 
>  
> I changed this too. But normally I would never use a declaration like 
>  
> void handle_upgrade_unittype_request(struct player * const pplayer, 
>                                      const struct packet_unittype_info 
> * const 
>                                      packet) 
>  
> Refusing to linewrap between identifier and argument list only gets 
> uglier the longer the function name is. And with calls (as opposed to 
> declarations) it gets even worse, for example: 
>  
> /* indentation */ the_first_function(the_second_function(an_argument, 
>                                                          another_arg, 
>                                                          yet_another          
>                                                 
>                                                          [index]), 
>                                      last_argument_to_first_function); 
>  
>  
> I consider this to be much nicer: 
>  
> /* indentation */ the_first_function 
>                     (the_second_function 
>                        (an_argument, another_arg, yet_another[index]), 
>                      last_argument_to_first_function); 
>  
>  
> The root of the problem is that when refusing to linewrap between 
> identifier and argument list the column number increases with the 
> lengt of the identifier for each nesting level instead of with a small 
> constant amount. 

I'm not fundamentally opposed to:

void handle_upgrade_unittype_request(struct player * const pplayer, 
                          const struct packet_unittype_info * const packet) 

or 

/* indentation */ the_first_function(the_second_function(an_argument, 
                                       another_arg, yet_another[index]),
                                     last_argument_to_first_function);

but if you variables are that long anyway, then we've got other problems...

btw, you should have an empty line between variable declaration and the
rest of the function block, but I imagine the committer can take care of
that.

-mike



[Prev in Thread] Current Thread [Next in Thread]