diff --git a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp index 466a4c4a62..c13a6a59b3 100644 --- a/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp +++ b/samples/Cpp/TestCpp/Classes/ExtensionsTest/ExtensionsTest.cpp @@ -99,14 +99,14 @@ void ExtensionsMainLayer::onEnter() void ExtensionsMainLayer::ccTouchesBegan(Set *pTouches, Event *pEvent) { - Touch* touch = (Touch*)pTouches->anyObject(); + Touch* touch = static_cast(pTouches->anyObject()); _beginPos = touch->getLocation(); } void ExtensionsMainLayer::ccTouchesMoved(Set *pTouches, Event *pEvent) { - Touch* touch = (Touch*)pTouches->anyObject(); + Touch* touch = static_cast(pTouches->anyObject()); Point touchLocation = touch->getLocation(); float nMoveY = touchLocation.y - _beginPos.y;