summaryrefslogtreecommitdiffstats
path: root/src/CBot/CBotTwoOpExpr.cpp
diff options
context:
space:
mode:
authorMichał Konopacki <konopacki.m@gmail.com>2012-08-13 01:26:36 +0200
committerMichał Konopacki <konopacki.m@gmail.com>2012-08-13 01:45:35 +0200
commite154e654f1e046a4d60e09d3ef87d1cf9c3ae6ae (patch)
tree049a2382a5bc8a611fe0ad3df25025eeb7293278 /src/CBot/CBotTwoOpExpr.cpp
parenta9186d19609c61c369d881cdbc40cc8973cf883d (diff)
downloadcolobot-e154e654f1e046a4d60e09d3ef87d1cf9c3ae6ae.tar.gz
colobot-e154e654f1e046a4d60e09d3ef87d1cf9c3ae6ae.tar.bz2
colobot-e154e654f1e046a4d60e09d3ef87d1cf9c3ae6ae.zip
Reduced amount of warnings in CBot library
Changed most of C-style casting to C++ casting Commented unused variables
Diffstat (limited to 'src/CBot/CBotTwoOpExpr.cpp')
-rw-r--r--src/CBot/CBotTwoOpExpr.cpp14
1 files changed, 7 insertions, 7 deletions
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<CBotToken*>(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<CBotToken*>(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<CBotToken*>(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<CBotToken*>(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<CBotToken*>(NULL), CBotTypResult(CBotTypIntrinsic, type1.GetClass() ) );
+ else temp = CBotVar::Create( static_cast<CBotToken*>(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;