Skip to content

Commit da75650

Browse files
authored
Merge pull request #4709 from neheb/abarr
replace boost::array with std version
2 parents 4b7cd2a + 6638dba commit da75650

File tree

8 files changed

+7
-13
lines changed

8 files changed

+7
-13
lines changed

hardware/Kodi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ void CKodiNode::handleRead(const boost::system::error_code& e, std::size_t bytes
631631
if (!e)
632632
{
633633
//do something with the data
634-
std::string sData(m_Buffer.begin(), bytes_transferred);
634+
std::string sData(m_Buffer.data(), bytes_transferred);
635635
sData = m_RetainedData + sData; // if there was some data left over from last time add it back in
636636
int iPos = 1;
637637
while (iPos) {

hardware/Kodi.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "../main/localtime_r.h"
66
#include <string>
77
#include <boost/asio.hpp>
8-
#include <boost/array.hpp>
98

109
class CKodiNode : public std::enable_shared_from_this<CKodiNode>, StoppableTask
1110
{
@@ -211,7 +210,7 @@ class CKodiNode : public std::enable_shared_from_this<CKodiNode>, StoppableTask
211210
std::string m_sLastMessage;
212211
boost::asio::io_service *m_Ios;
213212
boost::asio::ip::tcp::socket *m_Socket;
214-
boost::array<char, 256> m_Buffer;
213+
std::array<char, 256> m_Buffer;
215214
};
216215

217216
class CKodi : public CDomoticzHardwareBase

hardware/PanasonicTV.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ std::string CPanasonicNode::handleWriteAndRead(const std::string &pMessageToSend
386386
return "ERROR";
387387
}
388388

389-
boost::array<char, 512> _Buffer;
389+
std::array<char, 512> _Buffer;
390390
size_t request_length = std::strlen(pMessageToSend.c_str());
391391
_log.Debug(DEBUG_HARDWARE, "Panasonic Plugin: (%s) Attemping write.", m_Name.c_str());
392392

@@ -397,7 +397,7 @@ std::string CPanasonicNode::handleWriteAndRead(const std::string &pMessageToSend
397397
size_t reply_length = boost::asio::read(socket, boost::asio::buffer(_Buffer, request_length));
398398
//_log.Log(LOG_NORM, "Panasonic Plugin: (%s) Error code: (%i).'.", m_Name.c_str(),error);
399399
socket.close();
400-
std::string pReceived(_Buffer.begin(), reply_length);
400+
std::string pReceived(_Buffer.data(), reply_length);
401401
return pReceived;
402402
}
403403
catch (...)

hardware/PanasonicTV.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "../main/localtime_r.h"
66
#include <string>
77
#include <boost/asio.hpp>
8-
#include <boost/array.hpp>
98

109
class CPanasonicNode;
1110

hardware/XiaomiGateway.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ bool XiaomiGateway::SendMessageToGateway(const std::string &controlmessage) {
498498
remote_endpoint_ = boost::asio::ip::udp::endpoint(boost::asio::ip::address::from_string(m_GatewayIp), 9898);
499499
socket_.send_to(boost::asio::buffer(*message1), remote_endpoint_);
500500
sleep_milliseconds(150);
501-
boost::array<char, 512> recv_buffer_;
501+
std::array<char, 512> recv_buffer_;
502502
memset(&recv_buffer_[0], 0, sizeof(recv_buffer_));
503503
#ifdef _DEBUG
504504
_log.Log(LOG_STATUS, "XiaomiGateway: request to %s - %s", m_GatewayIp.c_str(), message.c_str());

hardware/Yeelight.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,7 @@ bool Yeelight::WriteToHardware(const char *pdata, const unsigned char length)
402402
return true;
403403
}
404404

405-
406-
boost::array<char, 1024> recv_buffer_;
405+
std::array<char, 1024> recv_buffer_;
407406
int hardwareId;
408407

409408
Yeelight::udp_server::udp_server(boost::asio::io_service& io_service, int m_HwdID)

tcpserver/TCPClient.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#include "../main/Noncopyable.h"
44
#include <boost/asio.hpp>
5-
#include <boost/array.hpp>
65

76
namespace http {
87
namespace server {
@@ -56,8 +55,7 @@ class CTCPClient : public CTCPClientBase,
5655
void handleWrite(const boost::system::error_code& error);
5756

5857
/// Buffer for incoming data.
59-
boost::array<char, 8192> buffer_;
60-
58+
std::array<char, 8192> buffer_;
6159
};
6260

6361
#ifndef NOCLOUD

webserver/connection.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#define HTTP_CONNECTION_HPP
1313

1414
#include <boost/asio.hpp>
15-
#include <boost/array.hpp>
1615
#include <deque>
1716
#include <fstream>
1817
#include "reply.hpp"

0 commit comments

Comments
 (0)