Skip to content

Commit

Permalink
tidy: Change literal suffixes to uppercase. (libmythtv)
Browse files Browse the repository at this point in the history
The clang-tidy "uppercase literal" readability checker pointed out a
few places where lowercase literals had crept into the code.  Change
these to uppercase for readability.

https://clang.llvm.org/extra/clang-tidy/checks/readability-uppercase-literal-suffix.html
  • Loading branch information
linuxdude42 committed Nov 23, 2019
1 parent 6842bf2 commit 1eb530d
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 69 deletions.
12 changes: 6 additions & 6 deletions mythtv/libs/libmythtv/decoders/avformatdecoder.cpp
Expand Up @@ -2403,13 +2403,13 @@ int AvFormatDecoder::ScanStreams(bool novideo)
if (tvformat == "ntsc" || tvformat == "ntsc-jp" ||
tvformat == "pal-m" || tvformat == "atsc")
{
m_fps = 29.97f;
m_parent->SetVideoParams(-1, -1, 29.97, 1.0f, false, 16);
m_fps = 29.97F;
m_parent->SetVideoParams(-1, -1, 29.97, 1.0F, false, 16);
}
else
{
m_fps = 25.0;
m_parent->SetVideoParams(-1, -1, 25.0, 1.0f, false, 16);
m_fps = 25.0F;
m_parent->SetVideoParams(-1, -1, 25.0, 1.0F, false, 16);
}
}

Expand Down Expand Up @@ -3067,7 +3067,7 @@ void AvFormatDecoder::MpegPreProcessPkt(AVStream *stream, AVPacket *pkt)

// some hardware decoders (e.g. VAAPI MPEG2) will reset when the aspect
// ratio changes
bool forceaspectchange = !qFuzzyCompare(m_current_aspect + 10.0f, aspect + 10.0f) &&
bool forceaspectchange = !qFuzzyCompare(m_current_aspect + 10.0F, aspect + 10.0F) &&
m_mythcodecctx && m_mythcodecctx->DecoderWillResetOnAspect();

m_current_aspect = aspect;
Expand Down Expand Up @@ -3179,7 +3179,7 @@ int AvFormatDecoder::H264PreProcessPkt(AVStream *stream, AVPacket *pkt)
bool res_changed = ((width != m_current_width) || (height != m_current_height));
bool fps_changed = (seqFPS > 0.0) && ((seqFPS > static_cast<double>(m_fps) + 0.01) ||
(seqFPS < static_cast<double>(m_fps) - 0.01));
bool forcechange = !qFuzzyCompare(aspect + 10.0f, m_current_aspect) &&
bool forcechange = !qFuzzyCompare(aspect + 10.0F, m_current_aspect) &&
m_mythcodecctx && m_mythcodecctx->DecoderWillResetOnAspect();
m_current_aspect = aspect;

Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/mythplayer.cpp
Expand Up @@ -654,7 +654,7 @@ void MythPlayer::SetVideoParams(int width, int height, double fps,
{
paramsChanged = true;
video_dim = video_disp_dim = QSize(width, height);
video_aspect = aspect > 0.0f ? aspect : static_cast<float>(width) / height;
video_aspect = aspect > 0.0F ? aspect : static_cast<float>(width) / height;
}

if (!qIsNaN(fps) && fps > 0.0 && fps < 121.0)
Expand Down Expand Up @@ -731,7 +731,7 @@ void MythPlayer::OpenDummy(void)
if (!videoOutput)
{
SetKeyframeDistance(15);
SetVideoParams(720, 576, 25.00, 1.25f, false, 2);
SetVideoParams(720, 576, 25.00, 1.25F, false, 2);
}

player_ctx->LockPlayingInfo(__FILE__, __LINE__);
Expand Down Expand Up @@ -1936,7 +1936,7 @@ void MythPlayer::AVSync2(VideoFrame *buffer)
int64_t audio_adjustment = 0;
int64_t unow = 0;
int64_t lateness = 0;
int64_t playspeed1000 = static_cast<int64_t>(1000.0f / play_speed);
int64_t playspeed1000 = static_cast<int64_t>(1000.0F / play_speed);
bool reset = false;

while (framedue == 0)
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/mythvideoout.cpp
Expand Up @@ -483,7 +483,7 @@ QRect MythVideoOutput::GetVisibleOSDBounds(float &VisibleAspect,
float ova = m_window.GetOverridenVideoAspect();
QRect vr = m_window.GetVideoRect();
float vs = vr.height() ? static_cast<float>(vr.width()) / vr.height() : 1.0F;
VisibleAspect = ThemeAspect * (ova > 0.0f ? vs / ova : 1.F) * dispPixelAdj;
VisibleAspect = ThemeAspect * (ova > 0.0F ? vs / ova : 1.F) * dispPixelAdj;

FontScaling = 1.0F;
return { QPoint(0,0), dvr.size() };
Expand Down Expand Up @@ -965,7 +965,7 @@ void MythVideoOutput::ResizeForVideo(int Width, int Height)
return;
}

float rate = m_dbDisplayProfile ? m_dbDisplayProfile->GetOutput() : 0.0f;
float rate = m_dbDisplayProfile ? m_dbDisplayProfile->GetOutput() : 0.0F;
if (m_displayRes && m_displayRes->SwitchToVideo(Width, Height, static_cast<double>(rate)))
{
// Switching to custom display resolution succeeded
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/opengl/mythopenglvideo.cpp
Expand Up @@ -106,7 +106,7 @@ void MythOpenGLVideo::UpdateColourSpace(bool PrimariesChanged)
}

float colourgamma = m_videoColourSpace->GetColourGamma();
float displaygamma = 1.0f / m_videoColourSpace->GetDisplayGamma();
float displaygamma = 1.0F / m_videoColourSpace->GetDisplayGamma();
QMatrix4x4 primary = m_videoColourSpace->GetPrimaryMatrix();
for (int i = Progressive; i < ShaderCount; ++i)
{
Expand All @@ -127,9 +127,9 @@ void MythOpenGLVideo::UpdateShaderParameters(void)

OpenGLLocker locker(m_render);
bool rect = m_textureTarget == QOpenGLTexture::TargetRectangle;
GLfloat lineheight = rect ? 1.0f : 1.0f / m_inputTextureSize.height();
GLfloat lineheight = rect ? 1.0F : 1.0F / m_inputTextureSize.height();
GLfloat maxheight = rect ? m_videoDispDim.height() : m_videoDispDim.height() / static_cast<GLfloat>(m_inputTextureSize.height());
GLfloat fieldsize = rect ? 0.5f : m_inputTextureSize.height() / 2.0f;
GLfloat fieldsize = rect ? 0.5F : m_inputTextureSize.height() / 2.0F;
QVector4D parameters(lineheight, /* lineheight */
static_cast<GLfloat>(m_inputTextureSize.width()), /* 'Y' select */
maxheight - lineheight, /* maxheight */
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/opengl/mythvideooutopengl.cpp
Expand Up @@ -103,7 +103,7 @@ MythVideoOutputOpenGL::MythVideoOutputOpenGL(QString Profile)
m_newCodecId(kCodec_NONE),
m_newVideoDim(),
m_newVideoDispDim(),
m_newAspect(0.0f),
m_newAspect(0.0F),
m_buffersCreated(false),
m_openGLPerf(nullptr)
{
Expand Down Expand Up @@ -442,7 +442,7 @@ void MythVideoOutputOpenGL::ProcessFrame(VideoFrame *Frame, OSD */*osd*/,
m_newCodecId = kCodec_NONE;
m_newVideoDim = QSize();
m_newVideoDispDim = QSize();
m_newAspect = 0.0f;
m_newAspect = 0.0F;

if (wasembedding && ok)
EmbedInWidget(oldrect);
Expand Down Expand Up @@ -840,7 +840,7 @@ void MythVideoOutputOpenGL::ShowPIP(VideoFrame*, MythPlayer *PiPPlayer, PIPLocat
const QSize pipvideodim = PiPPlayer->GetVideoBufferSize();
QRect pipvideorect = QRect(QPoint(0, 0), pipvideodim);

if ((PiPPlayer->GetVideoAspect() <= 0.0f) || !pipimage || !pipimage->buf ||
if ((PiPPlayer->GetVideoAspect() <= 0.0F) || !pipimage || !pipimage->buf ||
(pipimage->codec != FMT_YV12) || !PiPPlayer->IsPIPVisible())
{
PiPPlayer->ReleaseCurrentFrame(pipimage);
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/opengl/mythvideotexture.cpp
Expand Up @@ -576,7 +576,7 @@ MythVideoTexture* MythVideoTexture::CreateHelperTexture(MythRenderOpenGL *Contex

for (int i = 0; i < width; i++)
{
float x = (i + 0.5f) / static_cast<float>(width);
float x = (i + 0.5F) / static_cast<float>(width);
StoreBicubicWeights(x, ref);
ref += 4;
}
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/videobuffers.cpp
Expand Up @@ -983,7 +983,7 @@ QString VideoBuffers::GetStatus(uint Num) const
unsigned long long x = to_bitmap(m_decode, count);
for (uint i = 0; i < Num; i++)
{
unsigned long long mask = 1Ull << i;
unsigned long long mask = 1ULL << i;
QString tmp("");
if (a & mask)
tmp += (x & mask) ? "a" : "A";
Expand Down
32 changes: 16 additions & 16 deletions mythtv/libs/libmythtv/videocolourspace.cpp
Expand Up @@ -14,13 +14,13 @@ extern "C" {
#include <cmath>

const VideoColourSpace::ColourPrimaries VideoColourSpace::BT709 =
{{{0.640f, 0.330f}, {0.300f, 0.600f}, {0.150f, 0.060f}}, {0.3127f, 0.3290f}};
{{{0.640F, 0.330F}, {0.300F, 0.600F}, {0.150F, 0.060F}}, {0.3127F, 0.3290F}};
const VideoColourSpace::ColourPrimaries VideoColourSpace::BT610_525 =
{{{0.640f, 0.340f}, {0.310f, 0.595f}, {0.155f, 0.070f}}, {0.3127f, 0.3290f}};
{{{0.640F, 0.340F}, {0.310F, 0.595F}, {0.155F, 0.070F}}, {0.3127F, 0.3290F}};
const VideoColourSpace::ColourPrimaries VideoColourSpace::BT610_625 =
{{{0.640f, 0.330f}, {0.290f, 0.600f}, {0.150f, 0.060f}}, {0.3127f, 0.3290f}};
{{{0.640F, 0.330F}, {0.290F, 0.600F}, {0.150F, 0.060F}}, {0.3127F, 0.3290F}};
const VideoColourSpace::ColourPrimaries VideoColourSpace::BT2020 =
{{{0.708f, 0.292f}, {0.170f, 0.797f}, {0.131f, 0.046f}}, {0.3127f, 0.3290f}};
{{{0.708F, 0.292F}, {0.170F, 0.797F}, {0.131F, 0.046F}}, {0.3127F, 0.3290F}};

#define LOC QString("ColourSpace: ")

Expand Down Expand Up @@ -72,10 +72,10 @@ VideoColourSpace::VideoColourSpace(VideoColourSpace *Parent)
m_primariesMode(PrimariesAuto),
m_colourPrimaries(AVCOL_PRI_BT709),
m_displayPrimaries(AVCOL_PRI_BT709),
m_colourGamma(2.2f),
m_displayGamma(2.2f),
m_colourGamma(2.2F),
m_displayGamma(2.2F),
m_primaryMatrix(),
m_customDisplayGamma(2.2f),
m_customDisplayGamma(2.2F),
m_customDisplayPrimaries(nullptr),
m_parent(Parent)
{
Expand Down Expand Up @@ -269,7 +269,7 @@ void VideoColourSpace::Update(void)
// Works for NVDEC and VAAPI. VideoToolBox untested.
if ((m_colourSpaceDepth > 8) && !m_colourShifted)
{
float scaler = 65535.0f / ((1 << m_colourSpaceDepth) -1);
float scaler = 65535.0F / ((1 << m_colourSpaceDepth) -1);
scale(scaler);
}
static_cast<QMatrix4x4*>(this)->operator = (this->transposed());
Expand Down Expand Up @@ -413,7 +413,7 @@ void VideoColourSpace::SetContrast(int Value)

void VideoColourSpace::SetHue(int Value)
{
m_hue = Value * -3.6f;
m_hue = Value * -3.6F;
Update();
}

Expand All @@ -425,7 +425,7 @@ void VideoColourSpace::SetSaturation(int Value)

void VideoColourSpace::SetAlpha(int Value)
{
m_alpha = 100.0f / Value;
m_alpha = 100.0F / Value;
Update();
}

Expand Down Expand Up @@ -505,7 +505,7 @@ QMatrix4x4 VideoColourSpace::GetPrimaryConversion(int Source, int Dest)
// and destination. Most people will not notice the difference bt709 and bt610 etc
// and we avoid extra GPU processing.
// BT2020 is currently the main target - which is easily differentiated by its gamma.
if ((m_primariesMode == PrimariesAuto) && qFuzzyCompare(m_colourGamma + 1.0f, m_displayGamma + 1.0f))
if ((m_primariesMode == PrimariesAuto) && qFuzzyCompare(m_colourGamma + 1.0F, m_displayGamma + 1.0F))
return result;

// N.B. Custom primaries are not yet implemented but will, some day soon,
Expand All @@ -522,14 +522,14 @@ QMatrix4x4 VideoColourSpace::GetPrimaryConversion(int Source, int Dest)
void VideoColourSpace::GetPrimaries(int Primary, ColourPrimaries &Out, float &Gamma)
{
AVColorPrimaries primary = static_cast<AVColorPrimaries>(Primary);
Gamma = 2.2f;
Gamma = 2.2F;
switch (primary)
{
case AVCOL_PRI_BT470BG:
case AVCOL_PRI_BT470M: Out = BT610_625; return;
case AVCOL_PRI_SMPTE170M:
case AVCOL_PRI_SMPTE240M: Out = BT610_525; return;
case AVCOL_PRI_BT2020: Out = BT2020; Gamma = 2.4f; return;
case AVCOL_PRI_BT2020: Out = BT2020; Gamma = 2.4F; return;
default: Out = BT709; return;
}
}
Expand All @@ -552,7 +552,7 @@ inline float CalcGy(const float p[3][2], const float w[2], const float By)

inline float CalcRy(const float By, const float Gy)
{
return 1.0f - Gy - By;
return 1.0F - Gy - By;
}

/*! \brief Create a conversion matrix for RGB to XYZ with the given primaries
Expand All @@ -578,7 +578,7 @@ QMatrix4x4 VideoColourSpace::RGBtoXYZ(ColourPrimaries Primaries)
temp[2][0] = Ry / Primaries.primaries[0][1] * (1- Primaries.primaries[0][0] - Primaries.primaries[0][1]);
temp[2][1] = Gy / Primaries.primaries[1][1] * (1- Primaries.primaries[1][0] - Primaries.primaries[1][1]);
temp[2][2] = By / Primaries.primaries[2][1] * (1- Primaries.primaries[2][0] - Primaries.primaries[2][1]);
temp[0][3] = temp[1][3] = temp[2][3] = temp[3][0] = temp[3][1] = temp[3][2] = 0.0f;
temp[3][3] = 1.0f;
temp[0][3] = temp[1][3] = temp[2][3] = temp[3][0] = temp[3][1] = temp[3][2] = 0.0F;
temp[3][3] = 1.0F;
return QMatrix4x4(temp[0]);
}
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/videodisplayprofile.cpp
Expand Up @@ -395,7 +395,7 @@ void VideoDisplayProfile::SetInput(const QSize &Size, float Framerate, const QSt
m_lastSize = Size;
change = true;
}
if (Framerate > 0.0F && !qFuzzyCompare(Framerate + 1.0f, m_lastRate + 1.0f))
if (Framerate > 0.0F && !qFuzzyCompare(Framerate + 1.0F, m_lastRate + 1.0F))
{
m_lastRate = Framerate;
change = true;
Expand All @@ -412,7 +412,7 @@ void VideoDisplayProfile::SetInput(const QSize &Size, float Framerate, const QSt
void VideoDisplayProfile::SetOutput(float Framerate)
{
QMutexLocker locker(&m_lock);
if (!qFuzzyCompare(Framerate + 1.0f, m_lastRate + 1.0f))
if (!qFuzzyCompare(Framerate + 1.0F, m_lastRate + 1.0F))
{
m_lastRate = Framerate;
LoadBestPreferences(m_lastSize, m_lastRate, m_lastCodecName);
Expand Down
20 changes: 10 additions & 10 deletions mythtv/libs/libmythtv/videooutwindow.cpp
Expand Up @@ -193,7 +193,7 @@ void VideoOutWindow::Rotate(void)
m_manualHorizScale = m_manualVertScale;
m_manualVertScale = temp;
m_manualMove = QPoint(m_manualMove.y(), m_manualMove.x());
m_displayAspect = 1.0f / m_displayAspect;
m_displayAspect = 1.0F / m_displayAspect;

m_displayVisibleRect = QRect(QPoint(m_displayVisibleRect.top(), m_displayVisibleRect.left()),
QSize(m_displayVisibleRect.height(), m_displayVisibleRect.width()));
Expand Down Expand Up @@ -566,7 +566,7 @@ void VideoOutWindow::InputChanged(const QSize &VideoDim, const QSize &VideoDispD
QSize newvideodispdim = Fix1088(VideoDispDim);

if (!((VideoDim == m_videoDim) && (newvideodispdim == m_videoDispDim) &&
qFuzzyCompare(Aspect + 100.0f, m_videoAspect + 100.0f)))
qFuzzyCompare(Aspect + 100.0F, m_videoAspect + 100.0F)))
{
m_videoDispDim = newvideodispdim;
m_videoDim = VideoDim;
Expand Down Expand Up @@ -636,8 +636,8 @@ void VideoOutWindow::SetVideoScalingAllowed(bool Change)
m_dbScalingAllowed = false;
}

if (!(qFuzzyCompare(oldvert + 100.0f, m_dbVertScale + 100.0f) &&
qFuzzyCompare(oldhoriz + 100.0f, m_dbHorizScale + 100.0f)))
if (!(qFuzzyCompare(oldvert + 100.0F, m_dbVertScale + 100.0F) &&
qFuzzyCompare(oldhoriz + 100.0F, m_dbHorizScale + 100.0F)))
{
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("Over/underscan. V: %1, H: %2")
.arg(static_cast<double>(m_dbVertScale)).arg(static_cast<double>(m_dbHorizScale)));
Expand All @@ -647,7 +647,7 @@ void VideoOutWindow::SetVideoScalingAllowed(bool Change)

void VideoOutWindow::SetDisplayProperties(QSize DisplayDim, float DisplayAspect)
{
if (DisplayDim != m_displayDimensions || !qFuzzyCompare(DisplayAspect + 10.0f, m_displayAspect + 10.0f))
if (DisplayDim != m_displayDimensions || !qFuzzyCompare(DisplayAspect + 10.0F, m_displayAspect + 10.0F))
{
LOG(VB_GENERAL, LOG_INFO, LOC + QString("New display properties: %1mmx%2mm Aspect %3")
.arg(DisplayDim.width()).arg(DisplayDim.height())
Expand Down Expand Up @@ -925,7 +925,7 @@ void VideoOutWindow::Zoom(ZoomDirection Direction)
float oldhorizscale = m_manualHorizScale;
QPoint oldmove = m_manualMove;

const float zf = 0.02f;
const float zf = 0.02F;
if (kZoomHome == Direction)
{
m_manualVertScale = 1.0F;
Expand Down Expand Up @@ -1000,8 +1000,8 @@ void VideoOutWindow::Zoom(ZoomDirection Direction)
m_manualVertScale = snap(m_manualVertScale, 1.0F, zf / 2);
m_manualHorizScale = snap(m_manualHorizScale, 1.0F, zf / 2);

if (!((oldmove == m_manualMove) && qFuzzyCompare(m_manualVertScale + 100.0f, oldvertscale + 100.0f) &&
qFuzzyCompare(m_manualHorizScale + 100.0f, oldhorizscale + 100.0f)))
if (!((oldmove == m_manualMove) && qFuzzyCompare(m_manualVertScale + 100.0F, oldvertscale + 100.0F) &&
qFuzzyCompare(m_manualHorizScale + 100.0F, oldhorizscale + 100.0F)))
{
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("New zoom: Offset %1x%2 HScale %3 VScale %4")
.arg(m_manualMove.x()).arg(m_manualMove.y())
Expand Down Expand Up @@ -1037,8 +1037,8 @@ void VideoOutWindow::ToggleMoveBottomLine(void)
m_bottomLine = true;
}

if (!((oldmove == m_manualMove) && qFuzzyCompare(m_manualVertScale + 100.0f, oldvertscale + 100.0f) &&
qFuzzyCompare(m_manualHorizScale + 100.0f, oldhorizscale + 100.0f)))
if (!((oldmove == m_manualMove) && qFuzzyCompare(m_manualVertScale + 100.0F, oldvertscale + 100.0F) &&
qFuzzyCompare(m_manualHorizScale + 100.0F, oldhorizscale + 100.0F)))
{
LOG(VB_PLAYBACK, LOG_INFO, LOC + QString("New custom zoom: Offset %1x%2 HScale %3 VScale %4")
.arg(m_manualMove.x()).arg(m_manualMove.y())
Expand Down

0 comments on commit 1eb530d

Please sign in to comment.