diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-11-06 01:47:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-05 09:47:26 -0800 |
| commit | b118451e301d734e3e783b3acdf871f3f6ea851c (patch) | |
| tree | 277f160d31e2c442f724bc6a2d3c09fabff403ca /source/core/slang-byte-encode-util.cpp | |
| parent | 53dd5928c35d5a5cb1f7d2a563348fd1fa87d672 (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/core/slang-byte-encode-util.cpp')
| -rw-r--r-- | source/core/slang-byte-encode-util.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/source/core/slang-byte-encode-util.cpp b/source/core/slang-byte-encode-util.cpp index acafdf2b4..f3f375c60 100644 --- a/source/core/slang-byte-encode-util.cpp +++ b/source/core/slang-byte-encode-util.cpp @@ -210,20 +210,31 @@ SLANG_FORCE_INLINE static uint32_t _decodeLiteCut2UInt32(const uint8_t* in, int #if SLANG_BYTE_ENCODE_USE_UNALIGNED_ACCESS switch (numBytesRemaining) { - case 2: value = *(const uint16_t*)in; break; - case 3: value = (uint32_t(in[2]) << 16) | (uint32_t(in[1]) << 8) | uint32_t(in[0]); break; - case 4: value = *(const uint32_t*)in; break; - default: break; + case 2: + value = *(const uint16_t*)in; + break; + case 3: + value = (uint32_t(in[2]) << 16) | (uint32_t(in[1]) << 8) | uint32_t(in[0]); + break; + case 4: + value = *(const uint32_t*)in; + break; + default: + break; } #else // This works on all cpus although slower value = in[0]; switch (numBytesRemaining) { - case 4: value |= uint32_t(in[3]) << 24; /* fall thru */ - case 3: value |= uint32_t(in[2]) << 16; /* fall thru */ - case 2: value |= uint32_t(in[1]) << 8; /* fall thru */ - case 1: break; + case 4: + value |= uint32_t(in[3]) << 24; /* fall thru */ + case 3: + value |= uint32_t(in[2]) << 16; /* fall thru */ + case 2: + value |= uint32_t(in[1]) << 8; /* fall thru */ + case 1: + break; } #endif return value; |
