ソースを参照

Moved headers and started moving tests

Thomas Buck 10年前
コミット
ece6b3ec5a
58個のファイルの変更543行の追加514行の削除
  1. 5
    0
      ChangeLog
  2. 13
    13
      Makefile
  3. 0
    0
      include/Camera.h
  4. 0
    0
      include/Emitter.h
  5. 0
    0
      include/GLString.h
  6. 0
    0
      include/Light.h
  7. 0
    0
      include/Network.h
  8. 0
    0
      include/OpenGLMesh.h
  9. 0
    0
      include/OpenRaider.h
  10. 0
    0
      include/Particle.h
  11. 0
    0
      include/Render.h
  12. 0
    0
      include/SDLSystem.h
  13. 0
    0
      include/SkeletalModel.h
  14. 0
    0
      include/Sound.h
  15. 0
    0
      include/System.h
  16. 0
    0
      include/Texture.h
  17. 0
    0
      include/TombRaider.h
  18. 0
    0
      include/TombRaider1.h
  19. 0
    0
      include/TombRaider5.h
  20. 0
    0
      include/World.h
  21. 0
    0
      include/endian.h
  22. 0
    0
      include/hel/BoundingVolume.h
  23. 0
    0
      include/hel/Entity.h
  24. 0
    0
      include/hel/Matrix.h
  25. 0
    0
      include/hel/Quaternion.h
  26. 0
    0
      include/hel/Vector3d.h
  27. 0
    0
      include/hel/ViewVolume.h
  28. 0
    0
      include/hel/math.h
  29. 41
    4
      include/memory_test.h
  30. 19
    19
      include/mstl/List.h
  31. 59
    58
      include/mstl/Map.h
  32. 3
    3
      include/mstl/Tree.h
  33. 2
    2
      include/mstl/Vector.h
  34. 0
    0
      include/mtk_tga.h
  35. 5
    4
      src/Camera.cpp
  36. 4
    3
      src/Emitter.cpp
  37. 7
    8
      src/GLString.cpp
  38. 1
    1
      src/Light.cpp
  39. 38
    38
      src/Network.cpp
  40. 2
    1
      src/OpenGLMesh.cpp
  41. 12
    12
      src/OpenRaider.cpp
  42. 4
    3
      src/Particle.cpp
  43. 4
    8
      src/Render.cpp
  44. 5
    9
      src/SDLSystem.cpp
  45. 1
    1
      src/SkeletalModel.cpp
  46. 4
    3
      src/Sound.cpp
  47. 3
    7
      src/System.cpp
  48. 6
    6
      src/Texture.cpp
  49. 7
    6
      src/TombRaider.cpp
  50. 4
    3
      src/World.cpp
  51. 21
    21
      src/endian.cpp
  52. 2
    1
      src/hel/Matrix.cpp
  53. 2
    1
      src/hel/Quaternion.cpp
  54. 2
    1
      src/hel/Vector3d.cpp
  55. 39
    38
      src/hel/ViewVolume.cpp
  56. 61
    237
      src/memory_test.cpp
  57. 3
    3
      src/mtk_tga.cpp
  58. 164
    0
      test/memory_test.cpp

+ 5
- 0
ChangeLog ファイルの表示

@@ -5,6 +5,11 @@
5 5
 
6 6
  OpenRaider (0.1.2) xythobuz <xythobuz@xythobuz.de>
7 7
 
8
+	[ 20140109 ]
9
+	* Renamed all memeory references to memory
10
+	* Moved headers into include/
11
+	* Put Unit Tests into test/
12
+
8 13
 	[ 20140107 ]
9 14
 	* Removed hel/Mass. There was an object of this class in World,
10 15
 	  but it was never used!

+ 13
- 13
Makefile ファイルの表示

@@ -29,7 +29,7 @@ UNAME=$(shell uname -s)
29 29
 # -DUNICODE_SUPPORT			Add unicode/internation keyboard support
30 30
 # -DUSING_EMITTER_IN_GAME	Run particle test in game
31 31
 
32
-BASE_DEFS=$(shell sdl-config --cflags) -Isrc -DSDL_INTERFACE \
32
+BASE_DEFS=$(shell sdl-config --cflags) -Iinclude -DSDL_INTERFACE \
33 33
 	-DUSING_OPENGL -DZLIB_SUPPORT -DUSING_EMITTER \
34 34
 	-DUSING_OPENAL -DUSING_MTK_TGA -DUSING_PTHREADS \
35 35
 	-DUSING_HEL -DHAVE_SDL_TTF
@@ -158,13 +158,13 @@ ded:
158 158
 	CFLAGS="$(DEBUG_CFLAGS) -DDEDICATED_SERVER" \
159 159
 	LD_FLAGS="$(LD_FLAGS)"
160 160
 
161
-# -DDEBUG_MEMEORY_VERBOSE
162
-# -DDEBUG_MEMEORY
161
+# -DDEBUG_MEMORY_VERBOSE
162
+# -DDEBUG_MEMORY
163 163
 memory:
164 164
 	@-mkdir -p $(BUILD_MEM_DIR)
165 165
 	$(MAKE) targets BUILDDIR=$(BUILD_MEM_DIR) \
166 166
 	DEBUG_OBJ="$(BUILD_MEM_DIR)/memory_test.o" \
167
-	CFLAGS="$(DEBUG_CFLAGS) -DDEBUG_MEMEORY" \
167
+	CFLAGS="$(DEBUG_CFLAGS) -DDEBUG_MEMORY" \
168 168
 	LD_FLAGS="$(LD_FLAGS)"
169 169
 
170 170
 depend:
@@ -295,15 +295,15 @@ TombRaider.reg_test:
295 295
 TombRaider.test:
296 296
 	@-mkdir -p $(BUILD_TEST_DIR)
297 297
 	$(MAKE) targets NAME=TombRaider.test BUILDDIR=$(BUILD_TEST_DIR) \
298
-	OBJS="$(BUILD_TEST_DIR)/TombRaider.o $(BUILD_TEST_DIR)/mtk_tga.o $(BUILD_TEST_DIR)/memeory_test.o" \
299
-	CFLAGS="$(BASE_CFLAGS) -g -D__TOMBRAIDER_TEST__ -D__TEST_TR5_DUMP_TGA -D__TEST_32BIT_TEXTILES -DDEBUG_MEMEORY" \
298
+	OBJS="$(BUILD_TEST_DIR)/TombRaider.o $(BUILD_TEST_DIR)/mtk_tga.o $(BUILD_TEST_DIR)/memory_test.o" \
299
+	CFLAGS="$(BASE_CFLAGS) -g -D__TOMBRAIDER_TEST__ -D__TEST_TR5_DUMP_TGA -D__TEST_32BIT_TEXTILES -DDEBUG_MEMORY" \
300 300
 	LD_FLAGS="-lz -lstdc++"
301 301
 
302 302
 #################################################################
303 303
 
304 304
 GLString.test:
305 305
 	mkdir -p $(BUILD_TEST_DIR)
306
-	$(CC) -Wall -Isrc -D__TEST__ -DHAVE_MTK -DHAVE_SDL -DUSING_MTK_TGA \
306
+	$(CC) -Wall -Iinclude -D__TEST__ -DHAVE_MTK -DHAVE_SDL -DUSING_MTK_TGA \
307 307
 	$(shell sdl-config --cflags) $(shell sdl-config --libs) \
308 308
 	$(GL_LIBS) $(GL_DEFS) -lm -lstdc++ \
309 309
 	src/Texture.cpp src/mtk_tga.cpp \
@@ -316,7 +316,7 @@ Hel.test: Quaternion.test Matrix.test Math.test
316 316
 Matrix.test:
317 317
 	@-echo "Building Matrix unit test"
318 318
 	mkdir -p $(BUILD_TEST_DIR)
319
-	$(CC) -Wall -g -DMATRIX_UNIT_TEST -lm -lstdc++ -Isrc \
319
+	$(CC) -Wall -g -DMATRIX_UNIT_TEST -lm -lstdc++ -Iinclude \
320 320
 	src/hel/Matrix.cpp src/hel/Quaternion.cpp src/hel/Vector3d.cpp \
321 321
 	-o $(BUILD_TEST_DIR)/Matrix.test
322 322
 	@-echo "================================================="
@@ -326,7 +326,7 @@ Matrix.test:
326 326
 Quaternion.test:
327 327
 	@-echo "Building Quaternion unit test"
328 328
 	mkdir -p $(BUILD_TEST_DIR)
329
-	$(CC) -Wall -g -DUNIT_TEST_QUATERNION -lm -lstdc++ -Isrc \
329
+	$(CC) -Wall -g -DUNIT_TEST_QUATERNION -lm -lstdc++ -Iinclude \
330 330
 	src/hel/Quaternion.cpp -o $(BUILD_TEST_DIR)/Quaternion.test
331 331
 	@-echo "================================================="
332 332
 	@-echo "Running Quaternion unit test"
@@ -335,7 +335,7 @@ Quaternion.test:
335 335
 Math.test:
336 336
 	@-echo "Building Math unit test"
337 337
 	mkdir -p $(BUILD_TEST_DIR)
338
-	$(CC) -Wall -g -DMATH_UNIT_TEST -lm -lstdc++ -Isrc \
338
+	$(CC) -Wall -g -DMATH_UNIT_TEST -lm -lstdc++ -Iinclude \
339 339
 	src/hel/math.cpp src/hel/Vector3d.cpp -o $(BUILD_TEST_DIR)/Math.test
340 340
 	@-echo "================================================="
341 341
 	@-echo "Running hel unit test"
@@ -345,9 +345,9 @@ Math.test:
345 345
 
346 346
 Memory.test:
347 347
 	mkdir -p $(BUILD_TEST_DIR)
348
-	$(CC) -Wall -g -D__TEST__ -lstdc++ \
349
-	-DDEBUG_MEMEORY -DDEBUG_MEMEORY_ERROR \
350
-	src/memeory_test.cpp -o $(BUILD_TEST_DIR)/memory_test.test
348
+	$(CC) -Wall -g -lstdc++ -Iinclude \
349
+	-DDEBUG_MEMORY -DDEBUG_MEMORY_ERROR \
350
+	src/memory_test.cpp test/memory_test.cpp -o $(BUILD_TEST_DIR)/memory_test.test
351 351
 
352 352
 #################################################################
353 353
 

src/Camera.h → include/Camera.h ファイルの表示


src/Emitter.h → include/Emitter.h ファイルの表示


src/GLString.h → include/GLString.h ファイルの表示


src/Light.h → include/Light.h ファイルの表示


src/Network.h → include/Network.h ファイルの表示


src/OpenGLMesh.h → include/OpenGLMesh.h ファイルの表示


src/OpenRaider.h → include/OpenRaider.h ファイルの表示


src/Particle.h → include/Particle.h ファイルの表示


src/Render.h → include/Render.h ファイルの表示


src/SDLSystem.h → include/SDLSystem.h ファイルの表示


src/SkeletalModel.h → include/SkeletalModel.h ファイルの表示


src/Sound.h → include/Sound.h ファイルの表示


src/System.h → include/System.h ファイルの表示


src/Texture.h → include/Texture.h ファイルの表示


src/TombRaider.h → include/TombRaider.h ファイルの表示


src/TombRaider1.h → include/TombRaider1.h ファイルの表示


src/TombRaider5.h → include/TombRaider5.h ファイルの表示


src/World.h → include/World.h ファイルの表示


src/endian.h → include/endian.h ファイルの表示


src/hel/BoundingVolume.h → include/hel/BoundingVolume.h ファイルの表示


src/hel/Entity.h → include/hel/Entity.h ファイルの表示


src/hel/Matrix.h → include/hel/Matrix.h ファイルの表示


src/hel/Quaternion.h → include/hel/Quaternion.h ファイルの表示


src/hel/Vector3d.h → include/hel/Vector3d.h ファイルの表示


src/hel/ViewVolume.h → include/hel/ViewVolume.h ファイルの表示


src/hel/math.h → include/hel/math.h ファイルの表示


src/memeory_test.h → include/memory_test.h ファイルの表示

@@ -21,10 +21,10 @@
21 21
 
22 22
 #include <cstddef>
23 23
 
24
-#ifndef __MTK_MONGOOSE_MEMEORY_TEST_H_
25
-#define __MTK_MONGOOSE_MEMEORY_TEST_H_
24
+#ifndef __MTK_MONGOOSE_MEMORY_TEST_H_
25
+#define __MTK_MONGOOSE_MEMORY_TEST_H_
26 26
 
27
-#ifdef DEBUG_MEMEORY
27
+#if defined(DEBUG_MEMORY) && !defined(UNIT_TEST_MEMORY)
28 28
 
29 29
 #define DEBUG_NEW new(__FILE__, __LINE__)
30 30
 void *operator new(size_t size, const char *file, int line);
@@ -63,7 +63,7 @@ void operator delete [](void *p);
63 63
 	void dump_memory_report();
64 64
 	/*------------------------------------------------------
65 65
 	 * Pre  :
66
-	 * Post : Dumps raw Tree holding memeory accounting
66
+	 * Post : Dumps raw Tree holding memory accounting
67 67
 	 *
68 68
 	 *-- History ------------------------------------------
69 69
 	 *
@@ -71,5 +71,42 @@ void operator delete [](void *p);
71 71
 	 * Mongoose - Created
72 72
 	 ------------------------------------------------------*/
73 73
 
74
+#ifdef DEBUG_MEMORY
75
+
76
+    #define DWORD unsigned long
77
+    #define ZERO_ALLOC_SLOTS 3
78
+
79
+    typedef enum { RB_BLACK = 0, RB_RED = 1 } rbtree_color_t;
80
+
81
+    typedef struct rbtree_s {
82
+        void *data;
83
+        DWORD key;
84
+        rbtree_color_t color;
85
+        struct rbtree_s *left;
86
+        struct rbtree_s *right;
87
+        struct rbtree_s *parent;
88
+    } rbtree_t;
89
+
90
+    typedef struct meminfo_filename_s {
91
+        char *filename;
92
+        char filename_len;
93
+        DWORD size;
94
+        unsigned int alloc_zero;
95
+        unsigned short int alloc_zero_at_line[ZERO_ALLOC_SLOTS];
96
+        struct meminfo_filename_s *next;
97
+    } meminfo_filename_t;
98
+
99
+    extern rbtree_t *MEMORY_INFO;
100
+    extern meminfo_filename_t *MEMORY_FILENAME;
101
+    extern long MEMORY_USED;
102
+    extern long MEMORYA_USED;
103
+    extern long MEMORYC_USED;
104
+    extern long MAX_MEMORY_USED;
105
+    extern long MAX_MEMORYA_USED;
106
+    extern long MAX_MEMORYC_USED;
107
+
108
+    void tree_valid_report(rbtree_t *root);
109
+
110
+#endif
74 111
 
75 112
 #endif

src/mstl/List.h → include/mstl/List.h ファイルの表示

@@ -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  : Mongoose
6 6
  * Website : http://www.westga.edu/~stu7440/
@@ -10,11 +10,11 @@
10 10
  * Comments: mtk Template list
11 11
  *
12 12
  *           UINT_MAX is an error condition, used in place of -1
13
- * 
14
- *           This file was generated using Mongoose's C++ 
13
+ *
14
+ *           This file was generated using Mongoose's C++
15 15
  *           template generator script.  <stu7440@westga.edu>
16
- * 
17
- *-- History ------------------------------------------------ 
16
+ *
17
+ *-- History ------------------------------------------------
18 18
  *
19 19
  * 2000-10-26:
20 20
  * Mongoose - Created
@@ -28,11 +28,11 @@
28 28
 #include <limits.h>
29 29
 #include <stdio.h>
30 30
 
31
-#ifdef DEBUG_MEMEORY
32
-#   include "memeory_test.h"
31
+#ifdef DEBUG_MEMORY
32
+#include <memory_test.h>
33 33
 #endif
34 34
 
35
- 
35
+
36 36
 template <class T> class ListNode
37 37
 {
38 38
  public:
@@ -155,7 +155,7 @@ template <class T> class List
155 155
 
156 156
       last = current;
157 157
       current = current->Next();
158
-    }    
158
+    }
159 159
 
160 160
     return 0;
161 161
   }
@@ -184,7 +184,7 @@ template <class T> class List
184 184
 
185 185
       last = current;
186 186
       current = current->Next();
187
-    }    
187
+    }
188 188
 
189 189
     return UINT_MAX;
190 190
   }
@@ -228,7 +228,7 @@ template <class T> class List
228 228
 
229 229
 	if (_current == current)
230 230
 	  _current = NULL;
231
-	
231
+
232 232
 	delete current;
233 233
 	_num_items--;
234 234
 
@@ -237,7 +237,7 @@ template <class T> class List
237 237
 
238 238
       last = current;
239 239
       current = current->Next();
240
-    }    
240
+    }
241 241
   }
242 242
 
243 243
   void Remove(T data)
@@ -259,7 +259,7 @@ template <class T> class List
259 259
 	{
260 260
 	  last->Next(current->Next());
261 261
 	}
262
-	
262
+
263 263
 	if (_current == current)
264 264
 	  _current = NULL;
265 265
 
@@ -271,7 +271,7 @@ template <class T> class List
271 271
 
272 272
       last = current;
273 273
       current = current->Next();
274
-    }    
274
+    }
275 275
   }
276 276
 
277 277
   bool Empty()
@@ -291,7 +291,7 @@ template <class T> class List
291 291
 
292 292
     printf(" [%i] {\n", _num_items);
293 293
 
294
-    
294
+
295 295
     while (current)
296 296
     {
297 297
       printf("#%i, ", current->Id());
@@ -304,7 +304,7 @@ template <class T> class List
304 304
       fflush(stdout);
305 305
     }
306 306
 
307
-    printf(" }\n");    
307
+    printf(" }\n");
308 308
   }
309 309
 
310 310
 
@@ -314,7 +314,7 @@ template <class T> class List
314 314
 
315 315
     printf("List %i {\n", _num_items);
316 316
 
317
-    
317
+
318 318
     while (current)
319 319
     {
320 320
       //current->Print();
@@ -354,7 +354,7 @@ template <class T> class List
354 354
   {
355 355
     if (!_current)
356 356
       return UINT_MAX;
357
-    
357
+
358 358
     return _current->Id();
359 359
   }
360 360
 
@@ -407,7 +407,7 @@ template <class T> class List
407 407
 	{
408 408
 	  node->Id(i);
409 409
 	  node->Next(current);
410
-	  
410
+
411 411
 	  if (current == _head)
412 412
 	    _head = node;
413 413
 	  else if (last)

src/mstl/Map.h → include/mstl/Map.h ファイルの表示

@@ -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  : Mongoose
6 6
  * Website : http://www.westga.edu/~stu7440/
@@ -8,11 +8,11 @@
8 8
  * Object  : Map
9 9
  * License : No use w/o permission (C) 2000-2002 Mongoose
10 10
  * Comments: mtk Template list
11
- * 
12
- *           This file was generated using Mongoose's C++ 
11
+ *
12
+ *           This file was generated using Mongoose's C++
13 13
  *           template generator script.  <stu7440@westga.edu>
14
- * 
15
- *-- History ------------------------------------------------ 
14
+ *
15
+ *-- History ------------------------------------------------
16 16
  *
17 17
  * 2002.02.19:
18 18
  * Mongoose - Using RBTree and list overlay for faster access
@@ -25,7 +25,7 @@
25 25
  * Mongoose - Binary tree overlay started... at 0300  /_\ Zzzz
26 26
  *
27 27
  * 2002.02.01:
28
- * Mongoose - Dug out of cobwebs and fixed up 
28
+ * Mongoose - Dug out of cobwebs and fixed up
29 29
  *            Yes, I believe in code reuse!  =)
30 30
  *
31 31
  * 2000.10.26:
@@ -38,10 +38,11 @@
38 38
 
39 39
 #include <stdlib.h>
40 40
 #include <stdio.h>
41
-#include "Tree.h"
42 41
 
43
-#ifdef DEBUG_MEMEORY
44
-#   include "memeory_test.h"
42
+#include <mstl/Tree.h>
43
+
44
+#ifdef DEBUG_MEMORY
45
+#include <memory_test.h>
45 46
 #endif
46 47
 
47 48
 
@@ -57,47 +58,47 @@ public:
57 58
 		_next = NULL;
58 59
 	}
59 60
 
60
-	
61
+
61 62
 	~MapNode()
62 63
 	{
63 64
 	}
64
-	
65
+
65 66
 
66 67
 	void Key(K key)
67 68
 	{
68 69
 		_key = key;
69 70
 	}
70
-	
71
+
71 72
 
72 73
 	K Key()
73 74
 	{
74 75
 		return _key;
75 76
 	}
76
-	
77
+
77 78
 
78 79
 	void Data(D data)
79 80
 	{
80 81
     _data = data;
81 82
 	}
82
-	
83
+
83 84
 
84 85
 	D Data()
85 86
 	{
86 87
 		return _data;
87 88
 	}
88
-	
89
+
89 90
 
90 91
 	MapNode<K, D> *Next()
91 92
 	{
92 93
 		return _next;
93 94
 	}
94
-	
95
+
95 96
 
96 97
 	void Next(MapNode<K, D> *next)
97 98
 	{
98 99
 		_next = next;
99 100
 	}
100
-	
101
+
101 102
 private:
102 103
 
103 104
 	MapNode<K, D> *_next;
@@ -111,7 +112,7 @@ private:
111 112
 template <class K, class D> class Map
112 113
 {
113 114
 public:
114
-	
115
+
115 116
 	Map()
116 117
 	{
117 118
 		UnSetError();
@@ -120,20 +121,20 @@ public:
120 121
 		_current = NULL;
121 122
 		_cache = NULL;
122 123
 	}
123
-	
124
-	
124
+
125
+
125 126
 	~Map()
126 127
 	{
127 128
 		Clear();
128 129
 	}
129
-	
130
+
130 131
 
131 132
 	void Clear()
132 133
 	{
133 134
 		UnSetError();
134 135
 		_num_items = 0;
135 136
 		_cache = NULL;
136
-		
137
+
137 138
 		while (_head)
138 139
 		{
139 140
 			_current = _head;
@@ -149,13 +150,13 @@ public:
149 150
 	{
150 151
 		_error = true;
151 152
 	}
152
-	
153
+
153 154
 
154 155
 	void UnSetError()
155 156
 	{
156 157
 		_error = false;
157 158
 	}
158
-	
159
+
159 160
 
160 161
 	bool GetError()
161 162
 	{
@@ -167,7 +168,7 @@ public:
167 168
 	{
168 169
 		MapNode<K, D> *current = NULL;
169 170
 		MapNode<K, D> *next = NULL;
170
-		
171
+
171 172
 
172 173
 		if (_head)
173 174
 		{
@@ -190,7 +191,7 @@ public:
190 191
 				if (_error)
191 192
 					return false;
192 193
 			}
193
-			
194
+
194 195
 			if (current)
195 196
 			{
196 197
 				_cache = _current = current;
@@ -207,16 +208,16 @@ public:
207 208
 	{
208 209
 		return FindDataByKey(key);
209 210
 	}
210
-	
211
+
211 212
 
212 213
 	K FindKeyByData(D data)
213 214
 	{
214 215
 		MapNode<K, D> *current = _head;
215 216
 		MapNode<K, D> *last = NULL;
216
-		
217
+
217 218
 
218 219
 		UnSetError();
219
-		
220
+
220 221
 		while (current)
221 222
 		{
222 223
 			// Found
@@ -225,7 +226,7 @@ public:
225 226
 				_cache = current;
226 227
 				return current->Key();
227 228
 			}
228
-			
229
+
229 230
 			last = current;
230 231
 			current = current->Next();
231 232
 		}
@@ -275,7 +276,7 @@ public:
275 276
 			{
276 277
 				current = _tree.SearchByKey(key, &_error);
277 278
 			}
278
-			
279
+
279 280
 			if (current)
280 281
 			{
281 282
 				_cache = _current = current;
@@ -288,12 +289,12 @@ public:
288 289
 		return false;
289 290
 	}
290 291
 
291
-	
292
+
292 293
 	bool Add(K key, D data)
293 294
 	{
294 295
 		MapNode<K, D> *node;
295
-		
296
-		
296
+
297
+
297 298
 		UnSetError();
298 299
 		node = new MapNode<K, D>(key, data);
299 300
 		_num_items++;
@@ -323,7 +324,7 @@ public:
323 324
 				if (current->Key() > node->Key())
324 325
 				{
325 326
 					node->Next(current);
326
-					
327
+
327 328
 					if (current == _head)
328 329
 					{
329 330
 						_head = node;
@@ -340,7 +341,7 @@ public:
340 341
 				last = current;
341 342
 				current = current->Next();
342 343
 			}
343
-			
344
+
344 345
 			// Append
345 346
 			last->Next(node);
346 347
 		}
@@ -349,7 +350,7 @@ public:
349 350
 			_head = node;
350 351
 		}
351 352
 
352
-		_tree.Insert(node->Key(), node);		
353
+		_tree.Insert(node->Key(), node);
353 354
 		return true;
354 355
 	}
355 356
 
@@ -358,7 +359,7 @@ public:
358 359
 	{
359 360
 		MapNode<K, D> *current = _head;
360 361
 		MapNode<K, D> *last = NULL;
361
-		
362
+
362 363
 
363 364
 		UnSetError();
364 365
 
@@ -377,7 +378,7 @@ public:
377 378
 				{
378 379
 					last->Next(current->Next());
379 380
 				}
380
-				
381
+
381 382
 				if (_current == current)
382 383
 				{
383 384
 					_current = NULL;
@@ -386,10 +387,10 @@ public:
386 387
 				_tree.RemoveByKey(current->Key());
387 388
 				delete current;
388 389
 				_num_items--;
389
-				
390
+
390 391
 				return;
391 392
 			}
392
-			
393
+
393 394
 			last = current;
394 395
 			current = current->Next();
395 396
 		}
@@ -402,7 +403,7 @@ public:
402 403
 	{
403 404
 		MapNode<K, D> *current = _head;
404 405
 		MapNode<K, D> *last = NULL;
405
-		
406
+
406 407
 
407 408
 		UnSetError();
408 409
 
@@ -421,7 +422,7 @@ public:
421 422
 				{
422 423
 					last->Next(current->Next());
423 424
 				}
424
-				
425
+
425 426
 				if (_current == current)
426 427
 				{
427 428
 					_current = NULL;
@@ -430,10 +431,10 @@ public:
430 431
 				_tree.RemoveByKey(current->Key());
431 432
 				delete current;
432 433
 				_num_items--;
433
-				
434
+
434 435
 				return;
435 436
 			}
436
-			
437
+
437 438
 			last = current;
438 439
 			current = current->Next();
439 440
 		}
@@ -473,7 +474,7 @@ public:
473 474
 		}
474 475
 
475 476
 		printf(" [%i] {\n", _num_items);
476
-		
477
+
477 478
 		while (current)
478 479
 		{
479 480
 			printf("(");
@@ -482,11 +483,11 @@ public:
482 483
 			(*print_data_func)(current->Data());
483 484
 			printf("), ");
484 485
 
485
-			current = current->Next();			
486
+			current = current->Next();
486 487
 			fflush(stdout);
487 488
 		}
488
-		
489
-		printf(" }\n");    
489
+
490
+		printf(" }\n");
490 491
 	}
491 492
 
492 493
 
@@ -509,7 +510,7 @@ public:
509 510
 		{
510 511
 			_current = _current->Next();
511 512
 		}
512
-		
513
+
513 514
 		return (_current != NULL);
514 515
 	}
515 516
 
@@ -523,13 +524,13 @@ public:
523 524
 	K CurrentKey()
524 525
 	{
525 526
 		UnSetError();
526
-		
527
+
527 528
 		if (!_current)
528 529
 		{
529 530
 			SetError();
530 531
 			return 0;
531 532
 		}
532
-		
533
+
533 534
 		return _current->Key();
534 535
 	}
535 536
 
@@ -537,26 +538,26 @@ public:
537 538
 	D Current()
538 539
 	{
539 540
 		UnSetError();
540
-		
541
+
541 542
 		if (!_current)
542 543
 		{
543 544
 			SetError();
544 545
 			return 0;
545 546
 		}
546
-		
547
+
547 548
 		return _current->Data();
548 549
 	}
549 550
 
550 551
 private:
551
-	
552
+
552 553
 	unsigned int _num_items;
553
-	
554
+
554 555
 	bool _error;
555
-	
556
+
556 557
 	Tree<K, MapNode<K, D> *> _tree;
557 558
 
558 559
 	MapNode<K, D> *_head;
559
-	
560
+
560 561
 	MapNode<K, D> *_current;
561 562
 
562 563
 	MapNode<K, D> *_cache;

src/mstl/Tree.h → include/mstl/Tree.h ファイルの表示

@@ -47,11 +47,11 @@
47 47
 #include <stdio.h>
48 48
 
49 49
 #ifdef USE_IOSTREAM
50
-#   include <iostream.h>
50
+#include <iostream.h>
51 51
 #endif
52 52
 
53
-#ifdef DEBUG_MEMEORY
54
-#   include "memeory_test.h"
53
+#ifdef DEBUG_MEMORY
54
+#include <memory_test.h>
55 55
 #endif
56 56
 
57 57
 

src/mstl/Vector.h → include/mstl/Vector.h ファイルの表示

@@ -27,8 +27,8 @@
27 27
 #include <stdlib.h>
28 28
 #include <stdio.h>
29 29
 
30
-#ifdef DEBUG_MEMEORY
31
-#   include "memeory_test.h"
30
+#ifdef DEBUG_MEMORY
31
+#include <memory_test.h>
32 32
 #endif
33 33
 
34 34
 

src/mtk_tga.h → include/mtk_tga.h ファイルの表示


+ 5
- 4
src/Camera.cpp ファイルの表示

@@ -34,11 +34,12 @@
34 34
 
35 35
 #include <stdio.h>
36 36
 #include <math.h>
37
-#include "hel/math.h"
38
-#include "Camera.h"
39 37
 
40
-#ifdef DEBUG_MEMEORY
41
-#   include "memeory_test.h"
38
+#include <hel/math.h>
39
+#include <Camera.h>
40
+
41
+#ifdef DEBUG_MEMORY
42
+#include <memory_test.h>
42 43
 #endif
43 44
 
44 45
 

+ 4
- 3
src/Emitter.cpp ファイルの表示

@@ -29,10 +29,11 @@
29 29
 #include <GL/gl.h>
30 30
 #include <GL/glu.h>
31 31
 #endif
32
-#include "Emitter.h"
33 32
 
34
-#ifdef DEBUG_MEMEORY
35
-#   include "memeory_test.h"
33
+#include <Emitter.h>
34
+
35
+#ifdef DEBUG_MEMORY
36
+#include <memory_test.h>
36 37
 #endif
37 38
 
38 39
 vec_t Emitter::mFrustum[6][4];

+ 7
- 8
src/GLString.cpp ファイルの表示

@@ -15,12 +15,11 @@
15 15
 #include <GL/gl.h>
16 16
 #endif
17 17
 
18
-#include "Texture.h"
18
+#include <Texture.h>
19
+#include <GLString.h>
19 20
 
20
-#include "GLString.h"
21
-
22
-#ifdef DEBUG_MEMEORY
23
-#include "memeory_test.h"
21
+#ifdef DEBUG_MEMORY
22
+#include <memory_test.h>
24 23
 #endif
25 24
 
26 25
 
@@ -419,12 +418,12 @@ gl_string_t *GLString::GetString(unsigned int id)
419 418
 #endif
420 419
 
421 420
 #ifdef HAVE_MTK
422
-#   include "Texture.h"
423
-#   include "mtk_tga.h"
421
+#include <Texture.h>
422
+#include <mtk_tga.h>
424 423
 
425 424
 Texture gTexture;
426 425
 #else
427
-#   error "Requires MTK: Texture and mtk_tga"
426
+#error "Requires MTK: Texture and mtk_tga"
428 427
 #endif
429 428
 
430 429
 

+ 1
- 1
src/Light.cpp ファイルの表示

@@ -19,7 +19,7 @@
19 19
  * Mongoose - Created
20 20
  =================================================================*/
21 21
 
22
-#include "Light.h"
22
+#include <Light.h>
23 23
 
24 24
 
25 25
 Light::Light()

+ 38
- 38
src/Network.cpp ファイルの表示

@@ -1,25 +1,25 @@
1 1
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2 2
 /*================================================================
3
- * 
3
+ *
4 4
  * Project : UnRaider
5 5
  * Author  : Terry 'Mongoose' Hendrix II
6 6
  * Website : http://www.westga.edu/~stu7440/
7 7
  * Email   : stu7440@westga.edu
8 8
  * Object  : Network
9 9
  * License : No use w/o permission (C) 2002 Mongoose
10
- * Comments: 
10
+ * Comments:
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
  * 2002.06.21:
19 19
  * Mongoose - Created
20 20
  =================================================================*/
21 21
 
22
-#include "Network.h"
22
+#include <Network.h>
23 23
 
24 24
 #include <unistd.h>
25 25
 #include <signal.h>
@@ -70,11 +70,11 @@ Network *Network::mInstance = 0x0;
70 70
 
71 71
 Network *Network::Instance()
72 72
 {
73
-	if (mInstance == 0x0) 
73
+	if (mInstance == 0x0)
74 74
 	{
75 75
 		mInstance = new Network();
76 76
 	}
77
-	
77
+
78 78
 	return mInstance;
79 79
 }
80 80
 
@@ -82,7 +82,7 @@ Network *Network::Instance()
82 82
 void killNetworkSingleton()
83 83
 {
84 84
 	printf("Shutting down Network...\n");
85
-	
85
+
86 86
 	// Requires public deconstructor
87 87
 	delete Network::Instance();
88 88
 }
@@ -145,7 +145,7 @@ unsigned int Network::getUID()
145 145
 	srand(tv.tv_usec);
146 146
 
147 147
 	return ((unsigned int)(tv.tv_sec * getRandom(2.0, 3.3) -
148
-								  tv.tv_sec * getRandom(1.0, 2.0)) + 
148
+								  tv.tv_sec * getRandom(1.0, 2.0)) +
149 149
 			  (unsigned int)(tv.tv_usec * getRandom(2.0, 3.3) -
150 150
 								  tv.tv_usec * getRandom(1.0, 2.0)) +
151 151
 			  (unsigned int)getRandom(666.0, 5000.0));
@@ -285,7 +285,7 @@ int Network::runServer()
285 285
 	struct sockaddr_in s_in, from;
286 286
 	char hostid[64];
287 287
 	network_frame_t f;
288
-	unsigned int i;	
288
+	unsigned int i;
289 289
 	unsigned int packetsRecieved = 0;
290 290
 
291 291
 
@@ -309,7 +309,7 @@ int Network::runServer()
309 309
 			return -1;
310 310
 		}
311 311
 
312
-		printf("Server: gethostname returned '%s'\n", hostid); 
312
+		printf("Server: gethostname returned '%s'\n", hostid);
313 313
 		fflush(stdout);
314 314
 	}
315 315
 
@@ -346,8 +346,8 @@ int Network::runServer()
346 346
 
347 347
 	cip = ntohl(s_in.sin_addr.s_addr);
348 348
 
349
-	printf("Server: Started on ( %i.%i.%i.%i:%i )\n", 
350
-			 cip >> 24, cip << 8 >> 24, 
349
+	printf("Server: Started on ( %i.%i.%i.%i:%i )\n",
350
+			 cip >> 24, cip << 8 >> 24,
351 351
 			 cip << 16 >> 24, cip << 24 >> 24, s_in.sin_port);
352 352
 
353 353
 	for (; !mKillClient;)
@@ -356,7 +356,7 @@ int Network::runServer()
356 356
 
357 357
 		// 1. Wait for event
358 358
 		// 2. Get inbound frame
359
-		cc = recvfrom(socket_fd, &f, sizeof(network_frame_t), 0, 
359
+		cc = recvfrom(socket_fd, &f, sizeof(network_frame_t), 0,
360 360
 						  (struct sockaddr *)&from, &fsize);
361 361
 
362 362
 		if (cc < 0)
@@ -396,7 +396,7 @@ int Network::runServer()
396 396
 					gClients[i].frameExpected = 0;
397 397
 					++gNumClients;
398 398
 
399
-					printf("Server: %u made connection, as client %i\n", 
399
+					printf("Server: %u made connection, as client %i\n",
400 400
 							 gClients[i].uid, i);
401 401
 					break;
402 402
 				}
@@ -417,12 +417,12 @@ int Network::runServer()
417 417
 
418 418
 		if (mDebug)
419 419
 		{
420
-			printf("Server: Client (Famliy %d, Address %i.%i.%i.%i:%d)\n", 
421
-					 ntohs(from.sin_family), cip >> 24, cip << 8 >> 24, 
422
-					 cip << 16 >> 24, cip << 24 >> 24, 
420
+			printf("Server: Client (Famliy %d, Address %i.%i.%i.%i:%d)\n",
421
+					 ntohs(from.sin_family), cip >> 24, cip << 8 >> 24,
422
+					 cip << 16 >> 24, cip << 24 >> 24,
423 423
 					 ntohs(from.sin_port));
424 424
 
425
-			printf("Server: Datalink layer recieved: packet seq %i\n", 
425
+			printf("Server: Datalink layer recieved: packet seq %i\n",
426 426
 					 f.seq);
427 427
 		}
428 428
 
@@ -453,9 +453,9 @@ int Network::runServer()
453 453
 			to_network_layer(f.data);
454 454
 			gClients[i].frameExpected = !gClients[i].frameExpected;
455 455
 		}
456
-		
456
+
457 457
 		fflush(stdout);
458
-		
458
+
459 459
 #ifdef UNIT_TEST_NETWORK
460 460
 		if ((rand() % 10 == 0))
461 461
 		{
@@ -463,7 +463,7 @@ int Network::runServer()
463 463
 			continue;
464 464
 		}
465 465
 #endif
466
-		
466
+
467 467
 		// 4. Send ACK, w/ piggyback if requested
468 468
 		if (mPiggyBack)
469 469
 		{
@@ -476,7 +476,7 @@ int Network::runServer()
476 476
 				printf("SERVER> Sending data by piggyback\n");
477 477
 			}
478 478
 
479
-			cc = sendto(socket_fd, &gPiggyBack, sizeof(gPiggyBack), 0, 
479
+			cc = sendto(socket_fd, &gPiggyBack, sizeof(gPiggyBack), 0,
480 480
 							(struct sockaddr *)&from, sizeof(from));
481 481
 		}
482 482
 		else
@@ -485,10 +485,10 @@ int Network::runServer()
485 485
 			f.seq = 0;
486 486
 			f.uid = gUID;
487 487
 
488
-			cc = sendto(socket_fd, &f, sizeof(f), 0, 
488
+			cc = sendto(socket_fd, &f, sizeof(f), 0,
489 489
 							(struct sockaddr *)&from, sizeof(from));
490 490
 		}
491
-		
491
+
492 492
 		if (cc < 0)
493 493
 		{
494 494
 			perror("Server: send_udp:sendto");
@@ -519,15 +519,15 @@ void Network::runClient()
519 519
 	fd_set  readfds;
520 520
 	unsigned int packetsSent = 0;
521 521
 	unsigned int seq = 0;
522
-	char timedOut = 1;  
522
+	char timedOut = 1;
523 523
 
524 524
 	if (!mRemoteHost || !mRemoteHost[0])
525 525
 	{
526 526
 		return;
527 527
 	}
528 528
 
529
-	memset((char*) &timeout, 0, sizeof(timeout)); 
530
-	timeout.tv_sec = 5; 
529
+	memset((char*) &timeout, 0, sizeof(timeout));
530
+	timeout.tv_sec = 5;
531 531
 
532 532
 	socket_fd = socket(AF_INET, SOCK_DGRAM, 0);
533 533
 
@@ -536,10 +536,10 @@ void Network::runClient()
536 536
 		perror("Client: send_udp: socket");
537 537
 		exit(0);
538 538
 	}
539
-    
539
+
540 540
 	if ((hostptr = gethostbyname(mRemoteHost)) == NULL)
541 541
 	{
542
-		fprintf(stderr, "Client: send_udp: invalid host name, %s\n", 
542
+		fprintf(stderr, "Client: send_udp: invalid host name, %s\n",
543 543
 				  mRemoteHost);
544 544
 		exit(0);
545 545
 	}
@@ -560,7 +560,7 @@ void Network::runClient()
560 560
 #endif
561 561
 
562 562
 
563
-	// init	
563
+	// init
564 564
 	f.data.send = 0;
565 565
 	f.seq = 0;
566 566
 
@@ -608,7 +608,7 @@ void Network::runClient()
608 608
 				printf("Client: Sending packet %i\n", f.seq);
609 609
 			}
610 610
 
611
-			cc = sendto(socket_fd, &f, sizeof(f), 0, 
611
+			cc = sendto(socket_fd, &f, sizeof(f), 0,
612 612
 							(struct sockaddr *)&dest, sizeof(dest));
613 613
 
614 614
 			if (cc < 0)
@@ -631,16 +631,16 @@ void Network::runClient()
631 631
 
632 632
 		// 4. Wait for +ack or resend
633 633
 		FD_ZERO(&readfds);
634
- 
634
+
635 635
 		// Setup socket to listen on here
636 636
 		FD_SET(socket_fd, &readfds);
637 637
 
638 638
 		// Set timeout in milliseconds
639
-		timeout.tv_usec = 850; 
639
+		timeout.tv_usec = 850;
640 640
 
641 641
 		cc = select(socket_fd + 1, &readfds, NULL, NULL, &timeout);
642 642
 
643
-		if ((cc < 0) && (errno != EINTR)) 
643
+		if ((cc < 0) && (errno != EINTR))
644 644
 		{
645 645
 			// there was an local error with select
646 646
 		}
@@ -659,8 +659,8 @@ void Network::runClient()
659 659
 		f.header = 0;
660 660
 
661 661
 		fsize = sizeof(dest);
662
-		cc = recvfrom(socket_fd, &f, sizeof(f), 0, 
663
-						  (struct sockaddr *)&dest, &fsize); 
662
+		cc = recvfrom(socket_fd, &f, sizeof(f), 0,
663
+						  (struct sockaddr *)&dest, &fsize);
664 664
 
665 665
 		if (cc < 0)
666 666
 		{

+ 2
- 1
src/OpenGLMesh.cpp ファイルの表示

@@ -10,7 +10,8 @@
10 10
 #else
11 11
 #include <GL/gl.h>
12 12
 #endif
13
-#include "OpenGLMesh.h"
13
+
14
+#include <OpenGLMesh.h>
14 15
 
15 16
 
16 17
 ////////////////////////////////////////////////////////////

+ 12
- 12
src/OpenRaider.cpp ファイルの表示

@@ -27,14 +27,14 @@
27 27
 #include <math.h>
28 28
 #include <sys/types.h>
29 29
 
30
-#ifdef DEBUG_MEMEORY
31
-#include "memeory_test.h"
30
+#ifdef DEBUG_MEMORY
31
+#include <memory_test.h>
32 32
 #endif
33 33
 
34
-#include "World.h"
35
-#include "SkeletalModel.h"
36
-#include "TombRaider1.h" // tmp stop-gap
37
-#include "OpenRaider.h"
34
+#include <World.h>
35
+#include <SkeletalModel.h>
36
+#include <TombRaider1.h> // tmp stop-gap
37
+#include <OpenRaider.h>
38 38
 
39 39
 enum OpenRaiderText { textConsole = 2, textMenu = 3, textOutput = 4 };
40 40
 
@@ -90,8 +90,8 @@ void killOpenRaiderSingleton()
90 90
 	//delete OpenRaider::Instance();
91 91
 #warning "Can't delete OpenRaider::Instance() without a not-allocated-free error. Something is fishy here..."
92 92
 
93
-#ifdef DEBUG_MEMEORY
94
-	printf("\n[Mongoose MEMEORY_DEBUG]\nMemory leak table:\n");
93
+#ifdef DEBUG_MEMORY
94
+	printf("\n[Mongoose MEMORY_DEBUG]\nMemory leak table:\n");
95 95
 	dump_memory_report();
96 96
 #endif
97 97
 
@@ -1127,7 +1127,7 @@ void OpenRaider::loadLevel(char *mapname)
1127 1127
 	// Cache/process sound fx
1128 1128
 	processPakSounds();
1129 1129
 
1130
-#ifdef DEBUG_MEMEORY
1130
+#ifdef DEBUG_MEMORY
1131 1131
 	// Right before pak is cleared will be highest use or memory
1132 1132
 	display_memory_usage();
1133 1133
 #endif
@@ -1137,7 +1137,7 @@ void OpenRaider::loadLevel(char *mapname)
1137 1137
 
1138 1138
 	print(true, "Level pak freed from memory, Starting game...");
1139 1139
 
1140
-#ifdef DEBUG_MEMEORY
1140
+#ifdef DEBUG_MEMORY
1141 1141
 	display_memory_usage();
1142 1142
 #endif
1143 1143
 
@@ -2895,7 +2895,7 @@ void OpenRaider::consoleCommand(char *cmd)
2895 2895
 	}
2896 2896
 	else if (rc_command("mem", cmd))
2897 2897
 	{
2898
-#ifdef DEBUG_MEMEORY
2898
+#ifdef DEBUG_MEMORY
2899 2899
 		if (rc_command("usage", cmd))
2900 2900
 		{
2901 2901
 			display_memory_usage();
@@ -2905,7 +2905,7 @@ void OpenRaider::consoleCommand(char *cmd)
2905 2905
 			dump_memory_report();
2906 2906
 		}
2907 2907
 #else
2908
-		printf("This build isn't DEBUG_MEMEORY enabled\n");
2908
+		printf("This build isn't DEBUG_MEMORY enabled\n");
2909 2909
 #endif
2910 2910
 	}
2911 2911
 	else if (rc_command("loadlevel", cmd))

+ 4
- 3
src/Particle.cpp ファイルの表示

@@ -7,10 +7,11 @@
7 7
 
8 8
 #include <stdlib.h>
9 9
 #include <stdio.h>
10
-#include "Particle.h"
11 10
 
12
-#ifdef DEBUG_MEMEORY
13
-#   include "memeory_test.h"
11
+#include <Particle.h>
12
+
13
+#ifdef DEBUG_MEMORY
14
+#include <memory_test.h>
14 15
 #endif
15 16
 
16 17
 

+ 4
- 8
src/Render.cpp ファイルの表示

@@ -31,18 +31,14 @@
31 31
 #include <string.h>
32 32
 
33 33
 #ifdef USING_EMITTER
34
-#include "Emitter.h"
34
+#include <Emitter.h>
35 35
 #endif
36 36
 
37
-#ifdef DEBUG_MEMEORY
38
-#include "memeory_test.h"
37
+#ifdef DEBUG_MEMORY
38
+#include <memory_test.h>
39 39
 #endif
40 40
 
41
-#ifdef DEBUG_GL
42
-#include "gl_test.cpp"
43
-#endif
44
-
45
-#include "Render.h"
41
+#include <Render.h>
46 42
 
47 43
 extern entity_t *LARA;
48 44
 extern World gWorld;

+ 5
- 9
src/SDLSystem.cpp ファイルの表示

@@ -32,8 +32,8 @@
32 32
 #include <string.h>
33 33
 #include <cmath>
34 34
 
35
-#ifdef MEMEORY_TEST
36
-#include "memeory_test.h"
35
+#ifdef MEMORY_TEST
36
+#include <memory_test.h>
37 37
 #endif
38 38
 
39 39
 #ifdef USING_OPENGL
@@ -42,11 +42,7 @@
42 42
 #error "SDLSystem requires -DUSING_OPENGL"
43 43
 #endif
44 44
 
45
-#ifdef PS2_LINUX
46
-#include "ps2.h"
47
-#endif
48
-
49
-#include "SDLSystem.h"
45
+#include <SDLSystem.h>
50 46
 
51 47
 
52 48
 unsigned int *gWidth = 0x0;
@@ -581,8 +577,8 @@ void SDLSystem::shutdown(int i)
581 577
 	//SDL_QuitSubSystem(SDL_OPENGL);
582 578
 	//SDL_Quit(); // Moved to atexit() call
583 579
 
584
-	//#ifdef DEBUG_MEMEORY
585
-	//printf("[Mongoose MEMEORY_DEBUG]\nUnfreed memory table:\n");
580
+	//#ifdef DEBUG_MEMORY
581
+	//printf("[Mongoose MEMORY_DEBUG]\nUnfreed memory table:\n");
586 582
 	//dump_memory_report();
587 583
 	//#endif
588 584
 

+ 1
- 1
src/SkeletalModel.cpp ファイルの表示

@@ -19,7 +19,7 @@
19 19
  * Mongoose - Created
20 20
  =================================================================*/
21 21
 
22
-#include "SkeletalModel.h"
22
+#include <SkeletalModel.h>
23 23
 
24 24
 
25 25
 ////////////////////////////////////////////////////////////

+ 4
- 3
src/Sound.cpp ファイルの表示

@@ -30,10 +30,11 @@
30 30
 #include <sys/stat.h>
31 31
 #include <fcntl.h>
32 32
 #include <unistd.h>
33
-#include "Sound.h"
34 33
 
35
-#ifdef DEBUG_MEMEORY
36
-#include "memeory_test.h"
34
+#include <Sound.h>
35
+
36
+#ifdef DEBUG_MEMORY
37
+#include <memory_test.h>
37 38
 #endif
38 39
 
39 40
 

+ 3
- 7
src/System.cpp ファイルの表示

@@ -37,15 +37,11 @@
37 37
 #include <sys/time.h>
38 38
 #endif
39 39
 
40
-#ifdef MEMEORY_TEST
41
-#include "memeory_test.h"
40
+#ifdef MEMORY_TEST
41
+#include <memory_test.h>
42 42
 #endif
43 43
 
44
-#ifdef PS2_LINUX
45
-#include "ps2linux.h"
46
-#endif
47
-
48
-#include "System.h"
44
+#include <System.h>
49 45
 
50 46
 ////////////////////////////////////////////////////////////
51 47
 // Constructors

+ 6
- 6
src/Texture.cpp ファイルの表示

@@ -33,20 +33,20 @@
33 33
 #include <stdio.h>
34 34
 #include <stdarg.h>
35 35
 
36
-#ifdef DEBUG_MEMEORY
37
-#   include "memeory_test.h"
36
+#ifdef DEBUG_MEMORY
37
+#include <memory_test.h>
38 38
 #endif
39 39
 
40 40
 #ifdef USING_MTK_TGA
41
-#   include "mtk_tga.h"
41
+#include <mtk_tga.h>
42 42
 #endif
43 43
 
44 44
 #ifdef USING_MTK_PNG
45
-#   include "mtk_png.h"
45
+#include <mtk_png.h>
46 46
 #endif
47 47
 
48 48
 #ifdef HAVE_SDL_TTF
49
-#   include <SDL/SDL_ttf.h>
49
+#include <SDL/SDL_ttf.h>
50 50
 #endif
51 51
 
52 52
 #ifdef __APPLE__
@@ -57,7 +57,7 @@
57 57
 #include <GL/glu.h>
58 58
 #endif
59 59
 
60
-#include "Texture.h"
60
+#include <Texture.h>
61 61
 
62 62
 //Texture *gTextureManager = 0x0;
63 63
 gl_font_t *gFontTest = 0x0;

+ 7
- 6
src/TombRaider.cpp ファイルの表示

@@ -49,20 +49,21 @@
49 49
 #include <math.h>
50 50
 #include <string.h>
51 51
 #include <stdarg.h>
52
-#include "TombRaider.h"
52
+
53
+#include <TombRaider.h>
53 54
 
54 55
 #ifdef ZLIB_SUPPORT
55
-#   include "zlib.h"
56
+#include <zlib.h>
56 57
 #else
57 58
 #warning "No zlib. Won't support TR4+ files!"
58 59
 #endif
59 60
 
60 61
 #ifdef __TEST_TR5_DUMP_TGA
61
-#   include "mtk_tga.h"
62
+#include <mtk_tga.h>
62 63
 #endif
63 64
 
64
-#ifdef DEBUG_MEMEORY
65
-#   include "memeory_test.h"
65
+#ifdef DEBUG_MEMORY
66
+#include <memory_test.h>
66 67
 #endif
67 68
 
68 69
 
@@ -6828,7 +6829,7 @@ int main(int argc, char *argv[])
6828 6829
 {
6829 6830
 	test_main(argc, argv);
6830 6831
 
6831
-#ifdef DEBUG_MEMEORY
6832
+#ifdef DEBUG_MEMORY
6832 6833
   dump_memory_report();
6833 6834
 #endif
6834 6835
 

+ 4
- 3
src/World.cpp ファイルの表示

@@ -19,12 +19,13 @@
19 19
  * Mongoose - Created
20 20
  =================================================================*/
21 21
 
22
-#ifdef DEBUG_MEMEORY
23
-#   include "memeory_test.h"
22
+#ifdef DEBUG_MEMORY
23
+#include <memory_test.h>
24 24
 #endif
25 25
 
26 26
 #include <math.h>
27
-#include "World.h"
27
+
28
+#include <World.h>
28 29
 
29 30
 
30 31
 ////////////////////////////////////////////////////////////

+ 21
- 21
src/endian.cpp ファイルの表示

@@ -1,33 +1,33 @@
1 1
 /*==========================================================================
2
- * 
3
- * Project : MDDC 
2
+ *
3
+ * Project : MDDC
4 4
  * Author  : Terry 'Mongoose' Hendrix II
5 5
  * Website : http://www.westga.edu/~stu7440
6 6
  * Email   : stu7440@westga.edu
7
- * Object  : 
7
+ * Object  :
8 8
  * Comments: This is the endian utils.
9 9
  *
10 10
  *           See file COPYING for license details.
11 11
  *
12
- *           Based on type converting code by: 
13
- *           Michael Vance <mkv102@psu.edu> 
14
- * 
15
- *-- History ---------------------------------------------------------- 
12
+ *           Based on type converting code by:
13
+ *           Michael Vance <mkv102@psu.edu>
14
+ *
15
+ *-- History ----------------------------------------------------------
16 16
  *
17 17
  * 2000-03-17:
18
- * Mongoose: Created, I combined some endian checking with fread wrapper 
18
+ * Mongoose: Created, I combined some endian checking with fread wrapper
19 19
  ==========================================================================*/
20 20
 
21
-#include "endian.h"
21
+#include <endian.h>
22 22
 
23 23
 
24 24
 int fread_u_int_small(unsigned int *ptr, FILE *stream)
25
-{  
25
+{
26 26
 #ifdef BIG_ENDIAN
27 27
    unsigned char b1, b2, b3, b4;
28 28
    unsigned int l;
29 29
 #endif
30
- 
30
+
31 31
    if (fread(ptr, 4, 1, stream) != 1)
32 32
    {
33 33
       printf("FreadSmallInt> Failed fread.\n");
@@ -35,7 +35,7 @@ int fread_u_int_small(unsigned int *ptr, FILE *stream)
35 35
    }
36 36
 
37 37
 #ifdef BIG_ENDIAN
38
-   l = *ptr; 
38
+   l = *ptr;
39 39
 
40 40
    b1 = l & 255;
41 41
    b2 = ( l >> 8 ) & 255;
@@ -49,12 +49,12 @@ int fread_u_int_small(unsigned int *ptr, FILE *stream)
49 49
 
50 50
 
51 51
 int fread_int_small(int *ptr, FILE *stream)
52
-{  
52
+{
53 53
 #ifdef BIG_ENDIAN
54 54
    unsigned char b1, b2, b3, b4;
55 55
    int l;
56 56
 #endif
57
- 
57
+
58 58
    if (fread(ptr, 4, 1, stream) != 1)
59 59
    {
60 60
       printf("FreadSmallInt> Failed fread.\n");
@@ -62,7 +62,7 @@ int fread_int_small(int *ptr, FILE *stream)
62 62
    }
63 63
 
64 64
 #ifdef BIG_ENDIAN
65
-   l = *ptr; 
65
+   l = *ptr;
66 66
 
67 67
    b1 = l & 255;
68 68
    b2 = ( l >> 8 ) & 255;
@@ -75,17 +75,17 @@ int fread_int_small(int *ptr, FILE *stream)
75 75
 }
76 76
 
77 77
 int fread_float_small(float *ptr, FILE *stream)
78
-{  
78
+{
79 79
 #ifdef BIG_ENDIAN
80 80
    union
81 81
    {
82 82
       unsigned char b[4];
83
-      float f; 
83
+      float f;
84 84
    } in, out;
85
-	
85
+
86 86
    float l;
87 87
 #endif
88
- 
88
+
89 89
    if (fread(ptr, 4, 1, stream) != 1)
90 90
    {
91 91
       printf("FreadSmallFloat> Failed fread.\n");
@@ -93,14 +93,14 @@ int fread_float_small(float *ptr, FILE *stream)
93 93
    }
94 94
 
95 95
 #ifdef BIG_ENDIAN
96
-   l = *ptr; 
96
+   l = *ptr;
97 97
 
98 98
    in.f = l;
99 99
    out.b[0] = in.b[3];
100 100
    out.b[1] = in.b[2];
101 101
    out.b[2] = in.b[1];
102 102
    out.b[3] = in.b[0];
103
-	
103
+
104 104
    *ptr = out.f;
105 105
 #endif
106 106
 

+ 2
- 1
src/hel/Matrix.cpp ファイルの表示

@@ -21,7 +21,8 @@
21 21
 
22 22
 #include <stdio.h>
23 23
 #include <math.h>
24
-#include "Matrix.h"
24
+
25
+#include <hel/Matrix.h>
25 26
 
26 27
 
27 28
 ////////////////////////////////////////////////////////////

+ 2
- 1
src/hel/Quaternion.cpp ファイルの表示

@@ -20,7 +20,8 @@
20 20
  =================================================================*/
21 21
 
22 22
 #include <math.h>
23
-#include "Quaternion.h"
23
+
24
+#include <hel/Quaternion.h>
24 25
 
25 26
 
26 27
 ////////////////////////////////////////////////////////////

+ 2
- 1
src/hel/Vector3d.cpp ファイルの表示

@@ -20,7 +20,8 @@
20 20
  =================================================================*/
21 21
 
22 22
 #include <math.h>
23
-#include "Vector3d.h"
23
+
24
+#include <hel/Vector3d.h>
24 25
 
25 26
 
26 27
 ////////////////////////////////////////////////////////////

+ 39
- 38
src/hel/ViewVolume.cpp ファイルの表示

@@ -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 : hel
5 5
  * Author  : Terry 'Mongoose' Hendrix II
6 6
  * Website : http://www.westga.edu/~stu7440/
@@ -12,17 +12,18 @@
12 12
  *           Thanks Mark Morley for the article I used
13 13
  *           to get several algorithms.
14 14
  *
15
- *           This file was generated using Mongoose's C++ 
15
+ *           This file was generated using Mongoose's C++
16 16
  *           template generator script.  <stu7440@westga.edu>
17
- * 
18
- *-- History ------------------------------------------------- 
17
+ *
18
+ *-- History -------------------------------------------------
19 19
  *
20 20
  * 2002.12.15:
21 21
  * Mongoose - Created
22 22
  =================================================================*/
23 23
 
24 24
 #include <math.h>
25
-#include "ViewVolume.h"
25
+
26
+#include <hel/ViewVolume.h>
26 27
 
27 28
 
28 29
 ////////////////////////////////////////////////////////////
@@ -72,7 +73,7 @@ bool ViewVolume::isPointInFrustum(vec_t x, vec_t y, vec_t z)
72 73
 
73 74
    for (p = 0; p < 6; ++p)
74 75
 	{
75
-      if (mFrustum[p][0] * x + mFrustum[p][1] * y + mFrustum[p][2] * z + 
76
+      if (mFrustum[p][0] * x + mFrustum[p][1] * y + mFrustum[p][2] * z +
76 77
 			 mFrustum[p][3] <= 0)
77 78
 		{
78 79
          return false;
@@ -107,43 +108,43 @@ bool ViewVolume::isBboxInFrustum(vec3_t min, vec3_t max)
107 108
 
108 109
    for (p = 0; p < 6; ++p)
109 110
    {
110
-      if (mFrustum[p][0] * min[0] + 
111
-			 mFrustum[p][1] * min[1] + 
111
+      if (mFrustum[p][0] * min[0] +
112
+			 mFrustum[p][1] * min[1] +
112 113
 			 mFrustum[p][2] * min[2] + mFrustum[p][3] > 0)
113 114
          continue;
114 115
 
115
-      if (mFrustum[p][0] * max[0] + 
116
-			 mFrustum[p][1] * max[1] + 
116
+      if (mFrustum[p][0] * max[0] +
117
+			 mFrustum[p][1] * max[1] +
117 118
 			 mFrustum[p][2] * max[2] + mFrustum[p][3] > 0)
118 119
          continue;
119 120
 
120
-      if (mFrustum[p][0] * min[0] + 
121
-			 mFrustum[p][1] * max[1] + 
121
+      if (mFrustum[p][0] * min[0] +
122
+			 mFrustum[p][1] * max[1] +
122 123
 			 mFrustum[p][2] * max[2] + mFrustum[p][3] > 0)
123 124
          continue;
124 125
 
125
-      if (mFrustum[p][0] * min[0] + 
126
-			 mFrustum[p][1] * min[1] + 
126
+      if (mFrustum[p][0] * min[0] +
127
+			 mFrustum[p][1] * min[1] +
127 128
 			 mFrustum[p][2] * max[2] + mFrustum[p][3] > 0)
128 129
          continue;
129 130
 
130
-      if (mFrustum[p][0] * min[0] + 
131
-			 mFrustum[p][1] * max[1] + 
131
+      if (mFrustum[p][0] * min[0] +
132
+			 mFrustum[p][1] * max[1] +
132 133
 			 mFrustum[p][2] * min[2] + mFrustum[p][3] > 0)
133 134
          continue;
134 135
 
135
-      if (mFrustum[p][0] * max[0] + 
136
-			 mFrustum[p][1] * min[1] + 
136
+      if (mFrustum[p][0] * max[0] +
137
+			 mFrustum[p][1] * min[1] +
137 138
 			 mFrustum[p][2] * min[2] + mFrustum[p][3] > 0)
138 139
          continue;
139 140
 
140
-      if (mFrustum[p][0] * max[0] + 
141
-			 mFrustum[p][1] * max[1] + 
141
+      if (mFrustum[p][0] * max[0] +
142
+			 mFrustum[p][1] * max[1] +
142 143
 			 mFrustum[p][2] * min[2] + mFrustum[p][3] > 0)
143 144
          continue;
144 145
 
145
-      if (mFrustum[p][0] * max[0] + 
146
-			 mFrustum[p][1] * min[1] + 
146
+      if (mFrustum[p][0] * max[0] +
147
+			 mFrustum[p][1] * min[1] +
147 148
 			 mFrustum[p][2] * max[2] + mFrustum[p][3] > 0)
148 149
          continue;
149 150
 
@@ -154,7 +155,7 @@ bool ViewVolume::isBboxInFrustum(vec3_t min, vec3_t max)
154 155
 }
155 156
 
156 157
 
157
-vec_t ViewVolume::getDistToSphereFromNear(vec_t x, vec_t y, vec_t z, 
158
+vec_t ViewVolume::getDistToSphereFromNear(vec_t x, vec_t y, vec_t z,
158 159
 														vec_t radius)
159 160
 {
160 161
    unsigned int p;
@@ -180,9 +181,9 @@ vec_t ViewVolume::getDistToBboxFromNear(vec3_t min, vec3_t max)
180 181
 	helMidpoint3v(min, max, center);
181 182
 
182 183
 	// 5 should be near plane
183
-	d = (mFrustum[5][0] * center[0] + 
184
-		  mFrustum[5][1] * center[1] + 
185
-		  mFrustum[5][2] * center[2] + 
184
+	d = (mFrustum[5][0] * center[0] +
185
+		  mFrustum[5][1] * center[1] +
186
+		  mFrustum[5][2] * center[2] +
186 187
 		  mFrustum[5][3]);
187 188
 
188 189
 	radius = helDist3v(max, center);
@@ -295,8 +296,8 @@ void ViewVolume::updateFrustum()
295 296
    mFrustum[0][3] = clip[15] - clip[12];
296 297
 
297 298
    /* Normalize the result */
298
-   t = sqrt(mFrustum[0][0] * mFrustum[0][0] + 
299
-				mFrustum[0][1] * mFrustum[0][1] + 
299
+   t = sqrt(mFrustum[0][0] * mFrustum[0][0] +
300
+				mFrustum[0][1] * mFrustum[0][1] +
300 301
 				mFrustum[0][2] * mFrustum[0][2]);
301 302
    mFrustum[0][0] /= t;
302 303
    mFrustum[0][1] /= t;
@@ -310,8 +311,8 @@ void ViewVolume::updateFrustum()
310 311
    mFrustum[1][3] = clip[15] + clip[12];
311 312
 
312 313
    /* Normalize the result */
313
-   t = sqrt(mFrustum[1][0] * mFrustum[1][0] + 
314
-				mFrustum[1][1] * mFrustum[1][1] + 
314
+   t = sqrt(mFrustum[1][0] * mFrustum[1][0] +
315
+				mFrustum[1][1] * mFrustum[1][1] +
315 316
 				mFrustum[1][2] * mFrustum[1][2]);
316 317
    mFrustum[1][0] /= t;
317 318
    mFrustum[1][1] /= t;
@@ -325,8 +326,8 @@ void ViewVolume::updateFrustum()
325 326
    mFrustum[2][3] = clip[15] + clip[13];
326 327
 
327 328
    /* Normalize the result */
328
-   t = sqrt(mFrustum[2][0] * mFrustum[2][0] + 
329
-				mFrustum[2][1] * mFrustum[2][1] + 
329
+   t = sqrt(mFrustum[2][0] * mFrustum[2][0] +
330
+				mFrustum[2][1] * mFrustum[2][1] +
330 331
 				mFrustum[2][2] * mFrustum[2][2]);
331 332
    mFrustum[2][0] /= t;
332 333
    mFrustum[2][1] /= t;
@@ -340,8 +341,8 @@ void ViewVolume::updateFrustum()
340 341
    mFrustum[3][3] = clip[15] - clip[13];
341 342
 
342 343
    /* Normalize the result */
343
-   t = sqrt(mFrustum[3][0] * mFrustum[3][0] + 
344
-				mFrustum[3][1] * mFrustum[3][1] + 
344
+   t = sqrt(mFrustum[3][0] * mFrustum[3][0] +
345
+				mFrustum[3][1] * mFrustum[3][1] +
345 346
 				mFrustum[3][2] * mFrustum[3][2]);
346 347
    mFrustum[3][0] /= t;
347 348
    mFrustum[3][1] /= t;
@@ -355,8 +356,8 @@ void ViewVolume::updateFrustum()
355 356
    mFrustum[4][3] = clip[15] - clip[14];
356 357
 
357 358
    /* Normalize the result */
358
-   t = sqrt(mFrustum[4][0] * mFrustum[4][0] + 
359
-				mFrustum[4][1] * mFrustum[4][1] + 
359
+   t = sqrt(mFrustum[4][0] * mFrustum[4][0] +
360
+				mFrustum[4][1] * mFrustum[4][1] +
360 361
 				mFrustum[4][2] * mFrustum[4][2]);
361 362
    mFrustum[4][0] /= t;
362 363
    mFrustum[4][1] /= t;
@@ -370,8 +371,8 @@ void ViewVolume::updateFrustum()
370 371
    mFrustum[5][3] = clip[15] + clip[14];
371 372
 
372 373
    /* Normalize the result */
373
-   t = sqrt(mFrustum[5][0] * mFrustum[5][0] + 
374
-				mFrustum[5][1] * mFrustum[5][1] + 
374
+   t = sqrt(mFrustum[5][0] * mFrustum[5][0] +
375
+				mFrustum[5][1] * mFrustum[5][1] +
375 376
 				mFrustum[5][2] * mFrustum[5][2]);
376 377
    mFrustum[5][0] /= t;
377 378
    mFrustum[5][1] /= t;

src/memeory_test.cpp → src/memory_test.cpp ファイルの表示

@@ -5,7 +5,7 @@
5 5
  * Author  : Terry 'Mongoose' Hendrix II
6 6
  * Website : http://www.westga.edu/~stu7440/
7 7
  * Email   : stu7440@westga.edu
8
- * Object  : memeory_test
8
+ * Object  : memory_test
9 9
  * License : No use w/o permission (C) 2002 Mongoose
10 10
  * Comments: Memory testing tool kit
11 11
  *
@@ -23,28 +23,12 @@
23 23
 #include <stdio.h>
24 24
 #include <stdlib.h>
25 25
 
26
+#define UNIT_TEST_MEMORY
27
+#include <memory_test.h>
26 28
 
27
-#define DWORD unsigned long
28 29
 #define USE_ITERATIVE_TREE_INSERT
29 30
 
30 31
 
31
-typedef enum { RB_BLACK = 0, RB_RED = 1 } rbtree_color_t;
32
-
33
-typedef struct rbtree_s
34
-{
35
-	void *data;
36
-	DWORD key;
37
-
38
-	rbtree_color_t color;
39
-
40
-	struct rbtree_s *left;
41
-	struct rbtree_s *right;
42
-	struct rbtree_s *parent;
43
-
44
-} rbtree_t;
45
-
46
-
47
-
48 32
 bool tree_check(rbtree_t *tree, char *file, int line)
49 33
 {
50 34
 	bool ret = true;
@@ -455,7 +439,7 @@ int tree_print(rbtree_t *tree, void (*print_func)(void *))
455 439
 	{
456 440
 		(*print_func)(tree->data);
457 441
 
458
-#ifdef DEBUG_MEMEORY_RBTREE
442
+#ifdef DEBUG_MEMORY_RBTREE
459 443
 		printf(" :%s%s)",
460 444
 				 (!tree->parent) ? " (root, " : " ("),
461 445
 				 (tree->color == RB_BLACK) ? "black" : "red");
@@ -745,21 +729,7 @@ void tree_remove(rbtree_t **root, rbtree_t *tree)
745 729
 }
746 730
 
747 731
 
748
-#ifdef DEBUG_MEMEORY
749
-
750
-#define ZERO_ALLOC_SLOTS 3
751
-
752
-typedef struct meminfo_filename_s
753
-{
754
-	char *filename;
755
-	char filename_len;
756
-	DWORD size;
757
-	unsigned int alloc_zero;
758
-	unsigned short int alloc_zero_at_line[ZERO_ALLOC_SLOTS];
759
-
760
-	struct meminfo_filename_s *next;
761
-
762
-} meminfo_filename_t;
732
+#ifdef DEBUG_MEMORY
763 733
 
764 734
 
765 735
 typedef struct meminfo_s
@@ -793,14 +763,14 @@ void __print_meminfo(meminfo_t *meminfo)
793 763
 ///////////////////////////////////////////////////////////////////
794 764
 ///////////////////////////////////////////////////////////////////
795 765
 
796
-rbtree_t *MEMEORY_INFO = 0;
797
-meminfo_filename_t *MEMEORY_FILENAME = 0;
798
-long MEMEORY_USED  = 0L;
799
-long MEMEORYA_USED = 0L;
800
-long MEMEORYC_USED = 0L;
801
-long MAX_MEMEORY_USED = 0L;
802
-long MAX_MEMEORYA_USED = 0L;
803
-long MAX_MEMEORYC_USED = 0L;
766
+rbtree_t *MEMORY_INFO = 0;
767
+meminfo_filename_t *MEMORY_FILENAME = 0;
768
+long MEMORY_USED  = 0L;
769
+long MEMORYA_USED = 0L;
770
+long MEMORYC_USED = 0L;
771
+long MAX_MEMORY_USED = 0L;
772
+long MAX_MEMORYA_USED = 0L;
773
+long MAX_MEMORYC_USED = 0L;
804 774
 
805 775
 
806 776
 typedef enum
@@ -818,19 +788,19 @@ long memory_used(memory_query_t query)
818 788
 	switch (query)
819 789
 	{
820 790
 	case MEMORY_USED_BY_PROGRAM:
821
-		return MEMEORY_USED;
791
+		return MEMORY_USED;
822 792
 		break;
823 793
 	case MAX_MEMORY_USED_BY_PROGRAM:
824
-		return MAX_MEMEORY_USED;
794
+		return MAX_MEMORY_USED;
825 795
 		break;
826 796
 	case MAX_MEMORY_USED_BY_OVERHEAD:
827
-		return MAX_MEMEORYA_USED + MAX_MEMEORYC_USED;
797
+		return MAX_MEMORYA_USED + MAX_MEMORYC_USED;
828 798
 		break;
829 799
 	case MEMORY_USED_BY_OVERHEAD:
830
-		return MEMEORYA_USED + MEMEORYC_USED;
800
+		return MEMORYA_USED + MEMORYC_USED;
831 801
 		break;
832 802
 	case MEMORY_USED_TOTAL:
833
-		return MEMEORY_USED + MEMEORYA_USED + MEMEORYC_USED;
803
+		return MEMORY_USED + MEMORYA_USED + MEMORYC_USED;
834 804
 		break;
835 805
 	default:
836 806
 		;
@@ -843,7 +813,7 @@ long memory_used(memory_query_t query)
843 813
 void display_memory_usage()
844 814
 {
845 815
 	unsigned int i;
846
-	meminfo_filename_t *cur = MEMEORY_FILENAME;
816
+	meminfo_filename_t *cur = MEMORY_FILENAME;
847 817
 
848 818
 
849 819
 	printf("\n============================================================\n");
@@ -854,14 +824,14 @@ void display_memory_usage()
854 824
 	{
855 825
 		printf(" %s : ( %lu bytes, %3.2f%% )\n",
856 826
 				 cur->filename, cur->size,
857
-				 100.0 * ((float)cur->size / (float)MEMEORY_USED));
827
+				 100.0 * ((float)cur->size / (float)MEMORY_USED));
858 828
 
859 829
 		cur = cur->next;
860 830
 	}
861 831
 
862 832
 	printf("------------------------------------------------------------\n");
863 833
 
864
-	cur = MEMEORY_FILENAME;
834
+	cur = MEMORY_FILENAME;
865 835
 
866 836
 	printf("Memory special errors per file:\n");
867 837
 
@@ -895,30 +865,30 @@ void display_memory_usage()
895 865
 	printf("Memory usage summary:\n");
896 866
 
897 867
 	printf(" Tracked program memory    : %lu bytes \t(%.2f MB)\n",
898
-			 MEMEORY_USED, (double)MEMEORY_USED / 1024000.0);
868
+			 MEMORY_USED, (double)MEMORY_USED / 1024000.0);
899 869
 	printf(" Untracked overhead memory : %lu bytes \t(%.2f MB)\n",
900
-			 MEMEORYA_USED, (double)MEMEORYA_USED / 1024000.0);
870
+			 MEMORYA_USED, (double)MEMORYA_USED / 1024000.0);
901 871
 	printf(" Untracked m-string memory : %lu bytes\n",
902
-			 MEMEORYC_USED);
872
+			 MEMORYC_USED);
903 873
 
904 874
 	printf("\n Total accounted memory    : %lu bytes \t(%.2f MB)\n",
905
-			 MEMEORY_USED + MEMEORYA_USED + MEMEORYC_USED,
906
-			 (double)(MEMEORY_USED + MEMEORYA_USED + MEMEORYC_USED) / 1024000.0);
875
+			 MEMORY_USED + MEMORYA_USED + MEMORYC_USED,
876
+			 (double)(MEMORY_USED + MEMORYA_USED + MEMORYC_USED) / 1024000.0);
907 877
 
908 878
 	printf("------------------------------------------------------------\n");
909 879
 
910 880
 	printf("Memory max usage summary:\n");
911 881
 
912 882
 	printf(" Tracked program memory    : %lu bytes \t(%.2f MB)\n",
913
-			 MAX_MEMEORY_USED, (double)MAX_MEMEORY_USED / 1024000.0);
883
+			 MAX_MEMORY_USED, (double)MAX_MEMORY_USED / 1024000.0);
914 884
 	printf(" Untracked overhead memory : %lu bytes \t(%.2f MB)\n",
915
-			 MAX_MEMEORYA_USED, (double)MAX_MEMEORYA_USED / 1024000.0);
885
+			 MAX_MEMORYA_USED, (double)MAX_MEMORYA_USED / 1024000.0);
916 886
 	printf(" Untracked m-string memory : %lu bytes\n",
917
-			 MAX_MEMEORYC_USED);
887
+			 MAX_MEMORYC_USED);
918 888
 
919 889
 	printf("\n Total accounted memory    : %lu bytes \t(%.2f MB)\n",
920
-			 MAX_MEMEORY_USED + MAX_MEMEORYA_USED + MAX_MEMEORYC_USED,
921
-			 (double)(MAX_MEMEORY_USED + MAX_MEMEORYA_USED + MAX_MEMEORYC_USED) / 1024000.0);
890
+			 MAX_MEMORY_USED + MAX_MEMORYA_USED + MAX_MEMORYC_USED,
891
+			 (double)(MAX_MEMORY_USED + MAX_MEMORYA_USED + MAX_MEMORYC_USED) / 1024000.0);
922 892
 
923 893
 	printf("============================================================\n");
924 894
 }
@@ -930,10 +900,10 @@ void dump_memory_report()
930 900
 
931 901
 
932 902
 	printf("\n============================================================\n");
933
-	printf(" Memeory status report\n");
903
+	printf(" Memory status report\n");
934 904
 	printf("============================================================\n");
935 905
 	printf("Memory tracking table:\n");
936
-	i = tree_print(MEMEORY_INFO, (void (*)(void *))&__print_meminfo);
906
+	i = tree_print(MEMORY_INFO, (void (*)(void *))&__print_meminfo);
937 907
 	printf("%i records, %u bytes each : %i bytes\n",
938 908
 			 i, sizeof(meminfo_t), i * sizeof(meminfo_t));
939 909
 	display_memory_usage();
@@ -953,18 +923,18 @@ void add_track(DWORD addr, DWORD size, const char *filename, DWORD line_num)
953 923
 	unsigned int len, i;
954 924
 
955 925
 
956
-	MEMEORY_USED += size;
926
+	MEMORY_USED += size;
957 927
 
958
-	if (MEMEORY_USED > MAX_MEMEORY_USED)
928
+	if (MEMORY_USED > MAX_MEMORY_USED)
959 929
 	{
960
-		MAX_MEMEORY_USED = MEMEORY_USED;
930
+		MAX_MEMORY_USED = MEMORY_USED;
961 931
 	}
962 932
 
963
-	MEMEORYA_USED += sizeof(meminfo_t);
933
+	MEMORYA_USED += sizeof(meminfo_t);
964 934
 
965
-	if (MEMEORYA_USED > MAX_MEMEORYA_USED)
935
+	if (MEMORYA_USED > MAX_MEMORYA_USED)
966 936
 	{
967
-		MAX_MEMEORYA_USED = MEMEORYA_USED;
937
+		MAX_MEMORYA_USED = MEMORYA_USED;
968 938
 	}
969 939
 
970 940
 	meminfo = (meminfo_t *)malloc(sizeof(meminfo_t));
@@ -985,9 +955,9 @@ void add_track(DWORD addr, DWORD size, const char *filename, DWORD line_num)
985 955
 
986 956
 		memfile = memfile_prev = 0;
987 957
 
988
-		if (MEMEORY_FILENAME)
958
+		if (MEMORY_FILENAME)
989 959
 		{
990
-			memfile = MEMEORY_FILENAME;
960
+			memfile = MEMORY_FILENAME;
991 961
 
992 962
 			while (memfile)
993 963
 			{
@@ -1013,19 +983,19 @@ void add_track(DWORD addr, DWORD size, const char *filename, DWORD line_num)
1013 983
 			memfile->alloc_zero_at_line[1] = 0;
1014 984
 			memfile->alloc_zero_at_line[2] = 0;
1015 985
 
1016
-			MEMEORYC_USED += sizeof(meminfo_filename_t) + memfile->filename_len;
986
+			MEMORYC_USED += sizeof(meminfo_filename_t) + memfile->filename_len;
1017 987
 
1018
-			if (MEMEORYC_USED > MAX_MEMEORYC_USED)
1019
-				MAX_MEMEORYC_USED = MEMEORYC_USED;
988
+			if (MEMORYC_USED > MAX_MEMORYC_USED)
989
+				MAX_MEMORYC_USED = MEMORYC_USED;
1020 990
 
1021 991
 			if (memfile_prev)
1022 992
 			{
1023 993
 				memfile_prev->next = memfile;
1024 994
 			}
1025 995
 
1026
-			if (!MEMEORY_FILENAME)
996
+			if (!MEMORY_FILENAME)
1027 997
 			{
1028
-				MEMEORY_FILENAME = memfile;
998
+				MEMORY_FILENAME = memfile;
1029 999
 			}
1030 1000
 		}
1031 1001
 
@@ -1054,10 +1024,10 @@ void add_track(DWORD addr, DWORD size, const char *filename, DWORD line_num)
1054 1024
 		}
1055 1025
 	}
1056 1026
 
1057
-	MEMEORYA_USED += sizeof(rbtree_t);
1058
-	tree_insert(&MEMEORY_INFO, meminfo, meminfo->address);
1027
+	MEMORYA_USED += sizeof(rbtree_t);
1028
+	tree_insert(&MEMORY_INFO, meminfo, meminfo->address);
1059 1029
 
1060
-#ifdef DEBUG_MEMEORY_VERBOSE
1030
+#ifdef DEBUG_MEMORY_VERBOSE
1061 1031
 	printf("add_track> addr 0x%08lx, size %lu, filename %s, line %lu\n",
1062 1032
 			 addr, size, filename, line_num);
1063 1033
 #endif
@@ -1073,7 +1043,7 @@ void remove_track(DWORD addr)
1073 1043
 	rbtree_t *tree = 0;
1074 1044
 
1075 1045
 
1076
-	tree = tree_find(MEMEORY_INFO, addr);
1046
+	tree = tree_find(MEMORY_INFO, addr);
1077 1047
 
1078 1048
 	if (tree)
1079 1049
 	{
@@ -1081,7 +1051,7 @@ void remove_track(DWORD addr)
1081 1051
 
1082 1052
 		if (meminfo)
1083 1053
 		{
1084
-			tree_remove(&MEMEORY_INFO, tree);
1054
+			tree_remove(&MEMORY_INFO, tree);
1085 1055
 
1086 1056
 			if (meminfo->filename)
1087 1057
 			{
@@ -1095,41 +1065,41 @@ void remove_track(DWORD addr)
1095 1065
 						 meminfo->line);
1096 1066
 			}
1097 1067
 
1098
-			MEMEORY_USED -= meminfo->size;
1099
-			MEMEORYA_USED -= sizeof(meminfo_t);
1100
-			MEMEORYA_USED -= sizeof(rbtree_t);
1068
+			MEMORY_USED -= meminfo->size;
1069
+			MEMORYA_USED -= sizeof(meminfo_t);
1070
+			MEMORYA_USED -= sizeof(rbtree_t);
1101 1071
 
1102 1072
 			free(meminfo);
1103 1073
 		}
1104 1074
 	}
1105 1075
 	else
1106 1076
 	{
1107
-#ifndef DEBUG_MEMEORY_ERROR_OFF
1077
+#ifndef DEBUG_MEMORY_ERROR_OFF
1108 1078
 		printf("\nERROR: remove_track> Unknown addr 0x%08lx ", addr);
1109 1079
 		delete_check(0, 0, 1);
1110 1080
 		printf("?\n");
1111 1081
 #endif
1112 1082
 	}
1113 1083
 
1114
-	if (!MEMEORY_INFO)
1084
+	if (!MEMORY_INFO)
1115 1085
 	{
1116 1086
 		meminfo_filename_t *cur;
1117 1087
 		meminfo_filename_t *del;
1118 1088
 
1119 1089
 
1120
-		cur = MEMEORY_FILENAME;
1121
-		MEMEORY_FILENAME = 0;
1090
+		cur = MEMORY_FILENAME;
1091
+		MEMORY_FILENAME = 0;
1122 1092
 
1123 1093
 		while (cur)
1124 1094
 		{
1125 1095
 			del = cur;
1126 1096
 			cur = cur->next;
1127 1097
 
1128
-			MEMEORYC_USED -= sizeof(meminfo_filename_t);
1098
+			MEMORYC_USED -= sizeof(meminfo_filename_t);
1129 1099
 
1130 1100
 			if (del->filename)
1131 1101
 			{
1132
-				MEMEORYC_USED -= del->filename_len;
1102
+				MEMORYC_USED -= del->filename_len;
1133 1103
 				free(del->filename);
1134 1104
 			}
1135 1105
 
@@ -1137,7 +1107,7 @@ void remove_track(DWORD addr)
1137 1107
 		}
1138 1108
 	}
1139 1109
 
1140
-#ifdef DEBUG_MEMEORY_VERBOSE
1110
+#ifdef DEBUG_MEMORY_VERBOSE
1141 1111
 	printf("remove_track> addr 0x%lx\n", addr);
1142 1112
 #endif
1143 1113
 }
@@ -1211,149 +1181,3 @@ void operator delete [](void *p)
1211 1181
 };
1212 1182
 #endif
1213 1183
 
1214
-
1215
-
1216
-////////////////////////////////////////////////////////////
1217
-// Unit Test code
1218
-////////////////////////////////////////////////////////////
1219
-
1220
-#ifdef __TEST__
1221
-#include "memeory_test.h"
1222
-
1223
-#define PRINT_TEST_BREAK_LINE	printf("\n############################################################\n\n");
1224
-
1225
-int memeory_test_unit_test(int argc, char *argv[])
1226
-{
1227
-	int *i, *j, *k, *l, *m, *n, *o;
1228
-
1229
-
1230
-	PRINT_TEST_BREAK_LINE
1231
-	printf("Memeory test\n");
1232
-	PRINT_TEST_BREAK_LINE
1233
-
1234
-	printf(">\ti = new int;  %s:%i\n", __FILE__, __LINE__);
1235
-	i = new int;
1236
-	dump_memory_report();
1237
-	tree_valid_report(MEMEORY_INFO);
1238
-
1239
-	printf(">\tdelete i; (%p)  %s:%i\n", i, __FILE__, __LINE__);
1240
-	delete i;
1241
-	dump_memory_report();
1242
-	tree_valid_report(MEMEORY_INFO);
1243
-
1244
-	PRINT_TEST_BREAK_LINE
1245
-
1246
-	printf(">\ti = new int[3]; (%p)  %s:%i\n", i, __FILE__, __LINE__);
1247
-	i = new int[3];
1248
-	dump_memory_report();
1249
-	tree_valid_report(MEMEORY_INFO);
1250
-
1251
-	printf(">\tdelete [] i; (%p)  %s:%i\n", i, __FILE__, __LINE__);
1252
-	delete [] i;
1253
-	dump_memory_report();
1254
-	tree_valid_report(MEMEORY_INFO);
1255
-
1256
-	PRINT_TEST_BREAK_LINE
1257
-
1258
-	printf(">\ti = new int[3]; (%p)  %s:%i\n", i, __FILE__, __LINE__);
1259
-	i = new int[3];
1260
-	printf(">\tj = new int; (%p)  %s:%i\n", j, __FILE__, __LINE__);
1261
-	j = new int;
1262
-	printf(">\tk = new int[3]; (%p)  %s:%i\n", k, __FILE__, __LINE__);
1263
-	k = new int[3];
1264
-	dump_memory_report();
1265
-	tree_valid_report(MEMEORY_INFO);
1266
-	printf(">\tdelete [] i; (%p)  %s:%i\n", i, __FILE__, __LINE__);
1267
-	delete [] i;
1268
-	printf(">\tdelete j; (%p)  %s:%i\n", j, __FILE__, __LINE__);
1269
-	delete j;
1270
-	printf(">\tdelete [] k; (%p)  %s:%i\n", k, __FILE__, __LINE__);
1271
-	delete [] k;
1272
-	dump_memory_report();
1273
-	tree_valid_report(MEMEORY_INFO);
1274
-
1275
-	PRINT_TEST_BREAK_LINE
1276
-
1277
-	printf(">\ti = new int[3]; (%p)  %s:%i\n", i, __FILE__, __LINE__);
1278
-	i = new int[3];
1279
-	printf(">\tj = new int; (%p)  %s:%i\n", j, __FILE__, __LINE__);
1280
-	j = new int;
1281
-	printf(">\tk = new int[3]; (%p)  %s:%i\n", k, __FILE__, __LINE__);
1282
-	k = new int[3];
1283
-	dump_memory_report();
1284
-	tree_valid_report(MEMEORY_INFO);
1285
-	printf(">\tdelete j; (%p)  %s:%i\n", j, __FILE__, __LINE__);
1286
-	delete j;
1287
-	dump_memory_report();
1288
-	tree_valid_report(MEMEORY_INFO);
1289
-	printf(">\tj = new int[3]; (%p)  %s:%i\n", j, __FILE__, __LINE__);
1290
-	j = new int[3];
1291
-	dump_memory_report();
1292
-	tree_valid_report(MEMEORY_INFO);
1293
-	printf(">\tl = new int[3]; (%p)  %s:%i\n", l, __FILE__, __LINE__);
1294
-	l = new int[3];
1295
-	dump_memory_report();
1296
-	tree_valid_report(MEMEORY_INFO);
1297
-	printf(">\tm = new int[3]; (%p)  %s:%i\n", m, __FILE__, __LINE__);
1298
-	m = new int[3];
1299
-	dump_memory_report();
1300
-	tree_valid_report(MEMEORY_INFO);
1301
-
1302
-	printf(">\tn = new int[3]; (%p)  %s:%i\n", n, __FILE__, __LINE__);
1303
-	n = new int[3];
1304
-	dump_memory_report();
1305
-	tree_valid_report(MEMEORY_INFO);
1306
-
1307
-	printf(">\to = new int[3]; (%p)  %s:%i\n", o, __FILE__, __LINE__);
1308
-	o = new int[3];
1309
-	dump_memory_report();
1310
-	tree_valid_report(MEMEORY_INFO);
1311
-
1312
-	printf(">\tdelete [] k; (%p)  %s:%i\n", k, __FILE__, __LINE__);
1313
-	delete [] k;
1314
-	dump_memory_report();
1315
-	tree_valid_report(MEMEORY_INFO);
1316
-
1317
-	printf(">\tdelete [] j; (%p)  %s:%i\n", j, __FILE__, __LINE__);
1318
-	delete [] j;
1319
-	dump_memory_report();
1320
-	tree_valid_report(MEMEORY_INFO);
1321
-
1322
-	printf(">\tdelete [] l; (%p)  %s:%i\n", l, __FILE__, __LINE__);
1323
-	delete [] l;
1324
-	dump_memory_report();
1325
-	tree_valid_report(MEMEORY_INFO);
1326
-
1327
-	printf(">\tdelete [] m; (%p)  %s:%i\n", m, __FILE__, __LINE__);
1328
-	delete [] m;
1329
-	dump_memory_report();
1330
-	tree_valid_report(MEMEORY_INFO);
1331
-
1332
-	printf(">\tdelete [] n; (%p)  %s:%i\n", n, __FILE__, __LINE__);
1333
-	delete [] n;
1334
-	dump_memory_report();
1335
-	tree_valid_report(MEMEORY_INFO);
1336
-
1337
-	printf(">\tdelete [] o; (%p)  %s:%i\n", o, __FILE__, __LINE__);
1338
-	delete [] o;
1339
-	dump_memory_report();
1340
-	tree_valid_report(MEMEORY_INFO);
1341
-
1342
-	printf(">\tdelete [] i; (%p)  %s:%i\n", i, __FILE__, __LINE__);
1343
-	delete [] i;
1344
-	dump_memory_report();
1345
-	tree_valid_report(MEMEORY_INFO);
1346
-
1347
-	PRINT_TEST_BREAK_LINE
1348
-
1349
-	return 0;
1350
-}
1351
-
1352
-
1353
-int main(int argc, char *argv[])
1354
-{
1355
-	printf("[memeory_test test]\n");
1356
-
1357
-	return memeory_test_unit_test(argc, argv);
1358
-}
1359
-#endif

+ 3
- 3
src/mtk_tga.cpp ファイルの表示

@@ -27,10 +27,10 @@
27 27
 #include <string.h>
28 28
 #include <stdarg.h>
29 29
 
30
-#include "mtk_tga.h"
30
+#include <mtk_tga.h>
31 31
 
32
-#ifdef DEBUG_MEMEORY
33
-#   include "memeory_test.h"
32
+#ifdef DEBUG_MEMORY
33
+#include <memory_test.h>
34 34
 #endif
35 35
 
36 36
 

+ 164
- 0
test/memory_test.cpp ファイルの表示

@@ -0,0 +1,164 @@
1
+/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2
+/*================================================================
3
+ *
4
+ * Project : MTK
5
+ * Author  : Terry 'Mongoose' Hendrix II
6
+ * Website : http://www.westga.edu/~stu7440/
7
+ * Email   : stu7440@westga.edu
8
+ * Object  : memory_test
9
+ * License : No use w/o permission (C) 2002 Mongoose
10
+ * Comments: Memory testing tool kit
11
+ *
12
+ *
13
+ *           This file was generated using Mongoose's C++
14
+ *           template generator script.  <stu7440@westga.edu>
15
+ *
16
+ *-- History -------------------------------------------------
17
+ *
18
+ * 2002.03.27:
19
+ * Mongoose - Created
20
+ =================================================================*/
21
+
22
+#include <string.h>
23
+#include <stdio.h>
24
+#include <stdlib.h>
25
+
26
+#include <memory_test.h>
27
+
28
+#define PRINT_TEST_BREAK_LINE	printf("\n############################################################\n\n");
29
+
30
+int memory_test_unit_test(int argc, char *argv[])
31
+{
32
+	int *i, *j, *k, *l, *m, *n, *o;
33
+
34
+
35
+	PRINT_TEST_BREAK_LINE
36
+	printf("Memory test\n");
37
+	PRINT_TEST_BREAK_LINE
38
+
39
+	printf(">\ti = new int;  %s:%i\n", __FILE__, __LINE__);
40
+	i = new int;
41
+	dump_memory_report();
42
+	tree_valid_report(MEMORY_INFO);
43
+
44
+	printf(">\tdelete i; (%p)  %s:%i\n", i, __FILE__, __LINE__);
45
+	delete i;
46
+	dump_memory_report();
47
+	tree_valid_report(MEMORY_INFO);
48
+
49
+	PRINT_TEST_BREAK_LINE
50
+
51
+	printf(">\ti = new int[3]; (%p)  %s:%i\n", i, __FILE__, __LINE__);
52
+	i = new int[3];
53
+	dump_memory_report();
54
+	tree_valid_report(MEMORY_INFO);
55
+
56
+	printf(">\tdelete [] i; (%p)  %s:%i\n", i, __FILE__, __LINE__);
57
+	delete [] i;
58
+	dump_memory_report();
59
+	tree_valid_report(MEMORY_INFO);
60
+
61
+	PRINT_TEST_BREAK_LINE
62
+
63
+	printf(">\ti = new int[3]; (%p)  %s:%i\n", i, __FILE__, __LINE__);
64
+	i = new int[3];
65
+	printf(">\tj = new int; (%p)  %s:%i\n", j, __FILE__, __LINE__);
66
+	j = new int;
67
+	printf(">\tk = new int[3]; (%p)  %s:%i\n", k, __FILE__, __LINE__);
68
+	k = new int[3];
69
+	dump_memory_report();
70
+	tree_valid_report(MEMORY_INFO);
71
+	printf(">\tdelete [] i; (%p)  %s:%i\n", i, __FILE__, __LINE__);
72
+	delete [] i;
73
+	printf(">\tdelete j; (%p)  %s:%i\n", j, __FILE__, __LINE__);
74
+	delete j;
75
+	printf(">\tdelete [] k; (%p)  %s:%i\n", k, __FILE__, __LINE__);
76
+	delete [] k;
77
+	dump_memory_report();
78
+	tree_valid_report(MEMORY_INFO);
79
+
80
+	PRINT_TEST_BREAK_LINE
81
+
82
+	printf(">\ti = new int[3]; (%p)  %s:%i\n", i, __FILE__, __LINE__);
83
+	i = new int[3];
84
+	printf(">\tj = new int; (%p)  %s:%i\n", j, __FILE__, __LINE__);
85
+	j = new int;
86
+	printf(">\tk = new int[3]; (%p)  %s:%i\n", k, __FILE__, __LINE__);
87
+	k = new int[3];
88
+	dump_memory_report();
89
+	tree_valid_report(MEMORY_INFO);
90
+	printf(">\tdelete j; (%p)  %s:%i\n", j, __FILE__, __LINE__);
91
+	delete j;
92
+	dump_memory_report();
93
+	tree_valid_report(MEMORY_INFO);
94
+	printf(">\tj = new int[3]; (%p)  %s:%i\n", j, __FILE__, __LINE__);
95
+	j = new int[3];
96
+	dump_memory_report();
97
+	tree_valid_report(MEMORY_INFO);
98
+	printf(">\tl = new int[3]; (%p)  %s:%i\n", l, __FILE__, __LINE__);
99
+	l = new int[3];
100
+	dump_memory_report();
101
+	tree_valid_report(MEMORY_INFO);
102
+	printf(">\tm = new int[3]; (%p)  %s:%i\n", m, __FILE__, __LINE__);
103
+	m = new int[3];
104
+	dump_memory_report();
105
+	tree_valid_report(MEMORY_INFO);
106
+
107
+	printf(">\tn = new int[3]; (%p)  %s:%i\n", n, __FILE__, __LINE__);
108
+	n = new int[3];
109
+	dump_memory_report();
110
+	tree_valid_report(MEMORY_INFO);
111
+
112
+	printf(">\to = new int[3]; (%p)  %s:%i\n", o, __FILE__, __LINE__);
113
+	o = new int[3];
114
+	dump_memory_report();
115
+	tree_valid_report(MEMORY_INFO);
116
+
117
+	printf(">\tdelete [] k; (%p)  %s:%i\n", k, __FILE__, __LINE__);
118
+	delete [] k;
119
+	dump_memory_report();
120
+	tree_valid_report(MEMORY_INFO);
121
+
122
+	printf(">\tdelete [] j; (%p)  %s:%i\n", j, __FILE__, __LINE__);
123
+	delete [] j;
124
+	dump_memory_report();
125
+	tree_valid_report(MEMORY_INFO);
126
+
127
+	printf(">\tdelete [] l; (%p)  %s:%i\n", l, __FILE__, __LINE__);
128
+	delete [] l;
129
+	dump_memory_report();
130
+	tree_valid_report(MEMORY_INFO);
131
+
132
+	printf(">\tdelete [] m; (%p)  %s:%i\n", m, __FILE__, __LINE__);
133
+	delete [] m;
134
+	dump_memory_report();
135
+	tree_valid_report(MEMORY_INFO);
136
+
137
+	printf(">\tdelete [] n; (%p)  %s:%i\n", n, __FILE__, __LINE__);
138
+	delete [] n;
139
+	dump_memory_report();
140
+	tree_valid_report(MEMORY_INFO);
141
+
142
+	printf(">\tdelete [] o; (%p)  %s:%i\n", o, __FILE__, __LINE__);
143
+	delete [] o;
144
+	dump_memory_report();
145
+	tree_valid_report(MEMORY_INFO);
146
+
147
+	printf(">\tdelete [] i; (%p)  %s:%i\n", i, __FILE__, __LINE__);
148
+	delete [] i;
149
+	dump_memory_report();
150
+	tree_valid_report(MEMORY_INFO);
151
+
152
+	PRINT_TEST_BREAK_LINE
153
+
154
+	return 0;
155
+}
156
+
157
+
158
+int main(int argc, char *argv[])
159
+{
160
+	printf("[memory_test test]\n");
161
+
162
+	return memory_test_unit_test(argc, argv);
163
+}
164
+

読み込み中…
キャンセル
保存