diff --git a/cache.h b/cache.h index b69bd622..8ed51528 100644 --- a/cache.h +++ b/cache.h @@ -8,7 +8,7 @@ #include /* Interface for TValue: - * size_t weight() + * size_t weight() * bool is_newer( time_t ) * bool load() * diff --git a/ffmpeg.cpp b/ffmpeg.cpp index b718c0c3..6cb01cde 100644 --- a/ffmpeg.cpp +++ b/ffmpeg.cpp @@ -158,16 +158,16 @@ void FFmpegThread::Action() } // --- cPipe2 ----------------------------------------------------------------- - + // cPipe2::Open() and cPipe2::Close() are based on code originally received from // Andreas Vitting - + cPipe2::cPipe2(void) { pid = -1; f = NULL; } - + cPipe2::~cPipe2() { Close(); diff --git a/grab.cpp b/grab.cpp index cf8cf2ce..d571f941 100644 --- a/grab.cpp +++ b/grab.cpp @@ -9,7 +9,7 @@ namespace vdrlive { using namespace std; -const unsigned int GrabMinIntervalMs = 500; +const unsigned int GrabMinIntervalMs = 500; const unsigned int GrabPauseIntervalMs = GrabMinIntervalMs * 20; class GrabImageTask: public StickyTask @@ -38,7 +38,7 @@ class GrabImageTask: public StickyTask virtual void Action(); }; -bool GrabImageTask::IsActive() +bool GrabImageTask::IsActive() { cMutexLock lock( &LiveTaskManager() ); return GrabImage(); @@ -85,14 +85,14 @@ GrabImageManager::GrabImageManager() { } -GrabImageInfo GrabImageManager::GetImage() const +GrabImageInfo GrabImageManager::GetImage() const { cMutexLock lock( &LiveTaskManager() ); m_task->Activate(); return make_pair( m_image, m_size ); } -bool GrabImageManager::CanGrab() const +bool GrabImageManager::CanGrab() const { return m_task->IsActive(); } @@ -103,7 +103,7 @@ void GrabImageManager::PutImage( char* image, int size ) m_size = size; } -GrabImageManager& LiveGrabImageManager() +GrabImageManager& LiveGrabImageManager() { static GrabImageManager instance; return instance; diff --git a/md5.cpp b/md5.cpp index c926fe81..75b202a9 100644 --- a/md5.cpp +++ b/md5.cpp @@ -78,7 +78,7 @@ char* PrintMD5(uchar md5Digest[16]) { sprintf(chEach, "%02x", md5Digest[nCount]); // strncat(chBuffer, chEach, sizeof(chEach)); // compiler warning with gcc V9 - strncat(chBuffer, chEach, sizeof(chBuffer)-strlen(chBuffer)-1); // no need to limit to the size of chEach, + strncat(chBuffer, chEach, sizeof(chBuffer)-strlen(chBuffer)-1); // no need to limit to the size of chEach, // because it will only append up to the 0 byte of chEach, // but dont overflow chBuffer and let room the terminating 0 } diff --git a/osd_status.h b/osd_status.h index 3a5efe97..a0ea6f23 100644 --- a/osd_status.h +++ b/osd_status.h @@ -30,7 +30,7 @@ class OsdStatusMonitor: public cStatus private: OsdStatusMonitor(); OsdStatusMonitor( OsdStatusMonitor const& ); - + std::string title; std::string message; std::string red; @@ -42,12 +42,12 @@ class OsdStatusMonitor: public cStatus cList items; unsigned short tabs[MaxTabs]; clock_t lastUpdate; - + protected: // static void append(char *&tail, char type, const char *src, int max); public: - std::string const GetTitle() const {return title;} + std::string const GetTitle() const {return title;} std::string const GetMessage() const {return message;} std::string const GetRed() const {return red;} std::string const GetGreen() const {return green;} diff --git a/stdext.h b/stdext.h index 9bf3f201..04077848 100644 --- a/stdext.h +++ b/stdext.h @@ -24,7 +24,7 @@ # include # include -namespace std { +namespace std { namespace tr1 { using boost::bind; diff --git a/timerconflict.cpp b/timerconflict.cpp index 4d9d3493..a3c77428 100644 --- a/timerconflict.cpp +++ b/timerconflict.cpp @@ -36,7 +36,7 @@ namespace vdrlive { TimerConflict::TimerConflict( string const& data ) { Init(); -// dsyslog("live: TimerConflict() data '%s'", data.c_str()); +// dsyslog("live: TimerConflict() data '%s'", data.c_str()); vector< string > parts = StringSplit( data, ':' ); try { vector< string >::const_iterator part = parts.begin(); @@ -77,13 +77,13 @@ namespace vdrlive { if ( CheckEpgsearchVersion() && cPluginManager::CallFirstService(ServiceInterface, &service)) { cServiceHandler_v1_1* handler = dynamic_cast(service.handler.get()); - if (handler) + if (handler) { list< string > conflicts = service.handler->TimerConflictList(); // for(std::list::const_iterator i = conflicts.begin(); i != conflicts.end(); ++i) { // dsyslog("live: TimerConflicts::TimerConflicts() conflicts '%s'",i->c_str()); // } - GetRemote(conflicts); // add remote VDR conflicts + GetRemote(conflicts); // add remote VDR conflicts m_conflicts.assign( conflicts.begin(), conflicts.end() ); m_conflicts.sort(); } @@ -123,7 +123,7 @@ namespace vdrlive { // dsyslog("live: GetRemote() response[i] '%s'", response[i]); switch ( code ) { case 900: { - string rConflict = response[i]; + string rConflict = response[i]; string remConflict = rConflict.substr(4); remConflict.append("|"); remConflict.append(remoteServer); @@ -159,12 +159,12 @@ namespace vdrlive { if (CheckEpgsearchVersion() && cPluginManager::CallFirstService(ServiceInterface, &service)) { cServiceHandler_v1_1* handler = dynamic_cast(service.handler.get()); - if (!handler) + if (!handler) return false; else return handler->IsConflictCheckAdvised(); } - else + else return false; } diff --git a/timers.cpp b/timers.cpp index ef6cf85b..33213716 100644 --- a/timers.cpp +++ b/timers.cpp @@ -188,7 +188,7 @@ namespace vdrlive { { } - void TimerManager::UpdateTimer( int timerId, const char* remote, const char* oldRemote, int flags, const tChannelID& channel, string const& weekdays, + void TimerManager::UpdateTimer( int timerId, const char* remote, const char* oldRemote, int flags, const tChannelID& channel, string const& weekdays, string const& day, int start, int stop, int priority, int lifetime, string const& title, string const& aux ) { cMutexLock lock( this ); @@ -237,7 +237,7 @@ namespace vdrlive { dsyslog("live: DelTimer() timerId '%d'", timerId); dsyslog("live: DelTimer() remote '%s'", remote); - timerStruct timerData{ .id=timerId, .remote=remote, .oldRemote=remote, .builder=TIMER_DELETE }; + timerStruct timerData{ .id=timerId, .remote=remote, .oldRemote=remote, .builder=TIMER_DELETE }; m_updateTimers.push_back( timerData ); m_updateWait.Wait( *this ); @@ -251,7 +251,7 @@ namespace vdrlive { { cMutexLock lock( this ); - timerStruct timerData{ .id=timerId, .remote=remote, .oldRemote=remote, .builder=TIMER_TOGGLE }; + timerStruct timerData{ .id=timerId, .remote=remote, .oldRemote=remote, .builder=TIMER_TOGGLE }; m_updateTimers.push_back( timerData ); m_updateWait.Wait( *this ); @@ -305,7 +305,7 @@ namespace vdrlive { bool svdrpOK = ExecSVDRPCommand(timerData.remote, command.c_str(), &response); if ( !svdrpOK ) { esyslog("live: svdrp command on remote server %s failed", timerData.remote); - } + } else { for (int i = 0; i < response.Size(); i++) { int code = SVDRPCode(response[i]); diff --git a/timers.h b/timers.h index 430c6113..8578524e 100644 --- a/timers.h +++ b/timers.h @@ -53,7 +53,7 @@ namespace vdrlive { public: SortedTimers& GetTimers() { return m_timers; } - void UpdateTimer( int timerId, const char* remote, const char* oldRemote, int flags, const tChannelID& channel, std::string const& weekdays, + void UpdateTimer( int timerId, const char* remote, const char* oldRemote, int flags, const tChannelID& channel, std::string const& weekdays, std::string const& day, int start, int stop, int priority, int lifetime, std::string const& title, std::string const& aux ); void DelTimer( int timerId, const char* remote); diff --git a/users.cpp b/users.cpp index 3f99a58f..c81752fb 100644 --- a/users.cpp +++ b/users.cpp @@ -18,13 +18,13 @@ using namespace std; std::string cUsers::logged_in_user; // -- cUser ----------------------------------------------------------------- -cUser::cUser(int ID, const std::string& Name, const std::string& Password) - : m_ID(ID), m_Name(Name) +cUser::cUser(int ID, const std::string& Name, const std::string& Password) + : m_ID(ID), m_Name(Name) { SetPassword(Password); } -void cUser::SetPassword(const std::string& Password) +void cUser::SetPassword(const std::string& Password) { ostringstream passwordStr; passwordStr << Password.size() << "|" << MD5Hash(Password); @@ -67,9 +67,9 @@ bool cUser::Parse(const char *s) if (!pos_next) pos_next = pos + strlen(pos); valuelen = pos_next - pos + 1; - if (valuelen > MAXVALUELEN) + if (valuelen > MAXVALUELEN) { - esyslog("live: entry '%s' is too long. Will be truncated!", pos); + esyslog("live: entry '%s' is too long. Will be truncated!", pos); valuelen = MAXVALUELEN; } strn0cpy(value, pos, valuelen); @@ -82,7 +82,7 @@ bool cUser::Parse(const char *s) break; case 3: m_PasswordMD5 = value; break; - case 4: + case 4: m_Userrights = lexical_cast< int >(value); break; default: @@ -93,7 +93,7 @@ bool cUser::Parse(const char *s) } if (*pos) pos++; } //while - + free(line); return (parameter >= 4) ? true : false; } @@ -111,16 +111,16 @@ bool cUser::Save(FILE *f) return fprintf(f, "%s\n", ToText()) > 0; } -bool cUser::HasRightTo(eUserRights right) -{ +bool cUser::HasRightTo(eUserRights right) +{ return ((m_Userrights & (1 << (right-1))) != 0); } -bool cUser::CurrentUserHasRightTo(eUserRights right) -{ +bool cUser::CurrentUserHasRightTo(eUserRights right) +{ if (!LiveSetup().UseAuth()) return true; cUser* user = cUsers::GetByUserName(cUsers::logged_in_user); - return (cUsers::logged_in_user == LiveSetup().GetAdminLogin() || (user && (user->m_Userrights & (1 << (right-1))) != 0)); + return (cUsers::logged_in_user == LiveSetup().GetAdminLogin() || (user && (user->m_Userrights & (1 << (right-1))) != 0)); } void cUser::SetRight(eUserRights right) @@ -133,7 +133,7 @@ void cUser::SetRight(eUserRights right) bool cUsers::Delete(const std::string& Name) { cUser* user = Users.First(); - while (user) + while (user) { if (user->Name() == Name) { @@ -149,7 +149,7 @@ bool cUsers::Delete(const std::string& Name) cUser* cUsers::GetByUserId(const std::string& Id) { cUser* user = Users.First(); - while (user) + while (user) { if (user->Id() == atoi(Id.c_str())) return user; @@ -161,7 +161,7 @@ cUser* cUsers::GetByUserId(const std::string& Id) cUser* cUsers::GetByUserName(const std::string& Name) { cUser* user = Users.First(); - while (user) + while (user) { if (user->Name() == Name) return user; @@ -174,7 +174,7 @@ int cUsers::GetNewId() { int iMaxId = -1; cUser* user = Users.First(); - while (user) + while (user) { if (iMaxId < user->Id()) iMaxId = user->Id(); diff --git a/users.h b/users.h index ee973ce2..2db9137f 100644 --- a/users.h +++ b/users.h @@ -34,7 +34,7 @@ class cUser : public cListObject { cUser(int ID, const std::string& Name, const std::string& Password); int Id() const { return m_ID; } std::string Name() const { return m_Name; } - std::string PasswordMD5() const { return m_PasswordMD5; } + std::string PasswordMD5() const { return m_PasswordMD5; } int Userrights() const { return m_Userrights; } int GetPasswordLength() const; std::string const GetMD5HashPassword() const;