1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-04 07:45:34 +00:00

Merge pull request #1860 from akortunov/warningfix

Do not use fall-through to avoid GCC warnings
This commit is contained in:
Bret Curtis 2018-08-09 10:00:09 +02:00 committed by GitHub
commit 144f37f9b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,25 +104,17 @@ void TiXmlBase::ConvertUTF32ToUTF8( unsigned long input, char* output, int* leng
output += *length; output += *length;
// Scary scary fall throughs. int lengthLeft = *length;
switch (*length) while (lengthLeft > 1)
{ {
case 4: --output;
--output; *output = (char)((input | BYTE_MARK) & BYTE_MASK);
*output = (char)((input | BYTE_MARK) & BYTE_MASK); input >>= 6;
input >>= 6; --lengthLeft;
case 3: }
--output;
*output = (char)((input | BYTE_MARK) & BYTE_MASK); --output;
input >>= 6; *output = (char)(input | FIRST_BYTE_MARK[*length]);
case 2:
--output;
*output = (char)((input | BYTE_MARK) & BYTE_MASK);
input >>= 6;
case 1:
--output;
*output = (char)(input | FIRST_BYTE_MARK[*length]);
}
} }