Skip to content

Commit

Permalink
remove whitespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
kfb77 committed Aug 9, 2020
1 parent 542d6f5 commit 9522d52
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 42 deletions.
2 changes: 1 addition & 1 deletion cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <map>

/* Interface for TValue:
* size_t weight()
* size_t weight()
* bool is_newer( time_t )
* bool load()
*
Expand Down
6 changes: 3 additions & 3 deletions ffmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,16 @@ void FFmpegThread::Action()
}

// --- cPipe2 -----------------------------------------------------------------

// cPipe2::Open() and cPipe2::Close() are based on code originally received from
// Andreas Vitting <[email protected]>

cPipe2::cPipe2(void)
{
pid = -1;
f = NULL;
}

cPipe2::~cPipe2()
{
Close();
Expand Down
10 changes: 5 additions & 5 deletions grab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -38,7 +38,7 @@ class GrabImageTask: public StickyTask
virtual void Action();
};

bool GrabImageTask::IsActive()
bool GrabImageTask::IsActive()
{
cMutexLock lock( &LiveTaskManager() );
return GrabImage();
Expand Down Expand Up @@ -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();
}
Expand All @@ -103,7 +103,7 @@ void GrabImageManager::PutImage( char* image, int size )
m_size = size;
}

GrabImageManager& LiveGrabImageManager()
GrabImageManager& LiveGrabImageManager()
{
static GrabImageManager instance;
return instance;
Expand Down
2 changes: 1 addition & 1 deletion md5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions osd_status.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class OsdStatusMonitor: public cStatus
private:
OsdStatusMonitor();
OsdStatusMonitor( OsdStatusMonitor const& );

std::string title;
std::string message;
std::string red;
Expand All @@ -42,12 +42,12 @@ class OsdStatusMonitor: public cStatus
cList<cLiveOsdItem> 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;}
Expand Down
2 changes: 1 addition & 1 deletion stdext.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# include <boost/shared_ptr.hpp>
# include <boost/weak_ptr.hpp>

namespace std {
namespace std {
namespace tr1 {

using boost::bind;
Expand Down
12 changes: 6 additions & 6 deletions timerconflict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -77,13 +77,13 @@ namespace vdrlive {
if ( CheckEpgsearchVersion() && cPluginManager::CallFirstService(ServiceInterface, &service))
{
cServiceHandler_v1_1* handler = dynamic_cast<cServiceHandler_v1_1*>(service.handler.get());
if (handler)
if (handler)
{
list< string > conflicts = service.handler->TimerConflictList();
// for(std::list<std::string>::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();
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -159,12 +159,12 @@ namespace vdrlive {
if (CheckEpgsearchVersion() && cPluginManager::CallFirstService(ServiceInterface, &service))
{
cServiceHandler_v1_1* handler = dynamic_cast<cServiceHandler_v1_1*>(service.handler.get());
if (!handler)
if (!handler)
return false;
else
return handler->IsConflictCheckAdvised();
}
else
else
return false;
}

Expand Down
8 changes: 4 additions & 4 deletions timers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
Expand All @@ -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 );
Expand Down Expand Up @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion timers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
32 changes: 16 additions & 16 deletions users.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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:
Expand All @@ -93,7 +93,7 @@ bool cUser::Parse(const char *s)
}
if (*pos) pos++;
} //while

free(line);
return (parameter >= 4) ? true : false;
}
Expand All @@ -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)
Expand All @@ -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)
{
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion users.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9522d52

Please sign in to comment.