File: patch-to-use-extern-properly.-divVerent-neededed-it-so-we.patch

package info (click to toggle)
fteqcc 3343%2Bsvn3400-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,164 kB
  • sloc: ansic: 56,690; makefile: 75; sh: 6
file content (148 lines) | stat: -rw-r--r-- 3,985 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
From: Spoike <acceptthis@users.sourceforge.net>
Date: Sun, 1 Jan 2012 17:34:32 +0000
Subject: patch to use extern properly. divVerent neededed it,
 so we might as well.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3950 fc73d0e0-1445-4013-8a0c-d673dee63da5
(cherry picked from commit ac526f0e1b501f8ee663423fbaaef887616adf1e)
---
 qcc.h         | 45 +++++++++++++++++++++++++++------------------
 qcc_pr_comp.c |  1 -
 qcc_pr_lex.c  |  7 -------
 qccmain.c     |  8 ++++++--
 4 files changed, 33 insertions(+), 28 deletions(-)

diff --git a/qcc.h b/qcc.h
index 828db78..41736bc 100644
--- a/qcc.h
+++ b/qcc.h
@@ -282,7 +282,7 @@ extern hashtable_t globalstable, localstable;
 #endif
 
 #ifdef WRITEASM
-FILE *asmfile;
+extern FILE *asmfile;
 #endif
 //=============================================================================
 
@@ -841,23 +841,32 @@ extern int numtemps;
 
 typedef char PATHSTRING[MAX_DATA_PATH];
 
-PATHSTRING		*precache_sounds;
-int			*precache_sounds_block;
-int			*precache_sounds_used;
-int			numsounds;
-
-PATHSTRING		*precache_textures;
-int			*precache_textures_block;
-int			numtextures;
-
-PATHSTRING		*precache_models;
-int			*precache_models_block;
-int			*precache_models_used;
-int			nummodels;
-
-PATHSTRING		*precache_files;
-int			*precache_files_block;
-int			numfiles;
+extern PATHSTRING		*precache_sounds;
+extern int			*precache_sounds_block;
+extern int			*precache_sounds_used;
+extern int			numsounds;
+
+extern PATHSTRING		*precache_textures;
+extern int			*precache_textures_block;
+extern int			numtextures;
+
+extern PATHSTRING		*precache_models;
+extern int			*precache_models_block;
+extern int			*precache_models_used;
+extern int			nummodels;
+
+extern PATHSTRING		*precache_files;
+extern int			*precache_files_block;
+extern int			numfiles;
+
+typedef struct qcc_includechunk_s {
+	struct qcc_includechunk_s *prev;
+	char *filename;
+	char *currentdatapoint;
+	int currentlinenumber;
+	CompilerConstant_t *cnst;
+} qcc_includechunk_t;
+extern qcc_includechunk_t *currentchunk;
 
 int	QCC_CopyString (char *str);
 
diff --git a/qcc_pr_comp.c b/qcc_pr_comp.c
index cb7abd2..c0f91cb 100644
--- a/qcc_pr_comp.c
+++ b/qcc_pr_comp.c
@@ -9693,7 +9693,6 @@ pbool QCC_Include(char *filename)
 	int opr_source_line;
 	char *ocompilingfile;
 	struct qcc_includechunk_s *oldcurrentchunk;
-	extern struct qcc_includechunk_s *currentchunk;
 
 	ocompilingfile = compilingfile;
 	os_file = s_file;
diff --git a/qcc_pr_lex.c b/qcc_pr_lex.c
index 6b442bc..462113b 100644
--- a/qcc_pr_lex.c
+++ b/qcc_pr_lex.c
@@ -88,13 +88,6 @@ void QCC_PR_LexWhitespace (void);
 
 //for compiler constants and file includes.
 
-typedef struct qcc_includechunk_s {
-	struct qcc_includechunk_s *prev;
-	char *filename;
-	char *currentdatapoint;
-	int currentlinenumber;
-	CompilerConstant_t *cnst;
-} qcc_includechunk_t;
 qcc_includechunk_t *currentchunk;
 void QCC_PR_IncludeChunkEx (char *data, pbool duplicate, char *filename, CompilerConstant_t *cnst)
 {
diff --git a/qccmain.c b/qccmain.c
index 48d1994..4e51bc7 100644
--- a/qccmain.c
+++ b/qccmain.c
@@ -23,8 +23,6 @@ void QCC_PR_LexWhitespace (void);
 void *FS_ReadToMem(char *fname, void *membuf, int *len);
 void FS_CloseFromMem(void *mem);
 
-struct qcc_includechunk_s *currentchunk;
-
 unsigned int MAX_REGS;
 
 int	MAX_STRINGS;
@@ -74,14 +72,17 @@ int			numfielddefs;
 
 PATHSTRING		*precache_sounds;
 int			*precache_sounds_block;
+int			*precache_sounds_used;
 int			numsounds;
 
 PATHSTRING		*precache_textures;
 int			*precache_textures_block;
+int			*precache_textures_block;
 int			numtextures;
 
 PATHSTRING		*precache_models;
 int			*precache_models_block;
+int			*precache_models_used;
 int			nummodels;
 
 PATHSTRING		*precache_files;
@@ -92,6 +93,9 @@ extern int numCompilerConstants;
 hashtable_t compconstantstable;
 hashtable_t globalstable;
 hashtable_t localstable;
+#ifdef WRITEASM
+FILE *asmfile;
+#endif
 hashtable_t floatconstdefstable;
 hashtable_t stringconstdefstable;