Procházet zdrojové kódy

Silenced more warnings!

Thomas Buck před 11 roky
rodič
revize
499e161678
5 změnil soubory, kde provedl 225 přidání a 222 odebrání
  1. 2
    2
      src/Emitter.cpp
  2. 45
    45
      src/Emitter.h
  3. 169
    169
      src/OpenRaider.cpp
  4. 6
    3
      src/System.cpp
  5. 3
    3
      src/System.h

+ 2
- 2
src/Emitter.cpp Zobrazit soubor

@@ -68,7 +68,7 @@ int compareParticleDist(const void *voidA, const void *voidB)
68 68
 }
69 69
 
70 70
 
71
-Emitter::Emitter(char *name, int n)
71
+Emitter::Emitter(const char *name, int n)
72 72
 {
73 73
 	_name = NULL;
74 74
 	_flags = 0;
@@ -172,7 +172,7 @@ void Emitter::ParticleArray(int n)
172 172
 }
173 173
 
174 174
 
175
-void Emitter::Name(char *name)
175
+void Emitter::Name(const char *name)
176 176
 {
177 177
 	int l;
178 178
 

+ 45
- 45
src/Emitter.h Zobrazit soubor

@@ -1,6 +1,6 @@
1 1
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2 2
 /*================================================================
3
- * 
3
+ *
4 4
  * Project : Freyja
5 5
  * Author  : Terry 'Mongoose' Hendrix II
6 6
  * Website : http://www.westga.edu/~stu7440/
@@ -10,10 +10,10 @@
10 10
  * Comments: Particle emitter for freyja
11 11
  *
12 12
  *
13
- *           This file was generated using Mongoose's C++ 
13
+ *           This file was generated using Mongoose's C++
14 14
  *           template generator script.  <stu7440@westga.edu>
15
- * 
16
- *-- History ------------------------------------------------ 
15
+ *
16
+ *-- History ------------------------------------------------
17 17
  *
18 18
  * 2001.08.13:
19 19
  * Mongoose - Now using new Particle class!
@@ -33,14 +33,14 @@ class Emitter
33 33
 {
34 34
  public:
35 35
 
36
-	typedef enum 
36
+	typedef enum
37 37
 	{
38 38
 		fUseFrustumCulling = 1,
39 39
 		fUseDepthSorting = 2
40 40
 	} EmitterFlags;
41 41
 
42 42
 
43
-  Emitter(char *name, int n);
43
+  Emitter(const char *name, int n);
44 44
   /*------------------------------------------------------
45 45
    * Pre  : name is a valid C string
46 46
 	*        n is a number greater than 0
@@ -49,7 +49,7 @@ class Emitter
49 49
    *
50 50
    *-- History ------------------------------------------
51 51
    *
52
-   * 2001.06.30: 
52
+   * 2001.06.30:
53 53
    * Mongoose - Created
54 54
    ------------------------------------------------------*/
55 55
 
@@ -60,29 +60,29 @@ class Emitter
60 60
    *
61 61
    *-- History ------------------------------------------
62 62
    *
63
-   * 2001.06.30: 
63
+   * 2001.06.30:
64 64
    * Mongoose - Created
65 65
    ------------------------------------------------------*/
66 66
 
67 67
    Particle *Particles();
68 68
   /*------------------------------------------------------
69
-   * Pre  : 
69
+   * Pre  :
70 70
    * Post : Returns particle array
71 71
    *
72 72
    *-- History ------------------------------------------
73 73
    *
74
-   * 2001.08.14: 
74
+   * 2001.08.14:
75 75
    * Mongoose - Created
76 76
    ------------------------------------------------------*/
77 77
 
78 78
   int Count();
79 79
   /*------------------------------------------------------
80
-   * Pre  : 
80
+   * Pre  :
81 81
    * Post : Returns number of particles emitted
82 82
    *
83 83
    *-- History ------------------------------------------
84 84
    *
85
-   * 2001.08.14: 
85
+   * 2001.08.14:
86 86
    * Mongoose - Created
87 87
    ------------------------------------------------------*/
88 88
 
@@ -93,7 +93,7 @@ class Emitter
93 93
    *
94 94
    *-- History ------------------------------------------
95 95
    *
96
-   * 2001.08.13: 
96
+   * 2001.08.13:
97 97
    * Mongoose - Created
98 98
    ------------------------------------------------------*/
99 99
 
@@ -104,7 +104,7 @@ class Emitter
104 104
    *
105 105
    *-- History ------------------------------------------
106 106
    *
107
-   * 2001.08.13: 
107
+   * 2001.08.13:
108 108
    * Mongoose - Created
109 109
    ------------------------------------------------------*/
110 110
 
@@ -115,7 +115,7 @@ class Emitter
115 115
    *
116 116
    *-- History ------------------------------------------
117 117
    *
118
-   * 2001.08.13: 
118
+   * 2001.08.13:
119 119
    * Mongoose - Created
120 120
    ------------------------------------------------------*/
121 121
 
@@ -126,33 +126,33 @@ class Emitter
126 126
    *
127 127
    *-- History ------------------------------------------
128 128
    *
129
-   * 2001.08.13: 
129
+   * 2001.08.13:
130 130
    * Mongoose - Created
131 131
    ------------------------------------------------------*/
132 132
 
133 133
   unsigned int Flags();
134 134
   /*------------------------------------------------------
135
-   * Pre  : 
135
+   * Pre  :
136 136
    * Post : Returns emitter flags
137 137
    *
138 138
    *-- History ------------------------------------------
139 139
    *
140
-   * 2001.08.14: 
140
+   * 2001.08.14:
141 141
    * Mongoose - Created
142 142
    ------------------------------------------------------*/
143 143
 
144 144
 
145 145
   void Flags(unsigned int flag, bool op);
146 146
   /*------------------------------------------------------
147
-   * Pre  : 
148
-   * Post : Set and Unset flag with op 
147
+   * Pre  :
148
+   * Post : Set and Unset flag with op
149 149
 	*
150 150
 	*          true - set
151 151
 	*          flase - unset
152 152
    *
153 153
    *-- History ------------------------------------------
154 154
    *
155
-   * 2001.08.14: 
155
+   * 2001.08.14:
156 156
    * Mongoose - Created
157 157
    ------------------------------------------------------*/
158 158
 
@@ -162,108 +162,108 @@ class Emitter
162 162
    * Post : Allocates the particle array and sets the count.
163 163
 	*        If the array has been allocated previously, then
164 164
 	*        the array is deallocated and a new one made.
165
-	*         
165
+	*
166 166
    *
167 167
    *-- History ------------------------------------------
168 168
    *
169
-   * 2001.08.13: 
169
+   * 2001.08.13:
170 170
    * Mongoose - Created
171 171
    ------------------------------------------------------*/
172 172
 
173 173
   void Draw();
174 174
   /*------------------------------------------------------
175
-   * Pre  : 
175
+   * Pre  :
176 176
    * Post : Renders particles
177 177
    *
178 178
    *-- History ------------------------------------------
179 179
    *
180
-   * 2001.06.30: 
180
+   * 2001.06.30:
181 181
    * Mongoose - Created
182 182
    ------------------------------------------------------*/
183 183
 
184
-  void Name(char *name);
184
+  void Name(const char *name);
185 185
   /*------------------------------------------------------
186 186
    * Pre  : name is a valid C string
187 187
    * Post : Sets the emitters name
188 188
    *
189 189
    *-- History ------------------------------------------
190 190
    *
191
-   * 2001.08.13: 
191
+   * 2001.08.13:
192 192
    * Mongoose - Created
193 193
    ------------------------------------------------------*/
194 194
 
195 195
   void SetTextureId(int id);
196 196
   /*------------------------------------------------------
197
-   * Pre  : 
197
+   * Pre  :
198 198
    * Post : Resets all particle texture ids
199 199
    *
200 200
    *-- History ------------------------------------------
201 201
    *
202
-   * 2001.08.13: 
202
+   * 2001.08.13:
203 203
    * Mongoose - Created
204 204
    ------------------------------------------------------*/
205 205
 
206
-  void TextureId(unsigned int particle_start, unsigned int particle_end, 
206
+  void TextureId(unsigned int particle_start, unsigned int particle_end,
207 207
 					  int id);
208 208
   /*------------------------------------------------------
209
-   * Pre  : particle_start and particle_end are a valid 
209
+   * Pre  : particle_start and particle_end are a valid
210 210
 	*        range of particles in the array
211 211
 	*
212 212
 	*        id is a valid texture id
213 213
 	*
214
-   * Post : 
214
+   * Post :
215 215
    *
216 216
    *-- History ------------------------------------------
217 217
    *
218
-   * 2001.08.14: 
218
+   * 2001.08.14:
219 219
    * Mongoose - Created
220 220
    ------------------------------------------------------*/
221 221
 
222
-  void Color(unsigned int particle_start, unsigned int particle_end, 
222
+  void Color(unsigned int particle_start, unsigned int particle_end,
223 223
 				 float r, float g, float b);
224 224
   /*------------------------------------------------------
225
-   * Pre  : particle_start and particle_end are a valid 
225
+   * Pre  : particle_start and particle_end are a valid
226 226
 	*        range of particles in the array
227 227
 	*
228 228
 	*        r,g,b are colors 0.0 to 1.0
229 229
 	*
230
-   * Post : 
230
+   * Post :
231 231
    *
232 232
    *-- History ------------------------------------------
233 233
    *
234
-   * 2001.08.14: 
234
+   * 2001.08.14:
235 235
    * Mongoose - Created
236 236
    ------------------------------------------------------*/
237 237
 
238
-  void Speed(unsigned int particle_start, unsigned int particle_end, 
238
+  void Speed(unsigned int particle_start, unsigned int particle_end,
239 239
 				 float x, float y, float z);
240 240
   /*------------------------------------------------------
241
-   * Pre  : particle_start and particle_end are a valid 
241
+   * Pre  : particle_start and particle_end are a valid
242 242
 	*        range of particles in the array
243 243
 	*
244 244
 	*        take note speed inits at 2000, lower is faster
245 245
 	*
246
-   * Post : 
246
+   * Post :
247 247
    *
248 248
    *-- History ------------------------------------------
249 249
    *
250
-   * 2001.08.14: 
250
+   * 2001.08.14:
251 251
    * Mongoose - Created
252 252
    ------------------------------------------------------*/
253 253
 
254
-  void Force(unsigned int particle_start, unsigned int particle_end, 
254
+  void Force(unsigned int particle_start, unsigned int particle_end,
255 255
 				 float x, float y, float z);
256 256
   /*------------------------------------------------------
257
-   * Pre  : particle_start and particle_end are a valid 
257
+   * Pre  : particle_start and particle_end are a valid
258 258
 	*        range of particles in the array
259 259
 	*
260 260
 	*        Force/Gravity acting on particles
261 261
 	*
262
-   * Post : 
262
+   * Post :
263 263
    *
264 264
    *-- History ------------------------------------------
265 265
    *
266
-   * 2001.08.14: 
266
+   * 2001.08.14:
267 267
    * Mongoose - Created
268 268
    ------------------------------------------------------*/
269 269
 

+ 169
- 169
src/OpenRaider.cpp
Diff nebyl zobrazen, protože je příliš veliký
Zobrazit soubor


+ 6
- 3
src/System.cpp Zobrazit soubor

@@ -332,7 +332,7 @@ int System::downloadToFile(char *urlString, char *filename)
332 332
 // Public Mutators
333 333
 ////////////////////////////////////////////////////////////
334 334
 
335
-unsigned int System::addCommandMode(char *command)
335
+unsigned int System::addCommandMode(const char *command)
336 336
 {
337 337
 	if (command && command[0] == '[')
338 338
 	{
@@ -353,9 +353,10 @@ void System::bindKeyCommand(char *cmd, unsigned int key, int event)
353 353
 }
354 354
 
355 355
 
356
-void System::command(char *cmd)
356
+void System::command(const char *cmd)
357 357
 {
358 358
 	bool modeFound = false;
359
+    char *cmdbuf;
359 360
 
360 361
 
361 362
 	if (!cmd || !cmd[0]) // Null command string
@@ -380,7 +381,9 @@ void System::command(char *cmd)
380 381
 	}
381 382
 	else // Execute a command in current mode, eg "stat fps"
382 383
 	{
383
-		handleCommand(cmd, mCommandMode);
384
+        cmdbuf = new char[strlen(cmd) + 1];
385
+        strncpy(cmdbuf, cmd, strlen(cmd) + 1);
386
+		handleCommand(cmdbuf, mCommandMode);
384 387
 	}
385 388
 }
386 389
 

+ 3
- 3
src/System.h Zobrazit soubor

@@ -197,7 +197,7 @@ public:
197 197
 	// Public Mutators
198 198
 	////////////////////////////////////////////////////////////
199 199
 
200
-	virtual unsigned int addCommandMode(char *command);
200
+	virtual unsigned int addCommandMode(const char *command);
201 201
 	/*------------------------------------------------------
202 202
 	 * Pre  : <Command> is valid command mode for the
203 203
 	 *        resource file, eg "[Engine.OpenGL.Driver]"
@@ -224,7 +224,7 @@ public:
224 224
 	 * Mongoose - Created
225 225
 	 ------------------------------------------------------*/
226 226
 
227
-	virtual void command(char *cmd);
227
+	virtual void command(const char *cmd);
228 228
 	/*------------------------------------------------------
229 229
 	 * Pre  : cmd is a valid command string
230 230
 	 * Post : cmd sets it's var
@@ -488,7 +488,7 @@ public:
488 488
 
489 489
 	bool mConsoleMode;         /* Using text (console) event handler? */
490 490
 
491
-	Vector<char *> mCmdModes;	/* Dynamic resource command collection */
491
+	Vector<const char *> mCmdModes;	/* Dynamic resource command collection */
492 492
 
493 493
 	unsigned int mCommandMode;	/* Current resource command mode */
494 494
 

Loading…
Zrušit
Uložit