From 65277cdb28f937b0f0053d4f9f4f5782e5120ee5 Mon Sep 17 00:00:00 2001 From: Stine Vennemo Date: Tue, 22 Mar 2022 09:00:21 +0100 Subject: [PATCH] Remove updateValueInt, use updateValue< long > instead --- models/quantal_stp_synapse_impl.h | 4 ++-- sli/dictutils.h | 34 ------------------------------- 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/models/quantal_stp_synapse_impl.h b/models/quantal_stp_synapse_impl.h index 6e273fd7e3..e6d22fe25b 100644 --- a/models/quantal_stp_synapse_impl.h +++ b/models/quantal_stp_synapse_impl.h @@ -76,8 +76,8 @@ quantal_stp_synapse< targetidentifierT >::set_status( const DictionaryDatum& d, updateValue< double >( d, names::u, u_ ); updateValue< double >( d, names::tau_rec, tau_rec_ ); updateValue< double >( d, names::tau_fac, tau_fac_ ); - updateValueInt( d, names::n, n_ ); - updateValueInt( d, names::a, a_ ); + updateValue< long >( d, names::n, n_ ); + updateValue< long >( d, names::a, a_ ); } } // of namespace nest diff --git a/sli/dictutils.h b/sli/dictutils.h index 518d9b37e5..52d3626c04 100644 --- a/sli/dictutils.h +++ b/sli/dictutils.h @@ -270,40 +270,6 @@ updateValue2( DictionaryDatum const& d, Name const n, C& obj, void ( C::*setfunc } } -/** Update an int or a double from a dictionary entry if it exists, and convert it to an int. - * Skip call if it doesn't exist. - * @ingroup DictUtils - * @throws TypeMismatch The entry is neither int nor double. - * @returns true if the property was found (and updated) in the dictionary, false otherwise - */ -inline bool -updateValueInt( const DictionaryDatum& d, Name propname, int& prop ) -{ - if ( d->known( propname ) ) - { - Datum* dat = ( *d )[ propname ].datum(); - IntegerDatum* intdat = dynamic_cast< IntegerDatum* >( dat ); - if ( intdat != nullptr ) - { - prop = static_cast< int >( intdat->get() ); - return true; - } - DoubleDatum* doubledat = dynamic_cast< DoubleDatum* >( dat ); - if ( doubledat != nullptr ) - { - prop = static_cast< int >( doubledat->get() ); - return true; - } - else - { - throw TypeMismatch(); - } - } - - return false; -} - - /** Create a property of type ArrayDatum in the dictionary, if it does not * already exist. * @ingroup DictUtils