diff --git a/src/pugixml.cpp b/src/pugixml.cpp index 1a89b28..fe91d24 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -1574,8 +1574,8 @@ PUGI_IMPL_NS_BEGIN static value_type high(value_type result, uint32_t ch) { - uint32_t msh = static_cast(ch - 0x10000) >> 10; - uint32_t lsh = static_cast(ch - 0x10000) & 0x3ff; + uint32_t msh = (ch - 0x10000U) >> 10; + uint32_t lsh = (ch - 0x10000U) & 0x3ff; result[0] = static_cast(0xD800 + msh); result[1] = static_cast(0xDC00 + lsh); @@ -2455,7 +2455,7 @@ PUGI_IMPL_NS_BEGIN { // Move [old_gap_end, new_gap_start) to [old_gap_start, ...) assert(s >= end); - memmove(end - size, end, reinterpret_cast(s) - reinterpret_cast(end)); + memmove(end - size, end, (s - end) * sizeof(char_t)); } s += count; // end of current gap @@ -2472,7 +2472,7 @@ PUGI_IMPL_NS_BEGIN { // Move [old_gap_end, current_pos) to [old_gap_start, ...) assert(s >= end); - memmove(end - size, end, reinterpret_cast(s) - reinterpret_cast(end)); + memmove(end - size, end, (s - end) * sizeof(char_t)); return s - size; } @@ -5347,7 +5347,7 @@ namespace pugi PUGI_IMPL_FN size_t xml_attribute::hash_value() const { - return static_cast(reinterpret_cast(_attr) / sizeof(xml_attribute_struct)); + return reinterpret_cast(_attr) / sizeof(xml_attribute_struct); } PUGI_IMPL_FN xml_attribute_struct* xml_attribute::internal_object() const @@ -6531,7 +6531,7 @@ namespace pugi PUGI_IMPL_FN size_t xml_node::hash_value() const { - return static_cast(reinterpret_cast(_root) / sizeof(xml_node_struct)); + return reinterpret_cast(_root) / sizeof(xml_node_struct); } PUGI_IMPL_FN xml_node_struct* xml_node::internal_object() const @@ -6936,7 +6936,7 @@ namespace pugi PUGI_IMPL_FN xml_node* xml_node_iterator::operator->() const { assert(_wrap._root); - return const_cast(&_wrap); // BCC5 workaround + return &_wrap; } PUGI_IMPL_FN xml_node_iterator& xml_node_iterator::operator++() @@ -6997,7 +6997,7 @@ namespace pugi PUGI_IMPL_FN xml_attribute* xml_attribute_iterator::operator->() const { assert(_wrap._attr); - return const_cast(&_wrap); // BCC5 workaround + return &_wrap; } PUGI_IMPL_FN xml_attribute_iterator& xml_attribute_iterator::operator++() @@ -7058,7 +7058,7 @@ namespace pugi PUGI_IMPL_FN xml_node* xml_named_node_iterator::operator->() const { assert(_wrap._root); - return const_cast(&_wrap); // BCC5 workaround + return &_wrap; } PUGI_IMPL_FN xml_named_node_iterator& xml_named_node_iterator::operator++()