Ticket #12996: v2-0002-Unused-parameter-fixes-for-conditionally-used-var.patch

File v2-0002-Unused-parameter-fixes-for-conditionally-used-var.patch, 4.6 KB (added by David Hampton <mythtv@…>, 7 years ago)

Fix unused parameter warnings when the variable use is conditionally compiled.

  • mythtv/libs/libmythbase/loggingserver.cpp

    Unused parameter fixes for conditionally used variable.
    
    Fix unused parameter warnings when the variable is referenced inside
    of conditionally compiled blocks. In this case the variable can't be
    removed from the function arguments so the Q_UNUSED macro is used
    inside of an '#else' block or another conditional block is added
    containing the Q_UNUSED macros.
    ---
     mythtv/libs/libmythbase/loggingserver.cpp |  2 ++
     mythtv/libs/libmythtv/cardutil.cpp        |  3 ++-
     mythtv/libs/libmythtv/playercontext.cpp   | 12 ++++++++++++
     mythtv/libs/libmythtv/privatedecoder.cpp  | 10 ++++++++++
     mythtv/libs/libmythtv/videosource.cpp     |  1 +
     mythtv/libs/libmythupnp/xsd.cpp           |  2 ++
     6 files changed, 29 insertions(+), 1 deletion(-)
    
    diff --git a/mythtv/libs/libmythbase/loggingserver.cpp b/mythtv/libs/libmythbase/loggingserver.cpp
    index 08e6888..18b52ee 100644
    a b void LogServerThread::pingClient(QString clientId) 
    942942    QByteArray clientBa = QByteArray::fromHex(clientId.toLocal8Bit());
    943943    msg << clientBa << QByteArray("");
    944944    m_zmqInSock->sendMessage(msg);
     945#else
     946    Q_UNUSED(clientId)
    945947#endif
    946948}
    947949
  • mythtv/libs/libmythtv/cardutil.cpp

    diff --git a/mythtv/libs/libmythtv/cardutil.cpp b/mythtv/libs/libmythtv/cardutil.cpp
    index 56dfd07..5b5683dd 100644
    a b bool CardUtil::SetASIMode(uint device_num, uint mode, QString *error) 
    24072407    }
    24082408    return ok;
    24092409#else
    2410     (void) device_num;
     2410    Q_UNUSED(device_num);
     2411    Q_UNUSED(mode);
    24112412    if (error)
    24122413        *error = "Not compiled with ASI support.";
    24132414    return false;
  • mythtv/libs/libmythtv/playercontext.cpp

    diff --git a/mythtv/libs/libmythtv/playercontext.cpp b/mythtv/libs/libmythtv/playercontext.cpp
    index 593a1dc..40c2bb2 100644
    a b void PlayerContext::LockPlayingInfo(const char *file, int line) const 
    585585#if 0
    586586    LOG(VB_GENERAL, LOG_DEBUG, QString("LockPlayingInfo(%1,%2)")
    587587            .arg(file).arg(line));
     588#else
     589    Q_UNUSED(file);
     590    Q_UNUSED(line);
    588591#endif
    589592    playingInfoLock.lock();
    590593}
    void PlayerContext::UnlockPlayingInfo(const char *file, int line) const 
    594597#if 0
    595598    LOG(VB_GENERAL, LOG_DEBUG, QString("UnlockPlayingInfo(%1,%2)")
    596599            .arg(file).arg(line));
     600#else
     601    Q_UNUSED(file);
     602    Q_UNUSED(line);
    597603#endif
    598604    playingInfoLock.unlock();
    599605}
    void PlayerContext::LockDeletePlayer(const char *file, int line) const 
    608614#if 0
    609615    LOG(VB_GENERAL, LOG_DEBUG, QString("LockDeletePlayer(%1,%2)")
    610616            .arg(file).arg(line));
     617#else
     618    Q_UNUSED(file);
     619    Q_UNUSED(line);
    611620#endif
    612621    deletePlayerLock.lock();
    613622}
    void PlayerContext::UnlockDeletePlayer(const char *file, int line) const 
    620629#if 0
    621630    LOG(VB_GENERAL, LOG_DEBUG, QString("UnlockDeletePlayer(%1,%2)")
    622631            .arg(file).arg(line));
     632#else
     633    Q_UNUSED(file);
     634    Q_UNUSED(line);
    623635#endif
    624636    deletePlayerLock.unlock();
    625637}
  • mythtv/libs/libmythtv/privatedecoder.cpp

    diff --git a/mythtv/libs/libmythtv/privatedecoder.cpp b/mythtv/libs/libmythtv/privatedecoder.cpp
    index 5042599..a6ced57 100644
    a b void PrivateDecoder::GetDecoders(render_opts &opts) 
    2525#ifdef USING_CRYSTALHD
    2626    PrivateDecoderCrystalHD::GetDecoders(opts);
    2727#endif
     28
     29#if !(defined(Q_OS_MACX) || USING_OPENMAX || USING_CRYSTALHD)
     30    Q_UNUSED(opts);
     31#endif
    2832}
    2933
    3034PrivateDecoder* PrivateDecoder::Create(const QString &decoder,
    PrivateDecoder* PrivateDecoder::Create(const QString &decoder, 
    5256    delete chd;
    5357#endif
    5458
     59#if !(defined(Q_OS_MACX) || USING_OPENMAX || USING_CRYSTALHD)
     60    Q_UNUSED(decoder);
     61    Q_UNUSED(flags);
     62    Q_UNUSED(avctx);
     63#endif
     64
    5565    return NULL;
    5666}
  • mythtv/libs/libmythtv/videosource.cpp

    diff --git a/mythtv/libs/libmythtv/videosource.cpp b/mythtv/libs/libmythtv/videosource.cpp
    index 31c7339..74e249b 100644
    a b void ASIConfigurationGroup::probeCard(const QString &device) 
    19781978    }
    19791979    cardinfo->setValue(tr("Valid DVEO ASI card"));
    19801980#else
     1981    Q_UNUSED(device);
    19811982    cardinfo->setValue(QString("Not compiled with ASI support"));
    19821983#endif
    19831984}
  • mythtv/libs/libmythupnp/xsd.cpp

    diff --git a/mythtv/libs/libmythupnp/xsd.cpp b/mythtv/libs/libmythupnp/xsd.cpp
    index 7c6e942..231e74c 100755
    a b bool Xsd::IsEnum( const QMetaProperty &metaProperty, const QString &sType ) 
    562562        return true;
    563563    }
    564564
     565#else
     566    Q_UNUSED(sType);
    565567#endif
    566568
    567569    return false;