Skip to content

Commit

Permalink
tidy: Remove redundant casting. (cleanup)
Browse files Browse the repository at this point in the history
Minor cleanup removing unnecessary parentheses.
  • Loading branch information
linuxdude42 committed Mar 26, 2024
1 parent c2b1ece commit 8dbf21d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions mythplugins/mythmusic/mythmusic/visualize.cpp
Expand Up @@ -1090,7 +1090,7 @@ bool Spectrogram::process(VisualNode */*node*/)
{
painter.drawText(m_scale.pixel(i) - 20, half - 220,
40, 40, Qt::AlignCenter,
QString("%1").arg((i / 12)));
QString("%1").arg(i / 12));
}
}
painter.rotate(90); // frequency in Hz draws down
Expand All @@ -1109,7 +1109,7 @@ bool Spectrogram::process(VisualNode */*node*/)
painter.drawText(half + 100, -1 * now - 40,
80, 80, Qt::AlignVCenter|Qt::AlignLeft,
QString("%1%2").arg(m_scale.note(i))
.arg((i / 12)));
.arg(i / 12));
}
prev = now;
}
Expand Down Expand Up @@ -1212,7 +1212,7 @@ bool Spectrogram::processUndisplayed(VisualNode *node)

left *= gain;
int mag = clamp(left, 255, 0);
int z = (mag * 6);
int z = mag * 6;
left > 255 ? painter.setPen(Qt::white) :
painter.setPen(qRgb(m_red[z], m_green[z], m_blue[z]));
if (m_history)
Expand All @@ -1237,7 +1237,7 @@ bool Spectrogram::processUndisplayed(VisualNode *node)

right *= gain; // copy of above, s/left/right/g
mag = clamp(right, 255, 0);
z = (mag * 6);
z = mag * 6;
right > 255 ? painter.setPen(Qt::white) :
painter.setPen(qRgb(m_red[z], m_green[z], m_blue[z]));
if (m_history)
Expand Down
18 changes: 9 additions & 9 deletions mythtv/libs/libmythbase/test/test_logging/test_logging.cpp
Expand Up @@ -32,9 +32,9 @@ void TestLogging::test_syslogGetFacility_data (void)
#ifdef _WIN32
#elif defined(Q_OS_ANDROID)
#else
QTest::newRow("auth") << "auth" << (LOG_AUTH);
QTest::newRow("user") << "user" << (LOG_USER);
QTest::newRow("local7") << "local7" << (LOG_LOCAL7);
QTest::newRow("auth") << "auth" << LOG_AUTH;
QTest::newRow("user") << "user" << LOG_USER;
QTest::newRow("local7") << "local7" << LOG_LOCAL7;
QTest::newRow("random") << "random" << -1;
QTest::newRow("empty") << "" << -1;
#endif
Expand Down Expand Up @@ -280,20 +280,20 @@ void TestLogging::test_logPropagateCalc_data (void)
QTest::addColumn<QString>("expectedArgs");

QTest::newRow("plain") << "general"
<< 0 << (-1)
<< 0 << -1
<< false
<< "--verbose general --loglevel info";
QTest::newRow("path") << "general"
<< 0 << (-1)
<< 0 << -1
<< true
<< "--verbose general --logpath /tmp --loglevel info";
QTest::newRow("quiet") << "general"
<< 2 << (-1)
<< 2 << -1
<< false
<< "--verbose general --loglevel info --quiet --quiet";
#if !defined(_WIN32) && !defined(Q_OS_ANDROID)
QTest::newRow("syslog") << "general"
<< 0 << (LOG_DAEMON)
<< 0 << LOG_DAEMON
<< false
<< "--verbose general --loglevel info --syslog daemon";
#if CONFIG_SYSTEMD_JOURNAL
Expand All @@ -304,11 +304,11 @@ void TestLogging::test_logPropagateCalc_data (void)
#endif
#endif
QTest::newRow("muddle") << "general,schedule"
<< 2 << (LOG_LOCAL0)
<< 2 << LOG_LOCAL0
<< true
<< "--verbose general,schedule --logpath /tmp --loglevel info --quiet --quiet --syslog local0";
QTest::newRow("muddle2") << "schedule:debug,general:warn"
<< 2 << (LOG_LOCAL0)
<< 2 << LOG_LOCAL0
<< true
<< "--verbose general,schedule --logpath /tmp --loglevel info --quiet --quiet --syslog local0";
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythfreesurround/el_processor.cpp
Expand Up @@ -183,7 +183,7 @@ class fsurround_decoder::Impl {

private:
// polar <-> cartesian coodinates conversion
static cfloat polar(float a, float p) { return {(a*std::cos(p)),(a*std::sin(p))}; }
static cfloat polar(float a, float p) { return {a*std::cos(p), a*std::sin(p)}; }
static float amplitude(FFTComplex z) { return std::hypot(z.re, z.im); }
static float phase(FFTComplex z) { return std::atan2(z.im, z.re); }

Expand Down

0 comments on commit 8dbf21d

Please sign in to comment.