Skip to content

Commit fc17faa

Browse files
committed
Throw away some macro redefinition warnings.
1 parent 4bd0e3e commit fc17faa

File tree

8 files changed

+8
-139
lines changed

8 files changed

+8
-139
lines changed

src/utils/xrAI/StdAfx.h

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,35 +22,8 @@ extern CThreadManager::ReportProgressFunc ProxyProgress;
2222
#include "xrServerEntities/smart_cast.h"
2323
#endif
2424

25+
// Used in:
26+
// src\xrServerEntities\xrServer_Objects_ALife_Items.cpp
27+
// src\xrServerEntities\xrServer_Objects_ALife_Monsters.cpp
2528
#define READ_IF_EXISTS(ltx, method, section, name, default_value)\
2629
(ltx->line_exist(section, name)) ? ltx->method(section, name) : default_value
27-
28-
#if XRAY_EXCEPTIONS
29-
IC xr_string string2xr_string(LPCSTR s) { return s ? s : ""; }
30-
#define THROW(xpr)\
31-
if (!(xpr))\
32-
{\
33-
throw __FILE__LINE__ "\"" #xpr "\"";\
34-
}
35-
#define THROW2(xpr, msg0)\
36-
if (!(xpr))\
37-
{\
38-
throw *shared_str(\
39-
xr_string(__FILE__LINE__).append(" \"").append(#xpr).append(string2xr_string(msg0)).c_str());\
40-
}
41-
#define THROW3(xpr, msg0, msg1)\
42-
if (!(xpr))\
43-
{\
44-
throw *shared_str(xr_string(__FILE__LINE__)\
45-
.append(" \"")\
46-
.append(#xpr)\
47-
.append(string2xr_string(msg0))\
48-
.append(", ")\
49-
.append(string2xr_string(msg1))\
50-
.c_str());\
51-
}
52-
#else
53-
#define THROW VERIFY
54-
#define THROW2 VERIFY2
55-
#define THROW3 VERIFY3
56-
#endif

src/utils/xrAI/xr_graph_merge.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,6 @@ CGraphMerger::CGraphMerger(LPCSTR game_graph_id, LPCSTR name, bool rebuild)
566566
Logger.Phase("Processing level graphs");
567567

568568
CInifile* Ini = new CInifile(INI_FILE);
569-
if (!Ini->section_exist("levels"))
570-
THROW(false);
571569
R_ASSERT(Ini->section_exist("levels"));
572570

573571
tGraphHeader.m_guid = generate_guid();

src/utils/xrDO_Light/StdAfx.h

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "utils/xrLCUtil/ILevelCompilerLogger.hpp"
3030
#include "utils/xrLCUtil/xrThread.hpp"
3131
#include "xrCore/cdecl_cast.hpp"
32+
#include "xrScriptEngine/DebugMacros.hpp" // XXX: move debug macros to xrCore
3233

3334
extern ILevelCompilerLogger& Logger;
3435
extern CThread::LogFunc ProxyMsg;
@@ -37,36 +38,3 @@ extern CThreadManager::ReportProgressFunc ProxyProgress;
3738

3839
#define READ_IF_EXISTS(ltx, method, section, name, default_value)\
3940
(ltx->line_exist(section, name)) ? ltx->method(section, name) : default_value
40-
41-
#undef THROW
42-
43-
#if XRAY_EXCEPTIONS
44-
IC xr_string string2xr_string(LPCSTR s) { return s ? s : ""; }
45-
#define THROW(xpr)\
46-
if (!(xpr))\
47-
{\
48-
throw __FILE__LINE__ "\"" #xpr "\"";\
49-
}
50-
#define THROW2(xpr, msg0)\
51-
if (!(xpr))\
52-
{\
53-
throw xr_string(__FILE__LINE__).append(" \"").append(#xpr).append(string2xr_string(msg0));\
54-
}
55-
#define THROW3(xpr, msg0, msg1)\
56-
if (!(xpr))\
57-
{\
58-
throw xr_string(__FILE__LINE__)\
59-
.append(" \"")\
60-
.append(#xpr)\
61-
.append(string2xr_string(msg0))\
62-
.append(", ")\
63-
.append(string2xr_string(msg1));\
64-
}
65-
#else
66-
#define THROW VERIFY
67-
#define THROW2 VERIFY2
68-
#define THROW3 VERIFY3
69-
#endif
70-
71-
//{{AFX_INSERT_LOCATION}}
72-
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

src/utils/xrSE_Factory/stdafx.h

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "Common/Common.hpp"
1818
#include "xrCore/xrCore.h"
1919
#include "xrScriptEngine/xrScriptEngine.hpp"
20+
#include "xrScriptEngine/DebugMacros.hpp" // XXX: move debug macros to xrCore
2021
#include "xrCDB/xrCDB.h"
2122
#include "xrCore/_fbox.h"
2223
#include "xrCore/_quaternion.h"
@@ -27,33 +28,3 @@
2728

2829
#define READ_IF_EXISTS(ltx, method, section, name, default_value)\
2930
(ltx->line_exist(section, name)) ? ltx->method(section, name) : default_value
30-
31-
#if XRAY_EXCEPTIONS
32-
IC xr_string string2xr_string(LPCSTR s) { return s ? s : ""; }
33-
#define THROW(xpr)\
34-
if (!(xpr))\
35-
{\
36-
throw __FILE__LINE__ "\"" #xpr "\"";\
37-
}
38-
#define THROW2(xpr, msg0)\
39-
if (!(xpr))\
40-
{\
41-
throw *shared_str(\
42-
xr_string(__FILE__LINE__).append(" \"").append(#xpr).append(string2xr_string(msg0)).c_str());\
43-
}
44-
#define THROW3(xpr, msg0, msg1)\
45-
if (!(xpr))\
46-
{\
47-
throw *shared_str(xr_string(__FILE__LINE__)\
48-
.append(" \"")\
49-
.append(#xpr)\
50-
.append(string2xr_string(msg0))\
51-
.append(", ")\
52-
.append(string2xr_string(msg1))\
53-
.c_str());\
54-
}
55-
#else
56-
#define THROW VERIFY
57-
#define THROW2 VERIFY2
58-
#define THROW3 VERIFY3
59-
#endif

src/xrAICore/Navigation/a_star.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "xrAICore/Navigation/vertex_path.h"
1212
#include "xrAICore/Navigation/data_storage_constructor.h"
1313
#include "xrAICore/Navigation/dijkstra.h"
14+
#include "xrScriptEngine/DebugMacros.hpp" // XXX: move debug macros to xrCore
1415

1516
template <typename TDistance, typename TVertexData>
1617
struct AStarVertexData

src/xrGame/GameObject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "xrServer_Space.h"
1111
#include "alife_space.h"
1212
#include "xrScriptEngine/script_space_forward.hpp"
13+
#include "xrScriptEngine/DebugMacros.hpp" // XXX: move debug macros to xrCore
1314
#include "script_binder.h"
1415
#include "Hit.h"
1516
#include "game_object_space.h"

src/xrGame/StdAfx.h

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,8 @@
22

33
#include "Common/Common.hpp"
44

5-
#pragma warning(push)
6-
#pragma warning(disable : 4995)
75
#include "xrEngine/stdafx.h"
86
#include "DPlay/dplay8.h"
9-
#pragma warning(pop)
10-
11-
#pragma warning(4 : 4018)
12-
#pragma warning(4 : 4244)
13-
#pragma warning(disable : 4505)
14-
15-
#if XRAY_EXCEPTIONS
16-
#define THROW(expr) \
17-
do \
18-
{ \
19-
if (!(expr)) \
20-
{ \
21-
string4096 assertion_info; \
22-
xrDebug::GatherInfo(assertion_info, DEBUG_INFO, #expr, 0, 0, 0); \
23-
throw assertion_info; \
24-
} \
25-
} while (0)
26-
#define THROW2(expr, msg0) \
27-
do \
28-
{ \
29-
if (!(expr)) \
30-
{ \
31-
string4096 assertion_info; \
32-
xrDebug::GatherInfo(assertion_info, DEBUG_INFO, #expr, msg0, 0, 0); \
33-
throw assertion_info; \
34-
} \
35-
} while (0)
36-
#define THROW3(expr, msg0, msg1) \
37-
do \
38-
{ \
39-
if (!(expr)) \
40-
{ \
41-
string4096 assertion_info; \
42-
xrDebug::GatherInfo(assertion_info, DEBUG_INFO, #expr, msg0, msg1, 0); \
43-
throw assertion_info; \
44-
} \
45-
} while (0)
46-
#else
47-
#define THROW VERIFY
48-
#define THROW2 VERIFY2
49-
#define THROW3 VERIFY3
50-
#endif
517

528
#pragma region
539
#include "xrEngine/gamefont.h"

src/xrGame/alife_level_registry.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "safe_map_iterator.h"
1212
#include "xrServer_Objects_ALife.h"
1313
#include "xrAICore/Navigation/game_graph.h"
14+
#include "xrScriptEngine/DebugMacros.hpp" // XXX: move debug macros to xrCore
1415
#include "ai_debug.h"
1516

1617
//#define FULL_LEVEL_UPDATE

0 commit comments

Comments
 (0)