From b654fbe4d105833cc0fac9e219efd927d6f2b7b3 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 27 Aug 2019 08:43:15 +0200 Subject: Make InputBase::close() return void --- src/input/Edi.cpp | 3 +-- src/input/Edi.h | 2 +- src/input/File.cpp | 3 +-- src/input/File.h | 2 +- src/input/Prbs.cpp | 3 +-- src/input/Prbs.h | 2 +- src/input/Udp.cpp | 3 +-- src/input/Udp.h | 2 +- src/input/Zmq.cpp | 3 +-- src/input/Zmq.h | 2 +- src/input/inputs.h | 2 +- 11 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/input/Edi.cpp b/src/input/Edi.cpp index c50c9cf..2d82902 100644 --- a/src/input/Edi.cpp +++ b/src/input/Edi.cpp @@ -209,10 +209,9 @@ int Edi::setBitrate(int bitrate) return bitrate; } -int Edi::close() +void Edi::close() { m_udp_sock.close(); - return 0; } } diff --git a/src/input/Edi.h b/src/input/Edi.h index cd1167c..9542e28 100644 --- a/src/input/Edi.h +++ b/src/input/Edi.h @@ -55,7 +55,7 @@ class Edi : public InputBase { virtual void open(const std::string& name); virtual int readFrame(uint8_t* buffer, size_t size); virtual int setBitrate(int bitrate); - virtual int close(); + virtual void close(); protected: void m_run(); diff --git a/src/input/File.cpp b/src/input/File.cpp index 5c83627..99dd68d 100644 --- a/src/input/File.cpp +++ b/src/input/File.cpp @@ -84,13 +84,12 @@ int FileBase::setBitrate(int bitrate) } -int FileBase::close() +void FileBase::close() { if (m_fd != -1) { ::close(m_fd); m_fd = -1; } - return 0; } void FileBase::setNonblocking(bool nonblock) diff --git a/src/input/File.h b/src/input/File.h index 79b78b5..429a1ce 100644 --- a/src/input/File.h +++ b/src/input/File.h @@ -39,7 +39,7 @@ class FileBase : public InputBase { virtual void open(const std::string& name); virtual int readFrame(uint8_t* buffer, size_t size) = 0; virtual int setBitrate(int bitrate); - virtual int close(); + virtual void close(); virtual void setNonblocking(bool nonblock); diff --git a/src/input/Prbs.cpp b/src/input/Prbs.cpp index 5cbeee3..9f4f5dd 100644 --- a/src/input/Prbs.cpp +++ b/src/input/Prbs.cpp @@ -92,9 +92,8 @@ int Prbs::setBitrate(int bitrate) return bitrate; } -int Prbs::close() +void Prbs::close() { - return 0; } int Prbs::rewind() diff --git a/src/input/Prbs.h b/src/input/Prbs.h index 76fd6fa..b76ffc7 100644 --- a/src/input/Prbs.h +++ b/src/input/Prbs.h @@ -40,7 +40,7 @@ class Prbs : public InputBase { virtual void open(const std::string& name); virtual int readFrame(uint8_t* buffer, size_t size); virtual int setBitrate(int bitrate); - virtual int close(); + virtual void close(); private: virtual int rewind(); diff --git a/src/input/Udp.cpp b/src/input/Udp.cpp index fa9c286..b909c5a 100644 --- a/src/input/Udp.cpp +++ b/src/input/Udp.cpp @@ -114,10 +114,9 @@ int Udp::setBitrate(int bitrate) return bitrate; } -int Udp::close() +void Udp::close() { m_sock.close(); - return 0; } diff --git a/src/input/Udp.h b/src/input/Udp.h index d74e92f..58e0dfd 100644 --- a/src/input/Udp.h +++ b/src/input/Udp.h @@ -43,7 +43,7 @@ class Udp : public InputBase { virtual void open(const std::string& name); virtual int readFrame(uint8_t* buffer, size_t size); virtual int setBitrate(int bitrate); - virtual int close(); + virtual void close(); protected: Socket::UDPSocket m_sock; diff --git a/src/input/Zmq.cpp b/src/input/Zmq.cpp index ec5f9b9..c5cc1b2 100644 --- a/src/input/Zmq.cpp +++ b/src/input/Zmq.cpp @@ -231,10 +231,9 @@ void ZmqBase::open(const std::string& inputUri) m_stats.registerAtServer(); } -int ZmqBase::close() +void ZmqBase::close() { m_zmq_sock.close(); - return 0; } int ZmqBase::setBitrate(int bitrate) diff --git a/src/input/Zmq.h b/src/input/Zmq.h index ab3e610..2b42872 100644 --- a/src/input/Zmq.h +++ b/src/input/Zmq.h @@ -184,7 +184,7 @@ class ZmqBase : public InputBase, public RemoteControllable { virtual void open(const std::string& inputUri); virtual int readFrame(uint8_t* buffer, size_t size); virtual int setBitrate(int bitrate); - virtual int close(); + virtual void close(); /* Remote control */ virtual void set_parameter(const std::string& parameter, diff --git a/src/input/inputs.h b/src/input/inputs.h index 9c6c3f5..9a396e0 100644 --- a/src/input/inputs.h +++ b/src/input/inputs.h @@ -45,7 +45,7 @@ class InputBase { /* Returns the effectively used bitrate, or throws invalid_argument on invalid bitrate */ virtual int setBitrate(int bitrate) = 0; - virtual int close() = 0; + virtual void close() = 0; virtual ~InputBase() {} protected: -- cgit v1.2.3