File: modeling.cpp

package info (click to toggle)
freespace2 3.7.4%2Brepack-1
  • links: PTS, VCS
  • area: non-free
  • in suites: buster
  • size: 22,236 kB
  • sloc: cpp: 393,535; ansic: 4,106; makefile: 1,091; xml: 181; sh: 137
file content (49 lines) | stat: -rw-r--r-- 1,140 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
 * Coverity Scan modeling file.  Help reduce false positives
 */

// Assert & Assertion are "killpaths" in DEBUG, but not release
// This should get them treated as killpaths in release as well
// (just a copy of the DEBUG version of the macros)

void WinAssert(char * text, char *filename, int line)
{
	__coverity_panic__();
}

void WinAssert(char * text, char *filename, int line, const char * format, ... )
{
	__coverity_panic__();
}

#	define Assert(expr) do {\
		if (!(expr)) {\
			WinAssert(#expr,__FILE__,__LINE__);\
		}\
		ASSUME( expr );\
	} while (0)

#	ifndef _MSC_VER   // non MS compilers
#		define Assertion(expr, msg, ...) do {\
			if (!(expr)) {\
				WinAssert(#expr,__FILE__,__LINE__, msg , ##__VA_ARGS__ );\
			}\
		} while (0)
#	else
#		if _MSC_VER >= 1400	// VC 2005 or greater
#			define Assertion(expr, msg, ...) do {\
				if (!(expr)) {\
					WinAssert(#expr,__FILE__,__LINE__, msg, __VA_ARGS__ );\
				}\
				ASSUME(expr);\
			} while (0)
#		else // older MSVC compilers
#			define Assertion(expr, msg) do {\
				if (!(expr)) {\
					WinAssert(#expr,__FILE__,__LINE__);\
				}\
			} while (0)
#		endif
#	endif