Skip to content

Update boost to std #589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jan 30, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Replaced boost/cstdint.hpp with cstdint.
  • Loading branch information
glynos committed Jan 29, 2016
commit 873929e2139144868bd039e7ad34a1dda7f87afb
3 changes: 2 additions & 1 deletion boost/network/protocol/http/algorithms/linearize.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <algorithm>
#include <bitset>
#include <cstdint>
#include <boost/algorithm/string/compare.hpp>
#include <boost/concept/requires.hpp>
#include <boost/lexical_cast.hpp>
Expand Down Expand Up @@ -137,7 +138,7 @@ OutputIterator linearize(Request const& request,
*oi = consts::colon_char();
*oi = consts::space_char();
boost::copy(request.host(), oi);
boost::optional<boost::uint16_t> port_ =
boost::optional<std::uint16_t> port_ =
#if (_MSC_VER >= 1600 && BOOST_VERSION > 105500)
port(request).as_optional();
#else
Expand Down
14 changes: 7 additions & 7 deletions boost/network/protocol/http/client/connection/async_normal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// http://www.boost.org/LICENSE_1_0.txt)

#include <iterator>
#include <cstdint>
#include <boost/algorithm/string/trim.hpp>
#include <boost/array.hpp>
#include <boost/asio/deadline_timer.hpp>
Expand All @@ -18,7 +19,6 @@
#include <boost/asio/streambuf.hpp>
#include <boost/assert.hpp>
#include <boost/bind/protect.hpp>
#include <boost/cstdint.hpp>
#include <boost/logic/tribool.hpp>
#include <boost/network/constants.hpp>
#include <boost/network/detail/debug.hpp>
Expand Down Expand Up @@ -98,9 +98,9 @@ struct http_async_connection
std::ostreambuf_iterator<typename char_<Tag>::type>(
&command_streambuf));
this->method = method;
boost::uint16_t port_ = port(request);
std::uint16_t port_ = port(request);
string_type host_ = host(request);
boost::uint16_t source_port = request.source_port();
std::uint16_t source_port = request.source_port();

resolve_(resolver_, host_, port_,
request_strand_.wrap(boost::bind(
Expand Down Expand Up @@ -134,8 +134,8 @@ struct http_async_connection
is_timedout_ = true;
}

void handle_resolved(string_type host, boost::uint16_t port,
boost::uint16_t source_port, bool get_body,
void handle_resolved(string_type host, std::uint16_t port,
std::uint16_t source_port, bool get_body,
body_callback_function_type callback,
body_generator_function_type generator,
boost::system::error_code const& ec,
Expand All @@ -159,8 +159,8 @@ struct http_async_connection
}
}

void handle_connected(string_type host, boost::uint16_t port,
boost::uint16_t source_port, bool get_body,
void handle_connected(string_type host, std::uint16_t port,
std::uint16_t source_port, bool get_body,
body_callback_function_type callback,
body_generator_function_type generator,
resolver_iterator_pair endpoint_range,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// http://www.boost.org/LICENSE_1_0.txt)

#include <iterator>
#include <cstdint>
#include <boost/fusion/tuple/tuple.hpp>
#include <boost/fusion/tuple/tuple_tie.hpp>
#include <boost/logic/tribool.hpp>
Expand Down Expand Up @@ -76,7 +77,7 @@ struct http_async_protocol_handler {
version_promise.get_future());
version(response_, version_future);

std::shared_future<boost::uint16_t> status_future(
std::shared_future<std::uint16_t> status_future(
status_promise.get_future());
status(response_, status_future);

Expand Down Expand Up @@ -161,7 +162,7 @@ struct http_async_protocol_handler {
std::swap(status, partial_parsed);
status.append(std::begin(result_range), std::end(result_range));
trim(status);
boost::uint16_t status_int = lexical_cast<boost::uint16_t>(status);
std::uint16_t status_int = lexical_cast<std::uint16_t>(status);
status_promise.set_value(status_int);
part_begin = std::end(result_range);
} else if (parsed_ok == false) {
Expand Down Expand Up @@ -340,7 +341,7 @@ struct http_async_protocol_handler {

response_parser_type response_parser_;
std::promise<string_type> version_promise;
std::promise<boost::uint16_t> status_promise;
std::promise<std::uint16_t> status_promise;
std::promise<string_type> status_message_promise;
std::promise<typename headers_container<Tag>::type> headers_promise;
std::promise<string_type> source_promise;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include <cstdint>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/streambuf.hpp>
#include <boost/function.hpp>
Expand All @@ -18,7 +19,7 @@ namespace impl {

struct connection_delegate {
virtual void connect(asio::ip::tcp::endpoint &endpoint, std::string host,
boost::uint16_t source_port,
std::uint16_t source_port,
function<void(system::error_code const &)> handler) = 0;
virtual void write(
asio::streambuf &command_streambuf,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include <memory>
#include <cstdint>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/placeholders.hpp>
#include <boost/asio/streambuf.hpp>
#include <boost/network/protocol/http/client/connection/connection_delegate.hpp>
#include <boost/function.hpp>
#include <memory>

namespace boost {
namespace network {
Expand All @@ -23,7 +24,7 @@ struct normal_delegate : connection_delegate {
explicit normal_delegate(asio::io_service &service);

void connect(asio::ip::tcp::endpoint &endpoint, std::string host,
boost::uint16_t source_port,
std::uint16_t source_port,
function<void(system::error_code const &)> handler) override;
void write(asio::streambuf &command_streambuf,
function<void(system::error_code const &, size_t)> handler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include <cstdint>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/streambuf.hpp>
#include <boost/asio/write.hpp>
Expand All @@ -20,7 +21,7 @@ boost::network::http::impl::normal_delegate::normal_delegate(

void boost::network::http::impl::normal_delegate::connect(
asio::ip::tcp::endpoint &endpoint, std::string host,
boost::uint16_t source_port,
std::uint16_t source_port,
function<void(system::error_code const &)> handler) {

// TODO(dberris): review parameter necessity.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include <memory>
#include <cstdint>
#include <boost/asio/io_service.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/network/protocol/http/client/connection/connection_delegate.hpp>
#include <boost/network/support/is_default_string.hpp>
#include <boost/network/support/is_default_wstring.hpp>
#include <boost/optional.hpp>
#include <memory>

namespace boost {
namespace network {
Expand All @@ -30,7 +31,7 @@ struct ssl_delegate : connection_delegate,
optional<std::string> ciphers, long ssl_options);

void connect(asio::ip::tcp::endpoint &endpoint, std::string host,
boost::uint16_t source_port,
std::uint16_t source_port,
function<void(system::error_code const &)> handler) override;
void write(asio::streambuf &command_streambuf,
function<void(system::error_code const &, size_t)> handler)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include <cstdint>
#include <boost/asio/ssl.hpp>
#include <boost/bind.hpp>
#include <boost/network/protocol/http/client/connection/ssl_delegate.hpp>
Expand All @@ -28,7 +29,7 @@ boost::network::http::impl::ssl_delegate::ssl_delegate(

void boost::network::http::impl::ssl_delegate::connect(
asio::ip::tcp::endpoint &endpoint, std::string host,
boost::uint16_t source_port,
std::uint16_t source_port,
function<void(system::error_code const &)> handler) {
context_.reset(
new asio::ssl::context(asio::ssl::context::method::sslv23_client));
Expand Down
16 changes: 8 additions & 8 deletions boost/network/protocol/http/impl/request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* object encapsulates a URI which is parsed at runtime.
*/

#include <cstdint>
#include <boost/algorithm/string.hpp>
#include <boost/cstdint.hpp>
#include <boost/fusion/container/map.hpp>
#include <boost/fusion/sequence/intrinsic/at_key.hpp>
#include <boost/fusion/sequence/intrinsic/value_at_key.hpp>
Expand Down Expand Up @@ -51,13 +51,13 @@ namespace http {
template <class Tag>
struct basic_request : public basic_message<Tag> {
mutable boost::network::uri::uri uri_;
boost::uint16_t source_port_;
std::uint16_t source_port_;
typedef basic_message<Tag> base_type;

public:
typedef Tag tag;
typedef typename string<tag>::type string_type;
typedef boost::uint16_t port_type;
typedef std::uint16_t port_type;

explicit basic_request(string_type const& uri_)
: uri_(uri_), source_port_(0) {}
Expand Down Expand Up @@ -111,9 +111,9 @@ struct basic_request : public basic_message<Tag> {

boost::network::uri::uri const& uri() const { return uri_; }

void source_port(const boost::uint16_t port) { source_port_ = port; }
void source_port(const std::uint16_t port) { source_port_ = port; }

boost::uint16_t source_port() const { return source_port_; }
std::uint16_t source_port() const { return source_port_; }
};

/** This is the implementation of a POD request type
Expand All @@ -133,13 +133,13 @@ struct not_quite_pod_request_base {
typedef typename request_header<Tag>::type header_type;
typedef typename vector<Tag>::template apply<header_type>::type vector_type;
typedef vector_type headers_container_type;
typedef boost::uint16_t port_type;
typedef std::uint16_t port_type;
mutable string_type source;
mutable port_type source_port;
mutable string_type method;
mutable string_type destination;
mutable boost::uint8_t http_version_major;
mutable boost::uint8_t http_version_minor;
mutable std::uint8_t http_version_major;
mutable std::uint8_t http_version_minor;
mutable vector_type headers;
mutable string_type body;

Expand Down
9 changes: 5 additions & 4 deletions boost/network/protocol/http/message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_HPP
#define BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_HPP

#include <string>
#include <cstdint>
#include <boost/network/protocol/http/traits.hpp>
#include <boost/network/protocol/http/message/header/name.hpp>
#include <boost/network/protocol/http/message/header/value.hpp>
#include <boost/network/message.hpp>
#include <boost/network/tags.hpp>
#include <string>

namespace boost {
namespace network {
Expand Down Expand Up @@ -75,7 +76,7 @@ struct message_impl : public basic_message<Tag> {

protected:
mutable string_type version_;
mutable boost::uint16_t status_;
mutable std::uint16_t status_;
mutable string_type status_message_;

private:
Expand All @@ -94,9 +95,9 @@ struct message_impl : public basic_message<Tag> {

string_type const version() const { return version_; }

void status(boost::uint16_t status) const { status_ = status; }
void status(std::uint16_t status) const { status_ = status; }

boost::uint16_t status() const { return status_; }
std::uint16_t status() const { return status_; }

void status_message(string_type const &status_message) const {
status_message_ = status_message;
Expand Down
6 changes: 3 additions & 3 deletions boost/network/protocol/http/message/async_message.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// http://www.boost.org/LICENSE_1_0.txt)

#include <future>
#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/optional.hpp>

// FIXME move this out to a trait
Expand Down Expand Up @@ -66,7 +66,7 @@ struct async_message {
version_ = future;
}

boost::uint16_t status() const { return status_.get(); }
std::uint16_t status() const { return status_.get(); }

void status(std::shared_future<uint16_t> const& future) const {
status_ = future;
Expand Down Expand Up @@ -134,7 +134,7 @@ struct async_message {
private:
mutable std::shared_future<string_type> status_message_, version_, source_,
destination_;
mutable std::shared_future<boost::uint16_t> status_;
mutable std::shared_future<std::uint16_t> status_;
mutable std::shared_future<headers_container_type> headers_;
mutable headers_container_type added_headers;
mutable std::set<string_type> removed_headers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/network/protocol/http/support/is_server.hpp>
#include <boost/utility/enable_if.hpp>

Expand All @@ -18,16 +18,16 @@ template <class Tag>
struct basic_request;

struct major_version_directive {
boost::uint8_t major_version;
explicit major_version_directive(boost::uint8_t major_version)
std::uint8_t major_version;
explicit major_version_directive(std::uint8_t major_version)
: major_version(major_version) {}
template <class Tag>
void operator()(basic_request<Tag>& request) const {
request.http_version_major = major_version;
}
};

inline major_version_directive major_version(boost::uint8_t major_version_) {
inline major_version_directive major_version(std::uint8_t major_version_) {
return major_version_directive(major_version_);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

#include <boost/cstdint.hpp>
#include <cstdint>
#include <boost/network/protocol/http/support/is_server.hpp>
#include <boost/utility/enable_if.hpp>

Expand All @@ -18,16 +18,16 @@ template <class Tag>
struct basic_request;

struct minor_version_directive {
boost::uint8_t minor_version;
explicit minor_version_directive(boost::uint8_t minor_version)
std::uint8_t minor_version;
explicit minor_version_directive(std::uint8_t minor_version)
: minor_version(minor_version) {}
template <class Tag>
void operator()(basic_request<Tag>& request) const {
request.http_version_minor = minor_version;
}
};

inline minor_version_directive minor_version(boost::uint8_t minor_version_) {
inline minor_version_directive minor_version(std::uint8_t minor_version_) {
return minor_version_directive(minor_version_);
}

Expand Down
Loading