Commit 749e8e4e authored by Marco Clemencic's avatar Marco Clemencic
Browse files

fixed some "pedantic" warnings

parent d251fc0a
Package: GaudiAlg
Package manager : Marco Clemencic
! 2012-05-03 - Marco Clemencic
- Fixed some "pedantic" warnings.
=============================== GaudiAlg v14r1 ===============================
! 2012-02-24 - Chris Jones
- Patch #5234: Fix incorrect type in GaudiAlg tuples
......
......@@ -36,7 +36,9 @@ public:
virtual void before(StandardEventType evt, INamedInterface* alg);
virtual void after(StandardEventType evt, INamedInterface* alg, const StatusCode &sc);
using Auditor::before; // avoid hiding base-class methods
virtual void before(CustomEventTypeRef evt, const std::string& name);
using Auditor::after; // avoid hiding base-class methods
virtual void after(CustomEventTypeRef evt, const std::string& name, const StatusCode &sc);
private:
......
Package GaudiExamples
Package manager : Marco Clemencic
! 2012-05-03 - Marco Clemencic
- Fixed some "pedantic" warnings.
============================ GaudiExamples v23r2 =============================
! 2012-02-24 - Sasha Mazurov
- Patch #5210: add example for IntelProfiler
......
......@@ -91,6 +91,8 @@ namespace Gaudi
return sc ;
}
using NTuple::Selector::operator(); // avoid hiding base-class methods
/// Specialized callback for NTuples
virtual bool operator() ( NTuple::Tuple* /* nt */ )
{
......
......@@ -4,6 +4,9 @@
! Purpose : Profiling and performance monitoring of Gaudi/LHCb software
!-----------------------------------------------------------------------------
! 2012-05-03 - Marco Clemencic
- Fixed some "pedantic" warnings.
============================ GaudiProfiling v1r4 =============================
! 2012-03-13 - Marco Clemencic
- Modified to compile IntelProfiler only on x86_64 and if the VTune library is
......
......@@ -104,6 +104,16 @@ static std::stack<std::pair<INamedInterface *, std::vector<unsigned long int> >
namespace {
/// Hack to avoid the warning about casting between pointer to object and function [-pedantic]
template <typename T>
inline T function_cast(void *p) {
union {
void* object;
T function;
} caster;
caster.object = p;
return caster.function;
}
class PFMon {
public:
bool loaded;
......@@ -149,21 +159,21 @@ namespace {
handle = dlopen("libpfm.so", RTLD_NOW);
if (handle) { loaded = true; } else { loaded = false; }
if (loaded) {
pfm_start = (pfm_start_t) dlsym(handle, "pfm_start");
pfm_stop = (pfm_stop_t) dlsym(handle, "pfm_stop");
pfm_self_stop = (pfm_self_stop_t) dlsym(handle, "pfm_stop"); //it's the same
pfm_restart = (pfm_restart_t) dlsym(handle, "pfm_restart");
pfm_read_pmds = (pfm_read_pmds_t) dlsym(handle, "pfm_read_pmds");
pfm_initialize = (pfm_initialize_t) dlsym(handle, "pfm_initialize");
pfm_find_full_event = (pfm_find_full_event_t) dlsym(handle, "pfm_find_full_event");
pfm_dispatch_events = (pfm_dispatch_events_t) dlsym(handle, "pfm_dispatch_events");
pfm_create_context = (pfm_create_context_t) dlsym(handle, "pfm_create_context");
pfm_write_pmcs = (pfm_write_pmcs_t) dlsym(handle, "pfm_write_pmcs");
pfm_write_pmds = (pfm_write_pmds_t) dlsym(handle, "pfm_write_pmds");
pfm_load_context = (pfm_load_context_t) dlsym(handle, "pfm_load_context");
pfm_strerror = (pfm_strerror_t) dlsym(handle, "pfm_strerror");
pfm_set_options = (pfm_set_options_t) dlsym(handle, "pfm_set_options");
pfm_get_num_counters = (pfm_get_num_counters_t) dlsym(handle, "pfm_get_num_counters");
pfm_start = function_cast<pfm_start_t>(dlsym(handle, "pfm_start"));
pfm_stop = function_cast<pfm_stop_t>(dlsym(handle, "pfm_stop"));
pfm_self_stop = function_cast<pfm_self_stop_t>(dlsym(handle, "pfm_stop")); //it's the same
pfm_restart = function_cast<pfm_restart_t>(dlsym(handle, "pfm_restart"));
pfm_read_pmds = function_cast<pfm_read_pmds_t>(dlsym(handle, "pfm_read_pmds"));
pfm_initialize = function_cast<pfm_initialize_t>(dlsym(handle, "pfm_initialize"));
pfm_find_full_event = function_cast<pfm_find_full_event_t>(dlsym(handle, "pfm_find_full_event"));
pfm_dispatch_events = function_cast<pfm_dispatch_events_t>(dlsym(handle, "pfm_dispatch_events"));
pfm_create_context = function_cast<pfm_create_context_t>(dlsym(handle, "pfm_create_context"));
pfm_write_pmcs = function_cast<pfm_write_pmcs_t>(dlsym(handle, "pfm_write_pmcs"));
pfm_write_pmds = function_cast<pfm_write_pmds_t>(dlsym(handle, "pfm_write_pmds"));
pfm_load_context = function_cast<pfm_load_context_t>(dlsym(handle, "pfm_load_context"));
pfm_strerror = function_cast<pfm_strerror_t>(dlsym(handle, "pfm_strerror"));
pfm_set_options = function_cast<pfm_set_options_t>(dlsym(handle, "pfm_set_options"));
pfm_get_num_counters = function_cast<pfm_get_num_counters_t>(dlsym(handle, "pfm_get_num_counters"));
} else {
// pfm_start = pfm_stop = pfm_self_stop = pfm_restart = pfm_read_pmds = pfm_initialize = pfm_find_full_event = pfm_dispatch_events = pfm_create_context = pfm_write_pmcs = pfm_write_pmds = pfm_load_context = pfm_strerror = pfm_set_options = pfm_get_num_counters = failure;
}
......
......@@ -91,7 +91,7 @@ namespace Google
/** Check if the component in question is a GaudiSequencer or
* a Sequencer */
bool isSequencer( INamedInterface* i ) const
{
{
return ( dynamic_cast<GaudiSequencer*>(i) != NULL ||
dynamic_cast<Sequencer*>(i) != NULL );
}
......@@ -109,10 +109,10 @@ namespace Google
{
++m_nEvts;
m_audit = ( m_nEvts > m_eventsToSkip &&
( m_freq < 0 ||
m_nEvts == 1 ||
( m_freq < 0 ||
m_nEvts == 1 ||
m_nEvts % m_freq == 0 ) );
m_log << MSG::DEBUG << "Event " << m_nEvts
m_log << MSG::DEBUG << "Event " << m_nEvts
<< " Audit=" << m_audit << endmsg;
if ( m_fullEventAudit )
{
......@@ -138,7 +138,7 @@ namespace Google
public:
void before(StandardEventType type, INamedInterface* i)
void before(StandardEventType type, INamedInterface* i)
{
if ( !m_skipSequencers || !isSequencer(i) )
{
......@@ -147,10 +147,10 @@ namespace Google
}
void before(CustomEventTypeRef type, INamedInterface* i)
{
{
if ( !m_skipSequencers || !isSequencer(i) )
{
before(type,i->name());
before(type,i->name());
}
}
......@@ -185,7 +185,7 @@ namespace Google
}
void after(StandardEventType type, INamedInterface* i, const StatusCode& sc)
{
{
if ( !m_skipSequencers || !isSequencer(i) )
{
std::ostringstream t;
......@@ -195,7 +195,7 @@ namespace Google
}
void after(CustomEventTypeRef type, INamedInterface* i, const StatusCode& sc)
{
{
if ( !m_skipSequencers || !isSequencer(i) )
{
after(type,i->name(),sc);
......@@ -508,8 +508,8 @@ namespace Google
};
DECLARE_AUDITOR_FACTORY( HeapProfiler );
DECLARE_AUDITOR_FACTORY( HeapChecker );
DECLARE_AUDITOR_FACTORY( CPUProfiler );
DECLARE_AUDITOR_FACTORY( HeapProfiler )
DECLARE_AUDITOR_FACTORY( HeapChecker )
DECLARE_AUDITOR_FACTORY( CPUProfiler )
}
......@@ -39,7 +39,9 @@ public:
StatusCode initialize();
// Overridden functions.
void handle(const Incident& incident);
using Auditor::before; // avoid hiding base-class methods
void before(StandardEventType type, INamedInterface* i);
using Auditor::after; // avoid hiding base-class methods
void after(StandardEventType type, INamedInterface* i, const StatusCode& sc);
// ## Private attributes.
private:
......@@ -440,4 +442,4 @@ void IntelProfilerAuditor::after(StandardEventType type,
}
// Register the auditor
DECLARE_AUDITOR_FACTORY( IntelProfilerAuditor);
DECLARE_AUDITOR_FACTORY(IntelProfilerAuditor)
......@@ -114,7 +114,7 @@ typedef struct {
#define PFM_REGFL_RANDOM 0x2 /* PMD: randomize value after event */
#define PFM_REGFL_NO_EMUL64 0x4 /* PMC: no 64-bit emulation */
/*
/*
* PMD extended description
* to be used with pfm_writeand pfm_read
* must be used with type = PFM_RW_PMD_ATTR
......@@ -217,7 +217,7 @@ typedef union {
#define PFM_VERSION_MINOR(x) ((x) & 0xffff)
#ifdef __cplusplus
};
}
#endif
#endif /* _PERFMON_H */
......@@ -56,14 +56,14 @@ typedef struct {
/*
* Entry header in the sampling buffer. The header is directly followed
* with the values of the PMD registers of interest saved in increasing
* index order: PMD4, PMD5, and so on. How many PMDs are present depends
* with the values of the PMD registers of interest saved in increasing
* index order: PMD4, PMD5, and so on. How many PMDs are present depends
* on how the session was programmed.
*
* In the case where multiple counters overflow at the same time, multiple
* entries are written consecutively.
*
* last_reset_value member indicates the initial value of the overflowed PMD.
* last_reset_value member indicates the initial value of the overflowed PMD.
*/
typedef struct {
uint32_t pid; /* thread id (for NPTL, this is gettid()) */
......@@ -82,7 +82,7 @@ typedef struct {
#define PFM_DFL_SMPL_VERSION (((PFM_DFL_SMPL_VERSION_MAJ&0xffff)<<16)|(PFM_DFL_SMPL_VERSION_MIN & 0xffff))
#ifdef __cplusplus
};
}
#endif
#endif /* __PERFMON_DFL_SMPL_H__ */
Package: RootHistCnv
Package manager : David Quarrie
! 2012-05-03 - Marco Clemencic
- Fixed some "pedantic" warnings.
========================== RootHistCnv v11r0 ===========================
! 2011-12-01 - Chris Jones
- Fixed bug #85377: GaudiTuple tuple does not understand ulonglong
......
......@@ -270,7 +270,7 @@ bool RootHistCnv::parseName(std::string full, std::string &blk, std::string &var
/// Make the compiler instantiate the code...
#define INSTANTIATE(TYP) \
template INTupleItem* createNTupleItem<TYP>(std::string itemName, std::string blockName, std::string index_name, int indexRange, int arraySize, TYP minimum, TYP maximum, INTuple* tuple);
template INTupleItem* createNTupleItem<TYP>(std::string itemName, std::string blockName, std::string index_name, int indexRange, int arraySize, TYP minimum, TYP maximum, INTuple* tuple)
namespace RootHistCnv {
......
Supports Markdown
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