Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2002:
[Freeciv-Dev] [PATCH] bool cleanup (PR#1310)
Home

[Freeciv-Dev] [PATCH] bool cleanup (PR#1310)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Cc: bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] [PATCH] bool cleanup (PR#1310)
From: Markus Linnala <maage@xxxxxxxxx>
Date: Sun, 10 Mar 2002 07:55:53 -0800 (PST)

Boolean cleanup mainly on static functions.

diff -ur -X freeciv/diff_ignore freeciv/common/inputfile.c 
freeciv-bool-cleanup/common/inputfile.c
--- freeciv/common/inputfile.c  Tue Mar  5 17:46:00 2002
+++ freeciv-bool-cleanup/common/inputfile.c     Sun Mar 10 17:52:55 2002
@@ -136,7 +136,7 @@
   { "value",        get_token_value },
 };
 
-static int read_a_line(struct inputfile *inf);
+static bool read_a_line(struct inputfile *inf);
 
 /********************************************************************** 
   Return true if c is a 'comment' character: '#' or ';'
diff -ur -X freeciv/diff_ignore freeciv/common/unit.h 
freeciv-bool-cleanup/common/unit.h
--- freeciv/common/unit.h       Wed Feb 27 13:12:25 2002
+++ freeciv-bool-cleanup/common/unit.h  Sun Mar 10 17:53:29 2002
@@ -201,7 +201,7 @@
 void set_unit_activity_targeted(struct unit *punit,
                                enum unit_activity new_activity, int 
new_target);
 bool can_unit_do_auto(struct unit *punit); 
-int is_unit_activity_on_tile(enum unit_activity activity, int x, int y);
+bool is_unit_activity_on_tile(enum unit_activity activity, int x, int y);
 int get_unit_tile_pillage_set(int x, int y);
 bool is_military_unit(struct unit *punit);           /* !set !dip !cara */
 bool is_diplomat_unit(struct unit *punit);
diff -ur -X freeciv/diff_ignore freeciv/server/cityturn.c 
freeciv-bool-cleanup/server/cityturn.c
--- freeciv/server/cityturn.c   Fri Mar  8 19:06:25 2002
+++ freeciv-bool-cleanup/server/cityturn.c      Sun Mar 10 17:52:55 2002
@@ -50,14 +50,14 @@
 static void check_pollution(struct city *pcity);
 static void city_populate(struct city *pcity);
 
-static int worklist_change_build_target(struct player *pplayer, 
+static bool worklist_change_build_target(struct player *pplayer, 
                                        struct city *pcity);
 
 static void city_distribute_surplus_shields(struct player *pplayer,
                                            struct city *pcity);
-static int city_build_building(struct player *pplayer, struct city *pcity);
-static int city_build_unit(struct player *pplayer, struct city *pcity);
-static int city_build_stuff(struct player *pplayer, struct city *pcity);
+static bool city_build_building(struct player *pplayer, struct city *pcity);
+static bool city_build_unit(struct player *pplayer, struct city *pcity);
+static bool city_build_stuff(struct player *pplayer, struct city *pcity);
 static int improvement_upgrades_to(struct city *pcity, int imp);
 static void upgrade_building_prod(struct city *pcity);
 static Unit_Type_id unit_upgrades_to(struct city *pcity, Unit_Type_id id);
diff -ur -X freeciv/diff_ignore freeciv/server/diplomats.c 
freeciv-bool-cleanup/server/diplomats.c
--- freeciv/server/diplomats.c  Fri Mar  8 19:06:26 2002
+++ freeciv-bool-cleanup/server/diplomats.c     Sun Mar 10 17:52:55 2002
@@ -37,7 +37,7 @@
 /****************************************************************************/
 
 static void diplomat_charge_movement (struct unit *pdiplomat, int x, int y);
-static int diplomat_success_vs_defender (struct unit *pdefender);
+static bool diplomat_success_vs_defender (struct unit *pdefender);
 static bool diplomat_infiltrate_city (struct player *pplayer, struct player 
*cplayer,
                                     struct unit *pdiplomat, struct city 
*pcity);
 static void diplomat_escape (struct player *pplayer, struct unit *pdiplomat,
diff -ur -X freeciv/diff_ignore freeciv/server/gotohand.c 
freeciv-bool-cleanup/server/gotohand.c
--- freeciv/server/gotohand.c   Wed Feb 27 13:12:28 2002
+++ freeciv-bool-cleanup/server/gotohand.c      Sun Mar 10 17:52:55 2002
@@ -68,7 +68,7 @@
 static void make_list_of_refuel_points(struct player *pplayer);
 static void dealloc_refuel_stack(void);
 static bool find_air_first_destination(struct unit *punit, int *dest_x, int 
*dest_y);
-static int airspace_looks_safe(int x, int y, struct player *pplayer);
+static bool airspace_looks_safe(int x, int y, struct player *pplayer);
 
 /* These are used for all GOTO's */
 
diff -ur -X freeciv/diff_ignore freeciv/server/settlers.c 
freeciv-bool-cleanup/server/settlers.c
--- freeciv/server/settlers.c   Fri Mar  8 16:28:31 2002
+++ freeciv-bool-cleanup/server/settlers.c      Sun Mar 10 17:52:55 2002
@@ -45,8 +45,8 @@
 
 static void auto_settlers_player(struct player *pplayer); 
 
-static int is_already_assigned(struct unit *myunit, struct player *pplayer, 
-                              int x, int y);
+static bool is_already_assigned(struct unit *myunit, struct player *pplayer, 
+                               int x, int y);
 
 
 /**************************************************************************
diff -ur -X freeciv/diff_ignore freeciv/server/srv_main.c 
freeciv-bool-cleanup/server/srv_main.c
--- freeciv/server/srv_main.c   Thu Mar  7 07:24:34 2002
+++ freeciv-bool-cleanup/server/srv_main.c      Sun Mar 10 17:52:55 2002
@@ -100,7 +100,7 @@
 static void end_turn(void);
 static void send_all_info(struct conn_list *dest);
 static void ai_start_turn(void);
-static int is_game_over(void);
+static bool is_game_over(void);
 static void save_game_auto(void);
 static void generate_ai_players(void);
 static int mark_nation_as_used(int nation);
diff -ur -X freeciv/diff_ignore freeciv/server/unittools.c 
freeciv-bool-cleanup/server/unittools.c
--- freeciv/server/unittools.c  Thu Mar  7 07:24:34 2002
+++ freeciv-bool-cleanup/server/unittools.c     Sun Mar 10 17:52:55 2002
@@ -58,7 +58,7 @@
 static void unit_restore_movepoints(struct player *pplayer, struct unit 
*punit);
 static void update_unit_activity(struct unit *punit);
 static void wakeup_neighbor_sentries(struct unit *punit);
-static int upgrade_would_strand(struct unit *punit, int upgrade_type);
+static bool upgrade_would_strand(struct unit *punit, int upgrade_type);
 static void handle_leonardo(struct player *pplayer);
 
 static void sentry_transported_idle_units(struct unit *ptrans);
@@ -70,7 +70,7 @@
                                                        struct unit *punit2);
 static bool is_airunit_refuel_point(int x, int y, struct player *pplayer,
                                   Unit_Type_id type, bool unit_is_on_tile);
-static int maybe_cancel_patrol_due_to_enemy(struct unit *punit);
+static bool maybe_cancel_patrol_due_to_enemy(struct unit *punit);
 
 /**************************************************************************
   returns a unit type with a given role, use -1 if you don't want a tech 
diff -ur -X freeciv/diff_ignore freeciv/server/unittools.h 
freeciv-bool-cleanup/server/unittools.h
--- freeciv/server/unittools.h  Sun Feb 24 12:44:54 2002
+++ freeciv-bool-cleanup/server/unittools.h     Sun Mar 10 17:52:55 2002
@@ -74,8 +74,8 @@
 /* doing a unit activity */
 void do_nuclear_explosion(struct player *pplayer, int x, int y);
 bool try_move_unit(struct unit *punit, int dest_x, int dest_y); 
-int do_airline(struct unit *punit, struct city *city2);
-int do_paradrop(struct unit *punit, int dest_x, int dest_y);
+bool do_airline(struct unit *punit, struct city *city2);
+bool do_paradrop(struct unit *punit, int dest_x, int dest_y);
 void assign_units_to_transporter(struct unit *ptrans, bool take_from_land);
 bool move_unit(struct unit *punit, int dest_x, int dest_y,
              bool transport_units, bool take_from_land, int move_cost);

-- 
//Markus



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] [PATCH] bool cleanup (PR#1310), Markus Linnala <=