Thomas Buck 11 лет назад
Родитель
Сommit
f09dfbe486
8 измененных файлов: 23 добавлений и 16 удалений
  1. 6
    0
      ChangeLog
  2. 9
    8
      Makefile
  3. 1
    1
      include/BoundingVolume.h
  4. 1
    1
      include/OpenRaider.h
  5. 1
    1
      include/System.h
  6. 3
    3
      src/memory_test.cpp
  7. 1
    1
      test/TombRaider.cpp
  8. 1
    1
      test/greatest.h

+ 6
- 0
ChangeLog Просмотреть файл

5
 
5
 
6
  OpenRaider (0.1.2) xythobuz <xythobuz@xythobuz.de>
6
  OpenRaider (0.1.2) xythobuz <xythobuz@xythobuz.de>
7
 
7
 
8
+	[ 20140117 ]
9
+	* Now using C++11 standard.
10
+	* Turned on many more warnings and silenced some of them.
11
+	  There are a lot of unused parameters, so this warning is still turned
12
+	  off.
13
+
8
 	[ 20140111 ]
14
 	[ 20140111 ]
9
 	* Rewrote GLString Unit Test, now using TTF Font
15
 	* Rewrote GLString Unit Test, now using TTF Font
10
 	* Removed included TGA font and loading code
16
 	* Removed included TGA font and loading code

+ 9
- 8
Makefile Просмотреть файл

91
 
91
 
92
 ###############################################################
92
 ###############################################################
93
 CC=gcc
93
 CC=gcc
94
+WARNINGS=-std=c++11 -Wall -Wextra -pedantic -Wno-unused-parameter
94
 
95
 
95
-BASE_CFLAGS=-Wall $(BASE_DEFS) \
96
+BASE_CFLAGS=$(WARNINGS) $(BASE_DEFS) \
96
 	-DVERSION=\"\\\"$(NAME)-$(VERSION)-$(BUILD_ID)\\\"\" \
97
 	-DVERSION=\"\\\"$(NAME)-$(VERSION)-$(BUILD_ID)\\\"\" \
97
 	-DBUILD_HOST=\"\\\"$(BUILD_HOST)\\\"\"
98
 	-DBUILD_HOST=\"\\\"$(BUILD_HOST)\\\"\"
98
 
99
 
275
 #################################################################
276
 #################################################################
276
 # Unit Test builds
277
 # Unit Test builds
277
 #################################################################
278
 #################################################################
278
-TEST_FLAGS=-Wall -g -O0 -DDEBUG -lstdc++ -Iinclude
279
+TEST_FLAGS=$(WARNINGS) -g -O0 -DDEBUG -lstdc++ -Iinclude
279
 
280
 
280
 TEST_MAP_TR5=~/projects/Data/models/tombraider/tr5/demo.trc
281
 TEST_MAP_TR5=~/projects/Data/models/tombraider/tr5/demo.trc
281
 TEST_MAP_TR4=~/projects/Data/models/tombraider/tr4/angkor1.tr4
282
 TEST_MAP_TR4=~/projects/Data/models/tombraider/tr4/angkor1.tr4
295
 
296
 
296
 TombRaider.test:
297
 TombRaider.test:
297
 	@-mkdir -p $(BUILD_TEST_DIR)
298
 	@-mkdir -p $(BUILD_TEST_DIR)
298
-	$(CC) -Wall -Iinclude $(TR_FLAGS) -o $(BUILD_TEST_DIR)/TombRaiderTest.o -c test/TombRaider.cpp
299
+	$(CC) $(WARNINGS) -Iinclude $(TR_FLAGS) -o $(BUILD_TEST_DIR)/TombRaiderTest.o -c test/TombRaider.cpp
299
 	$(MAKE) targets NAME=TombRaider.test BUILDDIR=$(BUILD_TEST_DIR) \
300
 	$(MAKE) targets NAME=TombRaider.test BUILDDIR=$(BUILD_TEST_DIR) \
300
 	OBJS="$(BUILD_TEST_DIR)/TombRaiderTest.o $(BUILD_TEST_DIR)/TombRaider.o $(BUILD_TEST_DIR)/tga.o $(BUILD_TEST_DIR)/memory_test.o" \
301
 	OBJS="$(BUILD_TEST_DIR)/TombRaiderTest.o $(BUILD_TEST_DIR)/TombRaider.o $(BUILD_TEST_DIR)/tga.o $(BUILD_TEST_DIR)/memory_test.o" \
301
 	CFLAGS="$(BASE_CFLAGS) -g $(TR_FLAGS)" \
302
 	CFLAGS="$(BASE_CFLAGS) -g $(TR_FLAGS)" \
305
 
306
 
306
 GLString.test:
307
 GLString.test:
307
 	mkdir -p $(BUILD_TEST_DIR)
308
 	mkdir -p $(BUILD_TEST_DIR)
308
-	$(CC) -Wall -Iinclude -DHAVE_SDL_TTF -DHAVE_SDL \
309
+	$(CC) $(WARNINGS) -Iinclude -DHAVE_SDL_TTF -DHAVE_SDL \
309
 	$(shell sdl-config --cflags) $(shell sdl-config --libs) \
310
 	$(shell sdl-config --cflags) $(shell sdl-config --libs) \
310
 	$(GL_LIBS) $(GL_DEFS) -lSDL_ttf -lm -lstdc++ \
311
 	$(GL_LIBS) $(GL_DEFS) -lSDL_ttf -lm -lstdc++ \
311
 	src/Texture.cpp src/GLString.cpp \
312
 	src/Texture.cpp src/GLString.cpp \
327
 Matrix.test:
328
 Matrix.test:
328
 	@-echo "Building Matrix unit test"
329
 	@-echo "Building Matrix unit test"
329
 	mkdir -p $(BUILD_TEST_DIR)
330
 	mkdir -p $(BUILD_TEST_DIR)
330
-	$(CC) -Wall -g -lm -lstdc++ -Iinclude \
331
+	$(CC) $(WARNINGS) -g -lm -lstdc++ -Iinclude \
331
 	src/Matrix.cpp src/Quaternion.cpp src/Vector3d.cpp \
332
 	src/Matrix.cpp src/Quaternion.cpp src/Vector3d.cpp \
332
 	test/Matrix.cpp -o $(BUILD_TEST_DIR)/Matrix.test
333
 	test/Matrix.cpp -o $(BUILD_TEST_DIR)/Matrix.test
333
 
334
 
334
 Quaternion.test:
335
 Quaternion.test:
335
 	@-echo "Building Quaternion unit test"
336
 	@-echo "Building Quaternion unit test"
336
 	mkdir -p $(BUILD_TEST_DIR)
337
 	mkdir -p $(BUILD_TEST_DIR)
337
-	$(CC) -Wall -g -lm -lstdc++ -Iinclude \
338
+	$(CC) $(WARNINGS) -g -lm -lstdc++ -Iinclude \
338
 	src/Quaternion.cpp test/Quaternion.cpp -o $(BUILD_TEST_DIR)/Quaternion.test
339
 	src/Quaternion.cpp test/Quaternion.cpp -o $(BUILD_TEST_DIR)/Quaternion.test
339
 
340
 
340
 Math.test:
341
 Math.test:
341
 	@-echo "Building Math unit test"
342
 	@-echo "Building Math unit test"
342
 	mkdir -p $(BUILD_TEST_DIR)
343
 	mkdir -p $(BUILD_TEST_DIR)
343
-	$(CC) -Wall -g -lm -lstdc++ -Iinclude \
344
+	$(CC) $(WARNINGS) -g -lm -lstdc++ -Iinclude \
344
 	src/MatMath.cpp src/Vector3d.cpp test/MatMath.cpp -o $(BUILD_TEST_DIR)/Math.test
345
 	src/MatMath.cpp src/Vector3d.cpp test/MatMath.cpp -o $(BUILD_TEST_DIR)/Math.test
345
 
346
 
346
 #################################################################
347
 #################################################################
347
 
348
 
348
 Memory.test:
349
 Memory.test:
349
 	mkdir -p $(BUILD_TEST_DIR)
350
 	mkdir -p $(BUILD_TEST_DIR)
350
-	$(CC) -Wall -g -lstdc++ -Iinclude \
351
+	$(CC) $(WARNINGS) -g -lstdc++ -Iinclude \
351
 	-DDEBUG_MEMORY -DDEBUG_MEMORY_ERROR \
352
 	-DDEBUG_MEMORY -DDEBUG_MEMORY_ERROR \
352
 	src/memory_test.cpp test/memory_test.cpp -o $(BUILD_TEST_DIR)/memory_test.test
353
 	src/memory_test.cpp test/memory_test.cpp -o $(BUILD_TEST_DIR)/memory_test.test
353
 
354
 

+ 1
- 1
include/BoundingVolume.h Просмотреть файл

70
 
70
 
71
 	BoundingSphere mSphere;    /* Bounding sphere of this volume */
71
 	BoundingSphere mSphere;    /* Bounding sphere of this volume */
72
 
72
 
73
-	BoundingBox mBox;;         /* Bounding box of this volume */
73
+	BoundingBox mBox;          /* Bounding box of this volume */
74
 
74
 
75
  private:
75
  private:
76
 
76
 

+ 1
- 1
include/OpenRaider.h Просмотреть файл

66
 	OpenRaider_DumpTexture  =  16,
66
 	OpenRaider_DumpTexture  =  16,
67
 	OpenRaider_FullScreen   =  32,
67
 	OpenRaider_FullScreen   =  32,
68
 	OpenRaider_Loading      =  64,
68
 	OpenRaider_Loading      =  64,
69
-	OpenRaider_GameRunning  = 128,
69
+	OpenRaider_GameRunning  = 128
70
 
70
 
71
 } OpenRaiderFlags;
71
 } OpenRaiderFlags;
72
 
72
 

+ 1
- 1
include/System.h Просмотреть файл

47
     SYS_MOD_KEY_LALT   = 16,
47
     SYS_MOD_KEY_LALT   = 16,
48
     SYS_MOD_KEY_RALT   = 32,
48
     SYS_MOD_KEY_RALT   = 32,
49
     SYS_MOD_KEY_LMETA  = 64,
49
     SYS_MOD_KEY_LMETA  = 64,
50
-    SYS_MOD_KEY_RMETA  = 128,
50
+    SYS_MOD_KEY_RMETA  = 128
51
 } sdl_sys_mod_key_t;
51
 } sdl_sys_mod_key_t;
52
 
52
 
53
 /*!
53
 /*!

+ 3
- 3
src/memory_test.cpp Просмотреть файл

1122
 
1122
 
1123
 	add_track((DWORD)ptr, size, file, line);
1123
 	add_track((DWORD)ptr, size, file, line);
1124
 	return ptr;
1124
 	return ptr;
1125
-};
1125
+}
1126
 
1126
 
1127
 
1127
 
1128
 void *operator new [](size_t size, const char *file, int line)
1128
 void *operator new [](size_t size, const char *file, int line)
1171
 {
1171
 {
1172
 	remove_track((DWORD)p);
1172
 	remove_track((DWORD)p);
1173
 	free(p);
1173
 	free(p);
1174
-};
1174
+}
1175
 
1175
 
1176
 
1176
 
1177
 void operator delete [](void *p)
1177
 void operator delete [](void *p)
1178
 {
1178
 {
1179
 	remove_track((DWORD)p);
1179
 	remove_track((DWORD)p);
1180
 	free(p);
1180
 	free(p);
1181
-};
1181
+}
1182
 #endif
1182
 #endif
1183
 
1183
 

+ 1
- 1
test/TombRaider.cpp Просмотреть файл

53
 #include <TombRaider.h>
53
 #include <TombRaider.h>
54
 
54
 
55
 #ifdef __TEST_TR5_DUMP_TGA
55
 #ifdef __TEST_TR5_DUMP_TGA
56
-#include <mtk_tga.h>
56
+#include <tga.h>
57
 #endif
57
 #endif
58
 
58
 
59
 #ifdef DEBUG_MEMORY
59
 #ifdef DEBUG_MEMORY

+ 1
- 1
test/greatest.h Просмотреть файл

21
 #define GREATEST_H
21
 #define GREATEST_H
22
 
22
 
23
 #ifdef __cplusplus
23
 #ifdef __cplusplus
24
-#define __STDC_VERSION__ 19901L // C++ compilers support var args
24
+#define __STDC_VERSION__ 19901L // C++11 compilers support var args
25
 extern "C"
25
 extern "C"
26
 {
26
 {
27
 #endif
27
 #endif

Загрузка…
Отмена
Сохранить