Browse Source

Compilation fixes

Paul-Louis Ageneau 5 years ago
parent
commit
6c8fe8ca51

+ 3 - 0
include/rtc/channel.hpp

@@ -29,6 +29,9 @@ namespace rtc {
 
 class Channel {
 public:
+	Channel() = default;
+	virtual ~Channel() = default;
+
 	virtual void close() = 0;
 	virtual bool send(const std::variant<binary, string> &data) = 0; // returns false if buffered
 

+ 1 - 1
include/rtc/datachannel.hpp

@@ -36,7 +36,7 @@ namespace rtc {
 class SctpTransport;
 class PeerConnection;
 
-class DataChannel : public std::enable_shared_from_this<DataChannel>, public Channel {
+class DataChannel final : public std::enable_shared_from_this<DataChannel>, public Channel {
 public:
 	DataChannel(std::weak_ptr<PeerConnection> pc, unsigned int stream, string label,
 	            string protocol, Reliability reliability);

+ 2 - 2
include/rtc/include.hpp

@@ -75,14 +75,14 @@ template <typename F, typename T, typename... Args> auto weak_bind(F &&f, T *t,
 		if (auto shared_this = weak_this.lock())
 			return bound(args...);
 		else
-			return (result_type) false;
+			return static_cast<result_type>(false);
 	};
 }
 
 template <typename... P> class synchronized_callback {
 public:
 	synchronized_callback() = default;
-	synchronized_callback(std::function<void(P...)> func) { *this = std::move(func); };
+	synchronized_callback(std::function<void(P...)> func) { *this = std::move(func); }
 	~synchronized_callback() { *this = nullptr; }
 
 	synchronized_callback &operator=(std::function<void(P...)> func) {

+ 1 - 1
include/rtc/peerconnection.hpp

@@ -48,7 +48,7 @@ class SctpTransport;
 using certificate_ptr = std::shared_ptr<Certificate>;
 using future_certificate_ptr = std::shared_future<certificate_ptr>;
 
-class PeerConnection : public std::enable_shared_from_this<PeerConnection> {
+class PeerConnection final : public std::enable_shared_from_this<PeerConnection> {
 public:
 	enum class State : int {
 		New = RTC_NEW,

+ 4 - 1
include/rtc/queue.hpp

@@ -60,7 +60,10 @@ private:
 
 template <typename T>
 Queue<T>::Queue(size_t limit, amount_function func) : mLimit(limit), mAmount(0) {
-	mAmountFunction = func ? func : [](const T &element) -> size_t { return 1; };
+	mAmountFunction = func ? func : [](const T &element) -> size_t {
+		static_cast<void>(element);
+		return 1;
+	};
 }
 
 template <typename T> Queue<T>::~Queue() { stop(); }