Package: opentyrian / 2.1.20130907+dfsg-3

uninitialized-vars.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Subject: Fix several uninitialized variable warnings.
From: Yuri Kunde Schlesner <yuriks@yuriks.net>
Last-Update: 2014-05-11
Origin: commit:0a06d5af473ca34d65eae92f4fec45aaa33be6dd
Forwarded: not-needed

--- a/src/mainint.c
+++ b/src/mainint.c
@@ -3635,7 +3635,7 @@
 				blit_sprite2x2(VGAScreen, this_player->x - 17, this_player->y - 7, *shapes9ptr_, 220);
 				blit_sprite2x2(VGAScreen, this_player->x + 7, this_player->y - 7, *shapes9ptr_, 222);
 
-				int ship_banking;
+				int ship_banking = 0;
 				switch (ship_sprite)
 				{
 				case 5:
--- a/src/shots.c
+++ b/src/shots.c
@@ -319,7 +319,7 @@
 	if (weapon->sound > 0)
 		soundQueue[soundChannel[bay_i]] = weapon->sound;
 
-	int shot_id;
+	int shot_id = MAX_PWEAPON;
 	/*Rot*/
 	for (int multi_i = 1; multi_i <= weapon->multi; multi_i++)
 	{
--- a/src/tyrian2.c
+++ b/src/tyrian2.c
@@ -4325,8 +4325,8 @@
 
 	case 19: /* Enemy Global Move */
 	{
-		int initial_i, max_i;
-		bool all_enemies;
+		int initial_i = 0, max_i = 0;
+		bool all_enemies = false;
 
 		if (eventRec[eventLoc-1].eventdat3 > 79 && eventRec[eventLoc-1].eventdat3 < 90)
 		{