Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - minirop

Pages: [1]
1
General discussions / static analysis of SFML
« on: April 11, 2015, 12:37:36 am »
Hello,
as a test, I've tried PVS-Studio on SFML (master) and, considering I did it correctly, there is not many things to say (which is a good thing).

  • Most of the output was about c-style casts (mainly in glloader.cpp).
  • Several "variable assigned twice", like:
sfogl_StrToExtMap *entry = NULL;
entry = FindExtEntry(extensionName);
  • "The '(FT_RENDER_MODE_NORMAL)' named constant with the value of 0 is used in the bitwise operation. font.cpp:485"
  • SoundSource has a copy constructor but no assignment operator.
  • And a few about optimization, like : use !string.empty() instead of string != "".
  • Last, an UB in stb_image.h. There are bitwise shifts on negative numbers.
That's all folks!

Except the missing operator=(), the rest can be "forgotten" since it's mainly syntax choices¹ (but why the double assignment?)

++

¹: I know C-casts are discouraged, but with C structs and function, the static_cast should "win".

Pages: [1]