From e2367f3ed2060b273559200b3e40f75a98bb6a6f Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Tue, 14 Nov 2017 22:30:35 -0600 Subject: FULLPIPE: Remove unnecessary and unsafe C-style casts --- engines/fullpipe/gfx.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'engines/fullpipe/gfx.cpp') diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp index da626c7f1f..b12edcb621 100644 --- a/engines/fullpipe/gfx.cpp +++ b/engines/fullpipe/gfx.cpp @@ -300,8 +300,8 @@ void GameObject::renumPictures(Common::Array *lst) { int *buf = (int *)calloc(lst->size() + 2, sizeof(int)); for (uint i = 0; i < lst->size(); i++) { - if (_id == ((GameObject *)((*lst)[i]))->_id) - buf[((GameObject *)((*lst)[i]))->_odelay] = 1; + if (_id == (*lst)[i]->_id) + buf[(*lst)[i]->_odelay] = 1; } if (buf[_odelay]) { @@ -318,8 +318,8 @@ void GameObject::renumPictures(Common::Array *lst) { int *buf = (int *)calloc(lst->size() + 2, sizeof(int)); for (uint i = 0; i < lst->size(); i++) { - if (_id == ((GameObject *)((*lst)[i]))->_id) - buf[((GameObject *)((*lst)[i]))->_odelay] = 1; + if (_id == (*lst)[i]->_id) + buf[(*lst)[i]->_odelay] = 1; } if (buf[_odelay]) { @@ -348,7 +348,7 @@ bool GameObject::getPicAniInfo(PicAniInfo *info) { } if (_objtype == kObjTypeStaticANIObject) { - StaticANIObject *ani = (StaticANIObject *)this; + StaticANIObject *ani = static_cast(this); info->type = (ani->_messageQueueId << 16) | 1; info->objectId = ani->_id; @@ -398,8 +398,8 @@ bool GameObject::setPicAniInfo(PicAniInfo *picAniInfo) { return true; } - if (picAniInfo->type & 1) { - StaticANIObject *ani = (StaticANIObject *)this; + if (picAniInfo->type & 1 && _objtype == kObjTypeStaticANIObject) { + StaticANIObject *ani = static_cast(this); ani->_messageQueueId = (picAniInfo->type >> 16) & 0xffff; ani->_odelay = picAniInfo->field_8; -- cgit v1.2.3