summaryrefslogtreecommitdiff
blob: 931b7a01f7f98aeb165a4ae15e230d950599f98a (plain)
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
--- a/src/main.c
+++ b/src/main.c
@@ -61,6 +61,42 @@
 #include "window.h"
 #include "xml_strategy.h"
 
+// Global vars (-fno-common)
+Country country;
+GArray *users;
+gint season, week, week_round;
+OptionList options;
+OptionList constants;
+OptionList constants_app;
+OptionList settings;
+OptionList tokens;
+GArray *lg_commentary[LIVE_GAME_EVENT_END];
+GArray *news[NEWS_ARTICLE_TYPE_END];
+NewsPaper newspaper;
+GArray *transfer_list;
+GArray *season_stats;
+GArray *strategies;
+GArray *bets[2];
+gfloat current_interest;
+GArray *jobs, *job_teams;
+gint counters[COUNT_END];
+gint status[6];
+gpointer statp;
+gint selected_row;
+GArray *name_lists;
+Windows window;
+GArray *live_games;
+gint cur_user;
+gint timeout_id;
+GRand *rand_generator;
+gint debug_level, debug_output;
+GList *support_directories;
+GList *root_definitions_directories;
+GList *definitions_directories;
+gchar *save_file;
+gboolean os_is_unix;
+OptionList hints;
+
 #define DEBUG_LEVEL_DEFAULT 0
 
 #if defined(MAC_BUILD) || defined(G_OS_WIN32)
--- a/src/variables.h
+++ b/src/variables.h
@@ -33,89 +33,89 @@
  * The main variable of the game.
  * @see Country
  */
-Country country;
+extern Country country;
 
 /** The array of human players. @see #User */
-GArray *users;
+extern GArray *users;
 
 /** The season, week and week round numbers. 
     We keep track of the time in the game with these variables. */
-gint season, week, week_round;
+extern gint season, week, week_round;
 
 /** Array of options that get read from
     bygfoot.conf. */
-OptionList options;
+extern OptionList options;
 /** Array of constants that get read from the constants
     file specified in bygfoot.conf. */
-OptionList constants;
+extern OptionList constants;
 /** Array of constants affecting game appearance rather than
     behaviour. */
-OptionList constants_app;
+extern OptionList constants_app;
 /** Array with internal settings. */
-OptionList settings;
+extern OptionList settings;
 /* Array holding string replacement tokens. */
-OptionList tokens;
+extern OptionList tokens;
 
 /** The array containing the live game commentary strings. */
-GArray *lg_commentary[LIVE_GAME_EVENT_END];
+extern GArray *lg_commentary[LIVE_GAME_EVENT_END];
 
 /** The array containing the news article strings. */
-GArray *news[NEWS_ARTICLE_TYPE_END];
+extern GArray *news[NEWS_ARTICLE_TYPE_END];
 
 /** Newspaper containing the news articles. */
-NewsPaper newspaper;
+extern NewsPaper newspaper;
 
 /** The array containing players to be transfered.
     @see TransferPlayer */
-GArray *transfer_list;
+extern GArray *transfer_list;
 
 /** Array with season statistics (updated at the
     end of each season. */
-GArray *season_stats;
+extern GArray *season_stats;
 
 /** Array of available CPU strategies. */
-GArray *strategies;
+extern GArray *strategies;
 
 /** Array of current and recent bets. */
-GArray *bets[2];
+extern GArray *bets[2];
 
 /** Loan interest for the current week. */
-gfloat current_interest;
+extern gfloat current_interest;
 
 /** Array of jobs in the job exchange and
     teams going with the international jobs. */
-GArray *jobs, *job_teams;
+extern GArray *jobs, *job_teams;
 
 /** Some counters we use. */
-gint counters[COUNT_END];
+extern gint counters[COUNT_END];
 
 /** These help us keep track of what's happening. */
-gint status[6];
+extern gint status[6];
 
 /** A pointer we store temporary stuff in. */
-gpointer statp;
+extern gpointer statp;
 
 /** The currently selected row in the treeview. */
-gint selected_row;
+extern gint selected_row;
 
 /** An array of name lists. */
-GArray *name_lists;
+extern GArray *name_lists;
 
 /** The struct containing the window pointers. */
-Windows window;
+extern Windows window;
 
 /** The variables for non-user live games (which aren't shown). */
-GArray *live_games;
+extern GArray *live_games;
 
 /** The index of the current user in the #users array. */
-gint cur_user;
+extern gint cur_user;
 
-gint timeout_id;
+extern gint timeout_id;
 
-GRand *rand_generator;
+extern GRand *rand_generator;
 
 /** Debug information. */
-gint debug_level, debug_output;
+extern gint debug_level, debug_output;
 
 /**
    The list of directories the file_find_support_file() function
@@ -123,24 +123,24 @@
    @see file_find_support_file()
    @see file_add_support_directory_recursive()
 */
-GList *support_directories;
+extern GList *support_directories;
 
 /**
  * The list of root defintions directories found (ending in definitions)
  */ 
-GList *root_definitions_directories;
+extern GList *root_definitions_directories;
 
 /**
  * The list of defintions directories found
  */ 
-GList *definitions_directories;
+extern GList *definitions_directories;
 
 /** The name of the current save file (gets updated when a game is
     saved or loaded).  */
-gchar *save_file;
+extern gchar *save_file;
 
 /** Whether we are using a Unix system or Windows. */
-gboolean os_is_unix;
+extern gboolean os_is_unix;
 
 /** The hints displayed in the splash screen. */
-OptionList hints;
+extern OptionList hints;
--- a/src/xml_country.c
+++ b/src/xml_country.c
@@ -65,7 +65,7 @@
 /**
  * The state variable used in the XML parsing functions.
  */
-gint state;
+extern gint state;
 Country *cntry;
 
 /**
--- a/src/xml_cup.c
+++ b/src/xml_cup.c
@@ -129,7 +129,7 @@
 /**
  * The state variable used in the XML parsing functions.
  */
-gint state;
+extern gint state;
 
 /** The variable we will fill and append to an array. */
 Cup new_cup;
--- a/src/xml_league.c
+++ b/src/xml_league.c
@@ -123,7 +123,7 @@
 /**
  * The state variable used in the XML parsing functions.
  */
-gint state;
+extern gint state;
 
 /** The new league we create and append to an array. */
 League new_league;
--- a/src/xml_lg_commentary.c
+++ b/src/xml_lg_commentary.c
@@ -80,7 +80,8 @@
     STATE_END
 };
 
-gint state, commentary_idx, priority;
+extern gint state;
+gint commentary_idx, priority;
 gchar *condition;
 
 /** Return the appropriate enum integer going with the event string. */
--- a/src/xml_loadsave_cup.c
+++ b/src/xml_loadsave_cup.c
@@ -80,13 +80,13 @@
     TAG_END
 };
 
-gint state;
-Cup *new_cup;
-CupChooseTeam new_choose_team;
-CupRound new_round;
-gchar *dirname;
-WeekBreak new_week_break;
-CupRoundWait new_wait;
+extern gint state;
+extern Cup *new_cup;
+extern CupChooseTeam new_choose_team;
+extern CupRound new_round;
+extern gchar *dirname;
+extern WeekBreak new_week_break;
+extern CupRoundWait new_wait;
 
 void
 xml_loadsave_cup_start_element (GMarkupParseContext *context,
--- a/src/xml_loadsave_fixtures.c
+++ b/src/xml_loadsave_fixtures.c
@@ -47,7 +47,8 @@
     TAG_END
 };
 
-gint state, residx1, residx2, teamidx, nameidx;
+extern gint state;
+gint residx1, residx2, teamidx, nameidx;
 Fixture new_fixture;
 GArray *fixtures_array;
 
--- a/src/xml_loadsave_jobs.c
+++ b/src/xml_loadsave_jobs.c
@@ -48,7 +48,7 @@
     TAG_END
 };
 
-gint state;
+extern gint state;
 Job new_job;
 
 void
--- a/src/xml_loadsave_league.c
+++ b/src/xml_loadsave_league.c
@@ -67,12 +67,13 @@
     TAG_END
 };
 
-gint promrankidx, state;
+gint promrankidx;
+extern gint state;
 PromRelElement new_element;
 PromGames new_prom_games;
-WeekBreak new_week_break;
-League *new_league;
-gchar *dirname;
+extern WeekBreak new_week_break;
+extern League *new_league;
+extern gchar *dirname;
 
 void
 xml_loadsave_league_start_element (GMarkupParseContext *context,
--- a/src/xml_loadsave_leagues_cups.c
+++ b/src/xml_loadsave_leagues_cups.c
@@ -44,7 +44,7 @@
     TAG_END
 };
 
-gint state;
+extern gint state;
 const gchar *dir;
 
 void
--- a/src/xml_loadsave_league_stat.c
+++ b/src/xml_loadsave_league_stat.c
@@ -46,7 +46,8 @@
     TAG_END
 };
 
-gint state, in_state, valueidx;
+extern gint state;
+gint in_state, valueidx;
 Stat new_stat;
 LeagueStat *lig_stat;
 
--- a/src/xml_loadsave_live_game.c
+++ b/src/xml_loadsave_live_game.c
@@ -63,7 +63,8 @@
     TAG_END
 };
 
-gint state, unitidx,
+extern gint state;
+gint unitidx,
     statvalidx, statvalidx2, statplidx, statplidx2,
     team_name_idx;
 LiveGameUnit new_unit;
--- a/src/xml_loadsave_misc.c
+++ b/src/xml_loadsave_misc.c
@@ -53,8 +53,9 @@
     TAG_END
 };
 
-gint state, countidx, oddidx, betidx;
-BetMatch new_bet;
+extern gint state;
+gint countidx, oddidx, betidx;
+extern BetMatch new_bet;
 
 void
 xml_loadsave_misc_start_element (GMarkupParseContext *context,
--- a/src/xml_loadsave_newspaper.c
+++ b/src/xml_loadsave_newspaper.c
@@ -49,8 +49,8 @@
     TAG_END
 };
 
-gint state;
-NewsPaperArticle new_article;
+extern gint state;
+extern NewsPaperArticle new_article;
 
 void
 xml_loadsave_newspaper_start_element (GMarkupParseContext *context,
--- a/src/xml_loadsave_players.c
+++ b/src/xml_loadsave_players.c
@@ -69,8 +69,9 @@
     TAG_END
 };
 
-gint state, etalidx, careeridx;
-Player new_player;
+extern gint state;
+gint etalidx, careeridx;
+extern Player new_player;
 PlayerGamesGoals new_games_goals;
 PlayerCard new_card;
 
--- a/src/xml_loadsave_season_stats.c
+++ b/src/xml_loadsave_season_stats.c
@@ -46,7 +46,7 @@
     TAG_END
 };
 
-gint state, in_state;
+extern gint state, in_state;
 ChampStat new_champ_stat;
 SeasonStat new_season_stat;
 const gchar *dirname2;
--- a/src/xml_loadsave_table.c
+++ b/src/xml_loadsave_table.c
@@ -38,8 +38,8 @@
     TAG_END
 };
 
-gint state, valueidx;
-TableElement new_element;
+extern gint state, valueidx;
+extern TableElement new_element;
 Table *new_table;
 
 void
--- a/src/xml_loadsave_teams.c
+++ b/src/xml_loadsave_teams.c
@@ -53,12 +53,9 @@
     TAG_END
 };
 
-gint state, etalidx, careeridx;
+extern gint state;
 GArray *teams_array;
 Team new_team;
-Player new_player;
-PlayerGamesGoals new_games_goals;
-PlayerCard new_card;
 
 void
 xml_loadsave_teams_start_element (GMarkupParseContext *context,
--- a/src/xml_loadsave_transfers.c
+++ b/src/xml_loadsave_transfers.c
@@ -46,7 +46,8 @@
     TAG_END
 };
 
-gint state, feeidx, wageidx;
+extern gint state;
+gint feeidx, wageidx;
 Transfer new_transfer;
 TransferOffer new_offer;
 
--- a/src/xml_loadsave_users.c
+++ b/src/xml_loadsave_users.c
@@ -79,7 +79,8 @@
     TAG_END
 };
 
-gint state, idx_mon_in, idx_mon_out, idx,
+extern gint state;
+gint idx_mon_in, idx_mon_out, idx,
     idx_bet, idx_cnt;
 User new_user;
 UserHistory new_history;
--- a/src/xml_mmatches.c
+++ b/src/xml_mmatches.c
@@ -47,7 +47,7 @@
 /**
  * The state variable used in the XML parsing functions.
  */
-gint state;
+extern gint state;
 MemMatch new_match;
 gchar *dirname;
 GArray *mm_array;
--- a/src/xml_news.c
+++ b/src/xml_news.c
@@ -59,8 +59,9 @@
     STATE_END
 };
 
-gint state, article_idx, priority;
-gchar *condition;
+extern gint state, priority;
+gint article_idx;
+extern gchar *condition;
 NewsArticle new_article;
 NewsText new_title, new_subtitle;
 
--- a/src/xml_strategy.c
+++ b/src/xml_strategy.c
@@ -91,7 +91,8 @@
     STATE_STRATEGY_MATCH_ACTION_SUB_OUT_POS,
 };
 
-gint state, action_id;
+extern gint state;
+gint action_id;
 
 #define curstrat g_array_index(strategies, Strategy, strategies->len - 1)
 #define curprematch g_array_index(curstrat.prematch, StrategyPrematch, curstrat.prematch->len - 1)
--- a/src/xml_team.c
+++ b/src/xml_team.c
@@ -70,7 +70,8 @@
     STATE_END
 };
 
-gint state, birth_year;
+extern gint state;
+gint birth_year;
 Player new_player;
 Team *team;
 const gchar *d_file;