Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void VerifyUniformLayout(....)
- {
- ....
- switch(Member.GetBaseType())
- {
- case UBMT_STRUCT: BaseTypeName = TEXT("struct");
- case UBMT_BOOL: BaseTypeName = TEXT("bool"); break;
- case UBMT_INT32: BaseTypeName = TEXT("int"); break;
- case UBMT_UINT32: BaseTypeName = TEXT("uint"); break;
- case UBMT_FLOAT32: BaseTypeName = TEXT("float"); break;
- default:
- UE_LOG(LogShaders, Fatal,
- TEXT("Unrecognized uniform buffer "
- "struct member base type."));
- };
- ....
- }
- This is what should have been written here: case UBMT_STRUCT: BaseTypeName = TEXT("struct"); break;
- This suspicious code was found in UnrealEngine4 project by PVS-Studio static code analyzer.
- Warning message is:
- V519 The 'BaseTypeName' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 862, 863. openglshaders.cpp 863
- 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