Browse Source

Minor whitespace fixes

master
Nemanja Trifunovic 5 years ago
parent
commit
92158c9ce1
  1. 1
      source/utf8/checked.h
  2. 8
      source/utf8/core.h
  3. 1
      source/utf8/cpp11.h
  4. 10
      source/utf8/unchecked.h

1
source/utf8/checked.h

@ -312,4 +312,3 @@ namespace utf8
#endif //header guard

8
source/utf8/core.h

@ -142,7 +142,7 @@ namespace internal
if (!utf8::internal::is_trail(*it))
return INCOMPLETE_SEQUENCE;
return UTF8_OK;
}
@ -165,7 +165,7 @@ namespace internal
{
if (it == end)
return NOT_ENOUGH_ROOM;
code_point = utf8::internal::mask8(*it);
UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
@ -222,7 +222,7 @@ namespace internal
template <typename octet_iterator>
utf_error validate_next(octet_iterator& it, octet_iterator end, uint32_t& code_point)
{
if (it == end)
if (it == end)
return NOT_ENOUGH_ROOM;
// Save the original value of it so we can go back in case of failure
@ -237,7 +237,7 @@ namespace internal
// Get trail octets and calculate the code point
utf_error err = UTF8_OK;
switch (length) {
case 0:
case 0:
return INVALID_LEAD;
case 1:
err = utf8::internal::get_sequence_1(it, end, cp);

1
source/utf8/cpp11.h

@ -101,3 +101,4 @@ namespace utf8
} // namespace utf8
#endif // header guard

10
source/utf8/unchecked.h

@ -38,7 +38,7 @@ namespace utf8
octet_iterator append(uint32_t cp, octet_iterator result)
{
if (cp < 0x80) // one octet
*(result++) = static_cast<uint8_t>(cp);
*(result++) = static_cast<uint8_t>(cp);
else if (cp < 0x800) { // two octets
*(result++) = static_cast<uint8_t>((cp >> 6) | 0xc0);
*(result++) = static_cast<uint8_t>((cp & 0x3f) | 0x80);
@ -85,13 +85,13 @@ namespace utf8
break;
}
++it;
return cp;
return cp;
}
template <typename octet_iterator>
uint32_t peek_next(octet_iterator it)
{
return utf8::unchecked::next(it);
return utf8::unchecked::next(it);
}
template <typename octet_iterator>
@ -121,7 +121,7 @@ namespace utf8
template <typename u16bit_iterator, typename octet_iterator>
octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result)
{
{
while (start != end) {
uint32_t cp = utf8::internal::mask16(*start++);
// Take care of surrogate pairs first
@ -131,7 +131,7 @@ namespace utf8
}
result = utf8::unchecked::append(cp, result);
}
return result;
return result;
}
template <typename u16bit_iterator, typename octet_iterator>

Loading…
Cancel
Save