From b73e13d70477549bfb970fc4fc005473223a4402 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 20 Jan 2014 21:54:26 +0100 Subject: fix some cppcheck errors --- src/dabOutput/dabOutput.h | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/dabOutput') diff --git a/src/dabOutput/dabOutput.h b/src/dabOutput/dabOutput.h index 5cb619f..bbf27e3 100644 --- a/src/dabOutput/dabOutput.h +++ b/src/dabOutput/dabOutput.h @@ -134,13 +134,16 @@ class DabOutputRaw : public DabOutput #ifndef _WIN32 isCyclades_ = other.isCyclades_; #endif - buffer_ = other.buffer_; + buffer_ = new unsigned char[6144]; + memcpy(buffer_, other.buffer_, 6144); } ~DabOutputRaw() { delete[] buffer_; } + const DabOutputRaw operator=(const DabOutputRaw& other); + int Open(const char* name); int Write(void* buffer, int size); int Close(); @@ -164,11 +167,11 @@ class DabOutputUdp : public DabOutput socket_ = new UdpSocket(); } - DabOutputUdp(const DabOutputUdp& other) - { - packet_ = other.packet_; - socket_ = other.socket_; - } + // make sure we don't copy this output around + // the UdpPacket and UdpSocket do not support + // copying either + DabOutputUdp(const DabOutputUdp& other); + DabOutputUdp operator=(const DabOutputUdp& other); ~DabOutputUdp() { delete socket_; @@ -195,12 +198,8 @@ class DabOutputTcp : public DabOutput client = NULL; } - DabOutputTcp(const DabOutputTcp& other) - { - server = other.server; - client = other.client; - thread_ = other.thread_; - } + DabOutputTcp(const DabOutputTcp& other); + DabOutputTcp operator=(const DabOutputTcp& other); ~DabOutputTcp() { -- cgit v1.2.3