Clean up MSVC warning [C4312] conversion from type to type * of greater size

This commit is contained in:
suncaller 2019-02-02 23:09:55 -05:00
parent 265e64f6fc
commit 31d0eb16f8
21 changed files with 39 additions and 39 deletions

View file

@ -55,7 +55,7 @@ void ForestCreateUndoAction::addItem( ForestItemData *data,
// We store the datablock ID rather than the actual pointer
// since the pointer could go bad.
SimObjectId dataId = item.getData()->getId();
mItems.last().setData( (ForestItemData*)dataId );
mItems.last().setData( (ForestItemData*)(uintptr_t)dataId );
}
void ForestCreateUndoAction::redo()
@ -110,7 +110,7 @@ void ForestDeleteUndoAction::removeItem( const ForestItem &item )
SimObjectId dataId = item.getData()->getId();
mItems.push_back( item );
mItems.last().setData( (ForestItemData*)dataId );
mItems.last().setData( (ForestItemData*)(uintptr_t)dataId );
mData->removeItem( item.getKey(), item.getPosition() );
}
@ -171,7 +171,7 @@ void ForestUpdateAction::saveItem( const ForestItem &item )
// We store the datablock ID rather than the actual pointer
// since the pointer could go bad.
SimObjectId dataId = item.getData()->getId();
mItems.last().setData( (ForestItemData*)dataId );
mItems.last().setData( (ForestItemData*)(uintptr_t)dataId );
}
void ForestUpdateAction::_swapState()
@ -215,7 +215,7 @@ void ForestUpdateAction::_swapState()
item.getScale() );
// Save the state before this swap for the next swap.
newItem.setData( (ForestItemData*)data->getId() );
newItem.setData( (ForestItemData*)(uintptr_t)data->getId() );
mItems.push_back( newItem );
}