From b7ecc49a02dff87f62a82ef6f8477a7dd00e97d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Brammer?= Date: Sat, 31 May 2014 01:14:41 +0200 Subject: [PATCH] Remove a bit of dead code from C4Value --- src/script/C4Value.h | 6 ------ tests/aul/AulMathTest.cpp | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/script/C4Value.h b/src/script/C4Value.h index d2f1634b5..122b45b44 100644 --- a/src/script/C4Value.h +++ b/src/script/C4Value.h @@ -16,7 +16,6 @@ #ifndef INC_C4Value #define INC_C4Value -#include "C4Id.h" #include "C4StringTable.h" // C4Value type @@ -107,8 +106,6 @@ public: C4AulFunc *_getFunction() const { return Data.Fn; } C4PropList *_getPropList() const { return Data.PropList; } - // Template versions - bool operator ! () const { return !GetData(); } inline operator const void* () const { return GetData() ? this : 0; } // To allow use of C4Value in conditions @@ -233,9 +230,6 @@ inline C4Value C4VFunction(C4AulFunc * pFn) { return C4Value(pFn); } C4Value C4VString(StdStrBuf strString); C4Value C4VString(const char *strString); -#define C4VFalse C4VBool(false) -#define C4VTrue C4VBool(true) - extern const C4Value C4VNull; // C4Values can contain data structures that have to maintain their diff --git a/tests/aul/AulMathTest.cpp b/tests/aul/AulMathTest.cpp index 1130823a9..e063304e2 100644 --- a/tests/aul/AulMathTest.cpp +++ b/tests/aul/AulMathTest.cpp @@ -63,6 +63,6 @@ TEST_F(AulMathTest, Bug1389) EXPECT_EQ(C4VINT_MAX, RunExpr("-2147483648 - 1")); // x ± 1 ± 1 is handled differently from x ± 2, yet the result should be // the same. - EXPECT_EQ(C4VTrue, RunExpr("2147483647 + 1 + 1 == 2147483647 + 2")); - EXPECT_EQ(C4VTrue, RunExpr("-2147483648 - 1 - 1 == -2147483648 - 2")); + EXPECT_EQ(C4Value(true), RunExpr("2147483647 + 1 + 1 == 2147483647 + 2")); + EXPECT_EQ(C4Value(true), RunExpr("-2147483648 - 1 - 1 == -2147483648 - 2")); }