Hi,
On Thu, Jan 21, 2010 at 17:57, Nelson, Erik - 2
<[email protected]> wrote:
> In boost/network/uri/http/uri_concept.hpp line 22, I get a warning about
> conversion from a 32-bit to 16-bit integer
>
> 'initializing' : conversion from 'boost::uint32_t' to 'boost::uint16_t',
> possible loss of data
>
> Here's the offending line
>
> uint16_t port_ = port(uri);
>
> I'm not sure if it matters (probably doesn't) but if the truncation is
> as designed we might consider making it explicit with a cast.
>
> Thanks
>
> Erik
>
It seems I missed two uint32_t's when moving to the uint16_t type for
ports, I've attached a trivial patch which should fix this. The
attached patch also updates the documentation and tests.
Jeroen
diff --git a/boost/network/uri/http/uri.hpp b/boost/network/uri/http/uri.hpp
index 22244b4..6c5a98c 100644
--- a/boost/network/uri/http/uri.hpp
+++ b/boost/network/uri/http/uri.hpp
@@ -31,7 +31,7 @@ namespace boost { namespace network { namespace uri {
return parts_.host;
}
- uint32_t port() const {
+ uint16_t port() const {
return parts_.port ? *(parts_.port) :
(boost::iequals(parts_.scheme, string_type("https")) ? 443u : 80u);
}
@@ -61,7 +61,7 @@ namespace boost { namespace network { namespace uri {
}
inline
- uint32_t
+ uint16_t
port(basic_uri<tags::http_default_8bit_tcp_resolve> const & uri) {
return uri.port();
}
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Cpp-netlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cpp-netlib-devel