From 0add6cc392c43853ec79ecd70886b2406015d399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Ma=C5=82ecki?= Date: Thu, 10 Dec 2020 17:12:19 +0100 Subject: [PATCH] [core] Fixed formal problems detected by clang --- srtcore/common.h | 2 +- srtcore/core.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/srtcore/common.h b/srtcore/common.h index f5d042f09..edd44eb30 100644 --- a/srtcore/common.h +++ b/srtcore/common.h @@ -771,7 +771,7 @@ class RollNumber return right < *this; } - bool operator=(const this_t& right) const + bool operator==(const this_t& right) const { return number == right.number; } diff --git a/srtcore/core.cpp b/srtcore/core.cpp index afc5ec32e..34f14efa1 100644 --- a/srtcore/core.cpp +++ b/srtcore/core.cpp @@ -9668,8 +9668,10 @@ int CUDT::processData(CUnit* in_unit) std::string s = tns1.str(); tns2 << "SRT:TsbPd:@" << s.substr(s.size()-2, 2); - ThreadName tn(tns2.str().c_str()); - const char* thname = tns2.str().c_str(); + const string& tn = tns2.str(); + + ThreadName tnkeep(tn.c_str()); + const char* thname = tn.c_str(); #else const char* thname = "SRT:TsbPd"; #endif