Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Tile
- {
- Vec2 position;
- Vec2 startPosition;
- Size delta;
- };
- Tile* _tiles;
- void ShuffleTiles::startWithTarget(Node *target)
- {
- ....
- _tiles = (struct Tile *)new Tile[_tilesCount]; //<==
- Tile *tileArray = (Tile*) _tiles; //<==
- ....
- }
- This suspicious code was found in Cocos2d-x project by PVS-Studio static code analyzer.
- Warning message is:
- V572 It is odd that the object which was created using 'new' operator is immediately casted to another type. ccactiontiledgrid.cpp 322
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment