Commit d3e80d87 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Merge branch 'master' into dev/split-services

* master:
  Fixed gcc 4.6 warning: operation XYZ may be undefined (-Wsequence-point)
  Fixed Eclipse CDT Analyzer warnin
  Fixed gcc 4.6 warning: cast to pointer from integer of different size
  Fixed gcc 4.6 warning (-Wunused-but-set-variable)
  Fixed the problem with undefined size_t in GaudiKernel/Map.h
  Disable deprecation warnings on gcc 4.6.
  fixed CRLF

Conflicts:
	GaudiKernel/doc/release.notes
	GaudiPolicy/doc/release.notes

From: Marco Clemencic <marco.clemencic@cern.ch>


git-svn-id: svn+ssh://svn.cern.ch/reps/gaudi/Gaudi/branches/GAUDI/GAUDI_newpack@6720 53ecefc3-a64d-0410-9bdf-b8581fa3287e
parents 8e9f86fb f5dcdc64
Package GaudiExamples
Package manager : Marco Clemencic
! 2011-11-22 - Marco Clemencic
- Fixed gcc 4.6 warning (-Wunused-but-set-variable).
It was already present with ICC, but disabled.
============================ GaudiExamples v22r5 =============================
============================ GaudiExamples v22r4 =============================
! 2011-09-02 - Marco Clemencic
......
// $Id: TestTool.cpp,v 1.2 2006/01/10 19:58:26 hmd Exp $
// Include files
// from Gaudi
......@@ -8,11 +7,6 @@
// local
#include "TestTool.h"
#ifdef __ICC
// disable icc remark #593: variable "X" was set but never used
#pragma warning(disable:593)
#endif
//-----------------------------------------------------------------------------
// Implementation file for class : TestTool
//
......@@ -43,7 +37,7 @@ StatusCode TestTool::initialize()
if ( !GaudiTool::initialize() ) return StatusCode::FAILURE;
// setup tool registry
IAlgTool * mytool;
//IAlgTool * mytool;
for ( ToolList::iterator it = m_tools.begin();
it != m_tools.end(); ++it ) {
std::string name = (*it);
......@@ -54,7 +48,7 @@ StatusCode TestTool::initialize()
name = (*it).substr( slash+1 );
}
debug() << "Loading tool " << name << " of type " << type << endmsg;
mytool = tool<IAlgTool>( type, name );
/* mytool = */ tool<IAlgTool>( type, name );
}
return StatusCode::SUCCESS;
......
// $Id: TestToolAlg.cpp,v 1.2 2006/01/10 19:58:26 hmd Exp $
// Include files
// from Gaudi
#include "GaudiKernel/AlgFactory.h"
#include "GaudiKernel/MsgStream.h"
#ifdef __ICC
// disable icc remark #593: variable "X" was set but never used
#pragma warning(disable:593)
#endif
// local
#include "TestToolAlg.h"
......@@ -48,7 +42,7 @@ StatusCode TestToolAlg::initialize() {
if ( !GaudiAlgorithm::initialize() ) return StatusCode::FAILURE;
// setup tool registry
IAlgTool * mytool;
//IAlgTool * mytool;
for ( ToolList::iterator it = m_tools.begin();
it != m_tools.end(); ++it ) {
std::string name = (*it);
......@@ -59,7 +53,7 @@ StatusCode TestToolAlg::initialize() {
name = (*it).substr( slash+1 );
}
debug() << "Loading tool " << name << " of type " << type << endmsg;
mytool = tool<IAlgTool>( type, name );
/*mytool = */tool<IAlgTool>( type, name );
}
return StatusCode::SUCCESS;
......
// $Id: TestToolAlgFailure.cpp,v 1.1 2008/10/22 14:49:17 marcocle Exp $
// Include files
// from Gaudi
#include "GaudiKernel/AlgFactory.h"
#include "GaudiKernel/MsgStream.h"
#ifdef __ICC
// disable icc remark #593: variable "X" was set but never used
#pragma warning(disable:593)
#endif
// local
#include "TestToolAlgFailure.h"
......@@ -49,12 +43,12 @@ StatusCode TestToolAlgFailure::initialize() {
if ( !GaudiAlgorithm::initialize() ) return StatusCode::FAILURE;
// setup tool registry
IAlgTool * mytool;
//IAlgTool * mytool;
for ( ToolList::iterator it = m_tools.begin();
it != m_tools.end(); ++it ) {
info() << "Loading tool " << *it << endmsg;
try {
mytool = tool<IAlgTool>( *it );
/* mytool = */ tool<IAlgTool>( *it );
info() << "Tool loaded successfully" << endmsg;
} catch (GaudiException &e) {
if ( m_ignoreFailure ) {
......
// $Id: Map.h,v 1.6 2007/12/19 15:42:56 marcocle Exp $
// ============================================================================
// CVS tag $Name: $, version $Revision: 1.6 $
// ============================================================================
#ifndef GAUDIKERNEL_MAP_H
#define GAUDIKERNEL_MAP_H 1
// ============================================================================
// Include files
// ============================================================================
// STD & STL
// STD & STL
// ============================================================================
#include <map>
// ============================================================================
......@@ -15,69 +11,69 @@
// ============================================================================
#include "GaudiKernel/MapBase.h"
// ============================================================================
namespace GaudiUtils
namespace GaudiUtils
{
// ==========================================================================
/** @class Map GaudiKernel/Map.h
*
* Extension of the STL map.
* Extension of the STL map.
* Provides const accessors and can be extended by inheritance.
* @see std::map
* Note: in order to make it possible to use either a map or a hash_map,
* Note: in order to make it possible to use either a map or a hash_map,
* reverse iterators are not defined.
*
* Due to helper base class Gaudi::Utils::MapBase, this class
* is "python-friendly", and one can perform all python
* manipulaitons
* Due to helper base class Gaudi::Utils::MapBase, this class
* is "python-friendly", and one can perform all python
* manipulaitons
* in intuitive way:
* @code
*
* >>> m = ... ## get the map
* >>> print m ## print the map a'la python class dict
* ...
* @code
*
* >>> m = ... ## get the map
* >>> print m ## print the map a'la python class dict
* ...
* >>> for key in m : print key, m[key] ## iteration over the map
* ...
* >>> for key,value in m.iteritems() : print key, value
* >>> for key,value in m.iteritems() : print key, value
* ...
* >>> keys = m.keys() ## get the list of keys
* >>> values = m.values () ## get the list of values
* >> items = m.items () ## get the list of items
* >>> keys = m.keys() ## get the list of keys
* >>> values = m.values () ## get the list of values
* >> items = m.items () ## get the list of items
*
* >>> if 'one' in m ## check the presence of the key in map
*
*
* >>> v = m.get(key', None) ## return m[key] for existing key, else None
*
* >>> del m[key] ## erase the key form the map
* >>> del m[key] ## erase the key form the map
*
* >>> value m[key] ## unchecked access through the key
* ...
* >>> m.update( key, value ) ## update/insert key/value pair
*
* @endcode
*
* @attention The syntax can be drastically simplified, if one
* redefines the __setitem__ attribute:
* >>> m.update( key, value ) ## update/insert key/value pair
*
* @endcode
*
* @code
*
* >>> type(m).__setitem__ = Gaudi.Utils.MapBase.__setitem__
* @attention The syntax can be drastically simplified, if one
* redefines the __setitem__ attribute:
*
* @code
*
* >>> type(m).__setitem__ = Gaudi.Utils.MapBase.__setitem__
*
* >>> m[key] = value ## much more intuitive semantics for key insertion
*
* @endcode
* In a similar way <c>__getitem__</c> and <c>__delitem__</c> methods
* @endcode
* In a similar way <c>__getitem__</c> and <c>__delitem__</c> methods
* can be redefined.
* @attention
* @attention
* To avoid the unnesessary expansion of dictionaries
* it is recommended to exclude from dictionary the following methods:
* - lower_bound
* - upper_bound
* - equal_range
* - insert
* @warning This action is required for <c>HashMap</c> to avodi the
* - lower_bound
* - upper_bound
* - equal_range
* - insert
* @warning This action is required for <c>HashMap</c> to avodi the
* compilation problems
*
* @see Gaudi::Utils::MapBase
*
* @see Gaudi::Utils::MapBase
*
* @author Marco Clemencic
* @date 2005-10-06
......@@ -91,195 +87,195 @@ namespace GaudiUtils
typedef M map_type;
typedef K key_type;
typedef T mapped_type;
// -- from unary_function
typedef K argument_type;
typedef T result_type;
typedef std::pair<const K,T> value_type;
typedef typename map_type::size_type size_type;
typedef typename map_type::iterator iterator;
typedef typename map_type::const_iterator const_iterator;
// typedef typename map_type::reverse_iterator reverse_iterator;
// typedef typename map_type::const_reverse_iterator const_reverse_iterator;
// ========================================================================
// ========================================================================
protected:
// ========================================================================
map_type m_map;
static const result_type s_null_value;
// ========================================================================
// ========================================================================
public:
// ---- Constructors
/// Standard constructor
Map(): m_map() {}
/// Constructor from a standard map
Map(const map_type& other): m_map(other) {}
// /// Copy Constructor
// Map(const Map& other): m_map(other.m_map) {}
/// Construct from a subset.
template <typename In>
Map(In first, In last): m_map(first,last) {}
/// Virtual destructor. You can inherit from this map type.
virtual ~Map() {}
// ---- std::map interface
// -- iterators
inline iterator begin() { return m_map.begin(); }
inline iterator end() { return m_map.end(); }
inline const_iterator begin() const { return m_map.begin(); }
inline const_iterator end() const { return m_map.end(); }
// inline reverse_iterator rbegin() { return m_map.rbegin(); }
// inline reverse_iterator rend() { return m_map.rend(); }
// inline const_reverse_iterator rbegin() const { return m_map.rbegin(); }
// inline const_reverse_iterator rend() const { return m_map.rend(); }
// -- subscription
inline mapped_type &operator[] (const key_type &key) { return m_map[key]; }
// -- map operations
inline iterator find(const key_type &key) { return m_map.find(key); }
inline const_iterator find(const key_type &key) const { return m_map.find(key); }
inline size_type count(const key_type &key) const { return m_map.count(key); }
inline iterator lower_bound(const key_type &key) { return m_map.lower_bound(key); }
inline const_iterator lower_bound(const key_type &key) const { return m_map.lower_bound(key); }
inline iterator upper_bound(const key_type &key) { return m_map.upper_bound(key); }
inline iterator upper_bound(const key_type &key) { return m_map.upper_bound(key); }
inline const_iterator upper_bound(const key_type &key) const { return m_map.upper_bound(key); }
inline std::pair<iterator,iterator> equal_range(const key_type &key)
{ return m_map.equal_range(key); }
inline std::pair<const_iterator,const_iterator> equal_range(const key_type &key) const
{ return m_map.equal_range(key); }
// -- list operations
inline std::pair<iterator,bool> insert(const value_type &val) { return m_map.insert(val); }
inline std::pair<iterator,bool> insert
( const key_type & key ,
( const key_type & key ,
const mapped_type & val ) { return insert ( value_type ( key , val ) ) ; }
template <typename In>
inline void insert(In first, In last) { m_map.insert(first,last); }
inline iterator insert( iterator /* pos */ , const value_type &val)
inline iterator insert( iterator /* pos */ , const value_type &val)
{ return m_map.insert( /* pos, */ val ).first ; }
inline void erase(iterator pos) { m_map.erase(pos); }
inline size_type erase(const key_type &key) { return m_map.erase(key); }
inline void erase(iterator first, iterator last) { m_map.erase(first,last); }
inline void clear() { m_map.clear(); }
// -- container operations
inline size_type size() const { return m_map.size(); }
inline size_type max_size() const { return m_map.max_size(); }
inline bool empty() const { return size() == 0; }
inline void swap(map_type& other) { m_map.swap(other); }
// ---- extra functionalities
/** Allow to use Map as an unary function.
* There is no automatic extension of the map for missing keys!
*
* @attention The behaviour is different from std::map
* @attention The behaviour is different from std::map
*
* @code
* @code
*
* const GaudiUtils::Map<KEY,VALUE> m = ... ;
*
* // OK:
*
* // OK:
* KEY key = ... ;
* std::cout << " Value: " << m(key) << std::end ; // it is OK!
*
* std::cout << " Value: " << m(key) << std::end ; // it is OK!
*
* // ERROR:
* VALUE value = ... ;
* m(key) = value ; // ERROR!
*
* @endcode
* @param key the key
* @return the mapped value(const reference!) for the existing key,
* and the default value overwise
* @endcode
* @param key the key
* @return the mapped value(const reference!) for the existing key,
* and the default value overwise
*/
inline const result_type &operator() ( const argument_type &key ) const
{
// static const result_type s_null_value;
const_iterator it = m_map.find(key);
if ( it != m_map.end() ) { return it->second ; }
/// return the default value
return s_null_value; // return the default value
if ( it != m_map.end() ) { return it->second ; }
/// return the default value
return s_null_value; // return the default value
}
// ========================================================================
/** Access elements of a const Map.
* There is no automatic extension of the map for missing keys!
* There is no automatic extension of the map for missing keys!
*
* @attention The behaviour is different from std::map
* @attention The behaviour is different from std::map
*
* @code
* @code
*
* const GaudiUtils::Map<KEY,VALUE> m = ... ;
*
* // OK:
*
* // OK:
* KEY key = ... ;
* std::cout << " Value: " << m[key] << std::end ; // it is OK!
*
* std::cout << " Value: " << m[key] << std::end ; // it is OK!
*
* // ERROR:
* VALUE value = ... ;
* m[key] = value ; // ERROR!
*
* @endcode
* @param key the key
* @return the mapped value(const reference!) for the existing key,
* and the default value overwise
* @endcode
* @param key the key
* @return the mapped value(const reference!) for the existing key,
* and the default value overwise
*/
inline const mapped_type &operator[] ( const key_type &key ) const
{ return (*this)(key); }
// ========================================================================
/** checked access to the map
* @exception std::out_of_range for missing keys
* @exception std::out_of_range for missing keys
* @param key (INPUT) the key
* @return the value for the existing key
* @return the value for the existing key
*/
inline const result_type & at ( const argument_type &key ) const
{
const_iterator it = m_map.find ( key ) ;
if ( it == m_map.end() ) { this->throw_out_of_range_exception () ; }
return it->second ;
return it->second ;
}
// ========================================================================
/// Merge two maps.
inline Map& merge ( const map_type& other )
inline Map& merge ( const map_type& other )
{
for ( typename map_type::const_iterator it = other.begin() ;
for ( typename map_type::const_iterator it = other.begin() ;
other.end() != it ; ++it ) { (*this)[it->first] = it->second ; }
return *this;
}
/// Merge two maps.
inline Map& merge ( const Map& other )
inline Map& merge ( const Map& other )
{
for ( const_iterator it = other.begin() ;
for ( const_iterator it = other.begin() ;
other.end() != it ; ++it ) { (*this)[it->first] = it->second ; }
return *this;
}
/// Merge two maps.
template <class K1,class K2, class K3>
inline Map& merge ( const Map<K1,K2,K3>& other )
inline Map& merge ( const Map<K1,K2,K3>& other )
{
for ( typename Map<K1,K2,K3>::const_iterator it = other.begin() ;
for ( typename Map<K1,K2,K3>::const_iterator it = other.begin() ;
other.end() != it ; ++it ) { (*this)[it->first] = it->second ; }
return *this;
}
// update the key
void update
void update
( const key_type& key ,
const mapped_type& mapped ) { (*this)[ key ] = mapped ; }
// ========================================================================
......@@ -291,27 +287,27 @@ namespace GaudiUtils
// ========================================================================
public:
// ========================================================================
/** useful method for python decoration:
* @param index (INPUT) the index
* @return the key at given index
* @exception std::out_of_range for invalid index
/** useful method for python decoration:
* @param index (INPUT) the index
* @return the key at given index
* @exception std::out_of_range for invalid index
*/
const key_type& key_at ( const size_t index ) const
const key_type& key_at ( const size_type index ) const
{
if ( index >= size() )
if ( index >= size() )
{ this->throw_out_of_range_exception () ; }
const_iterator it = this->begin() ;
std::advance ( it , index ) ;
return it -> first ;
}
/** useful method for python decoration:
* @param index (INPUT) the index
* @return the value at given index
* @exception std::out_of_range for invalid index
/** useful method for python decoration:
* @param index (INPUT) the index
* @return the value at given index
* @exception std::out_of_range for invalid index
*/
const mapped_type& value_at ( const size_t index ) const
const mapped_type& value_at ( const size_type index ) const
{
if ( index >= size() )
if ( index >= size() )
{ this->throw_out_of_range_exception () ; }
const_iterator it = this->begin() ;
std::advance ( it , index ) ;
......@@ -327,7 +323,7 @@ namespace GaudiUtils
// ============================================================================
// ============================================================================
// The END
// The END
// ============================================================================
#endif // GAUDIKERNEL_MAP_H
// ============================================================================
......@@ -610,6 +610,7 @@ inline void StreamBuffer::swapToBuffer(const void* source, int siz) {
::_swab (src, buff, siz);
#endif
src = buff;
/* no break */
case NOSWAP:
memcpy(tar, src, siz);
break;
......
Package : GaudiKernel
Package manager : Marco Clemencic
! 2011-11-22 - Marco Clemencic
- Fixed gcc 4.6 warning: cast to pointer from integer of different size
(-Wint-to-pointer-cast)
- Fixed Eclipse CDT Analyzer warning.
! 2011-11-16 - Marco Clemencic
- Fixed the problem with undefined size_t in GaudiKernel/Map.h
! 2011-11-01 - Marco Clemencic
- Moved core services out of GaudiSvc and into the new packages GaudiCoreSvc
and GaudiCommonSvc. (patch #1816)
......
......@@ -404,7 +404,8 @@ System::ProcessDescriptor::ProcessHandle::ProcessHandle(long pid) {
m_handle = ::OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ,FALSE,
pid);
#else
m_handle = (void*)s_myPid;
// Note: the return type of getpid is pid_t, which is int on 64bit machines too
m_handle = reinterpret_cast<void*>(static_cast<long>(s_myPid));
#endif
m_needRelease = true;
return;
......
Package: GaudiMonitor
Package manager : Marco Clemencic
! 2011-11-22 - Marco Clemencic
- Fixed gcc 4.6 warning: operation XYZ may be undefined
(-Wsequence-point)
============================= GaudiMonitor v2r9 ==============================
! 2011-06-23 - Hubert Degaudenzi
- fixed warnings from the eclipse code analysis engine.
......
......@@ -226,7 +226,7 @@ void ApMon::updateSysInfo() {
logger(WARNING, perr.what());
sysRetResults[SYS_CPU_USAGE] = sysRetResults[SYS_CPU_SYS] =
sysRetResults[SYS_CPU_USR] = sysRetResults[SYS_CPU_NICE] =
sysRetResults[SYS_CPU_IDLE] = sysRetResults[SYS_CPU_USAGE] = PROCUTILS_ERROR;
sysRetResults[SYS_CPU_IDLE] = PROCUTILS_ERROR;
} catch (runtime_error &err) {
/* temporary error (next time we might be able to get the paramerers) */
logger(WARNING, err.what());
......@@ -234,7 +234,6 @@ void ApMon::updateSysInfo() {
= sysRetResults[SYS_CPU_USR]
= sysRetResults[SYS_CPU_NICE]
= sysRetResults[SYS_CPU_IDLE]
= sysRetResults[SYS_CPU_USAGE]
= RET_ERROR;
}
}
......
......@@ -750,7 +750,8 @@ macro_append cppflags "" \
# FIXME: (MCl) Temporary work-around until gccxml understands unordered_map
macro_append cppflags "" \
no-hide-warnings "" \
target-gcc43 " -Wno-deprecated"
target-gcc43 " -Wno-deprecated" \
target-gcc46 " -Wno-deprecated"
# FIXME: (MCl)
macro_append cppflags "" \
no-hide-warnings "" \
......