diff --git a/include/libtorrent/xml_parse.hpp b/include/libtorrent/xml_parse.hpp index b65b2c1df..087a12e02 100644 --- a/include/libtorrent/xml_parse.hpp +++ b/include/libtorrent/xml_parse.hpp @@ -50,12 +50,6 @@ namespace libtorrent xml_parse_error }; - inline bool isspace(char c) - { - const static char* ws = " \t\n\r\f\v"; - return std::strchr(ws, c); - } - // callback(int type, char const* name, char const* val) // str2 is only used for attributes. name is element or attribute // name and val is attribute value diff --git a/src/escape_string.cpp b/src/escape_string.cpp index 863321410..e234132e7 100644 --- a/src/escape_string.cpp +++ b/src/escape_string.cpp @@ -99,7 +99,8 @@ namespace libtorrent bool is_space(char c) { - return c == ' ' || c == '\t'; + const static char* ws = " \t\n\r\f\v"; + return bool(std::strchr(ws, c)); } char to_lower(char c) diff --git a/src/upnp.cpp b/src/upnp.cpp index 8d140d44f..07493645a 100644 --- a/src/upnp.cpp +++ b/src/upnp.cpp @@ -68,7 +68,7 @@ upnp::upnp(io_service& ios, connection_queue& cc , m_retry_count(0) , m_io_service(ios) , m_socket(ios, udp::endpoint(address_v4::from_string("239.255.255.250", ec), 1900) - , bind(&upnp::on_reply, self(), _1, _2, _3), false) + , bind(&upnp::on_reply, self(), _1, _2, _3)) , m_broadcast_timer(ios) , m_refresh_timer(ios) , m_disabled(false) diff --git a/test/test_primitives.cpp b/test/test_primitives.cpp index 65b1d276e..73fa9d71e 100644 --- a/test/test_primitives.cpp +++ b/test/test_primitives.cpp @@ -638,6 +638,17 @@ int test_main() to_hex(bin, 20, hex); TEST_CHECK(strcmp(hex, str) == 0); + // test is_space + + TEST_CHECK(!is_space('C')); + TEST_CHECK(!is_space('\b')); + TEST_CHECK(!is_space('8')); + TEST_CHECK(!is_space('=')); + TEST_CHECK(is_space(' ')); + TEST_CHECK(is_space('\t')); + TEST_CHECK(is_space('\n')); + TEST_CHECK(is_space('\r')); + // test to_lower TEST_CHECK(to_lower('C') == 'c');