aboutsummaryrefslogtreecommitdiffstats
path: root/taglib/toolkit/utf8/checked.h
diff options
context:
space:
mode:
authorTsuda Kageyu <tsuda.kageyu@gmail.com>2017-06-07 12:12:31 +0900
committerTsuda Kageyu <tsuda.kageyu@gmail.com>2017-06-07 12:12:31 +0900
commit3795f277fb2097b0c94f3ea282fb417f9664a2e4 (patch)
treec567b184f4a3be54ef4340cdd5490673a2d75ac4 /taglib/toolkit/utf8/checked.h
parent6045995e65289d562159946bca6b1588f77b869b (diff)
Update UTF8-CPP to v2.3.5.
Diffstat (limited to 'taglib/toolkit/utf8/checked.h')
-rw-r--r--taglib/toolkit/utf8/checked.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/taglib/toolkit/utf8/checked.h b/taglib/toolkit/utf8/checked.h
index 13311551..2aef5838 100644
--- a/taglib/toolkit/utf8/checked.h
+++ b/taglib/toolkit/utf8/checked.h
@@ -1,4 +1,4 @@
-// Copyright 2006 Nemanja Trifunovic
+// Copyright 2006-2016 Nemanja Trifunovic
/*
Permission is hereby granted, free of charge, to any person or organization
@@ -41,7 +41,7 @@ namespace utf8
class invalid_code_point : public exception {
uint32_t cp;
public:
- invalid_code_point(uint32_t cp) : cp(cp) {}
+ invalid_code_point(uint32_t codepoint) : cp(codepoint) {}
virtual const char* what() const throw() { return "Invalid code point"; }
uint32_t code_point() const {return cp;}
};
@@ -233,7 +233,7 @@ namespace utf8
template <typename u16bit_iterator, typename octet_iterator>
u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result)
{
- while (start != end) {
+ while (start < end) {
uint32_t cp = utf8::next(start, end);
if (cp > 0xffff) { //make a surrogate pair
*result++ = static_cast<uint16_t>((cp >> 10) + internal::LEAD_OFFSET);
@@ -257,7 +257,7 @@ namespace utf8
template <typename octet_iterator, typename u32bit_iterator>
u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result)
{
- while (start != end)
+ while (start < end)
(*result++) = utf8::next(start, end);
return result;
@@ -272,9 +272,9 @@ namespace utf8
public:
iterator () {}
explicit iterator (const octet_iterator& octet_it,
- const octet_iterator& range_start,
- const octet_iterator& range_end) :
- it(octet_it), range_start(range_start), range_end(range_end)
+ const octet_iterator& rangestart,
+ const octet_iterator& rangeend) :
+ it(octet_it), range_start(rangestart), range_end(rangeend)
{
if (it < range_start || it > range_end)
throw std::out_of_range("Invalid utf-8 iterator position");