Skip to content

Commit

Permalink
tidy: Change function definition variables to match declarations.
Browse files Browse the repository at this point in the history
Clang-tidy pointed out where the variable names in function
declarations didn't match the variable names in function definitions.
In these cases, the declaration name was more descriptive so the
definition was updated to match.

These problems were pointed out by clang-tidy's "inconsistent
declaration parameter name" check.

https://clang.llvm.org/extra/clang-tidy/checks/readability-inconsistent-declaration-parameter-name.html
  • Loading branch information
linuxdude42 committed Mar 19, 2019
1 parent 023a0b9 commit 7fd1b47
Show file tree
Hide file tree
Showing 35 changed files with 138 additions and 135 deletions.
4 changes: 2 additions & 2 deletions mythplugins/mythgame/mythgame/gamescan.cpp
Expand Up @@ -175,13 +175,13 @@ bool GameScannerThread::buildFileList()
}

void GameScannerThread::SendProgressEvent(uint progress, uint total,
QString messsage)
QString message)
{
if (!m_dialog)
return;

ProgressUpdateEvent *pue = new ProgressUpdateEvent(progress, total,
messsage);
message);
QApplication::postEvent(m_dialog, pue);
}

Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmyth/backendselect.cpp
Expand Up @@ -15,9 +15,9 @@

BackendSelection::BackendSelection(
MythScreenStack *parent, DatabaseParams *params,
Configuration *conf, bool exitOnFinish) :
Configuration *pConfig, bool exitOnFinish) :
MythScreenType(parent, "BackEnd Selection"),
m_DBparams(params), m_pConfig(conf), m_exitOnFinish(exitOnFinish)
m_DBparams(params), m_pConfig(pConfig), m_exitOnFinish(exitOnFinish)
{
if (exitOnFinish)
{
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmyth/programinfo.cpp
Expand Up @@ -4638,21 +4638,21 @@ void ProgramInfo::SaveMarkup(const QVector<MarkupEntry> &mapMark,
}
}

void ProgramInfo::SaveVideoProperties(uint mask, uint vid_flags)
void ProgramInfo::SaveVideoProperties(uint mask, uint video_property_flags)
{
MSqlQuery query(MSqlQuery::InitCon());

LOG(VB_RECORD, LOG_INFO,
QString("SaveVideoProperties(0x%1, 0x%2)")
.arg(mask,2,16,QChar('0')).arg(vid_flags,2,16,QChar('0')));
.arg(mask,2,16,QChar('0')).arg(video_property_flags,2,16,QChar('0')));

query.prepare(
"UPDATE recordedprogram "
"SET videoprop = ((videoprop+0) & :OTHERFLAGS) | :FLAGS "
"WHERE chanid = :CHANID AND starttime = :STARTTIME");

query.bindValue(":OTHERFLAGS", ~mask);
query.bindValue(":FLAGS", vid_flags);
query.bindValue(":FLAGS", video_property_flags);
query.bindValue(":CHANID", m_chanid);
query.bindValue(":STARTTIME", m_startts);
if (!query.exec())
Expand All @@ -4663,7 +4663,7 @@ void ProgramInfo::SaveVideoProperties(uint mask, uint vid_flags)

uint videoproperties = GetVideoProperties();
videoproperties &= ~mask;
videoproperties |= vid_flags;
videoproperties |= video_property_flags;
m_properties &= ~kVideoPropertyMask;
m_properties |= videoproperties << kVideoPropertyOffset;

Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmyth/standardsettings.cpp
Expand Up @@ -44,9 +44,9 @@ MythUIButtonListItem * StandardSetting::createButton(MythUIButtonList * list)
return item;
}

void StandardSetting::setEnabled(bool b)
void StandardSetting::setEnabled(bool enabled)
{
m_enabled = b;
m_enabled = enabled;
emit ShouldRedraw(this);
}

Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythbase/mythsocket.cpp
Expand Up @@ -295,14 +295,14 @@ void MythSocket::CallReadyReadHandler(void)
}

bool MythSocket::ConnectToHost(
const QHostAddress &hadr, quint16 port)
const QHostAddress &address, quint16 port)
{
bool ret = false;
QMetaObject::invokeMethod(
this, "ConnectToHostReal",
(QThread::currentThread() != m_thread->qthread()) ?
Qt::BlockingQueuedConnection : Qt::DirectConnection,
Q_ARG(QHostAddress, hadr),
Q_ARG(QHostAddress, address),
Q_ARG(quint16, port),
Q_ARG(bool*, &ret));
return ret;
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythbase/remotefile.cpp
Expand Up @@ -69,11 +69,11 @@ static bool RemoteSendReceiveStringList(const QString &host, QStringList &strlis
return ok;
}

RemoteFile::RemoteFile(const QString &_path, bool write, bool useRA,
int _timeout_ms,
RemoteFile::RemoteFile(const QString &url, bool write, bool usereadahead,
int timeout_ms,
const QStringList *possibleAuxiliaryFiles) :
m_path(_path),
m_usereadahead(useRA), m_timeout_ms(_timeout_ms),
m_path(url),
m_usereadahead(usereadahead), m_timeout_ms(timeout_ms),
m_writemode(write)
{
if (m_writemode)
Expand Down
10 changes: 5 additions & 5 deletions mythtv/libs/libmythtv/AirPlay/mythraopconnection.cpp
Expand Up @@ -1539,15 +1539,15 @@ QStringList MythRAOPConnection::splitLines(const QByteArray &lines)
/**
* stringFromSeconds:
*
* Usage: stringFromSeconds(seconds)
* Usage: stringFromSeconds(timeInSeconds)
* Description: create a string in the format HH:mm:ss from a duration in seconds
* HH: will not be displayed if there's less than one hour
*/
QString MythRAOPConnection::stringFromSeconds(int time)
QString MythRAOPConnection::stringFromSeconds(int timeInSeconds)
{
int hour = time / 3600;
int minute = (time - hour * 3600) / 60;
int seconds = time - hour * 3600 - minute * 60;
int hour = timeInSeconds / 3600;
int minute = (timeInSeconds - hour * 3600) / 60;
int seconds = timeInSeconds - hour * 3600 - minute * 60;
QString str;

if (hour)
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/AirPlay/mythraopconnection.h
Expand Up @@ -105,7 +105,7 @@ class MTV_PUBLIC MythRAOPConnection : public QObject
// utility functions
int64_t AudioCardLatency(void);
QStringList splitLines(const QByteArray &lines);
QString stringFromSeconds(int seconds);
QString stringFromSeconds(int timeInSeconds);
uint64_t framesToMs(uint64_t frames);

// notification functions
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/Bluray/bdringbuffer.cpp
Expand Up @@ -1549,15 +1549,15 @@ bool BDRingBuffer::StartFromBeginning(void)
return true;
}

bool BDRingBuffer::GetNameAndSerialNum(QString &name, QString &serial)
bool BDRingBuffer::GetNameAndSerialNum(QString &name, QString &serialnum)
{
if (!m_bdnav)
return false;

name = m_name;
serial = m_serialNumber;
name = m_name;
serialnum = m_serialNumber;

return !serial.isEmpty();
return !serialnum.isEmpty();
}

/** \brief Get a snapshot of the current BD state
Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmythtv/avformatdecoder.cpp
Expand Up @@ -3179,9 +3179,9 @@ int get_avf_buffer_nvdec(struct AVCodecContext *c, AVFrame *pic, int flags)
}
#endif

void AvFormatDecoder::DecodeDTVCC(const uint8_t *buf, uint len, bool scte)
void AvFormatDecoder::DecodeDTVCC(const uint8_t *buf, uint buf_size, bool scte)
{
if (!len)
if (!buf_size)
return;

// closed caption data
Expand All @@ -3198,19 +3198,19 @@ void AvFormatDecoder::DecodeDTVCC(const uint8_t *buf, uint len, bool scte)
uint cc_count = buf[0] & 0x1f;
// em_data 8 1.0

if (len < 2+(3*cc_count))
if (buf_size < 2+(3*cc_count))
return;

DecodeCCx08(buf+2, cc_count*3, scte);
}

void AvFormatDecoder::DecodeCCx08(const uint8_t *buf, uint len, bool scte)
void AvFormatDecoder::DecodeCCx08(const uint8_t *buf, uint buf_size, bool scte)
{
if (len < 3)
if (buf_size < 3)
return;

bool had_608 = false, had_708 = false;
for (uint cur = 0; cur + 3 < len; cur += 3)
for (uint cur = 0; cur + 3 < buf_size; cur += 3)
{
uint cc_code = buf[cur];
bool cc_valid = cc_code & 0x04;
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/cc708window.cpp
Expand Up @@ -650,12 +650,12 @@ bool CC708CharacterAttribute::operator==(
(m_edge_color == other.m_edge_color));
}

QColor CC708CharacterAttribute::ConvertToQColor(uint c)
QColor CC708CharacterAttribute::ConvertToQColor(uint eia708color)
{
// Color is expressed in 6 bits, 2 each for red, green, and blue.
// U.S. ATSC programs seem to use just the higher-order bit,
// i.e. values 0 and 2, so the last two elements of X[] are both
// set to the maximum 255, otherwise font colors are dim.
static int X[] = {0, 96, 255, 255};
return QColor(X[(c>>4)&3], X[(c>>2)&3], X[c&3]);
return QColor(X[(eia708color>>4)&3], X[(eia708color>>2)&3], X[eia708color&3]);
}
14 changes: 7 additions & 7 deletions mythtv/libs/libmythtv/channelscan/scanmonitor.cpp
Expand Up @@ -106,23 +106,23 @@ void ScanMonitor::ScanPercentComplete(int pct)
post_event(this, ScannerEvent::SetPercentComplete, tmp);
}

void ScanMonitor::ScanAppendTextToLog(const QString &str)
void ScanMonitor::ScanAppendTextToLog(const QString &status)
{
post_event(this, ScannerEvent::AppendTextToLog, str);
post_event(this, ScannerEvent::AppendTextToLog, status);
}

void ScanMonitor::ScanUpdateStatusText(const QString &str)
void ScanMonitor::ScanUpdateStatusText(const QString &status)
{
QString msg = tr("Scanning");
if (!str.isEmpty())
msg = QString("%1 %2").arg(msg).arg(str);
if (!status.isEmpty())
msg = QString("%1 %2").arg(msg).arg(status);

post_event(this, ScannerEvent::SetStatusText, msg);
}

void ScanMonitor::ScanUpdateStatusTitleText(const QString &str)
void ScanMonitor::ScanUpdateStatusTitleText(const QString &status)
{
post_event(this, ScannerEvent::SetStatusTitleText, str);
post_event(this, ScannerEvent::SetStatusTitleText, status);
}

void ScanMonitor::ScanErrored(const QString &error)
Expand Down
14 changes: 7 additions & 7 deletions mythtv/libs/libmythtv/channelutil.cpp
Expand Up @@ -2011,8 +2011,8 @@ IPTVTuningData ChannelUtil::GetIPTVTuningData(uint chanid)
* \deprecated Use ChannelInfo::LoadChannels() instead
*/
ChannelInfoList ChannelUtil::GetChannelsInternal(
uint sourceid, bool vis_only, bool include_disconnected,
const QString &grp, uint changrpid)
uint sourceid, bool visible_only, bool include_disconnected,
const QString &group_by, uint channel_groupid)
{
ChannelInfoList list;

Expand All @@ -2039,23 +2039,23 @@ ChannelInfoList ChannelUtil::GetChannelsInternal(
}

// Select only channels from the specified channel group
if (changrpid > 0)
if (channel_groupid > 0)
{
qstr += QString("%1 channelgroup.grpid = '%2' ")
.arg(cond).arg(changrpid);
.arg(cond).arg(channel_groupid);
cond = " AND ";
}

if (vis_only)
if (visible_only)
{
qstr += QString("%1 visible=1 ").arg(cond);
cond = " AND ";
}

qstr += " GROUP BY chanid";

if (!grp.isEmpty())
qstr += QString(", %1").arg(grp);
if (!group_by.isEmpty())
qstr += QString(", %1").arg(group_by);

query.prepare(qstr);
if (!query.exec())
Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmythtv/frequencytables.cpp
Expand Up @@ -83,14 +83,14 @@ TransportScanItem::TransportScanItem(uint _sourceid,

TransportScanItem::TransportScanItem(uint sourceid,
const QString &std,
const QString &fn,
uint fnum,
const QString &strFmt,
uint freqNum,
uint freq,
const FrequencyTable &ft,
uint tuneTO)
: m_mplexid(0), m_friendlyName(fn),
m_friendlyNum(fnum), m_sourceID(sourceid),
m_timeoutTune(tuneTO)
uint timeoutTune)
: m_mplexid(0), m_friendlyName(strFmt),
m_friendlyNum(freqNum), m_sourceID(sourceid),
m_timeoutTune(timeoutTune)
{
memset(m_freqOffsets, 0, sizeof(int)*3);

Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/mpeg/atscstreamdata.cpp
Expand Up @@ -119,10 +119,10 @@ void ATSCStreamData::Reset(int desiredProgram)
AddListeningPID(ATSC_PSIP_PID);
}

void ATSCStreamData::Reset(int major, int minor)
void ATSCStreamData::Reset(int desiredMajorChannel, int desiredMinorChannel)
{
_desired_major_channel = major;
_desired_minor_channel = minor;
_desired_major_channel = desiredMajorChannel;
_desired_minor_channel = desiredMinorChannel;

MPEGStreamData::Reset(-1);
_mgt_version = -1;
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libmythtv/mpeg/freesat_huffman.cpp
Expand Up @@ -12,8 +12,9 @@ struct fsattab {

#include "freesat_tables.h"

QString freesat_huffman_to_string(const unsigned char *src, uint size)
QString freesat_huffman_to_string(const unsigned char *compressed, uint size)
{
const unsigned char *src = compressed;
struct fsattab *fsat_table;
unsigned int *fsat_index;

Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/mpeg/mpegtables.cpp
Expand Up @@ -591,10 +591,10 @@ bool ProgramMapTable::IsProgramEncrypted(void) const
*
* \param i index of stream
*/
bool ProgramMapTable::IsStreamEncrypted(uint i) const
bool ProgramMapTable::IsStreamEncrypted(uint pid) const
{
desc_list_t descs = MPEGDescriptor::ParseOnlyInclude(
StreamInfo(i), StreamInfoLength(i), DescriptorID::conditional_access);
StreamInfo(pid), StreamInfoLength(pid), DescriptorID::conditional_access);

uint encrypted = 0;
QMap<uint,uint> encryption_system;
Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmythtv/netstream.cpp
Expand Up @@ -616,35 +616,35 @@ qlonglong NetStream::GetSize() const
/**
* Synchronous interface
*/
bool NetStream::WaitTillReady(unsigned long time)
bool NetStream::WaitTillReady(unsigned long milliseconds)
{
QMutexLocker locker(&m_mutex);

QTime t; t.start();
while (m_state < kReady)
{
unsigned elapsed = t.elapsed();
if (elapsed > time)
if (elapsed > milliseconds)
return false;

m_ready.wait(&m_mutex, time - elapsed);
m_ready.wait(&m_mutex, milliseconds - elapsed);
}

return true;
}

bool NetStream::WaitTillFinished(unsigned long time)
bool NetStream::WaitTillFinished(unsigned long milliseconds)
{
QMutexLocker locker(&m_mutex);

QTime t; t.start();
while (m_state < kFinished)
{
unsigned elapsed = t.elapsed();
if (elapsed > time)
if (elapsed > milliseconds)
return false;

m_finished.wait(&m_mutex, time - elapsed);
m_finished.wait(&m_mutex, milliseconds - elapsed);
}

return true;
Expand Down

0 comments on commit 7fd1b47

Please sign in to comment.