mirror of https://github.com/bkaradzic/bgfx
GCC7 fallthrough.
This commit is contained in:
parent
936d105589
commit
d6cdf71273
|
@ -443,12 +443,12 @@ namespace bgfx
|
|||
|
||||
switch (_instruction.numOperands)
|
||||
{
|
||||
case 6: size += read(_reader, _instruction.operand[currOp++], _err);
|
||||
case 5: size += read(_reader, _instruction.operand[currOp++], _err);
|
||||
case 4: size += read(_reader, _instruction.operand[currOp++], _err);
|
||||
case 3: size += read(_reader, _instruction.operand[currOp++], _err);
|
||||
case 2: size += read(_reader, _instruction.operand[currOp++], _err);
|
||||
case 1: size += read(_reader, _instruction.operand[currOp++], _err);
|
||||
case 6: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 5: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 4: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 3: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 2: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 1: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 0:
|
||||
if (!valuesBeforeOpcode
|
||||
&& 0 < info.numValues)
|
||||
|
@ -482,12 +482,12 @@ namespace bgfx
|
|||
uint32_t currOp = 0;
|
||||
switch (_instruction.numOperands)
|
||||
{
|
||||
case 6: size += write(_writer, _instruction.operand[currOp++], _err);
|
||||
case 5: size += write(_writer, _instruction.operand[currOp++], _err);
|
||||
case 4: size += write(_writer, _instruction.operand[currOp++], _err);
|
||||
case 3: size += write(_writer, _instruction.operand[currOp++], _err);
|
||||
case 2: size += write(_writer, _instruction.operand[currOp++], _err);
|
||||
case 1: size += write(_writer, _instruction.operand[currOp++], _err);
|
||||
case 6: size += write(_writer, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 5: size += write(_writer, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 4: size += write(_writer, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 3: size += write(_writer, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 2: size += write(_writer, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 1: size += write(_writer, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1279,12 +1279,12 @@ namespace bgfx
|
|||
_instruction.numOperands = info.numOperands;
|
||||
switch (info.numOperands)
|
||||
{
|
||||
case 6: size += read(_reader, _instruction.operand[currOp++], _err);
|
||||
case 5: size += read(_reader, _instruction.operand[currOp++], _err);
|
||||
case 4: size += read(_reader, _instruction.operand[currOp++], _err);
|
||||
case 3: size += read(_reader, _instruction.operand[currOp++], _err);
|
||||
case 2: size += read(_reader, _instruction.operand[currOp++], _err);
|
||||
case 1: size += read(_reader, _instruction.operand[currOp++], _err);
|
||||
case 6: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 5: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 4: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 3: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 2: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 1: size += read(_reader, _instruction.operand[currOp++], _err); BX_FALLTHROUGH;
|
||||
case 0:
|
||||
if (0 < info.numValues)
|
||||
{
|
||||
|
|
|
@ -393,9 +393,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f);
|
||||
case 3: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f);
|
||||
case 2: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f);
|
||||
default: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f); BX_FALLTHROUGH;
|
||||
case 3: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f); BX_FALLTHROUGH;
|
||||
case 2: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f); BX_FALLTHROUGH;
|
||||
case 1: *packed++ = uint8_t(*_input++ * 127.0f + 128.0f);
|
||||
}
|
||||
}
|
||||
|
@ -403,9 +403,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *packed++ = uint8_t(*_input++ * 255.0f);
|
||||
case 3: *packed++ = uint8_t(*_input++ * 255.0f);
|
||||
case 2: *packed++ = uint8_t(*_input++ * 255.0f);
|
||||
default: *packed++ = uint8_t(*_input++ * 255.0f); BX_FALLTHROUGH;
|
||||
case 3: *packed++ = uint8_t(*_input++ * 255.0f); BX_FALLTHROUGH;
|
||||
case 2: *packed++ = uint8_t(*_input++ * 255.0f); BX_FALLTHROUGH;
|
||||
case 1: *packed++ = uint8_t(*_input++ * 255.0f);
|
||||
}
|
||||
}
|
||||
|
@ -414,9 +414,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *packed++ = uint8_t(*_input++);
|
||||
case 3: *packed++ = uint8_t(*_input++);
|
||||
case 2: *packed++ = uint8_t(*_input++);
|
||||
default: *packed++ = uint8_t(*_input++); BX_FALLTHROUGH;
|
||||
case 3: *packed++ = uint8_t(*_input++); BX_FALLTHROUGH;
|
||||
case 2: *packed++ = uint8_t(*_input++); BX_FALLTHROUGH;
|
||||
case 1: *packed++ = uint8_t(*_input++);
|
||||
}
|
||||
}
|
||||
|
@ -432,9 +432,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default:
|
||||
case 3: packed |= uint32_t(*_input++ * 511.0f + 512.0f);
|
||||
case 2: packed <<= 10; packed |= uint32_t(*_input++ * 511.0f + 512.0f);
|
||||
default: BX_FALLTHROUGH;
|
||||
case 3: packed |= uint32_t(*_input++ * 511.0f + 512.0f); BX_FALLTHROUGH;
|
||||
case 2: packed <<= 10; packed |= uint32_t(*_input++ * 511.0f + 512.0f); BX_FALLTHROUGH;
|
||||
case 1: packed <<= 10; packed |= uint32_t(*_input++ * 511.0f + 512.0f);
|
||||
}
|
||||
}
|
||||
|
@ -442,9 +442,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default:
|
||||
case 3: packed |= uint32_t(*_input++ * 1023.0f);
|
||||
case 2: packed <<= 10; packed |= uint32_t(*_input++ * 1023.0f);
|
||||
default: BX_FALLTHROUGH;
|
||||
case 3: packed |= uint32_t(*_input++ * 1023.0f); BX_FALLTHROUGH;
|
||||
case 2: packed <<= 10; packed |= uint32_t(*_input++ * 1023.0f); BX_FALLTHROUGH;
|
||||
case 1: packed <<= 10; packed |= uint32_t(*_input++ * 1023.0f);
|
||||
}
|
||||
}
|
||||
|
@ -453,9 +453,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default:
|
||||
case 3: packed |= uint32_t(*_input++);
|
||||
case 2: packed <<= 10; packed |= uint32_t(*_input++);
|
||||
default: BX_FALLTHROUGH;
|
||||
case 3: packed |= uint32_t(*_input++); BX_FALLTHROUGH;
|
||||
case 2: packed <<= 10; packed |= uint32_t(*_input++); BX_FALLTHROUGH;
|
||||
case 1: packed <<= 10; packed |= uint32_t(*_input++);
|
||||
}
|
||||
}
|
||||
|
@ -472,9 +472,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *packed++ = int16_t(*_input++ * 32767.0f);
|
||||
case 3: *packed++ = int16_t(*_input++ * 32767.0f);
|
||||
case 2: *packed++ = int16_t(*_input++ * 32767.0f);
|
||||
default: *packed++ = int16_t(*_input++ * 32767.0f); BX_FALLTHROUGH;
|
||||
case 3: *packed++ = int16_t(*_input++ * 32767.0f); BX_FALLTHROUGH;
|
||||
case 2: *packed++ = int16_t(*_input++ * 32767.0f); BX_FALLTHROUGH;
|
||||
case 1: *packed++ = int16_t(*_input++ * 32767.0f);
|
||||
}
|
||||
}
|
||||
|
@ -482,9 +482,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f);
|
||||
case 3: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f);
|
||||
case 2: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f);
|
||||
default: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f); BX_FALLTHROUGH;
|
||||
case 3: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f); BX_FALLTHROUGH;
|
||||
case 2: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f); BX_FALLTHROUGH;
|
||||
case 1: *packed++ = int16_t(*_input++ * 65535.0f - 32768.0f);
|
||||
}
|
||||
}
|
||||
|
@ -493,9 +493,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *packed++ = int16_t(*_input++);
|
||||
case 3: *packed++ = int16_t(*_input++);
|
||||
case 2: *packed++ = int16_t(*_input++);
|
||||
default: *packed++ = int16_t(*_input++); BX_FALLTHROUGH;
|
||||
case 3: *packed++ = int16_t(*_input++); BX_FALLTHROUGH;
|
||||
case 2: *packed++ = int16_t(*_input++); BX_FALLTHROUGH;
|
||||
case 1: *packed++ = int16_t(*_input++);
|
||||
}
|
||||
}
|
||||
|
@ -507,9 +507,9 @@ namespace bgfx
|
|||
uint16_t* packed = (uint16_t*)data;
|
||||
switch (num)
|
||||
{
|
||||
default: *packed++ = bx::halfFromFloat(*_input++);
|
||||
case 3: *packed++ = bx::halfFromFloat(*_input++);
|
||||
case 2: *packed++ = bx::halfFromFloat(*_input++);
|
||||
default: *packed++ = bx::halfFromFloat(*_input++); BX_FALLTHROUGH;
|
||||
case 3: *packed++ = bx::halfFromFloat(*_input++); BX_FALLTHROUGH;
|
||||
case 2: *packed++ = bx::halfFromFloat(*_input++); BX_FALLTHROUGH;
|
||||
case 1: *packed++ = bx::halfFromFloat(*_input++);
|
||||
}
|
||||
}
|
||||
|
@ -548,9 +548,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f;
|
||||
case 3: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f;
|
||||
case 2: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f;
|
||||
default: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f; BX_FALLTHROUGH;
|
||||
case 3: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f; BX_FALLTHROUGH;
|
||||
case 2: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f; BX_FALLTHROUGH;
|
||||
case 1: *_output++ = (float(*packed++) - 128.0f)*1.0f/127.0f;
|
||||
}
|
||||
}
|
||||
|
@ -558,9 +558,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *_output++ = float(*packed++)*1.0f/255.0f;
|
||||
case 3: *_output++ = float(*packed++)*1.0f/255.0f;
|
||||
case 2: *_output++ = float(*packed++)*1.0f/255.0f;
|
||||
default: *_output++ = float(*packed++)*1.0f/255.0f; BX_FALLTHROUGH;
|
||||
case 3: *_output++ = float(*packed++)*1.0f/255.0f; BX_FALLTHROUGH;
|
||||
case 2: *_output++ = float(*packed++)*1.0f/255.0f; BX_FALLTHROUGH;
|
||||
case 1: *_output++ = float(*packed++)*1.0f/255.0f;
|
||||
}
|
||||
}
|
||||
|
@ -574,9 +574,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default:
|
||||
case 3: *_output++ = (float(packed & 0x3ff) - 512.0f)*1.0f/511.0f; packed >>= 10;
|
||||
case 2: *_output++ = (float(packed & 0x3ff) - 512.0f)*1.0f/511.0f; packed >>= 10;
|
||||
default: BX_FALLTHROUGH;
|
||||
case 3: *_output++ = (float(packed & 0x3ff) - 512.0f)*1.0f/511.0f; packed >>= 10; BX_FALLTHROUGH;
|
||||
case 2: *_output++ = (float(packed & 0x3ff) - 512.0f)*1.0f/511.0f; packed >>= 10; BX_FALLTHROUGH;
|
||||
case 1: *_output++ = (float(packed & 0x3ff) - 512.0f)*1.0f/511.0f;
|
||||
}
|
||||
}
|
||||
|
@ -584,9 +584,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default:
|
||||
case 3: *_output++ = float(packed & 0x3ff)*1.0f/1023.0f; packed >>= 10;
|
||||
case 2: *_output++ = float(packed & 0x3ff)*1.0f/1023.0f; packed >>= 10;
|
||||
default: BX_FALLTHROUGH;
|
||||
case 3: *_output++ = float(packed & 0x3ff)*1.0f/1023.0f; packed >>= 10; BX_FALLTHROUGH;
|
||||
case 2: *_output++ = float(packed & 0x3ff)*1.0f/1023.0f; packed >>= 10; BX_FALLTHROUGH;
|
||||
case 1: *_output++ = float(packed & 0x3ff)*1.0f/1023.0f;
|
||||
}
|
||||
}
|
||||
|
@ -600,9 +600,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *_output++ = float(*packed++)*1.0f/32767.0f;
|
||||
case 3: *_output++ = float(*packed++)*1.0f/32767.0f;
|
||||
case 2: *_output++ = float(*packed++)*1.0f/32767.0f;
|
||||
default: *_output++ = float(*packed++)*1.0f/32767.0f; BX_FALLTHROUGH;
|
||||
case 3: *_output++ = float(*packed++)*1.0f/32767.0f; BX_FALLTHROUGH;
|
||||
case 2: *_output++ = float(*packed++)*1.0f/32767.0f; BX_FALLTHROUGH;
|
||||
case 1: *_output++ = float(*packed++)*1.0f/32767.0f;
|
||||
}
|
||||
}
|
||||
|
@ -610,9 +610,9 @@ namespace bgfx
|
|||
{
|
||||
switch (num)
|
||||
{
|
||||
default: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f;
|
||||
case 3: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f;
|
||||
case 2: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f;
|
||||
default: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f; BX_FALLTHROUGH;
|
||||
case 3: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f; BX_FALLTHROUGH;
|
||||
case 2: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f; BX_FALLTHROUGH;
|
||||
case 1: *_output++ = (float(*packed++) + 32768.0f)*1.0f/65535.0f;
|
||||
}
|
||||
}
|
||||
|
@ -624,9 +624,9 @@ namespace bgfx
|
|||
uint16_t* packed = (uint16_t*)data;
|
||||
switch (num)
|
||||
{
|
||||
default: *_output++ = bx::halfToFloat(*packed++);
|
||||
case 3: *_output++ = bx::halfToFloat(*packed++);
|
||||
case 2: *_output++ = bx::halfToFloat(*packed++);
|
||||
default: *_output++ = bx::halfToFloat(*packed++); BX_FALLTHROUGH;
|
||||
case 3: *_output++ = bx::halfToFloat(*packed++); BX_FALLTHROUGH;
|
||||
case 2: *_output++ = bx::halfToFloat(*packed++); BX_FALLTHROUGH;
|
||||
case 1: *_output++ = bx::halfToFloat(*packed++);
|
||||
}
|
||||
}
|
||||
|
@ -640,9 +640,9 @@ namespace bgfx
|
|||
|
||||
switch (num)
|
||||
{
|
||||
case 1: *_output++ = 0.0f;
|
||||
case 2: *_output++ = 0.0f;
|
||||
case 3: *_output++ = 0.0f;
|
||||
case 1: *_output++ = 0.0f; BX_FALLTHROUGH;
|
||||
case 2: *_output++ = 0.0f; BX_FALLTHROUGH;
|
||||
case 3: *_output++ = 0.0f; BX_FALLTHROUGH;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue