Kaydet (Commit) 0fbc3a87 authored tarafından Adam Co's avatar Adam Co Kaydeden (comit) Michael Stahl

Boost Patch - Change '*b' to a variable, to remove GCC 4.7.3 -Wtype-limits

Change-Id: Ic7bac90c9b77490c47e5ddd2005453290374b7b2
Signed-off-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst aa555c72
...@@ -54,7 +54,7 @@ boost_patches += boost.preprocessor.Wundef.warnings.patch ...@@ -54,7 +54,7 @@ boost_patches += boost.preprocessor.Wundef.warnings.patch
# https://svn.boost.org/trac/boost/ticket/9892 # https://svn.boost.org/trac/boost/ticket/9892
boost_patches += boost.property_tree.Wshadow.warnings.patch.1 boost_patches += boost.property_tree.Wshadow.warnings.patch.1
# https://svn.boost.org/trac/boost/ticket/9893 # https://svn.boost.org/trac/boost/ticket/9893
boost_patches += boost.property_tree.Wtautological-constant-out-of-range-compare.warnings.patch.0 boost_patches += boost.property_tree.Wtype-limits.warnings.patch.1
# https://svn.boost.org/trac/boost/ticket/9894 # https://svn.boost.org/trac/boost/ticket/9894
boost_patches += boost.ptr_container.Wshadow.warnings.patch boost_patches += boost.ptr_container.Wshadow.warnings.patch
# https://svn.boost.org/trac/boost/ticket/9895 # https://svn.boost.org/trac/boost/ticket/9895
......
--- boost/property_tree/detail/json_parser_write.hpp
+++ boost/property_tree/detail/json_parser_write.hpp
@@ -33,7 +33,7 @@
// We escape everything outside ASCII, because this code can't
// handle high unicode characters.
if (*b == 0x20 || *b == 0x21 || (*b >= 0x23 && *b <= 0x2E) ||
- (*b >= 0x30 && *b <= 0x5B) || (*b >= 0x5D && *b <= 0xFF))
+ (*b >= 0x30 && *b <= 0x5B) || (*b >= 0x5D && static_cast<typename std::basic_string<Ch>::traits_type::int_type>(*b) <= 0xFF))
result += *b;
else if (*b == Ch('\b')) result += Ch('\\'), result += Ch('b');
else if (*b == Ch('\f')) result += Ch('\\'), result += Ch('f');
diff -ur boost.org/boost/property_tree/detail/json_parser_write.hpp boost/boost/property_tree/detail/json_parser_write.hpp
--- boost.org/boost/property_tree/detail/json_parser_write.hpp 2014-04-20 13:27:59.126224368 +0300
+++ boost/boost/property_tree/detail/json_parser_write.hpp 2014-04-20 13:32:35.206229552 +0300
@@ -29,25 +29,26 @@
typename std::basic_string<Ch>::const_iterator e = s.end();
while (b != e)
{
+ typename std::basic_string<Ch>::traits_type::int_type bDref = *b;
// This assumes an ASCII superset. But so does everything in PTree.
// We escape everything outside ASCII, because this code can't
// handle high unicode characters.
- if (*b == 0x20 || *b == 0x21 || (*b >= 0x23 && *b <= 0x2E) ||
- (*b >= 0x30 && *b <= 0x5B) || (*b >= 0x5D && *b <= 0xFF))
- result += *b;
- else if (*b == Ch('\b')) result += Ch('\\'), result += Ch('b');
- else if (*b == Ch('\f')) result += Ch('\\'), result += Ch('f');
- else if (*b == Ch('\n')) result += Ch('\\'), result += Ch('n');
- else if (*b == Ch('\r')) result += Ch('\\'), result += Ch('r');
- else if (*b == Ch('/')) result += Ch('\\'), result += Ch('/');
- else if (*b == Ch('"')) result += Ch('\\'), result += Ch('"');
- else if (*b == Ch('\\')) result += Ch('\\'), result += Ch('\\');
+ if (bDref == 0x20 || bDref == 0x21 || (bDref >= 0x23 && bDref <= 0x2E) ||
+ (bDref >= 0x30 && bDref <= 0x5B) || (bDref >= 0x5D && bDref <= 0xFF))
+ result += bDref;
+ else if (bDref == Ch('\b')) result += Ch('\\'), result += Ch('b');
+ else if (bDref == Ch('\f')) result += Ch('\\'), result += Ch('f');
+ else if (bDref == Ch('\n')) result += Ch('\\'), result += Ch('n');
+ else if (bDref == Ch('\r')) result += Ch('\\'), result += Ch('r');
+ else if (bDref == Ch('/')) result += Ch('\\'), result += Ch('/');
+ else if (bDref == Ch('"')) result += Ch('\\'), result += Ch('"');
+ else if (bDref == Ch('\\')) result += Ch('\\'), result += Ch('\\');
else
{
const char *hexdigits = "0123456789ABCDEF";
typedef typename make_unsigned<Ch>::type UCh;
unsigned long u = (std::min)(static_cast<unsigned long>(
- static_cast<UCh>(*b)),
+ static_cast<UCh>(bDref)),
0xFFFFul);
int d1 = u / 4096; u -= d1 * 4096;
int d2 = u / 256; u -= d2 * 256;
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