[empire] 02/06: Imported Upstream version 1.14

Markus Koschany apo-guest at moszumanska.debian.org
Tue Jan 5 12:33:19 UTC 2016


This is an automated email from the git hooks/post-receive script.

apo-guest pushed a commit to branch master
in repository empire.

commit 88c15160ae404f68ed1abb60c984f3a9ca2f7068
Author: Markus Koschany <apo at debian.org>
Date:   Tue Jan 5 13:12:59 2016 +0100

    Imported Upstream version 1.14
---
 Makefile       |  5 ++++-
 NEWS           | 15 +++++++++-----
 attack.c       |  5 +++--
 compmove.c     | 36 ++++++++++++++++-----------------
 control        | 14 ++++++++-----
 display.c      |  6 +++---
 edit.c         | 20 +++++++++---------
 empire.6       | 12 ++++++-----
 empire.c       |  2 +-
 game.c         | 32 +++++++++++++++++++----------
 map.c          |  4 ++--
 object.c       | 25 +++++++++--------------
 term.c         |  8 +++-----
 usermove.c     | 64 ++++++++++++++++++++++++++++++++--------------------------
 util.c         |  8 +++++---
 vms-empire.xml |  4 +++-
 16 files changed, 144 insertions(+), 116 deletions(-)

diff --git a/Makefile b/Makefile
index 8158eb7..966604a 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
 # See the file COPYING, distributed with empire, for restriction
 # and warranty information.
 
-VERS=1.13
+VERS=1.14
 
 # Use -g to compile the program for debugging.
 #DEBUG = -g -DDEBUG
@@ -128,3 +128,6 @@ dist: vms-empire-$(VERS).tar.gz
 
 release: vms-empire-$(VERS).tar.gz vms-empire.html
 	shipper version=$(VERS) | sh -e -x
+
+refresh: vms-empire.html
+	shipper -N -w version=$(VERS) | sh -e -x
diff --git a/NEWS b/NEWS
index 566c8a5..759412f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,24 +1,29 @@
 			vms-empire news
 
-1.13: 2014-12-14:
+1.14: 2016-01-05 06:49:17Z
+        Add an identifying magic cookie and version to save files.
+        Full ANSI prototypes for private functions as well as public.
+	Markup fix for probability table.
+
+1.13: 2014-12-14T17:06:26Z
 	Comment on entry to and exit from edit mode.
 	Cleaned up packaging and install/uninstall productions.
 
-1.12: 2014-05-20:
+1.12: 2014-05-20T09:03:09Z
 	Incorporated Dennis Pinckard's fix for a Mac OS/X port bug.
 	Added desktop file.
 
-1.11: 2013-12-31T17:28:06
+1.11: 2013-12-31T17:31:04Z
 	Clean up code to modern C, apply cppcheck.
 	Fix code typo reported as Debian bug #593434
 
-1.10: 2013-08-22T23:46:03
+1.10: 2013-08-22T23:47:21Z
 	Fix core dump when a satellite bounced off the world edge.
 	Full ANSIfication of function prototypes (which fixed the 
 	sat bug - the code appears to have been tickling some obscure
 	bug in the compilation of function calls with K&R-style prototypes).
 
-1.9: 2012-02-16T02:49:47
+1.9: 2012-02-16T22:59:22Z
 	Drop RPM packaging. Documentation cleanups.
 
 1.8: 2010-10-21T12:47:33Z
diff --git a/attack.c b/attack.c
index e313187..d17895e 100644
--- a/attack.c
+++ b/attack.c
@@ -79,8 +79,9 @@ First we have to figure out what is being attacked.
 void
 attack_obj(piece_info_t *att_obj, loc_t loc)
 {
-    void describe(), survive();
-	
+    void describe(piece_info_t *, piece_info_t *, loc_t);
+    void survive(piece_info_t *, loc_t);
+
     piece_info_t *def_obj; /* defender */
     int owner;
 
diff --git a/compmove.c b/compmove.c
index 6aa588d..eeb5949 100644
--- a/compmove.c
+++ b/compmove.c
@@ -34,7 +34,7 @@ void comp_prod(city_info_t *, bool);
 void
 comp_move(int nmoves) 
 {
-    void do_cities(), do_pieces(), check_endgame();
+    void do_cities(void), do_pieces(void), check_endgame(void);
 
     int i;
     piece_info_t *obj;
@@ -366,7 +366,7 @@ static path_map_t path_map[MAP_SIZE];
 void
 do_pieces(void) 
 {
-    void cpiece_move();
+    void cpiece_move(piece_info_t *);
 
     int i;
     piece_info_t *obj, *next_obj;
@@ -389,12 +389,10 @@ objective.
 void
 cpiece_move(piece_info_t *obj)
 {
-    void move1();
+    void move1(piece_info_t *);
 
     bool changed_loc;
     int max_hits;
-    loc_t saved_loc;
-    city_info_t *cityp;
 
     if (obj->type == SATELLITE) {
 	move_sat (obj);
@@ -406,11 +404,12 @@ cpiece_move(piece_info_t *obj)
     max_hits = piece_attr[obj->type].max_hits;
 
     if (obj->type == FIGHTER) { /* init fighter range */
-	cityp = find_city (obj->loc);
+	city_info_t *cityp = find_city (obj->loc);
 	if (cityp != NULL) obj->range = piece_attr[FIGHTER].range;
     }
 	
     while (obj->moved < obj_moves (obj)) {
+	loc_t saved_loc;
 	saved_loc = obj->loc; /* remember starting location */
 	move1 (obj);
 	if (saved_loc != obj->loc) changed_loc = true;
@@ -441,7 +440,8 @@ Move a piece one square.
 void
 move1(piece_info_t *obj)
 {
-    void army_move(), transport_move(), fighter_move(), ship_move();
+    void army_move(piece_info_t *), transport_move(piece_info_t *);
+    void fighter_move(piece_info_t *), ship_move(piece_info_t *);
 
     switch (obj->type) {
     case ARMY: army_move (obj); break;
@@ -483,10 +483,12 @@ destination.  (If there is no destination, sit around and wait.)
 void
 army_move(piece_info_t *obj)
 {
-    loc_t move_away();
-    loc_t find_attack();
-    void make_army_load_map(), make_unload_map(), make_tt_load_map();
-    void board_ship();
+    loc_t move_away(view_map_t *, loc_t, char *);
+    loc_t find_attack(loc_t, char *, char *);
+    void make_army_load_map(piece_info_t *, view_map_t *, view_map_t *);
+    void make_unload_map(view_map_t *, view_map_t *);
+    void make_tt_load_map(view_map_t *, view_map_t *);
+    void board_ship(piece_info_t *, path_map_t *, loc_t);
 	
     loc_t new_loc;
     path_map_t path_map2[MAP_SIZE];
@@ -760,12 +762,11 @@ load_army(piece_info_t *obj)
 {
     piece_info_t *p;
     int i;
-    loc_t x_loc;
 
     p = find_best_tt (obj->ship, obj->loc); /* look here first */
 
     for (i = 0; i < 8; i++) { /* try surrounding squares */
-	x_loc = obj->loc + dir_offset[i];
+	loc_t x_loc = obj->loc + dir_offset[i];
 	if (map[x_loc].on_board)
 	    p = find_best_tt (p, x_loc);
 
@@ -792,11 +793,10 @@ the correct terrain.
 loc_t
 move_away(view_map_t *vmap, loc_t loc, char *terrain)
 {
-    loc_t new_loc;
     int i;
 
     for (i = 0; i < 8; i++) {
-	new_loc = loc + dir_offset[i];
+	loc_t new_loc = loc + dir_offset[i];
 	if (map[new_loc].on_board
 	    && strchr (terrain, vmap[new_loc].contents))
 	    return (new_loc);
@@ -815,14 +815,14 @@ best of these.
 loc_t
 find_attack(loc_t loc, char *obj_list, char *terrain)
 {
-    loc_t new_loc, best_loc;
+    loc_t best_loc;
     int i, best_val;
     char *p;
 
     best_loc = loc; /* nothing found yet */
     best_val = INFINITY;
     for (i = 0; i < 8; i++) {
-	new_loc = loc + dir_offset[i];
+	loc_t new_loc = loc + dir_offset[i];
 
 	if (map[new_loc].on_board /* can we move here? */
 	    && strchr (terrain, map[new_loc].contents)) {
@@ -851,8 +851,6 @@ Transports become 'loading' when empty, and 'unloading' when full.
 void
 transport_move(piece_info_t *obj)
 {
-    void tt_do_move();
-
     loc_t new_loc;
 
     /* empty transports can attack */
diff --git a/control b/control
index 19c1142..a94ff05 100644
--- a/control
+++ b/control
@@ -3,7 +3,7 @@
 
 Package: vms-empire
 
-Description: The ancestor of all 4x (expand/explore/exploit/exterminate) games.
+Description: The ancestor of all expand/explore/exploit/exterminate games.
  Empire is a simulation of a full-scale war between two emperors, the
  computer and you.  Naturally, there is only room for one, so the
  object of the game is to destroy the other.  The computer plays by the
@@ -11,17 +11,21 @@ Description: The ancestor of all 4x (expand/explore/exploit/exterminate) games.
  expand/explore/exploit/exterminate games, including Civilization and
  Master of Orion.
 
-XBS-Destinations: freecode
+#XBS-Destinations: freshcode
 
 Homepage: http://www.catb.org/~esr/vms-empire
 
 XBS-HTML-Target: index.html
 
-XBS-Gitorious-URL: https://gitorious.org/vms-empire
+XBS-Repository-URL: http://thyrsus.com/gitweb/?p=vms-empire.git
 
-XBS-Ohloh-URL: https://www.ohloh.net/p/vms-empire
+XBS-Developer-Clone: git at thyrsus.com:vms-empire
 
-XBS-Freecode-Tags: Games/Entertainment
+XBS-Anonymous-Clone: git://thyrsus.com/repositories/vms-empire.git
+
+XBS-OpenHub-URL: https://www.openhub.net/p/vms-empire
+
+#XBS-Project-Tags: Games/Entertainment
 
 XBS-Logo: vms-empire.png
 
diff --git a/display.c b/display.c
index 7811815..0ef7d78 100644
--- a/display.c
+++ b/display.c
@@ -232,7 +232,7 @@ void
 print_sector(int whose, view_map_t vmap[], int sector)
 /* whose is USER or COMP, vmap is map to display, sector is sector to display */
 {
-    void display_screen();
+    void display_screen(view_map_t []);
 
     int first_row, first_col, last_row, last_col;
     int display_rows, display_cols;
@@ -437,7 +437,7 @@ char zoom_list[] = "XO*tcbsdpfaTCBSDPFAzZ+. ";
 void
 print_zoom(view_map_t *vmap)
 {
-    void print_zoom_cell ();
+    void print_zoom_cell (view_map_t *, int, int, int, int);
 
     int row_inc, col_inc;
     int r, c;
@@ -485,7 +485,7 @@ Print a condensed version of a pathmap.
 void
 print_pzoom(char *s, path_map_t *pmap, view_map_t *vmap)
 {
-    void print_pzoom_cell();
+    void print_pzoom_cell(path_map_t *, view_map_t *, int, int, int, int);
 
     int row_inc, col_inc;
     int r, c;
diff --git a/edit.c b/edit.c
index 9c12da3..e27be69 100644
--- a/edit.c
+++ b/edit.c
@@ -22,22 +22,24 @@ extern int get_piece_name(void);
 void
 edit(loc_t edit_cursor)
 {
-    char e_cursor();
-    void e_leave(), e_print(), e_random();
-    void e_stasis(), e_end(), e_wake(), e_sleep();
-    void e_info(), e_prod(), e_help(), e_explore();
-    void e_fill(), e_land(), e_city_func(), e_transport();
-    void e_attack(), e_repair();
+    char e_cursor(loc_t *);
+    void e_leave(void), e_print(loc_t *), e_random(loc_t);
+    void e_stasis(loc_t), e_end(loc_t *, loc_t, int);
+    void e_wake(loc_t), e_sleep(loc_t);
+    void e_info(loc_t), e_prod(loc_t), e_help(void), e_explore(loc_t);
+    void e_fill(loc_t), e_land(loc_t), e_transport(loc_t);
+    void e_city_func(loc_t *, loc_t, int *);
+    void e_attack(loc_t), e_repair(loc_t);
 
     loc_t path_start;
     int path_type;
-    char e;
 	
     path_start = -1; /* not building a path yet */
 	
     comment ("Edit mode...");
 
     for (;;) { /* until user gives command to leave */
+	char e;
 	display_loc_u (edit_cursor); /* position cursor */
 	e = e_cursor (&edit_cursor); /* handle cursor movement */
 
@@ -117,7 +119,6 @@ char
 e_cursor(loc_t *edit_cursor)
 {
     chtype e;
-    int p;
 	
     /* set up terminal */
     (void) crmode ();
@@ -126,6 +127,7 @@ e_cursor(loc_t *edit_cursor)
     topini (); /* clear any error messages */
 
     for (;;) {
+	int p;
 	p = direction (e);
 	if (p == -1) break;
 
@@ -353,10 +355,10 @@ e_wake(loc_t loc)
 {
     city_info_t *cityp;
     piece_info_t *obj;
-    int i;
 
     cityp = find_city (loc);
     if (cityp != NULL) {
+	int i;
 	for (i = 0; i < NUM_OBJECTS; i++)
 	    cityp->func[i] = NOFUNC;
     }
diff --git a/empire.6 b/empire.6
index 4dd763e..7dfd9a9 100644
--- a/empire.6
+++ b/empire.6
@@ -2,12 +2,12 @@
 .\"     Title: Empire
 .\"    Author: [see the "AUTHORS" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 05/21/2014
+.\"      Date: 01/05/2016
 .\"    Manual: Games
 .\"    Source: empire
 .\"  Language: English
 .\"
-.TH "EMPIRE" "6" "05/21/2014" "empire" "Games"
+.TH "EMPIRE" "6" "01/05/2016" "empire" "Games"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -313,13 +313,15 @@ Because of their ability to be repaired, ships with lots of hits such as Carrier
 The following table gives the probability that the piece listed on the side will defeat the piece listed at the top in a battle\&. (The table assumes that both pieces are undamaged\&.)
 .TS
 allbox center tab(:);
-l c c c c c
+c l c c c c
 l c c c c c
 l c c c c c
 l c c c c c
 l c c c c c
 l c c c c c.
 T{
+\ \&
+T}:T{
 AFPT
 T}:T{
 D
@@ -329,8 +331,6 @@ T}:T{
 C
 T}:T{
 B
-T}:T{
-\ \&
 T}
 T{
 AFPT
@@ -889,6 +889,8 @@ holds a history of the game so that the game can be replayed as a "movie"\&.
 .PP
 No doubt numerous\&.
 .PP
+The savefile format changed incompatibly after version 1\&.13\&.
+.PP
 Satellites are not completely implemented\&. You should be able to move to a square that contains a satellite, but the program won\*(Aqt let you\&. Enemy satellites should not cause your pieces to awaken\&.
 .SH "AUTHORS"
 .PP
diff --git a/empire.c b/empire.c
index 9238e05..a227523 100644
--- a/empire.c
+++ b/empire.c
@@ -28,7 +28,7 @@ void
 empire(void)
 {
     void do_command(char);
-    void print_zoom();
+    void print_zoom(view_map_t *);
 
     char order;
     int turn = 0;
diff --git a/game.c b/game.c
index 913dc41..0c95526 100644
--- a/game.c
+++ b/game.c
@@ -174,13 +174,15 @@ void place_cities(void)
 {
     count_t regen_land();
 
-    count_t placed, i;
-    loc_t loc;
+    count_t placed;
     count_t num_land;
 
     num_land = 0; /* nothing in land array yet */
     placed = 0; /* nothing placed yet */
     while (placed < NUM_CITY) {
+	count_t i;
+	loc_t loc;
+
 	while (num_land == 0) num_land = regen_land (placed);
 	i = irand (num_land-1); /* select random piece of land */
 	loc = land[i];
@@ -302,7 +304,7 @@ bool select_cities(void)
 {
     void find_cont(void), make_pair(void);
 
-    loc_t compi, useri;
+    loc_t compi;
     city_info_t *compp, *userp;
     int comp_cont, user_cont;
     int pair;
@@ -324,7 +326,7 @@ bool select_cities(void)
     compp = cont_tab[comp_cont].cityp[compi];
 
     do { /* select different user city */
-	useri = irand ((long)cont_tab[user_cont].ncity);
+	loc_t useri = irand ((long)cont_tab[user_cont].ncity);
 	userp = cont_tab[user_cont].cityp[useri];
     } while (userp == compp);
 
@@ -507,6 +509,10 @@ tell the user why.
 #define wbuf(buf) if (!xwrite (f, (char *)buf, sizeof (buf))) return
 #define wval(val) if (!xwrite (f, (char *)&val, sizeof (val))) return
 
+#define SAVECOOKIE	"EMPSAVE 1\n"	/* increase digit when format changes */
+
+static char buf[32];
+
 void save_game(void)
 {
     FILE *f; /* file to save game in */
@@ -516,6 +522,7 @@ void save_game(void)
 	perror ("Cannot save saved game");
 	return;
     }
+    wbuf(SAVECOOKIE);
     wbuf (map);
     wbuf (comp_map);
     wbuf (user_map);
@@ -547,7 +554,7 @@ We return true if we succeed, otherwise false.
 
 int restore_game(void)
 {
-    void read_embark();
+    void read_embark(piece_info_t *, int);
 	
     FILE *f; /* file to save game in */
     long i;
@@ -559,6 +566,11 @@ int restore_game(void)
 	perror ("Cannot open saved game");
 	return (false);
     }
+    if (fgets(buf, sizeof(buf), f) == NULL)
+	return false;
+    else if (strcmp(buf, SAVECOOKIE) != 0)
+	return false;
+    i = fread(buf, 1, sizeof(char), f);	/* skip trailing nul after cookie */ 
     rbuf (map);
     rbuf (comp_map);
     rbuf (user_map);
@@ -639,10 +651,9 @@ void read_embark(piece_info_t *list, int piece_type)
 
     piece_info_t *ship;
     piece_info_t *obj;
-    int count;
 
     for (ship = list; ship != NULL; ship = ship->piece_link.next) {
-	count = ship->count; /* get # of pieces we need */
+	int count = ship->count; /* get # of pieces we need */
 	if (count < 0) inconsistent ();
 	ship->count = 0; /* nothing on board yet */
 	for (obj = map[ship->loc].objp; obj && count;
@@ -749,10 +760,9 @@ print it using a zoomed display.
 void
 replay_movie(void)
 {
-    void print_movie_cell();
+    void print_movie_cell(char *, int, int, int, int);
 
     FILE *f; /* file to save game in */
-    int row_inc, col_inc;
     int r, c;
     int round;
 
@@ -765,6 +775,7 @@ replay_movie(void)
     round = 0;
     clear_screen ();
     for (;;) {
+	int row_inc, col_inc;
 	if (fread ((char *)mapbuf, 1, sizeof (mapbuf), f) != sizeof (mapbuf))
 	    break;
 	round += 1;
@@ -803,12 +814,11 @@ void stat_display(char *mbuf, int round)
     count_t i;
     int counts[2*NUM_OBJECTS+2];
     int user_cost, comp_cost;
-    char *p;
 	
     (void) memset ((char *)counts, '\0', sizeof (counts));
 	
     for (i = 0; i < MAP_SIZE; i++) {
-	p = strchr (pieces, mbuf[i]);
+	char *p = strchr (pieces, mbuf[i]);
 	if (p) counts[p-pieces] += 1;
     }
     user_cost = 0;
diff --git a/map.c b/map.c
index d0a539b..536e87d 100644
--- a/map.c
+++ b/map.c
@@ -1003,7 +1003,7 @@ vmap_find_dir(path_map_t path_map[], view_map_t *vmap,
 	      loc_t loc, char *terrain, char *adj_char)
 {
     int i, count, bestcount;
-    loc_t bestloc, new_loc;
+    loc_t bestloc;
     int path_count, bestpath;
     char *p;
 	
@@ -1015,7 +1015,7 @@ vmap_find_dir(path_map_t path_map[], view_map_t *vmap,
     bestloc = loc;
 	
     for (i = 0; i < 8; i++) { /* for each adjacent square */
-	new_loc = loc + dir_offset[order[i]];
+	loc_t new_loc = loc + dir_offset[order[i]];
 	if (path_map[new_loc].terrain == T_PATH) { /* which is on path */
 	    p = strchr (terrain, vmap[new_loc].contents);
 			
diff --git a/object.c b/object.c
index 4f44ee0..b32a897 100644
--- a/object.c
+++ b/object.c
@@ -120,12 +120,10 @@ loc_t
 find_transport(int owner, loc_t loc)
 {
     int i;
-    loc_t new_loc;
-    piece_info_t *t;
 
     for (i = 0; i < 8; i++) { /* look around */
-	new_loc = loc + dir_offset[i];
-	t = find_nfull (TRANSPORT, new_loc);
+	loc_t new_loc = loc + dir_offset[i];
+	piece_info_t *t = find_nfull (TRANSPORT, new_loc);
 	if (t != NULL && t->owner == owner) return (new_loc);
     }
     return (loc); /* no tt found */
@@ -182,7 +180,7 @@ anything in the object, it is killed as well.
 
 void kill_obj(piece_info_t *obj, loc_t loc)
 {
-    void kill_one();
+    void kill_one(piece_info_t **, piece_info_t *);
 
     piece_info_t **list;
     view_map_t *vmap;
@@ -217,11 +215,9 @@ to unowned.  We scan around the city's location.
 
 void kill_city(city_info_t *cityp)
 {
-    view_map_t *vmap;
     piece_info_t *p;
     piece_info_t *next_p;
     piece_info_t **list;
-    int i;
 	
     /* change ownership of hardware at this location; but not satellites */
     for (p = map[cityp->loc].objp; p; p = next_p) {
@@ -246,7 +242,8 @@ void kill_city(city_info_t *cityp)
     }
 
     if (cityp->owner != UNOWNED) {
-	vmap = MAP(cityp->owner);
+	view_map_t *vmap = MAP(cityp->owner);
+	int i;
 	cityp->owner = UNOWNED;
 	cityp->work = 0;
 	cityp->prod = NOPIECE;
@@ -512,10 +509,9 @@ on top.
 void
 scan(view_map_t vmap[], loc_t loc)
 {
-    void update(), check(void);
+    void update(view_map_t [], loc_t), check(void);
 
     int i;
-    loc_t xloc;
 
 #ifdef DEBUG
     check (); /* perform a consistency check */
@@ -523,7 +519,7 @@ scan(view_map_t vmap[], loc_t loc)
     ASSERT (map[loc].on_board); /* passed loc must be on board */
 
     for (i = 0; i < 8; i++) { /* for each surrounding cell */
-	xloc = loc + dir_offset[i];
+	loc_t xloc = loc + dir_offset[i];
 	update (vmap, xloc);
     }
     update (vmap, loc); /* update current location as well */
@@ -537,12 +533,11 @@ void
 scan_sat(view_map_t vmap[], loc_t loc)
 {
 	int i;
-	loc_t xloc;
 	
 	ASSERT (map[loc].on_board);
 
 	for (i = 0; i < 8; i++) { /* for each surrounding cell */
-		xloc = loc + 2 * dir_offset[i];
+		loc_t xloc = loc + 2 * dir_offset[i];
 		if (xloc >= 0 && xloc < MAP_SIZE && map[xloc].on_board)
 			scan (vmap, xloc);
 	}
@@ -590,12 +585,12 @@ asking until we get a valid answer.
 void
 set_prod(city_info_t *cityp)
 {
-    int i;
-
     scan (user_map, cityp->loc);
     display_loc_u (cityp->loc);
 
     for (;;) {
+	int i;
+
 	prompt ("What do you want the city at %d to produce? ",loc_disp(cityp->loc));
 
 	i = get_piece_name ();
diff --git a/term.c b/term.c
index ab94b06..0d7f833 100644
--- a/term.c
+++ b/term.c
@@ -323,9 +323,9 @@ a valid response.  We return true iff the user replies 'y'.
 bool
 getyn(char *message)
 {
-    char c;
-
     for (;;) {
+	char c;
+
 	prompt (message,0,0,0,0,0,0,0,0);
 	c = get_chx ();
 
@@ -343,10 +343,8 @@ Input an integer in a range.
 int
 get_range(char *message, int low, int high)
 {
-    int result;
-
     for (;;) {
-	result = getint (message);
+	int result = getint (message);
 
 	if (result >= low && result <= high) return (result);
 
diff --git a/usermove.c b/usermove.c
index 660165e..12f7237 100644
--- a/usermove.c
+++ b/usermove.c
@@ -24,9 +24,9 @@ extern int get_piece_name(void);
 void
 user_move(void)
 {
-    void piece_move();
+    void piece_move(piece_info_t *);
 
-    int i, j, sec, sec_start;
+    int i, j, sec_start;
     piece_info_t *obj, *next_obj;
     int prod;
 
@@ -74,7 +74,7 @@ user_move(void)
 
     /* loop through sectors, moving every piece in the sector */
     for (i = sec_start; i < sec_start + NUM_SECTORS; i++) {
-	sec = i % NUM_SECTORS;
+	int sec = i % NUM_SECTORS;
 	sector_change (); /* allow screen to be redrawn */
 
 	for (j = 0; j < NUM_OBJECTS; j++) /* loop through obj lists */
@@ -104,16 +104,16 @@ the piece has not moved after this, we ask the user what to do.
 void
 piece_move(piece_info_t *obj)
 {
-    void move_random(), move_fill(), move_land(), move_explore();
-    void move_path(), move_dir(), move_armyload(), ask_user();
-    void move_armyattack(), move_ttload(), move_repair();
-    void move_transport();
+    void move_random(piece_info_t *), move_fill(piece_info_t *);
+    void move_land(piece_info_t *), move_explore(piece_info_t *);
+    void move_path(piece_info_t *), move_dir(piece_info_t *); 
+    void move_armyload(piece_info_t *), ask_user(piece_info_t *);
+    void move_armyattack(piece_info_t *), move_ttload(piece_info_t *);
+    void move_repair(piece_info_t *), move_transport(piece_info_t *);
 
     bool changed_loc;
     int speed, max_hits;
-    int saved_moves;
     bool need_input;
-    loc_t saved_loc;
     city_info_t *cityp;
 
     /* set func for piece if on city */
@@ -128,8 +128,8 @@ piece_move(piece_info_t *obj)
     need_input = false; /* don't require user input yet */
 
     while (obj->moved < obj_moves (obj)) {
-	saved_moves = obj->moved; /* save moves made */
-	saved_loc = obj->loc; /* remember starting location */
+	int saved_moves = obj->moved; /* save moves made */
+	loc_t saved_loc = obj->loc; /* remember starting location */
 
 	if (awake (obj) || need_input){ /* need user input? */
 	    ask_user (obj);
@@ -208,12 +208,11 @@ void move_random(piece_info_t *obj)
 {
     loc_t loc_list[8];
     int i, nloc;
-    loc_t loc;
 
     nloc = 0;
 
     for (i = 0; i < 8; i++) {
-	loc = obj->loc + dir_offset[i];
+	loc_t loc = obj->loc + dir_offset[i];
 	if (good_loc (obj, loc)) {
 	    loc_list[nloc] = loc; /* remember this location */
 	    nloc++; /* count locations we can move to */
@@ -406,13 +405,12 @@ move_land(piece_info_t *obj)
 {
     long best_dist;
     loc_t best_loc;
-    long new_dist;
     piece_info_t *p;
 
     best_dist = find_nearest_city (obj->loc, USER, &best_loc);
 
     for (p = user_obj[CARRIER]; p != NULL; p = p->piece_link.next) {
-	new_dist = dist (obj->loc, p->loc);
+	long new_dist = dist (obj->loc, p->loc);
 	if (new_dist < best_dist) {
 	    best_dist = new_dist;
 	    best_loc = p->loc;
@@ -504,16 +502,19 @@ Ask the user to move her piece.
 
 void ask_user(piece_info_t *obj)
 {
-    void user_skip(), user_fill(), user_dir(), user_set_dir();
-    void user_wake(), user_set_city_func(), user_cancel_auto();
-    void user_redraw(), user_random(), user_land(), user_sentry();
-    void user_help(), reset_func(), user_explore();
-    void user_build(), user_transport();
-    void user_armyattack(), user_repair();
-
-    char c;
+    void user_skip(piece_info_t *), user_fill(piece_info_t *);
+    void user_dir(piece_info_t *, int), user_set_dir(piece_info_t *);
+    void user_wake(piece_info_t *), user_set_city_func(piece_info_t *);
+    void user_cancel_auto(void), user_redraw(void);
+    void user_random(piece_info_t *), user_land(piece_info_t *);
+    void user_sentry(piece_info_t *), user_help(void);
+    void reset_func(piece_info_t *), user_explore(piece_info_t *);
+    void user_build(piece_info_t *), user_transport(piece_info_t *);
+    void user_armyattack(piece_info_t *), user_repair(piece_info_t *);
 
     for (;;) {
+	char c;
+
 	display_loc_u (obj->loc); /* display piece to move */
 	describe_obj (obj); /* describe object to be moved */
 	display_score (); /* show current score */
@@ -738,9 +739,13 @@ Set a city's function.
 void
 user_set_city_func(piece_info_t *obj)
 {
-    void e_city_fill(), e_city_explore(), e_city_stasis();
-    void e_city_wake(), e_city_random(), e_city_repair();
-    void e_city_attack();
+    void e_city_fill(city_info_t *, int);
+    void e_city_explore(city_info_t *, int);
+    void e_city_stasis(city_info_t *, int);
+    void e_city_wake(city_info_t *, int);
+    void e_city_random(city_info_t *, int);
+    void e_city_repair(city_info_t *, int);
+    void e_city_attack(city_info_t *, int);
 	
     int type;
     char e;
@@ -814,7 +819,9 @@ This routine handles attacking objects.
 void
 user_dir(piece_info_t *obj, int dir)
 {
-    void user_dir_army(), user_dir_fighter(), user_dir_ship();
+    void user_dir_army(piece_info_t *, loc_t);
+    void user_dir_fighter(piece_info_t *, loc_t);
+    void user_dir_ship(piece_info_t *, loc_t);
 
     loc_t loc;
 
@@ -1037,7 +1044,6 @@ bool
 awake(piece_info_t *obj)
 {
     int i;
-    char c;
     long t;
 
     if (obj->type == ARMY && vmap_at_sea (user_map, obj->loc)) {
@@ -1054,7 +1060,7 @@ awake(piece_info_t *obj)
 	return (true);
     }
     for (i = 0; i < 8; i++) { /* for each surrounding cell */
-	c = user_map[obj->loc+dir_offset[i]].contents;
+	char c = user_map[obj->loc+dir_offset[i]].contents;
 
 	if (islower (c) || c == MAP_CITY || c == 'X') {
 	    if (obj->func < 0) obj->func = NOFUNC; /* awaken */
diff --git a/util.c b/util.c
index 3eb1af7..88a084e 100644
--- a/util.c
+++ b/util.c
@@ -80,7 +80,9 @@ static bool in_cargo[LIST_SIZE]; /* true if object in a cargo list */
 void
 check(void)
 {
-    void check_cargo(), check_obj(), check_obj_cargo();
+    void check_cargo(piece_info_t *, int);
+    void check_obj(piece_info_t **, int);
+    void check_obj_cargo(piece_info_t **);
 	
     long i, j;
     piece_info_t *p;
@@ -212,10 +214,10 @@ void
 check_cargo(piece_info_t *list, int cargo_type)
 {
     piece_info_t *p, *q;
-    long j, count;
+    long j;
 	
     for (p = list; p != NULL; p = p->piece_link.next) {
-	count = 0;
+	long count = 0;
 	for (q = p->cargo; q != NULL; q = q->cargo_link.next) {
 	    count += 1; /* count items in list */
 	    ASSERT (q->type == cargo_type);
diff --git a/vms-empire.xml b/vms-empire.xml
index 575585d..acc1c61 100644
--- a/vms-empire.xml
+++ b/vms-empire.xml
@@ -351,12 +351,12 @@ on the side will defeat the piece listed at the top in a battle.
     <colspec colname='c6'/>
     <tbody>
       <row rowsep='1'>
+	<entry align='center'></entry>
         <entry align='left' colsep='1'>AFPT</entry>
         <entry align='center' colsep='1'>D</entry>
         <entry align='center' colsep='1'>S</entry>
         <entry align='center' colsep='1'>C</entry>
         <entry align='center' colsep='1'>B</entry>
-        <entry align='center'></entry>
       </row>
       <row>
         <entry align='left' colsep='1'>AFPT</entry>
@@ -1066,6 +1066,8 @@ a "movie".</para>
 
 <para>No doubt numerous.</para>
 
+<para>The savefile format changed incompatibly after version 1.13.</para>
+
 <para>Satellites are not completely implemented.  You should be able to
 move to a square that contains a satellite, but the program won't
 let you.  Enemy satellites should not cause your pieces to awaken.</para>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/empire.git



More information about the Pkg-games-commits mailing list