Ticket #12996: v2-0012-Fix-unused-variable-warning-for-debug-code.patch

File v2-0012-Fix-unused-variable-warning-for-debug-code.patch, 1.1 KB (added by David Hampton <mythtv@…>, 3 years ago)

Fix 'unused variable' warning for debug code.

  • mythtv/libs/libmythtv/videoout_omx.cpp

    Fix 'unused variable' warning for debug code.
    
    The assert macro compiles differently when debugging is enabled in the
    'configure' command.  This means that the variable 'def' may or may
    not be used depending on how the build is configured. This patch uses
    the debug conditional compilation flag (the same one that assert uses)
    so that the variable only exists when debugging. This will prevent the
    compiler form complaining that it is an unused variable.
    ---
     mythtv/libs/libmythtv/videoout_omx.cpp | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/mythtv/libs/libmythtv/videoout_omx.cpp b/mythtv/libs/libmythtv/videoout_omx.cpp
    index 407347a..378ef52 100644
    a b OMX_ERRORTYPE VideoOutputOMX::UseBuffersCB() 
    13851385OMX_ERRORTYPE VideoOutputOMX::FreeBuffersCB()
    13861386{
    13871387    OMXComponent &cmpnt = m_imagefx.IsValid() ? m_imagefx : m_render;
     1388#ifndef NDEBUG
    13881389    const OMX_PARAM_PORTDEFINITIONTYPE &def = cmpnt.PortDef();
    13891390    assert(vbuffers.Size() >= def.nBufferCountActual);
     1391#endif
    13901392
    13911393    for (uint i = 0; i < vbuffers.Size(); ++i)
    13921394    {