summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-conversion.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-11-06 01:47:26 +0800
committerGitHub <noreply@github.com>2024-11-05 09:47:26 -0800
commitb118451e301d734e3e783b3acdf871f3f6ea851c (patch)
tree277f160d31e2c442f724bc6a2d3c09fabff403ca /source/slang/slang-check-conversion.cpp
parent53dd5928c35d5a5cb1f7d2a563348fd1fa87d672 (diff)
Move switch statement bodies to their own lines (#5493)
* Move switch statement bodies to their own lines * format --------- Co-authored-by: Yong He <yonghe@outlook.com>
Diffstat (limited to 'source/slang/slang-check-conversion.cpp')
-rw-r--r--source/slang/slang-check-conversion.cpp33
1 files changed, 22 insertions, 11 deletions
diff --git a/source/slang/slang-check-conversion.cpp b/source/slang/slang-check-conversion.cpp
index 7e33158e6..0c06fb113 100644
--- a/source/slang/slang-check-conversion.cpp
+++ b/source/slang/slang-check-conversion.cpp
@@ -636,11 +636,13 @@ static bool _canModifierBeAddedDuringCoercion(Val* modifier)
{
switch (modifier->astNodeType)
{
- default: return false;
+ default:
+ return false;
case ASTNodeType::UNormModifierVal:
case ASTNodeType::SNormModifierVal:
- case ASTNodeType::NoDiffModifierVal: return true;
+ case ASTNodeType::NoDiffModifierVal:
+ return true;
}
}
@@ -653,11 +655,13 @@ static bool _canModifierBeDroppedDuringCoercion(Val* modifier)
{
switch (modifier->astNodeType)
{
- default: return false;
+ default:
+ return false;
case ASTNodeType::UNormModifierVal:
case ASTNodeType::SNormModifierVal:
- case ASTNodeType::NoDiffModifierVal: return true;
+ case ASTNodeType::NoDiffModifierVal:
+ return true;
}
}
@@ -672,8 +676,10 @@ static bool isSigned(Type* t)
case BaseType::Int16:
case BaseType::Int:
case BaseType::Int64:
- case BaseType::IntPtr: return true;
- default: return false;
+ case BaseType::IntPtr:
+ return true;
+ default:
+ return false;
}
}
@@ -686,13 +692,17 @@ int getTypeBitSize(Type* t)
switch (basicType->getBaseType())
{
case BaseType::Int8:
- case BaseType::UInt8: return 8;
+ case BaseType::UInt8:
+ return 8;
case BaseType::Int16:
- case BaseType::UInt16: return 16;
+ case BaseType::UInt16:
+ return 16;
case BaseType::Int:
- case BaseType::UInt: return 32;
+ case BaseType::UInt:
+ return 32;
case BaseType::Int64:
- case BaseType::UInt64: return 64;
+ case BaseType::UInt64:
+ return 64;
case BaseType::IntPtr:
case BaseType::UIntPtr:
#if SLANG_PTR_IS_32
@@ -700,7 +710,8 @@ int getTypeBitSize(Type* t)
#else
return 64;
#endif
- default: return 0;
+ default:
+ return 0;
}
}