From e154e654f1e046a4d60e09d3ef87d1cf9c3ae6ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Konopacki?= Date: Mon, 13 Aug 2012 01:26:36 +0200 Subject: Reduced amount of warnings in CBot library Changed most of C-style casting to C++ casting Commented unused variables --- src/CBot/CBotTwoOpExpr.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/CBot/CBotTwoOpExpr.cpp') diff --git a/src/CBot/CBotTwoOpExpr.cpp b/src/CBot/CBotTwoOpExpr.cpp index 80a3bb0..dfaed9f 100644 --- a/src/CBot/CBotTwoOpExpr.cpp +++ b/src/CBot/CBotTwoOpExpr.cpp @@ -259,7 +259,7 @@ CBotInstr* CBotTwoOpExpr::Compile(CBotToken* &p, CBotCStack* pStack, int* pOpera CBotTypResult t(type1); t.SetType(TypeRes); // is a variable on the stack for the type of result - pStk->SetVar(CBotVar::Create((CBotToken*)NULL, t)); + pStk->SetVar(CBotVar::Create(static_cast(NULL), t)); // and returns the requested object return pStack->Return(inst, pStk); @@ -309,14 +309,14 @@ bool CBotTwoOpExpr::Execute(CBotStack* &pStack) // for OR and AND logic does not evaluate the second expression if not necessary if ( (GetTokenType() == ID_LOG_AND || GetTokenType() == ID_TXT_AND ) && pStk1->GetVal() == false ) { - CBotVar* res = CBotVar::Create( (CBotToken*)NULL, CBotTypBoolean); + CBotVar* res = CBotVar::Create( static_cast(NULL), CBotTypBoolean); res->SetValInt(false); pStk1->SetVar(res); return pStack->Return(pStk1); // transmits the result } if ( (GetTokenType() == ID_LOG_OR||GetTokenType() == ID_TXT_OR) && pStk1->GetVal() == true ) { - CBotVar* res = CBotVar::Create( (CBotToken*)NULL, CBotTypBoolean); + CBotVar* res = CBotVar::Create( static_cast(NULL), CBotTypBoolean); res->SetValInt(true); pStk1->SetVar(res); return pStack->Return(pStk1); // transmits the result @@ -374,7 +374,7 @@ bool CBotTwoOpExpr::Execute(CBotStack* &pStack) } // creates a variable for the result - CBotVar* result = CBotVar::Create( (CBotToken*)NULL, TypeRes); + CBotVar* result = CBotVar::Create( static_cast(NULL), TypeRes); // creates a variable to perform the calculation in the appropriate type TypeRes = MAX(type1.GetType(), type2.GetType()); @@ -387,8 +387,8 @@ bool CBotTwoOpExpr::Execute(CBotStack* &pStack) CBotVar* temp; if ( TypeRes == CBotTypPointer ) TypeRes = CBotTypNullPointer; - if ( TypeRes == CBotTypClass ) temp = CBotVar::Create( (CBotToken*)NULL, CBotTypResult(CBotTypIntrinsic, type1.GetClass() ) ); - else temp = CBotVar::Create( (CBotToken*)NULL, TypeRes ); + if ( TypeRes == CBotTypClass ) temp = CBotVar::Create( static_cast(NULL), CBotTypResult(CBotTypIntrinsic, type1.GetClass() ) ); + else temp = CBotVar::Create( static_cast(NULL), TypeRes ); int err = 0; // is a operation according to request @@ -558,7 +558,7 @@ void t() } #endif -#if 01 +#if 0 void t(bool t) { int x; -- cgit v1.2.3-1-g7c22