Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vec2::Vec2() : x(0.0f), y(0.0f) { }
- Vec2::Vec2(float xx, float yy) : x(xx), y(yy) { }
- bool MotionStreak::initWithFade(...)
- {
- ....
- _pointVertexes = (Vec2*)malloc(sizeof(Vec2) * _maxPoints);
- _vertices = (Vec2*)malloc(sizeof(Vec2) * _maxPoints * 2);
- _texCoords = (Tex2F*)malloc(sizeof(Tex2F) * _maxPoints * 2);
- ....
- }
- This suspicious code was found in Cocos2d-x project by PVS-Studio static code analyzer.
- Warning message is:
- V630 The 'malloc' function is used to allocate memory for an array of objects which are classes containing constructors and destructors. ccmotionstreak.cpp 122
- 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