File: fix_errors_with_multiple_definitions.patch

package info (click to toggle)
alex4 1.1-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 2,184 kB
  • sloc: ansic: 6,322; makefile: 27
file content (168 lines) | stat: -rw-r--r-- 3,486 bytes parent folder | download | duplicates (2)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
Author: Andreas Rönnquist <gusnan@debian.org>
Description: Fixes a few "multiple definition of" instances
 
--- a/src/timer.c
+++ b/src/timer.c
@@ -23,6 +23,15 @@
 #include "allegro.h"
 #include "timer.h"
 
+// the variables used by the timers
+volatile int frame_count;
+volatile int fps;
+volatile int logic_count;
+volatile int lps;
+volatile int cycle_count;
+volatile int game_count;
+
+
 // keeps track of frames each second
 void fps_counter(void) {
 	fps = frame_count;
@@ -60,4 +69,4 @@
 	game_count ++;
 
 	return TRUE;
-}
+}
--- a/src/timer.h
+++ b/src/timer.h
@@ -24,12 +24,12 @@
 #define _TIMERS_H_
 
 // the variables used by the timers
-volatile int frame_count;
-volatile int fps;
-volatile int logic_count;
-volatile int lps;
-volatile int cycle_count;
-volatile int game_count;
+extern volatile int frame_count;
+extern volatile int fps;
+extern volatile int logic_count;
+extern volatile int lps;
+extern volatile int cycle_count;
+extern volatile int game_count;
 
 
 // functions
@@ -37,4 +37,4 @@
 void fps_counter(void);
 void cycle_counter(void);
 
-#endif
+#endif
--- a/src/particle.c
+++ b/src/particle.c
@@ -24,7 +24,10 @@
 #include "defs.h"
 
 // pointer to datafile
-DATAFILE *data;
+extern DATAFILE *data;
+
+// the particles themselves
+Tparticle particle[MAX_PARTICLES];
 
 
 // set datafile to use
--- a/src/particle.h
+++ b/src/particle.h
@@ -42,7 +42,7 @@
 
 
 // the particles themselves
-Tparticle particle[MAX_PARTICLES];
+extern Tparticle particle[MAX_PARTICLES];
 
 // functions
 void set_datafile(DATAFILE *d);
--- a/src/player.c
+++ b/src/player.c
@@ -25,6 +25,9 @@
 #include "timer.h"
 #include "../data/data.h"
 
+// the player 
+Tplayer player;
+
 // draws the player depending on his state
 void draw_player(BITMAP *bmp, Tplayer *p, int x, int y) {
 	BITMAP *head, *body;
--- a/src/player.h
+++ b/src/player.h
@@ -53,7 +53,7 @@
 
 
 // the player 
-Tplayer player;
+extern Tplayer player;
 
 // functions
 void draw_player(BITMAP *bmp, Tplayer *p, int x, int y);
--- a/src/bullet.c
+++ b/src/bullet.c
@@ -26,6 +26,9 @@
 #include "timer.h"
 #include "../data/data.h"
 
+// the bullets themselves
+Tbullet bullet[MAX_BULLETS];
+
 
 // sets values on a bullet
 void set_bullet(Tbullet *b, int x, int y, double dx, double dy, BITMAP *bmp, int bad) {
--- a/src/bullet.h
+++ b/src/bullet.h
@@ -42,7 +42,7 @@
 #define MAX_BULLETS	64
 
 // the bullets themselves
-Tbullet bullet[MAX_BULLETS];
+extern Tbullet bullet[MAX_BULLETS];
 
 // functions
 void reset_bullets(Tbullet *b, int max);
--- a/src/script.c
+++ b/src/script.c
@@ -35,7 +35,7 @@
 
 
 // datafile to use
-DATAFILE *data;
+extern DATAFILE *data;
 // internal buffers
 BITMAP *buffer;
 BITMAP *swap_buffer;
@@ -44,6 +44,9 @@
 // any objects
 Tscript_object *objects = NULL;
 
+// array holding the sounds ids
+int active_sounds[MAX_SCRIPT_SOUNDS];
+
 
 
 // shows a speak bulb 
--- a/src/script.h
+++ b/src/script.h
@@ -42,7 +42,7 @@
 // max number of sounds played by the script
 #define MAX_SCRIPT_SOUNDS	16
 // array holding the sounds ids
-int active_sounds[MAX_SCRIPT_SOUNDS];
+extern int active_sounds[MAX_SCRIPT_SOUNDS];
 
 
 // functions
--- a/src/edit.c
+++ b/src/edit.c
@@ -34,7 +34,7 @@
 // path to current map
 char edit_path_and_file[1024];
 // datafile to use
-DATAFILE *data;
+extern DATAFILE *data;
 // current edit mode
 int edit_mode;