Trailing whitespace removal.

This commit is contained in:
King_DuckZ 2014-06-20 19:17:54 +02:00
parent 9c669480a6
commit b47a341222

View file

@ -116,15 +116,15 @@ namespace internal
inline bool is_overlong_sequence(uint32_t cp, octet_difference_type length) inline bool is_overlong_sequence(uint32_t cp, octet_difference_type length)
{ {
if (cp < 0x80) { if (cp < 0x80) {
if (length != 1) if (length != 1)
return true; return true;
} }
else if (cp < 0x800) { else if (cp < 0x800) {
if (length != 2) if (length != 2)
return true; return true;
} }
else if (cp < 0x10000) { else if (cp < 0x10000) {
if (length != 3) if (length != 3)
return true; return true;
} }
@ -142,11 +142,11 @@ namespace internal
if (!utf8::internal::is_trail(*it)) if (!utf8::internal::is_trail(*it))
return INCOMPLETE_SEQUENCE; return INCOMPLETE_SEQUENCE;
return UTF8_OK; return UTF8_OK;
} }
#define UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(IT, END) {utf_error ret = increase_safely(IT, END); if (ret != UTF8_OK) return ret;} #define UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(IT, END) {utf_error ret = increase_safely(IT, END); if (ret != UTF8_OK) return ret;}
/// get_sequence_x functions decode utf-8 sequences of the length x /// get_sequence_x functions decode utf-8 sequences of the length x
template <typename octet_iterator> template <typename octet_iterator>
@ -163,9 +163,9 @@ namespace internal
template <typename octet_iterator> template <typename octet_iterator>
utf_error get_sequence_2(octet_iterator& it, octet_iterator end, uint32_t& code_point) utf_error get_sequence_2(octet_iterator& it, octet_iterator end, uint32_t& code_point)
{ {
if (it == end) if (it == end)
return NOT_ENOUGH_ROOM; return NOT_ENOUGH_ROOM;
code_point = utf8::internal::mask8(*it); code_point = utf8::internal::mask8(*it);
UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end) UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
@ -180,7 +180,7 @@ namespace internal
{ {
if (it == end) if (it == end)
return NOT_ENOUGH_ROOM; return NOT_ENOUGH_ROOM;
code_point = utf8::internal::mask8(*it); code_point = utf8::internal::mask8(*it);
UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end) UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
@ -234,7 +234,7 @@ namespace internal
// Get trail octets and calculate the code point // Get trail octets and calculate the code point
utf_error err = UTF8_OK; utf_error err = UTF8_OK;
switch (length) { switch (length) {
case 0: case 0:
return INVALID_LEAD; return INVALID_LEAD;
case 1: case 1:
err = utf8::internal::get_sequence_1(it, end, cp); err = utf8::internal::get_sequence_1(it, end, cp);
@ -262,7 +262,7 @@ namespace internal
else else
err = OVERLONG_SEQUENCE; err = OVERLONG_SEQUENCE;
} }
else else
err = INVALID_CODE_POINT; err = INVALID_CODE_POINT;
} }
@ -311,8 +311,8 @@ namespace internal
((it != end) && (utf8::internal::mask8(*it)) == bom[2]) ((it != end) && (utf8::internal::mask8(*it)) == bom[2])
); );
} }
//Deprecated in release 2.3 //Deprecated in release 2.3
template <typename octet_iterator> template <typename octet_iterator>
inline bool is_bom (octet_iterator it) inline bool is_bom (octet_iterator it)
{ {
@ -325,5 +325,3 @@ namespace internal
} // namespace utf8 } // namespace utf8
#endif // header guard #endif // header guard