Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

technical fix for compiler issue on gcc490. #3308

Merged
merged 4 commits into from Apr 14, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions CondCore/CondDB/interface/KeyList.h
Expand Up @@ -37,8 +37,8 @@ namespace cond {

template<typename T>
boost::shared_ptr<T> get(size_t n) const {
if( n> (size()-1) ) throwException( "Index outside the bounds of the key array.",
"KeyList::get");
if( n >= size() ) throwException( "Index outside the bounds of the key array.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does not compile
use "int(n)"

"KeyList::get");
if( !m_objects[n] ){
auto i = m_data.find( n );
if( i != m_data.end() ){
Expand All @@ -52,7 +52,7 @@ namespace cond {
return boost::static_pointer_cast<T>( m_objects[n] );
}

int size() const { return m_objects.size();}
size_t size() const { return m_objects.size();}

private:
// the db session
Expand Down
2 changes: 1 addition & 1 deletion CondTools/DT/plugins/DTKeyedConfigPopConAnalyzer.cc
Expand Up @@ -26,7 +26,7 @@ class DTKeyedConfigPopConAnalyzer: public popcon::PopConAnalyzer<DTKeyedConfigHa
std::cout<<"got context"<<std::endl;
cond::persistency::KeyList const & kl= *klh.product();
cond::persistency::KeyList* list = const_cast<cond::persistency::KeyList*>( &kl );
for ( int i = 0; i < list->size(); i++ ) {
for ( size_t i = 0; i < list->size(); i++ ) {
boost::shared_ptr<DTKeyedConfig> kelem = list->get<DTKeyedConfig>( i );
if ( kelem.get() )
std::cout << kelem->getId() << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion CondTools/DT/plugins/DTUserKeyedConfigPopConAnalyzer.cc
Expand Up @@ -21,7 +21,7 @@ class DTUserKeyedConfigPopConAnalyzer: public popcon::PopConAnalyzer<DTUserKeyed
std::cout<<"got context"<<std::endl;
cond::persistency::KeyList const & kl= *klh.product();
cond::persistency::KeyList* list = const_cast<cond::persistency::KeyList*>( &kl );
for ( int i = 0; i < list->size(); i++ ) {
for ( size_t i = 0; i < list->size(); i++ ) {
boost::shared_ptr<DTKeyedConfig> kentry = list->get<DTKeyedConfig>( i );
if ( kentry.get() )
std::cout << kentry->getId() << std::endl;
Expand Down