Skip to content

Commit

Permalink
tidy: Fix some class member naming. (libs)
Browse files Browse the repository at this point in the history
The clang-tidy "identifier naming" checker pointed out a number of
places where class member variables don't use the convention of
starting with "m_", or static variables don't begin with "s_".  Fix
these for naming consistency across the code base.  There are also a
handful of member variables names that were converted from the
"m_lower_case" form to the "m_camelBack" form.

https://clang.llvm.org/extra/clang-tidy/checks/readability-identifier-naming.html
  • Loading branch information
linuxdude42 committed Nov 15, 2019
1 parent d49adc5 commit 5f003ea
Show file tree
Hide file tree
Showing 38 changed files with 1,031 additions and 1,031 deletions.
4 changes: 2 additions & 2 deletions mythtv/libs/libmyth/audio/audiooutput.cpp
Expand Up @@ -369,7 +369,7 @@ AudioOutput::AudioDeviceConfig* AudioOutput::GetAudioDeviceConfig(
(aosettings.canAC3() << 1) |
(aosettings.canDTS() << 2);
// cppcheck-suppress variableScope
static const char *type_names[] = { "LPCM", "AC3", "DTS" };
static const char *s_typeNames[] = { "LPCM", "AC3", "DTS" };

if (mask != 0)
{
Expand All @@ -381,7 +381,7 @@ AudioOutput::AudioDeviceConfig* AudioOutput::GetAudioDeviceConfig(
{
if (found_one)
capabilities += ", ";
capabilities += type_names[i];
capabilities += s_typeNames[i];
found_one = true;
}
}
Expand Down
10 changes: 5 additions & 5 deletions mythtv/libs/libmyth/audio/audiooutputgraph.cpp
Expand Up @@ -29,7 +29,7 @@ class AudioOutputGraph::Buffer : protected QByteArray

// Properties
void SetMaxSamples(unsigned samples) { m_maxSamples = samples; }
void SetSampleRate(unsigned sample_rate) { m_sample_rate = sample_rate; }
void SetSampleRate(unsigned sample_rate) { m_sampleRate = sample_rate; }

static inline int BitsPerChannel() { return sizeof(short) * CHAR_BIT; }
inline int Channels() const { return m_channels; }
Expand Down Expand Up @@ -136,12 +136,12 @@ class AudioOutputGraph::Buffer : protected QByteArray

inline unsigned long Samples2MS(unsigned samples) const
{
return m_sample_rate ? (samples * 1000UL + m_sample_rate - 1) / m_sample_rate : 0; // round up
return m_sampleRate ? (samples * 1000UL + m_sampleRate - 1) / m_sampleRate : 0; // round up
}

inline unsigned MS2Samples(int64_t ms) const
{
return ms > 0 ? (ms * m_sample_rate) / 1000 : 0; // NB round down
return ms > 0 ? (ms * m_sampleRate) / 1000 : 0; // NB round down
}

void Append(const void *b, unsigned long len, int bits)
Expand Down Expand Up @@ -190,13 +190,13 @@ class AudioOutputGraph::Buffer : protected QByteArray
{
m_bits = bits;
m_channels = channels;
m_sizeMax = ((m_sample_rate * kBufferMilliSecs) / 1000) * BytesPerSample();
m_sizeMax = ((m_sampleRate * kBufferMilliSecs) / 1000) * BytesPerSample();
resize(0);
}

private:
unsigned m_maxSamples {0};
unsigned m_sample_rate {44100};
unsigned m_sampleRate {44100};
unsigned long m_tcFirst {0}, m_tcNext {0};
int m_bits {0};
int m_channels {0};
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmyth/audio/audiopulsehandler.cpp
Expand Up @@ -38,8 +38,8 @@ bool PulseHandler::g_pulseHandlerActive = false;
bool PulseHandler::Suspend(enum PulseAction action)
{
// global lock around all access to our global singleton
static QMutex global_lock;
QMutexLocker locker(&global_lock);
static QMutex s_globalLock;
QMutexLocker locker(&s_globalLock);

// cleanup the PulseAudio server connection if requested
if (kPulseCleanup == action)
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmyth/audio/pink.c
Expand Up @@ -32,9 +32,9 @@
/* Calculate pseudo-random 32 bit number based on linear congruential method. */
static unsigned long generate_random_number( void )
{
static unsigned long rand_seed = 22222; /* Change this for different random sequences. */
rand_seed = (rand_seed * 196314165) + 907633515;
return rand_seed;
static unsigned long s_randSeed = 22222; /* Change this for different random sequences. */
s_randSeed = (s_randSeed * 196314165) + 907633515;
return s_randSeed;
}

/* Setup PinkNoise structure for N rows of generators. */
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmyth/audio/spdifencoder.cpp
Expand Up @@ -100,8 +100,8 @@ void SPDIFEncoder::WriteFrame(unsigned char *data, int size)
{
AVPacket packet;
av_init_packet(&packet);
static int pts = 1; // to avoid warning "Encoder did not produce proper pts"
packet.pts = pts++;
static int s_pts = 1; // to avoid warning "Encoder did not produce proper pts"
packet.pts = s_pts++;
packet.data = data;
packet.size = size;

Expand Down

0 comments on commit 5f003ea

Please sign in to comment.