From 097fea6405986de98e0ddb3dffd5659cff41709b Mon Sep 17 00:00:00 2001 From: Fanda Vacek Date: Mon, 29 Jan 2024 19:17:47 +0100 Subject: [PATCH] Clang tidy warning fixed --- libshvchainpack/include/shv/chainpack/rpcdriver.h | 2 +- libshvchainpack/include/shv/chainpack/socketrpcdriver.h | 2 +- libshvchainpack/src/chainpack/rpcdriver.cpp | 4 ++-- libshvchainpack/src/chainpack/socketrpcdriver.cpp | 2 +- libshviotqt/include/shv/iotqt/rpc/localsocket.h | 2 +- libshviotqt/include/shv/iotqt/rpc/serialportsocket.h | 2 +- libshviotqt/include/shv/iotqt/rpc/socket.h | 4 ++-- libshviotqt/include/shv/iotqt/rpc/socketrpcconnection.h | 2 +- libshviotqt/include/shv/iotqt/rpc/websocket.h | 2 +- libshviotqt/src/rpc/localsocket.cpp | 4 ++-- libshviotqt/src/rpc/serialportsocket.cpp | 4 ++-- libshviotqt/src/rpc/socket.cpp | 4 ++-- libshviotqt/src/rpc/socketrpcconnection.cpp | 4 ++-- libshviotqt/src/rpc/websocket.cpp | 4 ++-- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/libshvchainpack/include/shv/chainpack/rpcdriver.h b/libshvchainpack/include/shv/chainpack/rpcdriver.h index e5c862eb2..026c9ea32 100644 --- a/libshvchainpack/include/shv/chainpack/rpcdriver.h +++ b/libshvchainpack/include/shv/chainpack/rpcdriver.h @@ -29,7 +29,7 @@ class SHVCHAINPACK_DECL_EXPORT RpcDriver protected: virtual bool isOpen() = 0; - virtual void writeFrameData(std::string &&frame_data) = 0; + virtual void writeFrameData(const std::string &frame_data) = 0; /// call it when new data arrived virtual void onFrameDataRead(std::string &&frame_data); diff --git a/libshvchainpack/include/shv/chainpack/socketrpcdriver.h b/libshvchainpack/include/shv/chainpack/socketrpcdriver.h index 86fbd2881..4d674f331 100644 --- a/libshvchainpack/include/shv/chainpack/socketrpcdriver.h +++ b/libshvchainpack/include/shv/chainpack/socketrpcdriver.h @@ -21,7 +21,7 @@ class SHVCHAINPACK_DECL_EXPORT SocketRpcDriver : public RpcDriver void sendNotify(std::string &&method, const RpcValue &result); protected: bool isOpen() override; - void writeFrameData(std::string &&frame_data) override; + void writeFrameData(const std::string &frame_data) override; virtual void idleTaskOnSelectTimeout(); private: diff --git a/libshvchainpack/src/chainpack/rpcdriver.cpp b/libshvchainpack/src/chainpack/rpcdriver.cpp index 1ef9c7182..ebbe6cd3e 100644 --- a/libshvchainpack/src/chainpack/rpcdriver.cpp +++ b/libshvchainpack/src/chainpack/rpcdriver.cpp @@ -31,7 +31,7 @@ void RpcDriver::sendRpcMessage(const RpcMessage &msg) logRpcRawMsg() << SND_LOG_ARROW << msg.toPrettyString(); auto frame_data = msg.toChainPack(); logRpcData() << "SEND data:" << Utils::toHex(frame_data, 0, 250); - writeFrameData(std::move(frame_data)); + writeFrameData(frame_data); } void RpcDriver::sendRpcFrame(RpcFrame &&frame) @@ -42,7 +42,7 @@ void RpcDriver::sendRpcFrame(RpcFrame &&frame) << Utils::toHex(frame.data, 0, 250); auto frame_data = frame.toChainPack(); logRpcData() << "SEND data:" << Utils::toHex(frame_data, 0, 250); - writeFrameData(std::move(frame_data)); + writeFrameData(frame_data); } void RpcDriver::onFrameDataRead(std::string &&frame_data) diff --git a/libshvchainpack/src/chainpack/socketrpcdriver.cpp b/libshvchainpack/src/chainpack/socketrpcdriver.cpp index 7cbdf0f92..212169004 100644 --- a/libshvchainpack/src/chainpack/socketrpcdriver.cpp +++ b/libshvchainpack/src/chainpack/socketrpcdriver.cpp @@ -53,7 +53,7 @@ void SocketRpcDriver::idleTaskOnSelectTimeout() { } -void SocketRpcDriver::writeFrameData(std::string &&frame_data) +void SocketRpcDriver::writeFrameData(const std::string &frame_data) { if(!isOpen()) { nInfo() << "Write to closed socket"; diff --git a/libshviotqt/include/shv/iotqt/rpc/localsocket.h b/libshviotqt/include/shv/iotqt/rpc/localsocket.h index 32927ceec..4ed38bfaa 100644 --- a/libshviotqt/include/shv/iotqt/rpc/localsocket.h +++ b/libshviotqt/include/shv/iotqt/rpc/localsocket.h @@ -18,7 +18,7 @@ class SHVIOTQT_DECL_EXPORT LocalSocket : public Socket ~LocalSocket() override; std::string readFrameData() override; - void writeFrameData(std::string &&frame_data) override; + void writeFrameData(const std::string &frame_data) override; void connectToHost(const QUrl &url) override; void close() override; diff --git a/libshviotqt/include/shv/iotqt/rpc/serialportsocket.h b/libshviotqt/include/shv/iotqt/rpc/serialportsocket.h index 5b1cb271c..b197189be 100644 --- a/libshviotqt/include/shv/iotqt/rpc/serialportsocket.h +++ b/libshviotqt/include/shv/iotqt/rpc/serialportsocket.h @@ -50,7 +50,7 @@ class SHVIOTQT_DECL_EXPORT SerialPortSocket : public Socket SerialPortSocket(QSerialPort *port, QObject *parent = nullptr); std::string readFrameData() override; - void writeFrameData(std::string &&frame_data) override; + void writeFrameData(const std::string &frame_data) override; void setReceiveTimeout(int millis); diff --git a/libshviotqt/include/shv/iotqt/rpc/socket.h b/libshviotqt/include/shv/iotqt/rpc/socket.h index cb4d6fb73..5bc14e23d 100644 --- a/libshviotqt/include/shv/iotqt/rpc/socket.h +++ b/libshviotqt/include/shv/iotqt/rpc/socket.h @@ -88,7 +88,7 @@ class SHVIOTQT_DECL_EXPORT Socket : public QObject virtual quint16 peerPort() const = 0; virtual std::string readFrameData() = 0; - virtual void writeFrameData(std::string &&frame_data) = 0; + virtual void writeFrameData(const std::string &frame_data) = 0; virtual void ignoreSslErrors() = 0; @@ -115,7 +115,7 @@ class SHVIOTQT_DECL_EXPORT TcpSocket : public Socket TcpSocket(QTcpSocket *socket, QObject *parent = nullptr); std::string readFrameData() override; - void writeFrameData(std::string &&frame_data) override; + void writeFrameData(const std::string &frame_data) override; void connectToHost(const QUrl &url) override; void close() override; diff --git a/libshviotqt/include/shv/iotqt/rpc/socketrpcconnection.h b/libshviotqt/include/shv/iotqt/rpc/socketrpcconnection.h index 6782b93b8..e0157dec6 100644 --- a/libshviotqt/include/shv/iotqt/rpc/socketrpcconnection.h +++ b/libshviotqt/include/shv/iotqt/rpc/socketrpcconnection.h @@ -45,7 +45,7 @@ class SHVIOTQT_DECL_EXPORT SocketRpcConnection : public QObject, public shv::cha protected: // RpcDriver interface bool isOpen() Q_DECL_OVERRIDE; - void writeFrameData(std::string &&frame_data) override; + void writeFrameData(const std::string &frame_data) override; Socket* socket(); void onReadyRead(); diff --git a/libshviotqt/include/shv/iotqt/rpc/websocket.h b/libshviotqt/include/shv/iotqt/rpc/websocket.h index f48507a31..5fa7dd78a 100644 --- a/libshviotqt/include/shv/iotqt/rpc/websocket.h +++ b/libshviotqt/include/shv/iotqt/rpc/websocket.h @@ -16,7 +16,7 @@ class SHVIOTQT_DECL_EXPORT WebSocket : public Socket WebSocket(QWebSocket *socket, QObject *parent = nullptr); std::string readFrameData() override; - void writeFrameData(std::string &&frame_data) override; + void writeFrameData(const std::string &frame_data) override; void connectToHost(const QUrl &url) override; void close() override; diff --git a/libshviotqt/src/rpc/localsocket.cpp b/libshviotqt/src/rpc/localsocket.cpp index fed59d4a9..ab667b0e7 100644 --- a/libshviotqt/src/rpc/localsocket.cpp +++ b/libshviotqt/src/rpc/localsocket.cpp @@ -98,9 +98,9 @@ std::string LocalSocket::readFrameData() return m_frameReader->getFrame(); } -void LocalSocket::writeFrameData(std::string &&frame_data) +void LocalSocket::writeFrameData(const std::string &frame_data) { - m_frameWriter->addFrame(std::move(frame_data)); + m_frameWriter->addFrame(frame_data); flushWriteBuffer(); } diff --git a/libshviotqt/src/rpc/serialportsocket.cpp b/libshviotqt/src/rpc/serialportsocket.cpp index 42032ff96..369e818ae 100644 --- a/libshviotqt/src/rpc/serialportsocket.cpp +++ b/libshviotqt/src/rpc/serialportsocket.cpp @@ -318,9 +318,9 @@ std::string SerialPortSocket::readFrameData() return m_frameReader.getFrame(); } -void SerialPortSocket::writeFrameData(std::string &&frame_data) +void SerialPortSocket::writeFrameData(const std::string &frame_data) { - m_frameWriter.addFrame(std::move(frame_data)); + m_frameWriter.addFrame(frame_data); flushWriteBuffer(); } diff --git a/libshviotqt/src/rpc/socket.cpp b/libshviotqt/src/rpc/socket.cpp index 3dcf99c18..e75447c1f 100644 --- a/libshviotqt/src/rpc/socket.cpp +++ b/libshviotqt/src/rpc/socket.cpp @@ -205,9 +205,9 @@ std::string TcpSocket::readFrameData() return m_frameReader.getFrame(); } -void TcpSocket::writeFrameData(std::string &&frame_data) +void TcpSocket::writeFrameData(const std::string &frame_data) { - m_frameWriter.addFrame(std::move(frame_data)); + m_frameWriter.addFrame(frame_data); flushWriteBuffer(); } diff --git a/libshviotqt/src/rpc/socketrpcconnection.cpp b/libshviotqt/src/rpc/socketrpcconnection.cpp index 622b1e891..15293510c 100644 --- a/libshviotqt/src/rpc/socketrpcconnection.cpp +++ b/libshviotqt/src/rpc/socketrpcconnection.cpp @@ -121,9 +121,9 @@ bool SocketRpcConnection::isOpen() return isSocketConnected(); } -void SocketRpcConnection::writeFrameData(std::string &&frame_data) +void SocketRpcConnection::writeFrameData(const std::string &frame_data) { - socket()->writeFrameData(std::move(frame_data)); + socket()->writeFrameData(frame_data); } void SocketRpcConnection::sendRpcMessage(const shv::chainpack::RpcMessage &rpc_msg) diff --git a/libshviotqt/src/rpc/websocket.cpp b/libshviotqt/src/rpc/websocket.cpp index fd88983df..37c2e22e4 100644 --- a/libshviotqt/src/rpc/websocket.cpp +++ b/libshviotqt/src/rpc/websocket.cpp @@ -70,9 +70,9 @@ std::string WebSocket::readFrameData() return m_frameReader.getFrame(); } -void WebSocket::writeFrameData(std::string &&frame_data) +void WebSocket::writeFrameData(const std::string &frame_data) { - m_frameWriter.addFrame(std::move(frame_data)); + m_frameWriter.addFrame(frame_data); flushWriteBuffer(); }