changeset 184:7c059ec2a2c7

Merge Super-Rogue fixes into the MSVC testing branch.
author John "Elwin" Edwards
date Sun, 02 Aug 2015 12:25:44 -0400
parents 7f5f5f1ba09c (diff) db1c9a21a7c3 (current diff)
children 576cc8154521
files
diffstat 8 files changed, 18 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/rogue3/chase.c	Sun Aug 02 12:14:47 2015 -0400
+++ b/rogue3/chase.c	Sun Aug 02 12:25:44 2015 -0400
@@ -162,7 +162,7 @@
     int x, y;
     int dist, thisdist;
     struct linked_list *item;
-    struct object *obj;
+    struct object *obj = NULL;
     coord *er = &tp->t_pos;
     int ch;
 
--- a/rogue3/move.c	Sun Aug 02 12:14:47 2015 -0400
+++ b/rogue3/move.c	Sun Aug 02 12:25:44 2015 -0400
@@ -339,7 +339,7 @@
     int ch;
     int ex, ey, nopen = 0;
     struct linked_list *item;
-    struct object *obj;
+    struct object *obj = NULL;
     static coord ret;  /* what we will be returning */
     static coord dest;
 
--- a/rogue3/pack.c	Sun Aug 02 12:14:47 2015 -0400
+++ b/rogue3/pack.c	Sun Aug 02 12:25:44 2015 -0400
@@ -22,8 +22,8 @@
 void
 add_pack(struct linked_list *item, int silent)
 {
-    struct linked_list *ip, *lp;
-    struct object *obj, *op;
+    struct linked_list *ip, *lp = NULL;
+    struct object *obj, *op = NULL;
     int exact, from_floor;
 
     if (item == NULL)
--- a/rogue3/passages.c	Sun Aug 02 12:14:47 2015 -0400
+++ b/rogue3/passages.c	Sun Aug 02 12:25:44 2015 -0400
@@ -22,7 +22,7 @@
 void
 do_passages()
 {
-    struct rdes *r1, *r2;
+    struct rdes *r1, *r2 = NULL;
     int i, j;
     int roomcount;
     static struct rdes
@@ -131,7 +131,7 @@
 void
 conn(int r1, int r2)
 {
-    struct room *rpf, *rpt;
+    struct room *rpf, *rpt = NULL;
     int rmt;
     int distance, turn_spot, turn_distance;
     int rm;
--- a/rogue4/mdport.c	Sun Aug 02 12:14:47 2015 -0400
+++ b/rogue4/mdport.c	Sun Aug 02 12:25:44 2015 -0400
@@ -36,7 +36,6 @@
 #if defined(_WIN32)
 #include <Windows.h>
 #include <Lmcons.h>
-#include <process.h>
 #include <shlobj.h>
 #include <sys/types.h>
 #include <io.h>
@@ -73,6 +72,10 @@
 #include <term.h>
 #endif
 
+#if defined(_WIN32)
+#include <process.h>
+#endif
+
 #include <stdio.h>
 #include <fcntl.h>
 #include <limits.h>
--- a/rogue4/save.c	Sun Aug 02 12:14:47 2015 -0400
+++ b/rogue4/save.c	Sun Aug 02 12:25:44 2015 -0400
@@ -160,7 +160,10 @@
     /*
      * close any open score file
      */
-    close(fd);
+    if (fd >= 0) {
+        close(fd);
+        fd = -1;
+    }
     move(LINES-1, 0);
     refresh();
     fstat(md_fileno(savef), &sbuf);
--- a/srogue/pack.c	Sun Aug 02 12:14:47 2015 -0400
+++ b/srogue/pack.c	Sun Aug 02 12:25:44 2015 -0400
@@ -29,7 +29,7 @@
 bool silent;
 {
 	reg struct linked_list *ip, *lp;
-	reg struct object *obj, *op;
+	reg struct object *obj, *op = NULL;
 	bool from_floor;
 	char delchar;
 
@@ -292,7 +292,7 @@
 char *purpose;
 int type;
 {
-	reg struct linked_list *obj, *pit, *savepit;
+	reg struct linked_list *obj, *pit, *savepit = NULL;
 	struct object *pob;
 	int ch, och, anr, cnt;
 
--- a/srogue/passages.c	Sun Aug 02 12:14:47 2015 -0400
+++ b/srogue/passages.c	Sun Aug 02 12:25:44 2015 -0400
@@ -24,7 +24,7 @@
 
 do_passages()
 {
-	reg struct rdes *r1, *r2;
+	reg struct rdes *r1, *r2 = NULL;
 	reg int i, j;
 	reg int roomcount;
 	static struct rdes {
@@ -126,7 +126,7 @@
 conn(r1, r2)
 int r1, r2;
 {
-	reg struct room *rpf, *rpt;
+	reg struct room *rpf, *rpt = NULL;
 	reg char rmt, direc;
 	reg int distance, turn_spot, turn_distance, rm;
 	struct coord curr, turn_delta, spos, epos;