Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] [Patch] General cleanup (splint)
Home

[Freeciv-Dev] [Patch] General cleanup (splint)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] [Patch] General cleanup (splint)
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 3 Feb 2002 23:39:03 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

I didn't want to review another patch so I try something new: splint
(www.splint.org). If the weak mode is restricted further the number of
warnings went down to something manageable. The attached patch is the
result to fix these:
 - unused return values: either check the result (fwrite), replace if
 with something other (client/options.c) or ignore the value
 - incomplete struct/array initializing
 - empty if block (ai/aicity.c)

Discoveries:
 - ugly things like
-GtkWidget *input_dialog_create(GtkWidget *parent, char *dialogname,
-                          char *text, char *postinputtest,
-                          void *ok_callback, gpointer ok_cli_data,
-                          void *cancel_callback, gpointer cancel_cli_data)
+GtkWidget *input_dialog_create(GtkWidget * parent, char *dialogname,
+                              char *text, char *postinputtest,
+                              GtkSignalFunc ok_callback,
+                              gpointer ok_cli_data,
+                              GtkSignalFunc cancel_callback,
+                              gpointer cancel_cli_data)

 - nobody is interested in the return values of adjust_workers,
 key_city_workers, alloc_nations, do_unit_goto
 - nobody outside client/gui-gtk/mapctrl.c is interested in adjust_workers
 - common/ioz.c was really wrong all the time. Why hasn't anybody noticed this?
 - send_packet_attribute_chunk was really wrong
 - nobody uses the return value of do_unit_goto. The return value has
 been introduced 2001/10/04. So dead code was added.
 - gui-xaw/menu.h:enum MenuID and gui-gtk/menu.c:enum MenuID look identical

IMHO this tool is nice and I will try it a second this if these
changes are in.

Comments?

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Microsoft DNS service terminates abnormally when it recieves a response
  to a DNS query that was never made.
  Fix Information: Run your DNS service on a different platform."
    -- MS service information on bugtraq

Attachment: splint_cleanup1.diff.bz2
Description: BZip2 compressed data


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