PVS-StudioWarnings

PVS-Studio warning V519 for UnrealEngine4

Nov 19th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.04 KB | None | 0 0
  1. static void VerifyUniformLayout(....)
  2. {
  3.   ....
  4.   switch(Member.GetBaseType())
  5.   {
  6.     case UBMT_STRUCT:  BaseTypeName = TEXT("struct");
  7.     case UBMT_BOOL:    BaseTypeName = TEXT("bool"); break;
  8.     case UBMT_INT32:   BaseTypeName = TEXT("int"); break;
  9.     case UBMT_UINT32:  BaseTypeName = TEXT("uint"); break;
  10.     case UBMT_FLOAT32: BaseTypeName = TEXT("float"); break;
  11.     default:
  12.       UE_LOG(LogShaders, Fatal,
  13.         TEXT("Unrecognized uniform buffer "
  14.              "struct member base type."));
  15.   };
  16.   ....
  17. }
  18.  
  19. This is what should have been written here: case UBMT_STRUCT:  BaseTypeName = TEXT("struct"); break;
  20.  
  21. This suspicious code was found in UnrealEngine4 project by PVS-Studio static code analyzer.
  22. Warning message is:
  23. V519 The 'BaseTypeName' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 862, 863. openglshaders.cpp 863
  24.  
  25. 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