56 changes: 28 additions & 28 deletions mythtv/libs/libmythbase/iso639.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

using namespace std;

QMap<int, QString> _iso639_key_to_english_name;
static QMap<int, int> _iso639_key2_to_key3;
static QMap<int, int> _iso639_key3_to_canonical_key3;
static QStringList _languages;
static vector<int> _language_keys;
QMap<int, QString> iso639_key_to_english_name;
static QMap<int, int> s_iso639_key2_to_key3;
static QMap<int, int> s_iso639_key3_to_canonical_key3;
static QStringList s_languages;
static vector<int> s_language_keys;

/* Note: this file takes a long time to compile. **/

Expand All @@ -23,8 +23,8 @@ static int createCodeToCanonicalCodeMap(QMap<int, int>& canonical);

void iso639_clear_language_list(void)
{
_languages.clear();
_language_keys.clear();
s_languages.clear();
s_language_keys.clear();
}

/** \fn QStringList iso639_get_language_list(void)
Expand All @@ -34,44 +34,44 @@ void iso639_clear_language_list(void)
*/
QStringList iso639_get_language_list(void)
{
if (_languages.empty())
if (s_languages.empty())
{
for (uint i = 0; true; i++)
{
QString q = QString("ISO639Language%1").arg(i);
QString lang = gCoreContext->GetSetting(q, "").toLower();
if (lang.isEmpty())
break;
_languages << lang;
s_languages << lang;
}
if (_languages.empty())
if (s_languages.empty())
{
QString s3 = iso639_str2_to_str3(
gCoreContext->GetLanguage().toLower());
if (!s3.isEmpty())
_languages << s3;
s_languages << s3;
}
}
return _languages;
return s_languages;
}

vector<int> iso639_get_language_key_list(void)
{
if (_language_keys.empty())
if (s_language_keys.empty())
{
const QStringList list = iso639_get_language_list();
foreach (const auto & it, list)
_language_keys.push_back(iso639_str3_to_key(it));
s_language_keys.push_back(iso639_str3_to_key(it));
}
return _language_keys;
return s_language_keys;
}

QString iso639_str2_to_str3(const QString &str2)
{
int key2 = iso639_str2_to_key2(str2.toLatin1().constData());
int key3 = 0;
if (_iso639_key2_to_key3.contains(key2))
key3 = _iso639_key2_to_key3[key2];
if (s_iso639_key2_to_key3.contains(key2))
key3 = s_iso639_key2_to_key3[key2];
if (key3)
return iso639_key_to_str3(key3);
return "und";
Expand All @@ -82,8 +82,8 @@ static QString iso639_Alpha3_toName(const unsigned char *iso639_2)
int alpha3 = iso639_str3_to_key(iso639_2);
alpha3 = iso639_key_to_canonical_key(alpha3);

if (_iso639_key_to_english_name.contains(alpha3))
return _iso639_key_to_english_name[alpha3];
if (iso639_key_to_english_name.contains(alpha3))
return iso639_key_to_english_name[alpha3];

return "Unknown";
}
Expand All @@ -92,8 +92,8 @@ static QString iso639_Alpha2_toName(const unsigned char *iso639_1)
{
int alpha2 = iso639_str2_to_key2(iso639_1);

if (_iso639_key2_to_key3.contains(alpha2))
return _iso639_key_to_english_name[_iso639_key2_to_key3[alpha2]];
if (s_iso639_key2_to_key3.contains(alpha2))
return iso639_key_to_english_name[s_iso639_key2_to_key3[alpha2]];

return "Unknown";
}
Expand All @@ -110,8 +110,8 @@ QString iso639_str_toName(const unsigned char *iso639)
QString iso639_key_toName(int iso639_2)
{
QMap<int, QString>::const_iterator it;
it = _iso639_key_to_english_name.find(iso639_2);
if (it != _iso639_key_to_english_name.end())
it = iso639_key_to_english_name.find(iso639_2);
if (it != iso639_key_to_english_name.end())
return *it;

return "Unknown";
Expand All @@ -120,21 +120,21 @@ QString iso639_key_toName(int iso639_2)
int iso639_key_to_canonical_key(int iso639_2)
{
QMap<int, int>::const_iterator it;
it = _iso639_key3_to_canonical_key3.find(iso639_2);
it = s_iso639_key3_to_canonical_key3.find(iso639_2);

if (it != _iso639_key3_to_canonical_key3.end())
if (it != s_iso639_key3_to_canonical_key3.end())
return *it;
return iso639_2;
}

int dummy_createCodeToEnglishNamesMap =
createCodeToEnglishNamesMap(_iso639_key_to_english_name);
createCodeToEnglishNamesMap(iso639_key_to_english_name);

int dummy_createCode2ToCode3Map =
createCode2ToCode3Map(_iso639_key2_to_key3);
createCode2ToCode3Map(s_iso639_key2_to_key3);

int dummy_createCodeToCanonicalCodeMap =
createCodeToCanonicalCodeMap(_iso639_key3_to_canonical_key3);
createCodeToCanonicalCodeMap(s_iso639_key3_to_canonical_key3);

static int createCodeToCanonicalCodeMap(QMap<int, int>& canonical)
{
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/iso639.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class QStringList;

#include "mythbaseexp.h"

extern MBASE_PUBLIC QMap<int, QString> _iso639_key_to_english_name;
extern MBASE_PUBLIC QMap<int, QString> iso639_key_to_english_name;

/** \file iso639.h
* \brief ISO 639-1 and ISO 639-2 support functions
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythbase/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,14 +910,14 @@ void verboseInit(void)

// This looks funky, so I'll put some explanation here. The verbosedefs.h
// file gets included as part of the mythlogging.h include, and at that
// time, the normal (without _IMPLEMENT_VERBOSE defined) code case will
// define the VerboseMask enum. At this point, we force it to allow us
// to include the file again, but with _IMPLEMENT_VERBOSE set so that the
// time, the normal (without MYTH_IMPLEMENT_VERBOSE defined) code case will
// define the VerboseMask enum. At this point, we force it to allow us to
// include the file again, but with MYTH_IMPLEMENT_VERBOSE set so that the
// single definition of the VB_* values can be shared to define also the
// contents of verboseMap, via repeated calls to verboseAdd()

#undef VERBOSEDEFS_H_
#define _IMPLEMENT_VERBOSE
#define MYTH_IMPLEMENT_VERBOSE
#include "verbosedefs.h"

verboseInitialized = true;
Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmythbase/mythcdrom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ struct blockInput_t
RemoteFile* m_file;
};

static int _def_close(udfread_block_input *p_gen)
static int def_close(udfread_block_input *p_gen)
{
auto *p = (blockInput_t *)p_gen;
int result = -1;
Expand All @@ -157,14 +157,14 @@ static int _def_close(udfread_block_input *p_gen)
return result;
}

static uint32_t _def_size(udfread_block_input *p_gen)
static uint32_t def_size(udfread_block_input *p_gen)
{
auto *p = (blockInput_t *)p_gen;

return (uint32_t)(p->m_file->GetRealFileSize() / UDF_BLOCK_SIZE);
}

static int _def_read(udfread_block_input *p_gen, uint32_t lba, void *buf, uint32_t nblocks, int flags)
static int def_read(udfread_block_input *p_gen, uint32_t lba, void *buf, uint32_t nblocks, int flags)
{
(void)flags;
int result = -1;
Expand All @@ -189,9 +189,9 @@ MythCDROM::ImageType MythCDROM::inspectImage(const QString &path)
blockInput_t blockInput {};

blockInput.m_file = new RemoteFile(path); // Normally deleted via a call to udfread_close
blockInput.m_input.close = _def_close;
blockInput.m_input.read = _def_read;
blockInput.m_input.size = _def_size;
blockInput.m_input.close = def_close;
blockInput.m_input.read = def_read;
blockInput.m_input.size = def_size;

if (blockInput.m_file->isOpen())
{
Expand Down
22 changes: 11 additions & 11 deletions mythtv/libs/libmythbase/mythmiscutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,17 +737,17 @@ void myth_yield(void)
#include <asm/unistd.h>

#if defined(__i386__)
# define __NR_ioprio_set 289
# define __NR_ioprio_get 290
# define NR_ioprio_set 289
# define NR_ioprio_get 290
#elif defined(__ppc__)
# define __NR_ioprio_set 273
# define __NR_ioprio_get 274
# define NR_ioprio_set 273
# define NR_ioprio_get 274
#elif defined(__x86_64__)
# define __NR_ioprio_set 251
# define __NR_ioprio_get 252
# define NR_ioprio_set 251
# define NR_ioprio_get 252
#elif defined(__ia64__)
# define __NR_ioprio_set 1274
# define __NR_ioprio_get 1275
# define NR_ioprio_set 1274
# define NR_ioprio_get 1275
#endif

#define IOPRIO_BITS (16)
Expand All @@ -768,17 +768,17 @@ bool myth_ioprio(int val)
int new_ioprio = IOPRIO_PRIO_VALUE(new_ioclass, new_iodata);

int pid = getpid();
int old_ioprio = syscall(__NR_ioprio_get, IOPRIO_WHO_PROCESS, pid);
int old_ioprio = syscall(NR_ioprio_get, IOPRIO_WHO_PROCESS, pid);
if (old_ioprio == new_ioprio)
return true;

int ret = syscall(__NR_ioprio_set, IOPRIO_WHO_PROCESS, pid, new_ioprio);
int ret = syscall(NR_ioprio_set, IOPRIO_WHO_PROCESS, pid, new_ioprio);

if (-1 == ret && EPERM == errno && IOPRIO_CLASS_BE != new_ioclass)
{
new_iodata = (new_ioclass == IOPRIO_CLASS_RT) ? 0 : 7;
new_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, new_iodata);
ret = syscall(__NR_ioprio_set, IOPRIO_WHO_PROCESS, pid, new_ioprio);
ret = syscall(NR_ioprio_set, IOPRIO_WHO_PROCESS, pid, new_ioprio);
}

return 0 == ret;
Expand Down
14 changes: 7 additions & 7 deletions mythtv/libs/libmythbase/verbosedefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
/// This file gets included in two different ways:
/// 1) from mythlogging.h from nearly every file. This will define the
/// VerboseMask enum
/// 2) specifically (and a second include with _IMPLEMENT_VERBOSE defined) from
/// mythlogging.cpp. This is done in verboseInit (in the middle of the
/// function) as it will expand out to a series of calls to verboseAdd()
/// to fill the verboseMap.
/// 2) specifically (and a second include with MYTH_IMPLEMENT_VERBOSE defined)
/// from mythlogging.cpp. This is done in verboseInit (in the middle of the
/// function) as it will expand out to a series of calls to verboseAdd() to
/// fill the verboseMap.
///
/// The 4 fields are:
/// enum name (expected to start with VB_)
Expand All @@ -37,7 +37,7 @@
#undef LOGLEVEL_POSTAMBLE
#undef LOGLEVEL_MAP

#ifdef _IMPLEMENT_VERBOSE
#ifdef MYTH_IMPLEMENT_VERBOSE

// This is used to actually implement the mask in mythlogging.cpp
#define VERBOSE_PREAMBLE
Expand All @@ -50,7 +50,7 @@
#define LOGLEVEL_MAP(name,value,shortname) \
loglevelAdd(value,QString(#name),shortname);

#else // !defined(_IMPLEMENT_VERBOSE)
#else // !defined(MYTH_IMPLEMENT_VERBOSE)

// This is used to define the enumerated type (used by all files)

Expand Down Expand Up @@ -198,7 +198,7 @@ LOGLEVEL_MAP(LOG_DEBUG, 7, 'D')
LOGLEVEL_MAP(LOG_UNKNOWN, 8, '-')
LOGLEVEL_POSTAMBLE

#ifndef _IMPLEMENT_VERBOSE
#ifndef MYTH_IMPLEMENT_VERBOSE
#ifdef __cplusplus
struct VerboseDef {
uint64_t mask {0};
Expand Down
28 changes: 14 additions & 14 deletions mythtv/libs/libmythfreemheg/Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ bool MHEngine::Launch(const MHObjectRef &target, bool fIsSpawn)
delete pProgram;
return false;
}
if ((__mhlogoptions & MHLogScenes) && __mhlogStream != nullptr) // Print it so we know what's going on.
if ((gMHLogoptions & MHLogScenes) && gMHLogStream != nullptr) // Print it so we know what's going on.
{
pProgram->PrintMe(__mhlogStream, 0);
pProgram->PrintMe(gMHLogStream, 0);
}

// Clear the action queue of anything pending.
Expand Down Expand Up @@ -505,9 +505,9 @@ void MHEngine::TransitionToScene(const MHObjectRef &target)
SetInputRegister(CurrentScene()->m_nEventReg);
m_redrawRegion = QRegion(0, 0, CurrentScene()->m_nSceneCoordX, CurrentScene()->m_nSceneCoordY); // Redraw the whole screen

if ((__mhlogoptions & MHLogScenes) && __mhlogStream != nullptr) // Print it so we know what's going on.
if ((gMHLogoptions & MHLogScenes) && gMHLogStream != nullptr) // Print it so we know what's going on.
{
pProgram->PrintMe(__mhlogStream, 0);
pProgram->PrintMe(gMHLogStream, 0);
}

pProgram->Preparation(this);
Expand Down Expand Up @@ -621,11 +621,11 @@ void MHEngine::RunActions()
// Run it. If it fails and throws an exception catch it and continue with the next.
try
{
if ((__mhlogoptions & MHLogActions) && __mhlogStream != nullptr) // Debugging
if ((gMHLogoptions & MHLogActions) && gMHLogStream != nullptr) // Debugging
{
fprintf(__mhlogStream, "[freemheg] Action - ");
pAction->PrintMe(__mhlogStream, 0);
fflush(__mhlogStream);
fprintf(gMHLogStream, "[freemheg] Action - ");
pAction->PrintMe(gMHLogStream, 0);
fflush(gMHLogStream);
}

pAction->Perform(this);
Expand Down Expand Up @@ -1473,20 +1473,20 @@ void MHEngine::GetDefaultFontAttrs(MHOctetString &str)
const char *MHEngine::MHEGEngineProviderIdString = "MHGGNU001";

// Define the logging function and settings
int __mhlogoptions = MHLogError;
int gMHLogoptions = MHLogError;

FILE *__mhlogStream = nullptr;
FILE *gMHLogStream = nullptr;

// The MHEG engine calls this when it needs to log something.
void __mhlog(const QString& logtext)
void mhlog_fn(const QString& logtext)
{
QByteArray tmp = logtext.toLatin1();
fprintf(__mhlogStream, "[freemheg] %s\n", tmp.constData());
fprintf(gMHLogStream, "[freemheg] %s\n", tmp.constData());
}

// Called from the user of the library to set the logging.
void MHSetLogging(FILE *logStream, unsigned int logLevel)
{
__mhlogStream = logStream;
__mhlogoptions = logLevel;
gMHLogStream = logStream;
gMHLogoptions = logLevel;
}
4 changes: 2 additions & 2 deletions mythtv/libs/libmythfreemheg/Groups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ void MHGroup::Initialise(MHParseNode *p, MHEngine *engine)
catch (...)
{
MHLOG(MHLogError, "ERROR in MHGroup::Initialise ingredient");
if (pIngredient && __mhlogStream)
pIngredient->PrintMe(__mhlogStream, 0);
if (pIngredient && gMHLogStream)
pIngredient->PrintMe(gMHLogStream, 0);

delete(pIngredient);
throw;
Expand Down
14 changes: 7 additions & 7 deletions mythtv/libs/libmythfreemheg/Logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@

#define MHASSERT(f) Q_ASSERT(f)

extern int __mhlogoptions;
extern void __mhlog(const QString& logtext);
extern FILE *__mhlogStream;
extern int gMHLogoptions;
extern void mhlog_fn(const QString& logtext);
extern FILE *gMHLogStream;

#define MHLOG(__level,__text) \
do { \
if ((__level) & __mhlogoptions) \
__mhlog(__text); \
if ((__level) & gMHLogoptions) \
mhlog_fn(__text); \
} while (false)

#define MHERROR(__text) \
do { \
if (MHLogError & __mhlogoptions) \
__mhlog(__text); \
if (MHLogError & gMHLogoptions) \
mhlog_fn(__text); \
throw "Failed"; \
} while (false)

Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmythtv/AirPlay/mythraopconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ QString MythRAOPConnection::g_rsaLastError;
// anything lower than 50ms on windows, isn't reliable
#define AUDIO_BUFFER 100

class _NetStream : public QTextStream
class RaopNetStream : public QTextStream
{
public:
explicit _NetStream(QIODevice *device) : QTextStream(device)
explicit RaopNetStream(QIODevice *device) : QTextStream(device)
{
};
_NetStream &operator<<(const QString &str)
RaopNetStream &operator<<(const QString &str)
{
LOG(VB_PLAYBACK, LOG_DEBUG,
LOC + QString("Sending(%1): ").arg(str.length()) + str);
Expand Down Expand Up @@ -175,7 +175,7 @@ void MythRAOPConnection::CleanUp(void)
bool MythRAOPConnection::Init(void)
{
// connect up the request socket
m_textStream = new _NetStream(m_socket);
m_textStream = new RaopNetStream(m_socket);
m_textStream->setCodec("UTF-8");
if (!connect(m_socket, SIGNAL(readyRead()), this, SLOT(readClient())))
{
Expand Down Expand Up @@ -1420,7 +1420,7 @@ void MythRAOPConnection::ProcessRequest(const QStringList &header,
FinishResponse(m_textStream, m_socket, option, tags["CSeq"], responseData);
}

void MythRAOPConnection::FinishAuthenticationResponse(_NetStream *stream,
void MythRAOPConnection::FinishAuthenticationResponse(RaopNetStream *stream,
QTcpSocket *socket,
QString &cseq)
{
Expand All @@ -1438,7 +1438,7 @@ void MythRAOPConnection::FinishAuthenticationResponse(_NetStream *stream,
.arg(cseq).arg(socket->flush()));
}

void MythRAOPConnection::FinishResponse(_NetStream *stream, QTcpSocket *socket,
void MythRAOPConnection::FinishResponse(RaopNetStream *stream, QTcpSocket *socket,
QString &option, QString &cseq, QString &responseData)
{
if (!stream)
Expand Down
8 changes: 4 additions & 4 deletions mythtv/libs/libmythtv/AirPlay/mythraopconnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class QUdpSocket;
class QTimer;
class AudioOutput;
class ServerPool;
class _NetStream;
class RaopNetStream;

using RawHash = QHash<QString,QString>;

Expand Down Expand Up @@ -79,9 +79,9 @@ class MTV_PUBLIC MythRAOPConnection : public QObject
void ResetAudio(void);
void ProcessRequest(const QStringList &header,
const QByteArray &content);
static void FinishResponse(_NetStream *stream, QTcpSocket *socket,
static void FinishResponse(RaopNetStream *stream, QTcpSocket *socket,
QString &option, QString &cseq, QString &responseData);
void FinishAuthenticationResponse(_NetStream *stream, QTcpSocket *socket,
void FinishAuthenticationResponse(RaopNetStream *stream, QTcpSocket *socket,
QString &cseq);

static RawHash FindTags(const QStringList &lines);
Expand Down Expand Up @@ -114,7 +114,7 @@ class MTV_PUBLIC MythRAOPConnection : public QObject
QTimer *m_watchdogTimer {nullptr};
// comms socket
QTcpSocket *m_socket {nullptr};
_NetStream *m_textStream {nullptr};
RaopNetStream *m_textStream {nullptr};
QByteArray m_hardwareId;
QStringList m_incomingHeaders;
QByteArray m_incomingContent;
Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythtv/Bluray/bdringbuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static void bd_logger(const char* msg)
LOG(VB_PLAYBACK, LOG_DEBUG, QString("libbluray: %1").arg(QString(msg).trimmed()));
}

static int _img_read(void *handle, void *buf, int lba, int num_blocks)
static int img_read(void *handle, void *buf, int lba, int num_blocks)
{
int result = -1;

Expand Down Expand Up @@ -191,7 +191,7 @@ BDInfo::BDInfo(const QString &filename)
m_bdnav = bd_init();

if (m_bdnav)
bd_open_stream(m_bdnav, &imgHandle, _img_read);
bd_open_stream(m_bdnav, &imgHandle, img_read);
}
}
else
Expand Down Expand Up @@ -573,7 +573,7 @@ bool BDRingBuffer::OpenFile(const QString &lfilename, uint /*retry_ms*/)
m_bdnav = bd_init();

if (m_bdnav)
bd_open_stream(m_bdnav, &m_imgHandle, _img_read);
bd_open_stream(m_bdnav, &m_imgHandle, img_read);
}
}
else
Expand Down
14 changes: 7 additions & 7 deletions mythtv/libs/libmythtv/cc608decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,23 +854,23 @@ static void DumpPIL(int pil)
int hour = (pil >> 6 ) & 0x1F;
int min = (pil ) & 0x3F;

#define _PIL_(day, mon, hour, min) \
#define PIL_TIME(day, mon, hour, min) \
(((day) << 15) + ((mon) << 11) + ((hour) << 6) + ((min) << 0))

if (pil == _PIL_(0, 15, 31, 63))
if (pil == PIL_TIME(0, 15, 31, 63))
LOG(VB_VBI, LOG_INFO, " PDC: Timer-control (no PDC)");
else if (pil == _PIL_(0, 15, 30, 63))
else if (pil == PIL_TIME(0, 15, 30, 63))
LOG(VB_VBI, LOG_INFO, " PDC: Recording inhibit/terminate");
else if (pil == _PIL_(0, 15, 29, 63))
else if (pil == PIL_TIME(0, 15, 29, 63))
LOG(VB_VBI, LOG_INFO, " PDC: Interruption");
else if (pil == _PIL_(0, 15, 28, 63))
else if (pil == PIL_TIME(0, 15, 28, 63))
LOG(VB_VBI, LOG_INFO, " PDC: Continue");
else if (pil == _PIL_(31, 15, 31, 63))
else if (pil == PIL_TIME(31, 15, 31, 63))
LOG(VB_VBI, LOG_INFO, " PDC: No time");
else
LOG(VB_VBI, LOG_INFO, QString(" PDC: %1, 200X-%2-%3 %4:%5")
.arg(pil).arg(mon).arg(day).arg(hour).arg(min));
#undef _PIL_
#undef PIL_TIME
}

void CC608Decoder::DecodeVPS(const unsigned char *buf)
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythtv/channelscan/channelscan_sm.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class ChannelScanSM : public MPEGStreamListener,
bool ScanExistingTransports(uint sourceid, bool follow_nit);

void SetAnalog(bool is_analog);
void SetSourceID(int _SourceID) { m_sourceID = _SourceID; }
void SetSourceID(int SourceID) { m_sourceID = SourceID; }
void SetSignalTimeout(uint val) { m_signalTimeout = val; }
void SetChannelTimeout(uint val) { m_channelTimeout = val; }
void SetScanDTVTunerType(DTVTunerType t) { m_scanDTVTunerType = t; }
Expand Down
13 changes: 3 additions & 10 deletions mythtv/libs/libmythtv/mythframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ const char* format_description(VideoFrameType Type)
return "?";
}

#ifndef __MAX
# define __MAX(a, b) ( ((a) > (b)) ? (a) : (b) )
#endif
#ifndef __MIN
# define __MIN(a, b) ( ((a) < (b)) ? (a) : (b) )
#endif

#if ARCH_X86

static bool features_detected = false;
Expand Down Expand Up @@ -548,7 +541,7 @@ static void SSE_copyplane(uint8_t *dst, int dst_pitch,

for (int y = 0; y < height; y += hstep)
{
const int hblock = __MIN(hstep, height - y);
const int hblock = std::min(hstep, height - y);

/* Copy a bunch of line into our cache */
CopyFromUswc(cache, w16,
Expand Down Expand Up @@ -577,7 +570,7 @@ static void SSE_splitplanes(uint8_t *dstu, int dstu_pitch,

for (int y = 0; y < height; y += hstep)
{
const int hblock = __MIN(hstep, height - y);
const int hblock = std::min(hstep, height - y);

/* Copy a bunch of line into our cache */
CopyFromUswc(cache, w16, src, src_pitch,
Expand Down Expand Up @@ -785,7 +778,7 @@ void MythUSWCCopy::resetUSWCDetection(void)
void MythUSWCCopy::allocateCache(int width)
{
av_freep(&m_cache);
m_size = __MAX((width + 63) & ~63, 4096);
m_size = std::max((width + 63) & ~63, 4096);
m_cache = (uint8_t*)av_malloc(m_size);
}

Expand Down
16 changes: 8 additions & 8 deletions mythtv/libs/libmythtv/recorders/dvbdev/dvbci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@


// Set these to 'true' for debug output:
static bool DumpTPDUDataTransfer = false;
static bool DebugProtocol = false;
static bool _connected = false;
static bool sDumpTPDUDataTransfer = false;
static bool sDebugProtocol = false;
static bool sConnected = false;

#define dbgprotocol(a...) if (DebugProtocol) LOG(VB_DVBCAM, LOG_DEBUG, QString::asprintf(a))
#define dbgprotocol(a...) if (sDebugProtocol) LOG(VB_DVBCAM, LOG_DEBUG, QString::asprintf(a))

#define OK 0
#define TIMEOUT (-1)
Expand Down Expand Up @@ -323,7 +323,7 @@ int cTPDU::Read(int fd)

void cTPDU::Dump(bool Outgoing)
{
if (DumpTPDUDataTransfer) {
if (sDumpTPDUDataTransfer) {
#define MAX_DUMP 256
QString msg = QString("%1 ").arg(Outgoing ? "-->" : "<--");
for (int i = 0; i < m_size && i < MAX_DUMP; i++)
Expand Down Expand Up @@ -521,7 +521,7 @@ int cCiTransportConnection::CreateConnection(void)
if (SendTPDU(T_CREATE_TC) == OK) {
m_state = stCREATION;
if (RecvTPDU() == T_CTC_REPLY) {
_connected=true;
sConnected=true;
return OK;
// the following is a workaround for CAMs that don't quite follow the specs...
}
Expand All @@ -530,7 +530,7 @@ int cCiTransportConnection::CreateConnection(void)
dsyslog("CAM: retrying to establish connection");
if (RecvTPDU() == T_CTC_REPLY) {
dsyslog("CAM: connection established");
_connected=true;
sConnected=true;
return OK;
}
}
Expand Down Expand Up @@ -1852,7 +1852,7 @@ bool cLlCiHandler::Reset(int Slot)

bool cLlCiHandler::connected()
{
return _connected;
return sConnected;
}

// -- cHlCiHandler -------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythtv/visualisations/goom/mathtools.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef MATHTOOLS_H
#define MATHTOOLS_H

#define _double2fixmagic (68719476736.0*1.5)
//#define _double2fixmagic (68719476736.0*1.5)
//2^36 * 1.5, (52-_shiftamt=36) uses limited precisicion to floor
#define _shiftamt 16
//#define _shiftamt 16
//16.16 fixed point representation,

#ifdef BigEndian_
Expand Down
12 changes: 6 additions & 6 deletions mythtv/libs/libmythupnp/servicehost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "xsd.h"
//#include "services/rtti.h"

#define _MAX_PARAMS 256
static constexpr int MAX_PARAMS = 256;

//////////////////////////////////////////////////////////////////////////////
//
Expand Down Expand Up @@ -50,15 +50,15 @@ QVariant MethodInfo::Invoke( Service *pService, const QStringMap &reqParams ) co
QList<QByteArray> paramTypes = m_oMethod.parameterTypes();

// ----------------------------------------------------------------------
// Create Parameter array (Can't have more than _MAX_PARAMS parameters)....
// Create Parameter array (Can't have more than MAX_PARAMS parameters)....
// switched to static array for performance.
// ----------------------------------------------------------------------

void *param[ _MAX_PARAMS ];
int types[ _MAX_PARAMS ];
void *param[ MAX_PARAMS ];
int types[ MAX_PARAMS ];

memset( param, 0, _MAX_PARAMS * sizeof(void *));
memset( types, 0, _MAX_PARAMS * sizeof(int));
memset( param, 0, MAX_PARAMS * sizeof(void *));
memset( types, 0, MAX_PARAMS * sizeof(int));

try
{
Expand Down
4 changes: 2 additions & 2 deletions mythtv/programs/mythfrontend/globalsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3067,8 +3067,8 @@ static void ISO639_fill_selections(MythUIComboBoxSetting *widget, uint i)
lang = iso639_str2_to_str3(gCoreContext->GetLanguage().toLower());
}

QMap<int,QString>::iterator it = _iso639_key_to_english_name.begin();
QMap<int,QString>::iterator ite = _iso639_key_to_english_name.end();
QMap<int,QString>::iterator it = iso639_key_to_english_name.begin();
QMap<int,QString>::iterator ite = iso639_key_to_english_name.end();

for (; it != ite; ++it)
{
Expand Down
6 changes: 3 additions & 3 deletions mythtv/programs/mythfrontend/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void handleSIGUSR2(void);
static bool gLoaded = false;
#endif

static const QString _Location = qApp->translate("(Common)",
static const QString sLocation = qApp->translate("(Common)",
"MythFrontend");

namespace
Expand Down Expand Up @@ -1321,7 +1321,7 @@ static int internal_play_media(const QString &mrl, const QString &plot,
{
ShowNotificationError(qApp->translate("(MythFrontendMain)",
"DVD Failure"),
_Location,
sLocation,
dvd->GetLastError());
delete dvd;
delete pginfo;
Expand All @@ -1347,7 +1347,7 @@ static int internal_play_media(const QString &mrl, const QString &plot,
// ToDo: Change string to "BD Failure" after 0.28 is released
ShowNotificationError(qApp->translate("(MythFrontendMain)",
"DVD Failure"),
_Location,
sLocation,
bd.GetLastError());
delete pginfo;
return res;
Expand Down
16 changes: 8 additions & 8 deletions mythtv/programs/mythfrontend/playbackbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
#define LOC_WARN QString("PlaybackBox Warning: ")
#define LOC_ERR QString("PlaybackBox Error: ")

static const QString _Location = "Playback Box";
static const QString sLocation = "Playback Box";

static int comp_programid(const ProgramInfo *a, const ProgramInfo *b)
{
Expand Down Expand Up @@ -2715,45 +2715,45 @@ void PlaybackBox::ShowAvailabilityPopup(const ProgramInfo &pginfo)
if (pginfo.QueryIsInUse(byWho))
{
ShowNotification(tr("Recording Available\n"),
_Location, msg +
sLocation, msg +
tr("This recording is currently in "
"use by:") + "\n" + byWho);
}
else
{
ShowNotification(tr("Recording Available\n"),
_Location, msg +
sLocation, msg +
tr("This recording is currently "
"Available"));
}
break;
case asPendingDelete:
ShowNotificationError(tr("Recording Unavailable\n"),
_Location, msg +
sLocation, msg +
tr("This recording is currently being "
"deleted and is unavailable"));
break;
case asDeleted:
ShowNotificationError(tr("Recording Unavailable\n"),
_Location, msg +
sLocation, msg +
tr("This recording has been "
"deleted and is unavailable"));
break;
case asFileNotFound:
ShowNotificationError(tr("Recording Unavailable\n"),
_Location, msg +
sLocation, msg +
tr("The file for this recording can "
"not be found"));
break;
case asZeroByte:
ShowNotificationError(tr("Recording Unavailable\n"),
_Location, msg +
sLocation, msg +
tr("The file for this recording is "
"empty."));
break;
case asNotYetAvailable:
ShowNotificationError(tr("Recording Unavailable\n"),
_Location, msg +
sLocation, msg +
tr("This recording is not yet "
"available."));
}
Expand Down
10 changes: 5 additions & 5 deletions mythtv/programs/mythfrontend/videodlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
// for ImageDLFailureEvent
#include "metadataimagedownload.h"

static const QString _Location = "MythVideo";
static const QString sLocation = "MythVideo";

namespace
{
Expand Down Expand Up @@ -2148,7 +2148,7 @@ void VideoDialog::createFetchDialog(VideoMetadata *metadata)
desc = tr("Season %1, Episode %2")
.arg(metadata->GetSeason()).arg(metadata->GetEpisode());
}
MythBusyNotification n(msg, _Location, desc);
MythBusyNotification n(msg, sLocation, desc);
n.SetId(id);
n.SetParent(this);
GetNotificationCenter()->Queue(n);
Expand Down Expand Up @@ -2179,14 +2179,14 @@ void VideoDialog::dismissFetchDialog(VideoMetadata *metadata, bool ok)
}
if (ok)
{
MythCheckNotification n(msg, _Location, desc);
MythCheckNotification n(msg, sLocation, desc);
n.SetId(id);
n.SetParent(this);
GetNotificationCenter()->Queue(n);
}
else
{
MythErrorNotification n(msg, _Location, desc);
MythErrorNotification n(msg, sLocation, desc);
n.SetId(id);
n.SetParent(this);
GetNotificationCenter()->Queue(n);
Expand Down Expand Up @@ -3380,7 +3380,7 @@ void VideoDialog::customEvent(QEvent *levent)
else if (levent->type() == ImageDLFailureEvent::kEventType)
{
MythErrorNotification n(tr("Failed to retrieve image(s)"),
_Location,
sLocation,
tr("Check logs"));
GetNotificationCenter()->Queue(n);
}
Expand Down