👌 fixed compiler warnings #1031

parent 727dd466
...@@ -168,9 +168,6 @@ class input_buffer_adapter : public input_adapter_protocol ...@@ -168,9 +168,6 @@ class input_buffer_adapter : public input_adapter_protocol
template<typename WideStringType> template<typename WideStringType>
class wide_string_input_adapter : public input_adapter_protocol class wide_string_input_adapter : public input_adapter_protocol
{ {
private:
using char_t = typename WideStringType::value_type;
public: public:
wide_string_input_adapter(const WideStringType& w) : str(w) {} wide_string_input_adapter(const WideStringType& w) : str(w) {}
...@@ -186,7 +183,7 @@ class wide_string_input_adapter : public input_adapter_protocol ...@@ -186,7 +183,7 @@ class wide_string_input_adapter : public input_adapter_protocol
// check if buffer needs to be filled // check if buffer needs to be filled
if (utf8_bytes_index == utf8_bytes_filled) if (utf8_bytes_index == utf8_bytes_filled)
{ {
if (sizeof(char_t) == 2) if (sizeof(typename WideStringType::value_type) == 2)
{ {
fill_buffer_utf16(); fill_buffer_utf16();
} }
...@@ -223,7 +220,7 @@ class wide_string_input_adapter : public input_adapter_protocol ...@@ -223,7 +220,7 @@ class wide_string_input_adapter : public input_adapter_protocol
else else
{ {
// get the current character // get the current character
const char_t wc = str[current_wchar++]; const int wc = static_cast<int>(str[current_wchar++]);
// UTF-16 to UTF-8 encoding // UTF-16 to UTF-8 encoding
if (wc < 0x80) if (wc < 0x80)
...@@ -248,7 +245,7 @@ class wide_string_input_adapter : public input_adapter_protocol ...@@ -248,7 +245,7 @@ class wide_string_input_adapter : public input_adapter_protocol
{ {
if (current_wchar < str.size()) if (current_wchar < str.size())
{ {
const char_t wc2 = str[current_wchar++]; const int wc2 = static_cast<int>(str[current_wchar++]);
const int charcode = 0x10000 + (((wc & 0x3FF) << 10) | (wc2 & 0x3FF)); const int charcode = 0x10000 + (((wc & 0x3FF) << 10) | (wc2 & 0x3FF));
utf8_bytes[0] = 0xf0 | (charcode >> 18); utf8_bytes[0] = 0xf0 | (charcode >> 18);
utf8_bytes[1] = 0x80 | ((charcode >> 12) & 0x3F); utf8_bytes[1] = 0x80 | ((charcode >> 12) & 0x3F);
...@@ -279,7 +276,7 @@ class wide_string_input_adapter : public input_adapter_protocol ...@@ -279,7 +276,7 @@ class wide_string_input_adapter : public input_adapter_protocol
else else
{ {
// get the current character // get the current character
const char_t wc = str[current_wchar++]; const int wc = static_cast<int>(str[current_wchar++]);
// UTF-32 to UTF-8 encoding // UTF-32 to UTF-8 encoding
if (wc < 0x80) if (wc < 0x80)
......
...@@ -1741,9 +1741,6 @@ class input_buffer_adapter : public input_adapter_protocol ...@@ -1741,9 +1741,6 @@ class input_buffer_adapter : public input_adapter_protocol
template<typename WideStringType> template<typename WideStringType>
class wide_string_input_adapter : public input_adapter_protocol class wide_string_input_adapter : public input_adapter_protocol
{ {
private:
using char_t = typename WideStringType::value_type;
public: public:
wide_string_input_adapter(const WideStringType& w) : str(w) {} wide_string_input_adapter(const WideStringType& w) : str(w) {}
...@@ -1759,7 +1756,7 @@ class wide_string_input_adapter : public input_adapter_protocol ...@@ -1759,7 +1756,7 @@ class wide_string_input_adapter : public input_adapter_protocol
// check if buffer needs to be filled // check if buffer needs to be filled
if (utf8_bytes_index == utf8_bytes_filled) if (utf8_bytes_index == utf8_bytes_filled)
{ {
if (sizeof(char_t) == 2) if (sizeof(typename WideStringType::value_type) == 2)
{ {
fill_buffer_utf16(); fill_buffer_utf16();
} }
...@@ -1796,7 +1793,7 @@ class wide_string_input_adapter : public input_adapter_protocol ...@@ -1796,7 +1793,7 @@ class wide_string_input_adapter : public input_adapter_protocol
else else
{ {
// get the current character // get the current character
const char_t wc = str[current_wchar++]; const int wc = static_cast<int>(str[current_wchar++]);
// UTF-16 to UTF-8 encoding // UTF-16 to UTF-8 encoding
if (wc < 0x80) if (wc < 0x80)
...@@ -1821,7 +1818,7 @@ class wide_string_input_adapter : public input_adapter_protocol ...@@ -1821,7 +1818,7 @@ class wide_string_input_adapter : public input_adapter_protocol
{ {
if (current_wchar < str.size()) if (current_wchar < str.size())
{ {
const char_t wc2 = str[current_wchar++]; const int wc2 = static_cast<int>(str[current_wchar++]);
const int charcode = 0x10000 + (((wc & 0x3FF) << 10) | (wc2 & 0x3FF)); const int charcode = 0x10000 + (((wc & 0x3FF) << 10) | (wc2 & 0x3FF));
utf8_bytes[0] = 0xf0 | (charcode >> 18); utf8_bytes[0] = 0xf0 | (charcode >> 18);
utf8_bytes[1] = 0x80 | ((charcode >> 12) & 0x3F); utf8_bytes[1] = 0x80 | ((charcode >> 12) & 0x3F);
...@@ -1852,7 +1849,7 @@ class wide_string_input_adapter : public input_adapter_protocol ...@@ -1852,7 +1849,7 @@ class wide_string_input_adapter : public input_adapter_protocol
else else
{ {
// get the current character // get the current character
const char_t wc = str[current_wchar++]; const int wc = static_cast<int>(str[current_wchar++]);
// UTF-32 to UTF-8 encoding // UTF-32 to UTF-8 encoding
if (wc < 0x80) if (wc < 0x80)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment