(svn r5229) Remove a write-only variable
authorglx
Sun, 11 Jun 2006 21:38:35 +0000
changeset 4016 e3c8f26fb798
parent 4015 4f67e077e30e
child 4017 62f8877d1085
(svn r5229) Remove a write-only variable
saveload.c
--- a/saveload.c	Sun Jun 11 21:19:51 2006 +0000
+++ b/saveload.c	Sun Jun 11 21:38:35 2006 +0000
@@ -1464,7 +1464,6 @@
 {
 	uint32 hdr[2];
 	const SaveLoadFormat *fmt;
-	uint version;
 
 	/* An instance of saving is already active, so don't go saving again */
 	if (_ts.saveinprogress && mode == SL_SAVE) {
@@ -1515,10 +1514,6 @@
 		return SL_ERROR;
 	}
 
-	/* We first initialize here to avoid: "warning: variable `version' might
-	 * be clobbered by `longjmp' or `vfork'" */
-	version = 0;
-
 	/* General tactic is to first save the game to memory, then use an available writer
 	 * to write it to file, either in threaded mode if possible, or single-threaded */
 	if (mode == SL_SAVE) { /* SAVE game */
@@ -1557,7 +1552,7 @@
 			if (fmt == endof(_saveload_formats)) {
 				DEBUG(misc, 0) ("[Sl] Unknown savegame type, trying to load it as the buggy format.");
 				rewind(_sl.fh);
-				_sl_version = version = 0;
+				_sl_version = 0;
 				_sl_minor_version = 0;
 				fmt = _saveload_formats + 1; // LZO
 				break;
@@ -1565,7 +1560,7 @@
 
 			if (fmt->tag == hdr[0]) {
 				// check version number
-				_sl_version = version = TO_BE32(hdr[1]) >> 16;
+				_sl_version = TO_BE32(hdr[1]) >> 16;
 				/* Minor is not used anymore from version 18.0, but it is still needed
 				 *  in versions before that (4 cases) which can't be removed easy.
 				 *  Therefor it is loaded, but never saved (or, it saves a 0 in any scenario).