5 changes: 3 additions & 2 deletions mythtv/libs/libmythbase/netutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,8 @@ bool insertInDB(RSSSite* site)
site->GetUpdated(), site->GetType());
}

bool insertInDB(const QString &name, const QString &sortname,
bool insertInDB(const QString &name,
[[maybe_unused]] const QString &sortname,
const QString &thumbnail,
const QString &description, const QString &url,
const QString &author, const bool download,
Expand All @@ -665,7 +666,7 @@ bool insertInDB(const QString &name, const QString &sortname,
"VALUES( :NAME, :THUMBNAIL, :DESCRIPTION, :URL, :AUTHOR, :DOWNLOAD, "
":UPDATED, :PODCAST, :TYPE);");
query.bindValue(":NAME", name);
Q_UNUSED(sortname); // query.bindValue(":SORTNAME", sortname);
// query.bindValue(":SORTNAME", sortname);
query.bindValue(":THUMBNAIL", thumbnail);
query.bindValue(":DESCRIPTION", description);
query.bindValue(":URL", url);
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythbase/referencecounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ void ReferenceCounter::PrintDebug(void)
void ReferenceCounter::PrintDebug(void) {}
#endif

ReferenceCounter::ReferenceCounter(const QString &debugName, bool logDebug) :
ReferenceCounter::ReferenceCounter([[maybe_unused]] const QString &debugName,
bool logDebug) :
#ifdef EXTRA_DEBUG
m_debugName(debugName),
#endif
m_logDebug(logDebug)
{
(void) debugName;
#ifdef LEAK_DEBUG
QWriteLocker locker(&leakLock);
leakMap[this] = LeakInfo(debugName);
Expand Down
12 changes: 5 additions & 7 deletions mythtv/libs/libmythbase/signalhandling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ void SignalHandler::SetHandler(int signum, SigHandlerFunc handler)
s_singleton->SetHandlerPrivate(signum, handler);
}

void SignalHandler::SetHandlerPrivate(int signum, SigHandlerFunc handler)
void SignalHandler::SetHandlerPrivate([[maybe_unused]] int signum,
[[maybe_unused]] SigHandlerFunc handler)
{
#ifndef _WIN32
const char *signame = strsignal(signum);
Expand Down Expand Up @@ -180,9 +181,6 @@ void SignalHandler::SetHandlerPrivate(int signum, SigHandlerFunc handler)
}

LOG(VB_GENERAL, LOG_INFO, QString("Setup %1 handler").arg(signal_name));
#else
Q_UNUSED(signum);
Q_UNUSED(handler);
#endif
}

Expand All @@ -194,14 +192,14 @@ struct SignalInfo {
uint64_t m_value;
};

void SignalHandler::signalHandler(int signum, siginfo_t *info, void *context)
void SignalHandler::signalHandler(int signum,
[[maybe_unused]] siginfo_t *info,
[[maybe_unused]] void *context)
{
SignalInfo signalInfo {};

(void)context;
signalInfo.m_signum = signum;
#ifdef _WIN32
(void)info;
signalInfo.m_code = 0;
signalInfo.m_pid = 0;
signalInfo.m_uid = 0;
Expand Down
3 changes: 1 addition & 2 deletions mythtv/libs/libmythbase/test/test_template/test_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ void TestTemplate::example_benchmark_test(void)
{
QBENCHMARK
{
int sum = 0;
[[maybe_unused]] int sum = 0;
for (int i = 0; i < 999; i++)
sum += i;
Q_UNUSED(sum);
}
}

Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythmetadata/metadatagrabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,10 +463,10 @@ MetadataLookupList MetaGrabberScript::SearchSubtitle(const QString &title,
}

MetadataLookupList MetaGrabberScript::SearchSubtitle(const QString &inetref,
const QString &title, const QString &subtitle,
[[maybe_unused]] const QString &title,
const QString &subtitle,
MetadataLookup *lookup, bool passseas)
{
(void)title;
QStringList args;
SetDefaultArgs(args);

Expand Down
39 changes: 13 additions & 26 deletions mythtv/libs/libmythmetadata/metaio.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,9 @@ class META_PUBLIC MetaIO
* \param mdata A pointer to a MusicMetadata object
* \returns Boolean to indicate success/failure.
*/
virtual bool writeVolatileMetadata(const QString & filename, MusicMetadata* mdata)
virtual bool writeVolatileMetadata([[maybe_unused]] const QString & filename,
[[maybe_unused]] MusicMetadata* mdata)
{
// These are here so that the parameters can be documented
// with doxygen.
(void) filename;
(void) mdata;
return false;
}

Expand Down Expand Up @@ -69,42 +66,33 @@ class META_PUBLIC MetaIO
* \param filename The filename to read images from.
* \returns the list of embedded images
*/
virtual AlbumArtList getAlbumArtList(const QString &filename)
virtual AlbumArtList getAlbumArtList([[maybe_unused]] const QString &filename)
{
(void)filename;
return {};
}

virtual bool writeAlbumArt(const QString &filename,
const AlbumArtImage *albumart)
virtual bool writeAlbumArt([[maybe_unused]] const QString &filename,
[[maybe_unused]] const AlbumArtImage *albumart)
{
(void)filename;
(void)albumart;
return false;
}

virtual bool removeAlbumArt(const QString &filename,
const AlbumArtImage *albumart)
virtual bool removeAlbumArt([[maybe_unused]] const QString &filename,
[[maybe_unused]] const AlbumArtImage *albumart)
{
(void)filename;
(void)albumart;
return false;
}

virtual bool changeImageType(const QString &filename,
const AlbumArtImage *albumart,
ImageType newType)
virtual bool changeImageType([[maybe_unused]] const QString &filename,
[[maybe_unused]] const AlbumArtImage *albumart,
[[maybe_unused]] ImageType newType)
{
(void)filename;
(void)albumart;
(void)newType;
return false;
}

virtual QImage *getAlbumArt(const QString &filename, ImageType type)
virtual QImage *getAlbumArt([[maybe_unused]] const QString &filename,
[[maybe_unused]] ImageType type)
{
(void)filename;
(void)type;
return nullptr;
}

Expand Down Expand Up @@ -133,9 +121,8 @@ class META_PUBLIC MetaIO

void readFromFilename(MusicMetadata *metadata);

virtual bool TagExists(const QString &filename)
virtual bool TagExists([[maybe_unused]] const QString &filename)
{
(void)filename;
return false;
}

Expand Down
13 changes: 4 additions & 9 deletions mythtv/libs/libmythmetadata/videoscan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ namespace
m_imageExt.insert(ext.toLower());
}

DirectoryHandler *newDir(const QString &dir_name,
const QString &fq_dir_name) override // DirectoryHandler
DirectoryHandler *newDir([[maybe_unused]] const QString &dir_name,
[[maybe_unused]] const QString &fq_dir_name) override // DirectoryHandler
{
(void) dir_name;
(void) fq_dir_name;
return this;
}

void handleFile(const QString &file_name,
void handleFile([[maybe_unused]] const QString &file_name,
const QString &fq_file_name,
const QString &extension,
const QString &host) override // DirectoryHandler
Expand All @@ -59,7 +57,6 @@ namespace
LOG(VB_GENERAL, LOG_DEBUG,
QString("handleFile: %1 :: %2").arg(fq_file_name).arg(host));
#endif
(void) file_name;
if (m_imageExt.find(extension.toLower()) == m_imageExt.end())
{
m_videoFiles[fq_file_name].check = false;
Expand Down Expand Up @@ -229,10 +226,8 @@ void VideoScannerThread::run()


void VideoScannerThread::removeOrphans(unsigned int id,
const QString &filename)
[[maybe_unused]] const QString &filename)
{
(void) filename;

// TODO: use single DB connection for all calls
if (m_removeAll)
m_dbMetadata->purgeByID(id);
Expand Down
6 changes: 2 additions & 4 deletions mythtv/libs/libmythprotoserver/mythsocketmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ class PROTOSERVER_PUBLIC MythSocketManager : public QObject, public MythSocketCB

void readyRead(MythSocket *socket) override; // MythSocketCBs
void connectionClosed(MythSocket *socket) override; // MythSocketCBs
void connectionFailed(MythSocket *socket) override // MythSocketCBs
{ (void)socket; }
void connected(MythSocket *socket) override // MythSocketCBs
{ (void)socket; }
void connectionFailed([[maybe_unused]] MythSocket *socket) override {}; // MythSocketCBs
void connected([[maybe_unused]] MythSocket *socket) override {}; // MythSocketCBs

void SetThreadCount(uint count);

Expand Down
6 changes: 3 additions & 3 deletions mythtv/libs/libmythui/devices/lirc_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,10 @@ static void lirc_parse_string(const struct lirc_state *state, char *s,const char
*t=0;
}

static void lirc_parse_include(char *s,const char *name,int line)
static void lirc_parse_include(char *s,
[[maybe_unused]] const char *name,
[[maybe_unused]] int line)
{
(void)name;
(void)line;
size_t len=strlen(s);
if(len<2)
{
Expand Down
11 changes: 3 additions & 8 deletions mythtv/libs/libmythui/devices/mythinputdevicehandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,8 @@ void MythInputDeviceHandler::Start(void)
#endif
}

void MythInputDeviceHandler::Stop(bool Finishing /* = true */)
void MythInputDeviceHandler::Stop([[maybe_unused]] bool Finishing /* = true */)
{
Q_UNUSED(Finishing) // depending on #ifdefs
LOG(VB_GENERAL, LOG_INFO, LOC + "Stopping");

#ifdef USING_LIBCEC
Expand Down Expand Up @@ -177,12 +176,10 @@ void MythInputDeviceHandler::Event(QEvent *Event) const
#endif
}

void MythInputDeviceHandler::Action(const QString &Action)
void MythInputDeviceHandler::Action([[maybe_unused]] const QString &Action)
{
#ifdef USING_LIBCEC
m_cecAdapter.Action(Action);
#else
(void) Action;
#endif
}

Expand All @@ -208,10 +205,8 @@ void MythInputDeviceHandler::MainWindowReady(void)
#endif
}

void MythInputDeviceHandler::customEvent(QEvent* Event)
void MythInputDeviceHandler::customEvent([[maybe_unused]] QEvent* Event)
{
Q_UNUSED(Event) // depending on #ifdefs

if (m_ignoreKeys)
return;

Expand Down
4 changes: 1 addition & 3 deletions mythtv/libs/libmythui/mythdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
/*! \brief Create a MythDisplay object appropriate for the current platform.
* \note This function always returns a valid MythDisplay object.
*/
MythDisplay* MythDisplay::Create(MythMainWindow* MainWindow)
MythDisplay* MythDisplay::Create([[maybe_unused]] MythMainWindow* MainWindow)
{
MythDisplay* result = nullptr;
#ifdef USING_X11
Expand Down Expand Up @@ -111,8 +111,6 @@ MythDisplay* MythDisplay::Create(MythMainWindow* MainWindow)
}
#endif
}
#else
(void)MainWindow;
#endif
#ifdef USING_MMAL
if (!result)
Expand Down
5 changes: 2 additions & 3 deletions mythtv/libs/libmythui/mythhdr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ bool MythHDRMetadata::Equals(MythHDRMetadata* Other)
m_displayPrimaries[2][1] == Other->m_displayPrimaries[2][1];
}

MythHDRPtr MythHDR::Create(MythDisplay* MDisplay, const MythHDRDesc& Desc)
MythHDRPtr MythHDR::Create([[maybe_unused]] MythDisplay* MDisplay,
const MythHDRDesc& Desc)
{
MythHDRPtr result = nullptr;

Expand All @@ -35,8 +36,6 @@ MythHDRPtr MythHDR::Create(MythDisplay* MDisplay, const MythHDRDesc& Desc)
{
#if defined (USING_DRM) && defined (USING_QTPRIVATEHEADERS)
result = MythDRMHDR::Create(MDisplay, Desc);
#else
(void)MDisplay;
#endif
}

Expand Down
6 changes: 0 additions & 6 deletions mythtv/libs/libmythui/mythpainter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,6 @@ void MythPainter::DrawEllipse(const QRect area, const QBrush &fillBrush,
}
}

void MythPainter::PushTransformation(const UIEffects &zoom, QPointF center)
{
(void)zoom;
(void)center;
}

void MythPainter::DrawTextPriv(MythImage *im, const QString &msg, int flags,
const QRect r, const MythFontProperties &font)
{
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libmythui/mythpainter.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ class MUI_PUBLIC MythPainter : public QObject
virtual void DrawEllipse(QRect area, const QBrush &fillBrush,
const QPen &linePen, int alpha);

virtual void PushTransformation(const UIEffects &zoom, QPointF center = QPointF());
virtual void PushTransformation([[maybe_unused]] const UIEffects &zoom,
[[maybe_unused]] QPointF center = QPointF()) {};
virtual void PopTransformation(void) { }

/// Returns a blank reference counted image in the format required
Expand Down
7 changes: 2 additions & 5 deletions mythtv/libs/libmythui/mythscreensaver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
* use the MythMainWindow object here (or in any MythScreenSaver constructor) as
* it is not complete. Instead listen for the MythMainWindow::signalWindowReady signal.
*/
MythScreenSaverControl::MythScreenSaverControl(MythMainWindow* MainWin, MythDisplay* mDisplay)
MythScreenSaverControl::MythScreenSaverControl([[maybe_unused]] MythMainWindow* MainWin,
[[maybe_unused]] MythDisplay* mDisplay)
{
#if defined(USING_DBUS)
m_screenSavers.push_back(new MythScreenSaverDBus(this));
Expand All @@ -59,14 +60,10 @@ MythScreenSaverControl::MythScreenSaverControl(MythMainWindow* MainWin, MythDisp
MythScreenSaverDRM* drmsaver = MythScreenSaverDRM::Create(this, mDisplay);
if (drmsaver)
m_screenSavers.push_back(drmsaver);
#else
(void)mDisplay;
#endif
#ifdef USING_WAYLANDEXTRAS
if (QGuiApplication::platformName().toLower().contains("wayland"))
m_screenSavers.push_back(new MythScreenSaverWayland(this, MainWin));
#else
(void)MainWin;
#endif

for (auto * screensaver : m_screenSavers)
Expand Down
4 changes: 2 additions & 2 deletions mythtv/libs/libmythui/mythuiguidegrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,12 +677,12 @@ QPoint MythUIGuideGrid::GetRowAndColumn(QPoint position)
return {-1,-1};
}

void MythUIGuideGrid::SetProgramInfo(int row, int col, const QRect area,
void MythUIGuideGrid::SetProgramInfo(int row,
[[maybe_unused]] int col, const QRect area,
const QString &title, const QString &genre,
int arrow, int recType, int recStat,
bool selected)
{
(void)col;
auto *data = new UIGTCon(area, title, genre, arrow, recType, recStat);
m_allData[row].append(data);

Expand Down
6 changes: 1 addition & 5 deletions mythtv/libs/libmythui/opengl/mythegl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,11 @@ bool MythEGL::InitEGL(void)
return true;

LOG(VB_GENERAL, LOG_ERR, LOC + "Failed to resolve EGL functions");
#else
(void)m_context;
#endif
return false;
}

bool MythEGL::HasEGLExtension(QString Extension)
bool MythEGL::HasEGLExtension([[maybe_unused]] QString Extension)
{
#ifdef USING_EGL
OpenGLLocker locker(m_context);
Expand All @@ -71,8 +69,6 @@ bool MythEGL::HasEGLExtension(QString Extension)
QByteArray extensions = QByteArray(eglQueryString(m_eglDisplay, EGL_EXTENSIONS));
return extensions.contains(Extension.data()->toLatin1());
}
#else
(void)Extension;
#endif
return false;
}
Expand Down
10 changes: 4 additions & 6 deletions mythtv/libs/libmythui/platforms/drm/mythdrmframebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,21 @@
/*! \class MythDRMFramebuffer
* \brief A simple object representing a DRM Framebuffer object.
*/
DRMFb MythDRMFramebuffer::Create(int FD, uint32_t Id)
DRMFb MythDRMFramebuffer::Create([[maybe_unused]] int FD,
[[maybe_unused]] uint32_t Id)
{
/*
Currently disabled as drmModeGetFB2 is not available on older systems and
this functionality is not currently an absolute requirement
if (auto fb = std::shared_ptr<MythDRMFramebuffer>(new MythDRMFramebuffer(FD, Id)); fb.get() && fb->m_id)
return fb;
*/
(void)FD;
(void)Id;
return nullptr;
}

MythDRMFramebuffer::MythDRMFramebuffer(int FD, uint32_t Id)
MythDRMFramebuffer::MythDRMFramebuffer([[maybe_unused]] int FD,
[[maybe_unused]] uint32_t Id)
{
(void)FD;
(void)Id;
/*
if (auto fb = drmModeGetFB2(FD, Id); fb)
{
Expand Down
4 changes: 1 addition & 3 deletions mythtv/libs/libmythui/platforms/mythdisplaydrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ bool MythDisplayDRM::DirectRenderingAvailable()
return false;
}

MythDisplayDRM::MythDisplayDRM(MythMainWindow* MainWindow)
MythDisplayDRM::MythDisplayDRM([[maybe_unused]] MythMainWindow* MainWindow)
{
m_device = MythDRMDevice::Create(m_screen);
Initialise();
#ifdef USING_QTPRIVATEHEADERS
if (MainWindow && m_device && m_device->GetVideoPlane())
connect(MainWindow, &MythMainWindow::SignalWindowReady, this, &MythDisplayDRM::MainWindowReady);
#else
(void)MainWindow;
#endif
}

Expand Down
5 changes: 2 additions & 3 deletions mythtv/libs/libmythui/platforms/mythdrmdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ void MythDRMDevice::SetupDRM(const MythCommandLineParser& CmdLine)
/*! \brief Create a MythDRMDevice instance.
* \returns A valid instance or nullptr on error.
*/
MythDRMPtr MythDRMDevice::Create(QScreen *qScreen, const QString &Device, bool NeedPlanes)
MythDRMPtr MythDRMDevice::Create(QScreen *qScreen, const QString &Device,
[[maybe_unused]] bool NeedPlanes)
{
#ifdef USING_QTPRIVATEHEADERS
auto * app = dynamic_cast<QGuiApplication *>(QCoreApplication::instance());
Expand Down Expand Up @@ -363,8 +364,6 @@ MythDRMPtr MythDRMDevice::Create(QScreen *qScreen, const QString &Device, bool N
#ifdef USING_QTPRIVATEHEADERS
if (auto result = std::shared_ptr<MythDRMDevice>(new MythDRMDevice(Device, NeedPlanes)); result && result->m_valid)
return result;
#else
(void)NeedPlanes;
#endif
return nullptr;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ void TestMythGenericTree::test_state(void)
QCOMPARE(QString("tres"), node.GetState("three"));
}

static QString test_cb_fn(const QString &name, void *data)
static QString test_cb_fn(const QString &name, [[maybe_unused]] void *data)
{
Q_UNUSED(data);
if (name == QStringLiteral("key2"))
return QStringLiteral("beta");
if (name == QStringLiteral("key3"))
Expand Down
5 changes: 3 additions & 2 deletions mythtv/libs/libmythupnp/serializers/jsonSerializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ class UPNP_PUBLIC JSONSerializer : public Serializer

public:

JSONSerializer( QIODevice *pDevice, const QString &sRequestName )
: m_stream( pDevice ) { Q_UNUSED(sRequestName) }
JSONSerializer( QIODevice *pDevice,
[[maybe_unused]] const QString &sRequestName )
: m_stream( pDevice ) {};
virtual ~JSONSerializer() = default;

QString GetContentType() override; // Serializer
Expand Down