diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2019-02-04 12:11:18 -0500 |
|---|---|---|
| committer | Tim Foley <tfoleyNV@users.noreply.github.com> | 2019-02-04 09:11:18 -0800 |
| commit | 0d206996cd68b9f08ae1b4d9da6f16293984302c (patch) | |
| tree | 023fe84547955b1356a770f407433f45e1fb8048 /source/slang/parameter-binding.cpp | |
| parent | 3726194fbe3da234eb30b6371e5b4ab1ea388f93 (diff) | |
Feature/casting tidyup (#822)
* Use 'is' over 'as' where appropriate.
* dynamic_cast -> dynamicCast
* Replace 'dynamicCast' with 'as' where has no change in behavior/ambiguity.
* Replace dynamicCast with as where doesn't change behavior/non ambiguous.
Diffstat (limited to 'source/slang/parameter-binding.cpp')
| -rw-r--r-- | source/slang/parameter-binding.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/slang/parameter-binding.cpp b/source/slang/parameter-binding.cpp index e722ccbb9..2fb571db2 100644 --- a/source/slang/parameter-binding.cpp +++ b/source/slang/parameter-binding.cpp @@ -523,7 +523,7 @@ LayoutSemanticInfo ExtractLayoutSemanticInfo( UInt space = 0; - if( auto registerSemantic = dynamic_cast<HLSLRegisterSemantic*>(semantic) ) + if( auto registerSemantic = as<HLSLRegisterSemantic>(semantic) ) { auto const& spaceName = registerSemantic->spaceName.Content; if(spaceName.size() != 0) @@ -698,25 +698,25 @@ static bool validateValuesMatch( Val* right, StructuralTypeMatchStack* stack) { - if( auto leftType = dynamic_cast<Type*>(left) ) + if( auto leftType = dynamicCast<Type>(left) ) { - if( auto rightType = dynamic_cast<Type*>(right) ) + if( auto rightType = dynamicCast<Type>(right) ) { return validateTypesMatch(context, leftType, rightType, stack); } } - if( auto leftInt = dynamic_cast<IntVal*>(left) ) + if( auto leftInt = dynamicCast<IntVal>(left) ) { - if( auto rightInt = dynamic_cast<IntVal*>(right) ) + if( auto rightInt = dynamicCast<IntVal>(right) ) { return validateIntValuesMatch(context, leftInt, rightInt, stack); } } - if( auto leftWitness = dynamic_cast<SubtypeWitness*>(left) ) + if( auto leftWitness = dynamicCast<SubtypeWitness>(left) ) { - if( auto rightWitness = dynamic_cast<SubtypeWitness*>(right) ) + if( auto rightWitness = dynamicCast<SubtypeWitness>(right) ) { return true; } |
