Advertisement
PVS-StudioWarnings

PVS-Studio warning V561 for UnrealEngine4

Nov 21st, 2014
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1. void FStreamableManager::AsyncLoadCallback(
  2.   FStringAssetReference Request)
  3. {
  4.   ....
  5.   FStreamable* Existing = StreamableItems.FindRef(TargetName);
  6.   ....
  7.   if (!Existing)
  8.   {
  9.     // hmm, maybe it was redirected by a consolidate
  10.     TargetName = ResolveRedirects(TargetName);
  11.     FStreamable* Existing = StreamableItems.FindRef(TargetName);
  12.   }
  13.   if (Existing && Existing->bAsyncLoadRequestOutstanding)
  14.   ....
  15. }
  16.  
  17. This is what should have been written here: Existing = StreamableItems.FindRef(TargetName);
  18.  
  19. This suspicious code was found in UnrealEngine4 project by PVS-Studio static code analyzer.
  20. Warning message is:
  21. V561 It's probably better to assign value to 'Existing' variable than to declare it anew. Previous declaration: streamablemanager.cpp, line 325. streamablemanager.cpp 332
  22.  
  23. 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
Advertisement