Skip to content

Commit

Permalink
tidy: Ignore macros containing control flow statements.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxdude42 committed Jul 10, 2022
1 parent cc913be commit bbfefd8
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions mythtv/libs/libmythservicecontracts/service.h
Expand Up @@ -81,6 +81,7 @@ inline Service::Service(QObject *parent) : QObject(parent)
//
//////////////////////////////////////////////////////////////////////////////

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define SCRIPT_CATCH_EXCEPTION( default, code ) \
try \
{ \
Expand Down Expand Up @@ -108,6 +109,7 @@ inline Service::Service(QObject *parent) : QObject(parent)
// first parameter.
//////////////////////////////////////////////////////////////////////////////

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define Q_SCRIPT_DECLARE_QMETAOBJECT_MYTHTV(T, _Arg1) \
template<> inline QScriptValue qscriptQMetaObjectConstructor<T>(QScriptContext *ctx, QScriptEngine *eng, T *) /* NOLINT(bugprone-macro-parentheses) */ \
{ \
Expand Down
3 changes: 2 additions & 1 deletion mythtv/libs/libmythtv/decoders/mythvdpauhelper.cpp
Expand Up @@ -13,7 +13,7 @@
VdpStatus status; \
bool ok = true;

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
// NOLINTBEGIN(cppcoreguidelines-macro-usage)
#define CHECK_ST \
ok &= (status == VDP_STATUS_OK); \
if (!ok) \
Expand All @@ -25,6 +25,7 @@ if (!ok) \

#define GET_PROC(FUNC_ID, PROC) \
status = m_vdpGetProcAddress(m_device, FUNC_ID, reinterpret_cast<void **>(&(PROC))); CHECK_ST
// NOLINTEND(cppcoreguidelines-macro-usage)

VDPAUCodec::VDPAUCodec(MythCodecContext::CodecProfile Profile, QSize Size, uint32_t Macroblocks, uint32_t Level)
: m_maxSize(Size),
Expand Down
2 changes: 2 additions & 0 deletions mythtv/libs/libmythtv/dtvconfparser.cpp
Expand Up @@ -40,6 +40,7 @@
#include "dtvconfparser.h"
#include "channelutil.h"

// NOLINTBEGIN(cppcoreguidelines-macro-usage)
#define PARSE_SKIP(VAR) do { \
if (it == tokens.end()) return false; \
++it; } while(false)
Expand All @@ -58,6 +59,7 @@
#define PARSE_UINT_1000(VAR) do { \
if (it != tokens.end()) \
(VAR) = (*it++).toUInt() * 1000ULL; else return false; } while(false)
// NOLINTEND(cppcoreguidelines-macro-usage)


QString DTVChannelInfo::toString() const
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/inputinfo.cpp
Expand Up @@ -9,6 +9,7 @@ void InputInfo::Clear(void)
*this = blank;
}

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define NEXT() do { ++it; if (it == end) return false; } while (false)
bool InputInfo::FromStringList(QStringList::const_iterator &it,
const QStringList::const_iterator& end)
Expand Down
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/mpeg/mpegstreamdata.cpp
Expand Up @@ -854,6 +854,7 @@ void MPEGStreamData::UpdateTimeOffset(uint64_t _si_utc_time)

}

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define DONE_WITH_PSIP_PACKET() { delete psip; \
if (morePSIPTables) goto HAS_ANOTHER_PSIP; else return; }

Expand Down

0 comments on commit bbfefd8

Please sign in to comment.