Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [RFC] [Patch] Unused parameter
Home

[Freeciv-Dev] Re: [RFC] [Patch] Unused parameter

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raimar Falke <rfalke@xxxxxxxxxxxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [RFC] [Patch] Unused parameter
From: Mike Kaufman <mkaufman@xxxxxxxxxxxxxx>
Date: Tue, 5 Feb 2002 22:11:59 -0600

On Tue, Feb 05, 2002 at 04:51:42PM +0100, Raimar Falke 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?
> 

the pdialog should go. obviously that was there before we passed in the
labels themselves. I'll fix that when I commit that other citydlg patch.

The print usage should stay, only because that entire function is kinda
useless. Truly, it's only use could be moved into civclient.c, but it's
there as a placeholder. If it does ever get used, it'll need the
parameter.

-mike


> RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/citydlg.c,v
> retrieving revision 1.110
> diff -u -r1.110 citydlg.c
> --- client/gui-gtk/citydlg.c  2002/02/02 09:21:34     1.110
> +++ client/gui-gtk/citydlg.c  2002/02/05 15:42:18
> @@ -537,7 +537,7 @@
>   **info_label points to the info_label in the respective struct
>  ****************************************************************/
>  static GtkWidget *create_city_info_table(GtkWidget ** info_label,
> -                                      struct city_dialog *pdialog)
> +                                      /*@unused@ */ struct city_dialog 
> *pdialog)
>  {
>    int i;
>    GtkWidget *hbox, *table, *label;
> ===================================================================
> RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk/gui_main.c,v
> retrieving revision 1.95
> diff -u -r1.95 gui_main.c
> --- client/gui-gtk/gui_main.c 2002/01/28 04:41:39     1.95
> +++ client/gui-gtk/gui_main.c 2002/02/05 15:42:22
> @@ -160,7 +160,7 @@
>    Print extra usage information, including one line help on each option,
>    to stderr. 
>  **************************************************************************/
> -static void print_usage(const char *argv0)
> +static void print_usage(/*@unused@ */ const char *argv0)
>  {
>    /* add client-specific usage information here */
>    fprintf(stderr, _("Report bugs to <%s>.\n"), BUG_EMAIL_ADDRESS);
> @@ -1067,7 +1067,9 @@
>  /**************************************************************************


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