From 2b1a0a5c34b99582bee26e8139eea2ee48928c83 Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Thu, 6 Oct 2011 17:05:00 +0200 Subject: [PATCH] Use gcc-c++ >= 4.5 --- CMakeLists.txt | 2 +- libzypp.spec.cmake | 2 +- zypp/ProblemSolution.cc | 5 +++-- zypp/base/Easy.h | 2 +- zypp/base/ProfilingFormater.cc | 11 +++++------ zypp/parser/ProductFileReader.cc | 2 +- zypp/target/rpm/RpmHeader.cc | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4d9a68..c975716 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ include(CheckCXXCompilerFlag) CHECK_C_COMPILER_FLAG("-Werror=format-security" CC_FORMAT_SECURITY) CHECK_CXX_COMPILER_FLAG("-Werror=format-security" CXX_FORMAT_SECURITY) -SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fPIC -g -Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wl,-as-needed" ) +SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fPIC -g -Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wl,-as-needed -std=c++0x" ) SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -fPIC -g -Wall -Wl,-as-needed" ) set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3" ) diff --git a/libzypp.spec.cmake b/libzypp.spec.cmake index 603b41f..557a6d5 100644 --- a/libzypp.spec.cmake +++ b/libzypp.spec.cmake @@ -44,7 +44,7 @@ BuildRequires: hal-devel BuildRequires: boost-devel BuildRequires: dejagnu BuildRequires: doxygen -BuildRequires: gcc-c++ +BuildRequires: gcc-c++ >= 4.5 BuildRequires: gettext-devel BuildRequires: graphviz BuildRequires: libxml2-devel diff --git a/zypp/ProblemSolution.cc b/zypp/ProblemSolution.cc index cc741f3..cbaf555 100644 --- a/zypp/ProblemSolution.cc +++ b/zypp/ProblemSolution.cc @@ -96,17 +96,18 @@ ProblemSolution::apply (solver::detail::Resolver & resolver) solver::detail::SolutionAction_constPtr action = *iter; if (! action->execute (resolver)) { + WAR << "apply solution action failed: " << action << endl; ret = false; break; } } - return true; + return ret; } /** * Add an action to the actions list. - **/ + **/ void ProblemSolution::addAction (solver::detail::SolutionAction_constPtr action) { diff --git a/zypp/base/Easy.h b/zypp/base/Easy.h index 4a565ce..e1809a3 100644 --- a/zypp/base/Easy.h +++ b/zypp/base/Easy.h @@ -21,7 +21,7 @@ * } * \endcode */ -#define for_(IT,BEG,END) for ( typeof(BEG) IT = BEG, _for_end = END; IT != _for_end; ++IT ) +#define for_(IT,BEG,END) for ( auto IT = BEG, _for_end = END; IT != _for_end; ++IT ) #define for_each_(IT,CONT) for_( IT, CONT.begin(), CONT.end() ) /** Simple C-array iterator diff --git a/zypp/base/ProfilingFormater.cc b/zypp/base/ProfilingFormater.cc index 28a21ac..63fc9ac 100644 --- a/zypp/base/ProfilingFormater.cc +++ b/zypp/base/ProfilingFormater.cc @@ -37,7 +37,7 @@ namespace zypp /////////////////////////////////////////////////////////////////// // ProfilingFormater /////////////////////////////////////////////////////////////////// - + std::string ProfilingFormater::format( const std::string & group_r, logger::LogLevel level_r, const char * file_r, @@ -45,11 +45,10 @@ namespace zypp int line_r, const std::string & message_r ) { - struct timeval tp; - int rtn; - rtn = gettimeofday( &tp, NULL); - - return str::form( "%ld.%ld [%d] <%d> %s(%s):%d %s", + struct timeval tp; + gettimeofday( &tp, NULL); + + return str::form( "%ld.%ld [%d] <%d> %s(%s):%d %s", tp.tv_sec, tp.tv_usec, level_r, diff --git a/zypp/parser/ProductFileReader.cc b/zypp/parser/ProductFileReader.cc index c6d07ff..b68d4cd 100644 --- a/zypp/parser/ProductFileReader.cc +++ b/zypp/parser/ProductFileReader.cc @@ -147,7 +147,7 @@ namespace zypp ("arch", MANDTAORY, xml::parseDefAssign( _pdata._arch ) ) ("shortsummary", OPTIONAL, xml::parseDefAssign( _pdata._shortName ) ) ("summary", MULTIPLE_OPTIONAL, xml::parseDefAssign( _ttext )( "lang", _tlocale ) - >>bind( &ProductNode::doneLocalizedDefault, this, _1, ref(_pdata._summary) )) + >>bind( &ProductNode::doneLocalizedDefault, this, _1, boost::ref(_pdata._summary) )) ("productline", OPTIONAL, xml::parseDefAssign( _pdata._productline ) ) ("register", OPTIONAL) ("updaterepokey", OPTIONAL, xml::parseDefAssign( _pdata._updaterepokey ) ) diff --git a/zypp/target/rpm/RpmHeader.cc b/zypp/target/rpm/RpmHeader.cc index b83bcba..2ea29fa 100644 --- a/zypp/target/rpm/RpmHeader.cc +++ b/zypp/target/rpm/RpmHeader.cc @@ -914,9 +914,9 @@ std::list RpmHeader::tag_fileinfos() const md5sums[i], uid, gid, - filemodes[i], + mode_t(filemodes[i]), filemtimes[i], - fileflags[i] & RPMFILE_GHOST, + bool(fileflags[i] & RPMFILE_GHOST), filelinks[i] }; -- 2.7.4