PVS-StudioWarnings

PVS-Studio warning V656 for ReactOS

Nov 11th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. GpStatus WINGDIPAPI GdipGetRegionBoundsI(....)
  2. {
  3.   ....
  4.   status = GdipGetRegionBounds(region, graphics, &rectf);
  5.   if (status == Ok){
  6.     rect->X = gdip_round(rectf.X);
  7.     rect->Y = gdip_round(rectf.X);
  8.     rect->Width  = gdip_round(rectf.Width);
  9.     rect->Height = gdip_round(rectf.Height);
  10.   }
  11.   return status;
  12. }
  13.  
  14. This suspicious code was found in ReactOS project by PVS-Studio static code analyzer.
  15. Warning message is:
  16. V656 Variables 'rect->X', 'rect->Y' are initialized through the call to the same function. It's probably an error or un-optimized code. Consider inspecting the 'gdip_round(rectf.X)' expression. Check lines: 718, 719. region.c 719
  17.  
  18. 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