[Freeciv-Dev] Re: [RFC] [Patch] Unused parameter
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: >
> The attached patch tags unused parameter with "/*@unused@*/" which
> splint understands. This patch could act as a discussion base and to
> decide case by case what should happen with the parameter: remove it
> or keep it. For example the parameters in create_improvements_list,
> handle_move_unit and notify_about_incoming_packet should be
> removed. create_help_page should be removed altogether. In some other
> cases (get_total_attack_power, build_*_time) it indicates some
> flexibility which was never used. Should this flexibility be kept?
In the case of get_total_attack_power (see below), the flexibility should
be retained I think. Just in case some crazy soul would define a unit
whose attack was better against certain types. Although, given the
amount of trouble that pikemen produce, I hope it wouldn't happen in my
lifetime.
> Index: common/combat.c
> ===================================================================
> RCS file: /home/freeciv/CVS/freeciv/common/combat.c,v
> retrieving revision 1.9
> diff -u -r1.9 combat.c
> --- common/combat.c 2001/09/15 15:31:24 1.9
> +++ common/combat.c 2002/02/05 15:42:25
> @@ -282,7 +282,8 @@
> return the modified attack power of a unit. Currently they aren't
> any
> modifications...
>
>
***************************************************************************/
> -int get_total_attack_power(struct unit *attacker, struct unit
> *defender)
> +int get_total_attack_power(struct unit *attacker,
> + /*@unused@ */ struct unit *defender)
> {
> int attackpower = get_attack_power(attacker);
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
|
|