Skip to content

Commit cb5cdbd

Browse files
committed
Fix boost asio deprecation warnings
Signed-off-by: Rye <[email protected]>
1 parent 4089e5d commit cb5cdbd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

indra/llcommon/llprocess.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,14 @@ class WritePipeImpl: public LLProcess::WritePipe
176176
// In general, our streambuf might contain a number of different
177177
// physical buffers; iterate over those.
178178
bool keepwriting = true;
179-
for (const_buffer_sequence::const_iterator bufi(bufs.begin()), bufend(bufs.end());
179+
for (auto bufi(boost::asio::buffer_sequence_begin(bufs)), bufend(boost::asio::buffer_sequence_end(bufs));
180180
bufi != bufend && keepwriting; ++bufi)
181181
{
182182
// http://www.boost.org/doc/libs/1_49_0_beta1/doc/html/boost_asio/reference/buffer.html#boost_asio.reference.buffer.accessing_buffer_contents
183183
// Although apr_file_write() accepts const void*, we
184184
// manipulate const char* so we can increment the pointer.
185-
const char* remainptr = boost::asio::buffer_cast<const char*>(*bufi);
186-
std::size_t remainlen = boost::asio::buffer_size(*bufi);
185+
const char* remainptr = static_cast<const char*>(bufi->data());
186+
std::size_t remainlen = bufi->size();
187187
while (remainlen)
188188
{
189189
// Tackle the current buffer in discrete chunks. On
@@ -377,14 +377,14 @@ class ReadPipeImpl: public LLProcess::ReadPipe
377377
// In general, the mutable_buffer_sequence returned by prepare() might
378378
// contain a number of different physical buffers; iterate over those.
379379
std::size_t tocommit(0);
380-
for (mutable_buffer_sequence::const_iterator bufi(bufs.begin()), bufend(bufs.end());
380+
for (auto bufi(boost::asio::buffer_sequence_begin(bufs)), bufend(boost::asio::buffer_sequence_end(bufs));
381381
bufi != bufend; ++bufi)
382382
{
383383
// http://www.boost.org/doc/libs/1_49_0_beta1/doc/html/boost_asio/reference/buffer.html#boost_asio.reference.buffer.accessing_buffer_contents
384-
std::size_t toread(boost::asio::buffer_size(*bufi));
384+
std::size_t toread(bufi->size());
385385
apr_size_t gotten(toread);
386386
apr_status_t err = apr_file_read(mPipe,
387-
boost::asio::buffer_cast<void*>(*bufi),
387+
bufi->data(),
388388
&gotten);
389389
// EAGAIN is exactly what we want from a nonblocking pipe.
390390
// Rather than waiting for data, it should return immediately.

0 commit comments

Comments
 (0)