Fixed some GCC7 warnings.

This commit is contained in:
Branimir Karadžić 2017-06-27 20:26:31 -07:00
parent e09c96de84
commit 936d105589
3 changed files with 12 additions and 7 deletions

View File

@ -73,12 +73,12 @@ static char* cpToUTF8(int cp, char* str)
str[n] = '\0';
switch (n)
{
case 6: str[5] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x4000000;
case 5: str[4] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x200000;
case 4: str[3] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x10000;
case 3: str[2] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x800;
case 2: str[1] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0xc0;
case 1: str[0] = char(cp);
case 6: str[5] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x4000000; BX_FALLTHROUGH;
case 5: str[4] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x200000; BX_FALLTHROUGH;
case 4: str[3] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x10000; BX_FALLTHROUGH;
case 3: str[2] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0x800; BX_FALLTHROUGH;
case 2: str[1] = 0x80 | (cp & 0x3f); cp = cp >> 6; cp |= 0xc0; BX_FALLTHROUGH;
case 1: str[0] = char(cp); BX_FALLTHROUGH;
}
return str;
}

View File

@ -319,7 +319,7 @@ public:
float brushAttn = m_brush.m_size - bx::fsqrt(a2 + b2);
// Raise/Lower and scale by brush power.
height += (bx::fclamp(brushAttn * m_brush.m_power, 0.0, m_brush.m_power) * m_brush.m_raise)
height += 0.0f < bx::fclamp(brushAttn*m_brush.m_power, 0.0f, m_brush.m_power) && m_brush.m_raise
? 1.0f
: -1.0f
;

View File

@ -213,6 +213,11 @@ project "fcpp"
"/wd4706", -- warning C4706: assignment within conditional expression
}
configuration { "not vs*" }
buildoptions {
"-Wno-implicit-fallthrough",
}
configuration {}
project "shaderc"