Commit f327e891 authored by Zhao Zhili's avatar Zhao Zhili Committed by Hugo Beauzée-Luyssen

Fix compilation error

Until C++17, a function could not return a tuple using
list-initialization.

g++ (Debian 6.3.0-18) has no problem with -std=c++11.
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.11) failed with:

../src/filesystem/common/CommonDevice.cpp:85:30: error: converting to ‘std::tuple<bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >’ from initializer list would use explicit constructor ‘constexpr std::tuple<_T1, _T2>::tuple(_U1&&, _U2&&) [with _U1 = bool; _U2 = const std::__cxx11::basic_string<char>&; <template-parameter-2-3> = void; _T1 = bool; _T2 = std::__cxx11::basic_string<char>]’
             return { true, m };
Fix #54Signed-off-by: 's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent a0fe6317
Pipeline #3787 passed with stages
in 10 minutes and 8 seconds
......@@ -82,9 +82,9 @@ CommonDevice::matchesMountpoint( const std::string& mrl ) const
for ( const auto& m : m_mountpoints )
{
if ( mrl.find( m ) == 0 )
return { true, m };
return std::make_tuple( true, m );
}
return { false, "" };
return std::make_tuple( false, "" );
}
std::string CommonDevice::relativeMrl( const std::string& absoluteMrl ) const
......
......@@ -517,11 +517,11 @@ std::tuple<bool, bool> MetadataAnalyzer::refreshFile( IItem& item ) const
{
LOG_WARN( "Failed to find playlist associated to modified playlist file ",
item.mrl() );
return { false, false };
return std::make_tuple( false, false );
}
LOG_INFO( "Reloading playlist ", playlist->name(), " on ", item.mrl() );
Playlist::destroy( m_ml, playlist->id() );
return { true, true };
return std::make_tuple( true, true );
}
case IFile::Type::Part:
case IFile::Type::Soundtrack:
......@@ -533,7 +533,7 @@ std::tuple<bool, bool> MetadataAnalyzer::refreshFile( IItem& item ) const
LOG_WARN( "Refreshing of file type ",
static_cast<std::underlying_type<IFile::Type>::type>( file->type() ),
" is unsupported" );
return { false, false };
return std::make_tuple( false, false );
}
std::tuple<bool, bool> MetadataAnalyzer::refreshMedia( IItem& item ) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment