From dab0b9f41cdc96daf2adfe7cfde37a1c0fb00767 Mon Sep 17 00:00:00 2001 From: Jan Vogelsang Date: Wed, 12 Oct 2022 12:05:28 +0200 Subject: [PATCH 1/6] Replaced more NULLs by nullptrs --- doc/htmldoc/static/js/11.1.0_highlight.min.js | 2 +- doc/htmldoc/static/js/highlight.min.js | 2 +- libnestutil/config.h.in | 2 +- libnestutil/lockptr.h | 50 +++++++++---------- nest/neststartup.cpp | 8 +-- nest/neststartup.h | 2 +- nestkernel/conn_builder_conngen.cpp | 2 +- nestkernel/connection_manager.cpp | 2 +- nestkernel/event.h | 8 +-- nestkernel/recording_backend_sionlib.cpp | 16 +++--- nestkernel/target_table_devices.h | 2 +- nestkernel/target_table_devices_impl.h | 2 +- sli/aggregatedatum.h | 2 +- sli/genericdatum.h | 2 +- sli/sli_io.cc | 8 +-- sli/sliactions.cc | 4 +- sli/sliarray.cc | 18 +++---- sli/slitype.h | 2 +- sli/specialfunctionsmodule.cc | 4 +- sli/tarrayobj.cc | 22 ++++---- sli/token.h | 4 +- sli/tokenutils.h | 4 +- sli/typechk.cc | 6 +-- 23 files changed, 87 insertions(+), 87 deletions(-) diff --git a/doc/htmldoc/static/js/11.1.0_highlight.min.js b/doc/htmldoc/static/js/11.1.0_highlight.min.js index 6e1c60cd92..6ba2180025 100644 --- a/doc/htmldoc/static/js/11.1.0_highlight.min.js +++ b/doc/htmldoc/static/js/11.1.0_highlight.min.js @@ -419,7 +419,7 @@ className:"title",begin:u(t)+e.IDENT_RE,relevance:0 },c=u(t)+e.IDENT_RE+"\\s*\\(",d={ keyword:["asm","auto","break","case","const","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","static","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"], type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","complex","bool","imaginary"], -literal:"true false NULL", +literal:"true false nullptr", built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr" },g=[o,i,n,e.C_BLOCK_COMMENT_MODE,r,s],b={variants:[{begin:/=/,end:/;/},{ begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], diff --git a/doc/htmldoc/static/js/highlight.min.js b/doc/htmldoc/static/js/highlight.min.js index da9162bf8e..362585e4a5 100644 --- a/doc/htmldoc/static/js/highlight.min.js +++ b/doc/htmldoc/static/js/highlight.min.js @@ -431,7 +431,7 @@ className:"title",begin:n.optional(a)+e.IDENT_RE,relevance:0 },d=n.optional(a)+e.IDENT_RE+"\\s*\\(",g={ keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"], type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"], -literal:"true false NULL", +literal:"true false nullptr", built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr" },u=[l,r,t,e.C_BLOCK_COMMENT_MODE,o,s],b={variants:[{begin:/=/,end:/;/},{ begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], diff --git a/libnestutil/config.h.in b/libnestutil/config.h.in index 8b4d78e471..6ffe368c0d 100644 --- a/libnestutil/config.h.in +++ b/libnestutil/config.h.in @@ -129,7 +129,7 @@ /* "Define if NAN is available" */ #cmakedefine HAVE_NAN 1 -/* "Define if std::nan(NULL) is available" */ +/* "Define if std::nan(nullptr) is available" */ #cmakedefine HAVE_STD_NAN 1 /* define for ostream */ diff --git a/libnestutil/lockptr.h b/libnestutil/lockptr.h index 19b5ebc1e5..17fd622304 100644 --- a/libnestutil/lockptr.h +++ b/libnestutil/lockptr.h @@ -97,7 +97,7 @@ class lockPTR PointerObject( PointerObject const& ); public: - explicit PointerObject( D* p = NULL ) + explicit PointerObject( D* p = nullptr ) : pointee( p ) , deletable( true ) , locked( false ) @@ -114,7 +114,7 @@ class lockPTR ~PointerObject() { assert( not locked ); - if ( ( pointee != NULL ) && deletable && ( not locked ) ) + if ( ( pointee ) && deletable && ( not locked ) ) { delete pointee; } @@ -164,34 +164,34 @@ class lockPTR // object which must then be initialised, for example // by assignement. - explicit lockPTR( D* p = NULL ) + explicit lockPTR( D* p = nullptr ) { obj = std::make_shared< PointerObject >( p ); - assert( obj != NULL ); + assert( obj ); } explicit lockPTR( D& p_o ) { obj = std::make_shared< PointerObject >( p_o ); - assert( obj != NULL ); + assert( obj ); } lockPTR( const lockPTR< D >& spd ) : obj( spd.obj ) { - assert( obj != NULL ); + assert( obj ); } virtual ~lockPTR() { - assert( obj != NULL ); + assert( obj ); } lockPTR< D > operator=( const lockPTR< D >& spd ) { - assert( obj != NULL ); - assert( spd.obj != NULL ); + assert( obj ); + assert( spd.obj ); obj = spd.obj; @@ -234,7 +234,7 @@ class lockPTR D* operator->() const { - assert( obj->get() != NULL ); + assert( obj->get() ); return obj->get(); } @@ -242,7 +242,7 @@ class lockPTR D* operator->() { - assert( obj->get() != NULL ); + assert( obj->get() ); return obj->get(); } @@ -250,7 +250,7 @@ class lockPTR D& operator*() { - assert( obj->get() != NULL ); + assert( obj->get() ); return *( obj->get() ); } @@ -258,17 +258,17 @@ class lockPTR const D& operator*() const { - assert( obj->get() != NULL ); + assert( obj->get() ); return *( obj->get() ); } bool - operator not() const //!< returns true if and only if obj->pointee == NULL + operator not() const //!< returns true if and only if not obj->pointee { - // assert(obj != NULL); + // assert(obj); - return ( obj->get() == NULL ); + return not obj->get(); } @@ -296,51 +296,51 @@ class lockPTR bool - valid() const //!< returns true if and only if obj->pointee != NULL + valid() const //!< returns true if and only if obj->pointee { - assert( obj != NULL ); - return ( obj->get() != NULL ); + assert( obj ); + return ( obj->get() ); } bool islocked() const { - assert( obj != NULL ); + assert( obj ); return ( obj->islocked() ); } bool deletable() const { - assert( obj != NULL ); + assert( obj ); return ( obj->isdeletable() ); } void lock() const { - assert( obj != NULL ); + assert( obj ); obj->lock(); } void unlock() const { - assert( obj != NULL ); + assert( obj ); obj->unlock(); } void unlock() { - assert( obj != NULL ); + assert( obj ); obj->unlock(); } size_t references() const { - return ( obj == NULL ) ? 0 : obj.use_count(); + return not obj ? 0 : obj.use_count(); } }; diff --git a/nest/neststartup.cpp b/nest/neststartup.cpp index 3707984d62..9b5db021f3 100644 --- a/nest/neststartup.cpp +++ b/nest/neststartup.cpp @@ -149,7 +149,7 @@ neststartup( int* argc, char*** argv, SLIInterpreter& engine, std::string module #ifdef _IS_PYNEST // add the init-script to the list of module initializers ArrayDatum* ad = dynamic_cast< ArrayDatum* >( engine.baselookup( engine.commandstring_name ).datum() ); - assert( ad != NULL ); + assert( ad ); ad->push_back( new StringDatum( "(" + modulepath + "/pynest-init.sli) run" ) ); #endif @@ -168,11 +168,11 @@ nestshutdown( int exitcode ) Datum* CYTHON_unpackConnectionGeneratorDatum( PyObject* obj ) { - Datum* ret = NULL; - ConnectionGenerator* cg = NULL; + Datum* ret = nullptr; + ConnectionGenerator* cg = nullptr; cg = PNS::unpackConnectionGenerator( obj ); - if ( cg != NULL ) + if ( cg ) { ret = static_cast< Datum* >( new ConnectionGeneratorDatum( cg ) ); } diff --git a/nest/neststartup.h b/nest/neststartup.h index 5974e68414..72b790ecd1 100644 --- a/nest/neststartup.h +++ b/nest/neststartup.h @@ -33,7 +33,7 @@ Datum* CYTHON_unpackConnectionGeneratorDatum( PyObject* ); #else #define CYTHON_isConnectionGenerator( x ) 0 -#define CYTHON_unpackConnectionGeneratorDatum( x ) NULL +#define CYTHON_unpackConnectionGeneratorDatum( x ) nullptr #endif class SLIInterpreter; diff --git a/nestkernel/conn_builder_conngen.cpp b/nestkernel/conn_builder_conngen.cpp index d6f2f6119f..d56f091791 100644 --- a/nestkernel/conn_builder_conngen.cpp +++ b/nestkernel/conn_builder_conngen.cpp @@ -82,7 +82,7 @@ ConnectionGeneratorBuilder::connect_() if ( num_parameters == 0 ) { // connect source to target - while ( cg_->next( source, target, NULL ) ) + while ( cg_->next( source, target, nullptr ) ) { // No need to check for locality of the target, as the mask // created by cg_set_masks() only contains local nodes. diff --git a/nestkernel/connection_manager.cpp b/nestkernel/connection_manager.cpp index 53ed61be8c..761b097249 100644 --- a/nestkernel/connection_manager.cpp +++ b/nestkernel/connection_manager.cpp @@ -895,7 +895,7 @@ nest::ConnectionManager::trigger_update_weight( const long vt_id, for ( std::vector< ConnectorBase* >::iterator it = connections_[ tid ].begin(); it != connections_[ tid ].end(); ++it ) { - if ( *it != NULL ) + if ( *it ) { ( *it )->trigger_update_weight( vt_id, tid, dopa_spikes, t_trig, kernel().model_manager.get_connection_models( tid ) ); diff --git a/nestkernel/event.h b/nestkernel/event.h index 2847077dae..acfe6a0ea8 100644 --- a/nestkernel/event.h +++ b/nestkernel/event.h @@ -299,10 +299,10 @@ class Event * members, however, in order to avoid the reference of reference * problem, we store sender and receiver as pointers and use * references in the interface. - * Thus, we can still ensure that the pointers are never NULL. + * Thus, we can still ensure that the pointers are never nullptr. */ - Node* sender_; //!< Pointer to sender or NULL. - Node* receiver_; //!< Pointer to receiver or NULL. + Node* sender_; //!< Pointer to sender or nullptr. + Node* receiver_; //!< Pointer to receiver or nullptr. /** @@ -620,7 +620,7 @@ class DataLoggingRequest : public Event Time recording_offset_; /** * Names of properties to record from. - * @note This pointer shall be NULL unless the event is sent by a connection + * @note This pointer shall be nullptr unless the event is sent by a connection * routine. */ std::vector< Name > const* const record_from_; diff --git a/nestkernel/recording_backend_sionlib.cpp b/nestkernel/recording_backend_sionlib.cpp index 106905c028..48c5b27631 100644 --- a/nestkernel/recording_backend_sionlib.cpp +++ b/nestkernel/recording_backend_sionlib.cpp @@ -167,7 +167,7 @@ nest::RecordingBackendSIONlib::open_files_() // we need to delay the throwing of exceptions to the end of the parallel // section - WrappedThreadException* we = NULL; + WrappedThreadException* we = nullptr; // This code is executed in a parallel region (opened above)! const thread t = kernel().vp_manager.get_thread_id(); @@ -228,8 +228,8 @@ nest::RecordingBackendSIONlib::open_files_() &sion_chunksize, &fs_block_size, &rank, - NULL, - NULL ); + nullptr, + nullptr ); file.buffer.reserve( P_.buffer_size_ ); file.buffer.clear(); @@ -316,7 +316,7 @@ nest::RecordingBackendSIONlib::close_files_() if ( task == 0 ) { int mc; - sion_int64* cs = NULL; + sion_int64* cs = nullptr; int info_blk; // here int, other place sion_int64 due to sion api sion_int64 info_pos; @@ -536,14 +536,14 @@ nest::RecordingBackendSIONlib::build_filename_() const * ---------------------------------------------------------------- */ nest::RecordingBackendSIONlib::SIONBuffer::SIONBuffer() - : buffer_( NULL ) + : buffer_( nullptr ) , ptr_( 0 ) , max_size_( 0 ) { } nest::RecordingBackendSIONlib::SIONBuffer::SIONBuffer( size_t size ) - : buffer_( NULL ) + : buffer_( nullptr ) , ptr_( 0 ) , max_size_( 0 ) { @@ -552,7 +552,7 @@ nest::RecordingBackendSIONlib::SIONBuffer::SIONBuffer( size_t size ) nest::RecordingBackendSIONlib::SIONBuffer::~SIONBuffer() { - if ( buffer_ != NULL ) + if ( buffer_ ) { delete[] buffer_; } @@ -563,7 +563,7 @@ nest::RecordingBackendSIONlib::SIONBuffer::reserve( size_t size ) { char* new_buffer = new char[ size ]; - if ( buffer_ != NULL ) + if ( buffer_ ) { ptr_ = std::min( ptr_, size ); memcpy( new_buffer, buffer_, ptr_ ); diff --git a/nestkernel/target_table_devices.h b/nestkernel/target_table_devices.h index f80d360a35..32855ed47b 100644 --- a/nestkernel/target_table_devices.h +++ b/nestkernel/target_table_devices.h @@ -239,7 +239,7 @@ TargetTableDevices::send_from_device( const thread tid, it != target_from_devices_[ tid ][ ldid ].end(); ++it ) { - if ( *it != NULL ) + if ( *it ) { ( *it )->send_to_all( tid, cm, e ); } diff --git a/nestkernel/target_table_devices_impl.h b/nestkernel/target_table_devices_impl.h index cf29786c9e..095d82c11b 100644 --- a/nestkernel/target_table_devices_impl.h +++ b/nestkernel/target_table_devices_impl.h @@ -83,7 +83,7 @@ nest::TargetTableDevices::send_to_device( const thread tid, it != target_to_devices_[ tid ][ lid ].end(); ++it ) { - if ( *it != NULL ) + if ( *it ) { ( *it )->send_to_all( tid, cm, e ); } diff --git a/sli/aggregatedatum.h b/sli/aggregatedatum.h index c284633f60..517c803061 100644 --- a/sli/aggregatedatum.h +++ b/sli/aggregatedatum.h @@ -96,7 +96,7 @@ class AggregateDatum : public TypedDatum< slt >, public C // to work. const AggregateDatum< C, slt >* ddc = dynamic_cast< AggregateDatum< C, slt >* >( const_cast< Datum* >( dat ) ); - if ( ddc == NULL ) + if ( not ddc ) { return false; } diff --git a/sli/genericdatum.h b/sli/genericdatum.h index ea8be03c7e..dc6847d5f3 100644 --- a/sli/genericdatum.h +++ b/sli/genericdatum.h @@ -114,7 +114,7 @@ class GenericDatum : public TypedDatum< slt > // std::cerr << "d = " << d << " ddc = " << ddc << " dat = " << dat << // std::endl; - if ( ddc == NULL ) + if ( not ddc ) { return false; } diff --git a/sli/sli_io.cc b/sli/sli_io.cc index 3b8c31e389..ba0e4d684d 100644 --- a/sli/sli_io.cc +++ b/sli/sli_io.cc @@ -469,7 +469,7 @@ OstrstreamFunction::execute( SLIInterpreter* i ) const #else std::ostrstream* out = new std::ostrstream(); #endif - assert( out != NULL ); + assert( out ); if ( out->good() ) { @@ -498,7 +498,7 @@ StrFunction::execute( SLIInterpreter* i ) const OstreamDatum* ostreamdatum = dynamic_cast< OstreamDatum* >( i->OStack.top().datum() ); - if ( ostreamdatum == NULL ) + if ( not ostreamdatum ) { OstreamDatum const d; Token t = i->OStack.top(); @@ -510,10 +510,10 @@ StrFunction::execute( SLIInterpreter* i ) const #else std::ostrstream* out = dynamic_cast< std::ostrstream* >( ostreamdatum->get() ); #endif - assert( out != NULL ); + assert( out ); ostreamdatum->unlock(); - if ( out != NULL ) + if ( out ) { if ( out->good() ) { diff --git a/sli/sliactions.cc b/sli/sliactions.cc index e4fc75d405..77995bc29e 100644 --- a/sli/sliactions.cc +++ b/sli/sliactions.cc @@ -115,7 +115,7 @@ TrietypeFunction::execute( SLIInterpreter* i ) const void CallbacktypeFunction::execute( SLIInterpreter* i ) const { - // assert(i->ct.datum() != NULL); // we wouldn't be here otherwise + // assert(i->ct.datum()); // we wouldn't be here otherwise CallbackDatum* cb = static_cast< CallbackDatum* >( i->ct.datum() ); @@ -125,7 +125,7 @@ CallbacktypeFunction::execute( SLIInterpreter* i ) const i->EStack.push_move( i->ct ); // This moves the complete callback datum to the EStack. - // Now, the pointer in ct is set to NULL !! + // Now, the pointer in ct is set to nullptr !! // Now push command to restore the callback, once the action has // been finished diff --git a/sli/sliarray.cc b/sli/sliarray.cc index 976325d160..8971de5c40 100644 --- a/sli/sliarray.cc +++ b/sli/sliarray.cc @@ -1613,26 +1613,26 @@ void SLIArrayModule::IMapThreadFunction::execute( SLIInterpreter* i ) const { ProcedureDatum* procd = static_cast< ProcedureDatum* >( i->EStack.pick( 1 ).datum() ); - // assert(procd != NULL); + // assert(procd); size_t proclimit = procd->size(); IntegerDatum* argcountd = static_cast< IntegerDatum* >( i->EStack.pick( 2 ).datum() ); - // assert(argcountd != NULL); + // assert(argcountd); size_t argcount = argcountd->get(); IntegerDatum* proccountd = static_cast< IntegerDatum* >( i->EStack.pick( 3 ).datum() ); - // assert(proccountd != NULL); + // assert(proccountd); size_t proccount = proccountd->get(); ArrayDatum* sarray = static_cast< ArrayDatum* >( i->EStack.pick( 4 ).datum() ); - // assert(sarray != NULL); + // assert(sarray); ArrayDatum* tarray = static_cast< ArrayDatum* >( i->EStack.pick( 5 ).datum() ); - // assert(tarray != NULL); + // assert(tarray); IntegerDatum* limitd = static_cast< IntegerDatum* >( i->EStack.pick( 6 ).datum() ); - // assert(limitd != NULL); + // assert(limitd); size_t args = sarray->size(); // number of argument arrays size_t limit = limitd->get(); // number of arguments per array @@ -2073,7 +2073,7 @@ SLIArrayModule::AreaFunction::execute( SLIInterpreter* i ) const IntegerDatum* a_y_d = dynamic_cast< IntegerDatum* >( i->OStack.pick( 1 ).datum() ); IntegerDatum* a_x_d = dynamic_cast< IntegerDatum* >( i->OStack.pick( 0 ).datum() ); - // if(s_h_d == NULL) + // if(not s_h_d) // { // i->raiseerror(i->ArgumentTypeError); // return; @@ -2337,12 +2337,12 @@ SLIArrayModule::Area2Function::execute( SLIInterpreter* i ) const IntegerDatum* a_y_d = dynamic_cast< IntegerDatum* >( i->OStack.pick( 1 ).datum() ); IntegerDatum* a_x_d = dynamic_cast< IntegerDatum* >( i->OStack.pick( 0 ).datum() ); - // if(s_h_d == NULL) + // if(not s_h_d) // { // i->raiseerror(i->ArgumentTypeError); // return; // } - // if(s_w_d == NULL) + // if(not s_w_d) // { // i->raiseerror(i->ArgumentTypeError); // return; diff --git a/sli/slitype.h b/sli/slitype.h index b9a3523543..eea1523c90 100644 --- a/sli/slitype.h +++ b/sli/slitype.h @@ -86,7 +86,7 @@ class SLIType SLIFunction* getaction() const { - // assert(defaultaction != NULL); + // assert(defaultaction); // If this fails, we have created a datum before the types were initialised. return defaultaction; } diff --git a/sli/specialfunctionsmodule.cc b/sli/specialfunctionsmodule.cc index 6167ef2d7c..221de85c36 100644 --- a/sli/specialfunctionsmodule.cc +++ b/sli/specialfunctionsmodule.cc @@ -444,11 +444,11 @@ SpecialFunctionsModule::ErfcFunction::execute( SLIInterpreter* i ) const // --------------------------------------------------------------- -SpecialFunctionsModule::GaussDiskConvFunction::GaussDiskConvFunction( void ) +SpecialFunctionsModule::GaussDiskConvFunction::GaussDiskConvFunction() { } -SpecialFunctionsModule::GaussDiskConvFunction::~GaussDiskConvFunction( void ) +SpecialFunctionsModule::GaussDiskConvFunction::~GaussDiskConvFunction() { } diff --git a/sli/tarrayobj.cc b/sli/tarrayobj.cc index 919ac172bb..f5f7824fe5 100644 --- a/sli/tarrayobj.cc +++ b/sli/tarrayobj.cc @@ -89,7 +89,7 @@ TokenArrayObj::allocate( size_t new_s, size_t new_c, size_t new_a, const Token& assert( new_a != 0 ); Token* h = new Token[ new_c ]; - assert( h != NULL ); + assert( h ); if ( t != Token() ) { @@ -123,7 +123,7 @@ TokenArrayObj::allocate( size_t new_s, size_t new_c, size_t new_a, const Token& delete[] p; } p = h; - assert( p != NULL ); + assert( p ); ++allocations; } @@ -278,7 +278,7 @@ TokenArrayObj::erase( Token* first, Token* last ) { if ( to->p ) { - // deleting NULL pointer is safe in ISO C++ + // deleting nullptr pointer is safe in ISO C++ to->p->removeReference(); } to->p = from->p; // move @@ -399,7 +399,7 @@ TokenArrayObj::insert( size_t i, size_t n, const Token& t ) to->p = from->p; // move from->p = nullptr; // knowing that to->p is --from; - --to; // NULL before + --to; // nullptr before } for ( size_t i = 0; i < n; ++i ) // insert n copies of Token t; @@ -426,7 +426,7 @@ TokenArrayObj::insert_move( size_t i, TokenArrayObj& a ) to->p = from->p; // move from->p = nullptr; // knowing that to->p is --from; - --to; // NULL before + --to; // nullptr before } from = a.p; @@ -498,7 +498,7 @@ TokenArrayObj::insert_move( size_t i, Token& t ) to->p = from->p; // move from->p = nullptr; // knowing that to->p is --from; - --to; // NULL before + --to; // nullptr before } ( p + i )->p = t.p; // move contens of t @@ -549,7 +549,7 @@ TokenArrayObj::replace_move( size_t i, size_t n, TokenArrayObj& a ) { if ( to->p ) { - // deleting NULL pointer is safe in ISO C++ + // deleting nullptr pointer is safe in ISO C++ to->p->removeReference(); } to->p = from->p; // move @@ -586,7 +586,7 @@ TokenArrayObj::replace_move( size_t i, size_t n, TokenArrayObj& a ) to->p->removeReference(); } to->p = from->p; // movement, it is typically - from->p = nullptr; // not the NULL pointer + from->p = nullptr; // not the nullptr pointer ++from; ++to; } @@ -603,7 +603,7 @@ TokenArrayObj::append_move( TokenArrayObj& a ) while ( from < a.end() ) // move { // knowing that to->p is - to->p = from->p; // NULL before + to->p = from->p; // nullptr before from->p = nullptr; ++from; ++to; @@ -628,9 +628,9 @@ TokenArrayObj::operator==( const TokenArrayObj& a ) const } // experimentally replaced by line below 090120, Diesmann - // because [] cvx has non NULL p + // because [] cvx has non nullptr p // - // if( p == NULL || a.p == NULL || size() != a.size()) + // if( not p || not a.p || size() != a.size()) // return false; if ( size() != a.size() ) diff --git a/sli/token.h b/sli/token.h index 658e245ef9..a066f83268 100644 --- a/sli/token.h +++ b/sli/token.h @@ -373,7 +373,7 @@ class Token Datum* operator->() const { - // assert(p!= NULL); + // assert(p!= nullptr); return p; } @@ -381,7 +381,7 @@ class Token Datum& operator*() const { - // assert(p != NULL); + // assert(p); return *p; } diff --git a/sli/tokenutils.h b/sli/tokenutils.h index 2523feaae3..64c92195d5 100644 --- a/sli/tokenutils.h +++ b/sli/tokenutils.h @@ -152,7 +152,7 @@ FT getValue( const Token& t ) { FT* value = dynamic_cast< FT* >( t.datum() ); - if ( value == NULL ) + if ( not value ) { throw TypeMismatch(); } @@ -177,7 +177,7 @@ void setValue( const Token& t, FT const& value ) { FT* old = dynamic_cast< FT* >( t.datum() ); - if ( old == NULL ) + if ( not old ) { throw TypeMismatch(); } diff --git a/sli/typechk.cc b/sli/typechk.cc index 50e9e8c400..c28de60efb 100644 --- a/sli/typechk.cc +++ b/sli/typechk.cc @@ -167,7 +167,7 @@ TypeTrie::getalternative( TypeTrie::TypeNode* pos, const Name& type ) if ( pos->type == empty ) { pos->type = type; - // assert(pos->next == NULL); + // assert(not pos->next); return pos; } @@ -183,7 +183,7 @@ TypeTrie::getalternative( TypeTrie::TypeNode* pos, const Name& type ) // any must have been the tail and the previous // if must have added an extra Node, thus the following // assertion must hold: - // assert(pos->alt->alt == NULL); + // assert(not pos->alt->alt); TypeNode* new_tail = pos->alt; @@ -255,7 +255,7 @@ TypeTrie::insert_move( const TypeArray& a, Token& f ) /* Error conditions: 1. If pos->next!=NULL, the parameter list overlaps with an existing function definition. - 2. If pos->alt != NULL, something undefined must have happened. + 2. If pos->alt, something undefined must have happened. This should be impossible. */ if ( not pos->next ) From f4709cd8803d8ef68432c3cc30da31ef79276975 Mon Sep 17 00:00:00 2001 From: Jan Vogelsang Date: Thu, 13 Oct 2022 21:57:24 +0200 Subject: [PATCH 2/6] Removed redundant parentheses --- libnestutil/lockptr.h | 2 +- models/ac_generator.cpp | 2 +- models/aeif_cond_alpha.cpp | 2 +- models/aeif_cond_alpha_multisynapse.cpp | 2 +- models/aeif_cond_beta_multisynapse.cpp | 2 +- models/aeif_cond_exp.cpp | 2 +- models/aeif_psc_alpha.cpp | 2 +- models/aeif_psc_delta.cpp | 2 +- models/aeif_psc_delta_clopath.cpp | 2 +- models/aeif_psc_exp.cpp | 2 +- models/amat2_psc_exp.cpp | 2 +- models/binary_neuron.h | 2 +- models/cm_default.cpp | 2 +- models/dc_generator.cpp | 2 +- models/gamma_sup_generator.cpp | 2 +- models/gif_cond_exp.cpp | 2 +- models/gif_cond_exp_multisynapse.cpp | 2 +- models/gif_psc_exp.cpp | 2 +- models/gif_psc_exp_multisynapse.cpp | 2 +- models/hh_cond_beta_gap_traub.cpp | 2 +- models/hh_cond_exp_traub.cpp | 2 +- models/hh_psc_alpha.cpp | 2 +- models/hh_psc_alpha_clopath.cpp | 2 +- models/hh_psc_alpha_gap.cpp | 2 +- models/ht_neuron.cpp | 2 +- models/iaf_chs_2007.cpp | 2 +- models/iaf_cond_alpha.cpp | 2 +- models/iaf_cond_alpha_mc.cpp | 2 +- models/iaf_cond_beta.cpp | 2 +- models/iaf_cond_exp.cpp | 2 +- models/iaf_cond_exp_sfa_rr.cpp | 2 +- models/iaf_psc_alpha.cpp | 2 +- models/iaf_psc_alpha_multisynapse.cpp | 2 +- models/iaf_psc_delta.cpp | 2 +- models/iaf_psc_exp.cpp | 2 +- models/iaf_psc_exp_htum.cpp | 2 +- models/iaf_psc_exp_multisynapse.cpp | 2 +- models/izhikevich.cpp | 2 +- models/mat2_psc_exp.cpp | 2 +- models/noise_generator.cpp | 2 +- models/parrot_neuron.cpp | 2 +- models/poisson_generator.cpp | 2 +- models/poisson_generator_ps.cpp | 2 +- models/pp_cond_exp_mc_urbanczik.cpp | 2 +- models/pp_psc_delta.cpp | 2 +- models/ppd_sup_generator.cpp | 2 +- models/rate_neuron_ipn_impl.h | 2 +- models/rate_neuron_opn_impl.h | 2 +- models/rate_transformer_node_impl.h | 2 +- models/siegert_neuron.cpp | 2 +- models/sinusoidal_gamma_generator.cpp | 2 +- models/sinusoidal_poisson_generator.cpp | 2 +- models/step_current_generator.cpp | 2 +- models/step_rate_generator.cpp | 2 +- sli/sliarray.cc | 16 ++++++++-------- sli/token.h | 2 +- 56 files changed, 63 insertions(+), 63 deletions(-) diff --git a/libnestutil/lockptr.h b/libnestutil/lockptr.h index 17fd622304..c20821fa37 100644 --- a/libnestutil/lockptr.h +++ b/libnestutil/lockptr.h @@ -114,7 +114,7 @@ class lockPTR ~PointerObject() { assert( not locked ); - if ( ( pointee ) && deletable && ( not locked ) ) + if ( pointee && deletable && ( not locked ) ) { delete pointee; } diff --git a/models/ac_generator.cpp b/models/ac_generator.cpp index b1d81ce856..6d727cf435 100644 --- a/models/ac_generator.cpp +++ b/models/ac_generator.cpp @@ -202,7 +202,7 @@ nest::ac_generator::pre_run_hook() void nest::ac_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); long start = origin.get_steps(); diff --git a/models/aeif_cond_alpha.cpp b/models/aeif_cond_alpha.cpp index dfde99fab1..f07e72701e 100644 --- a/models/aeif_cond_alpha.cpp +++ b/models/aeif_cond_alpha.cpp @@ -448,7 +448,7 @@ nest::aeif_cond_alpha::pre_run_hook() void nest::aeif_cond_alpha::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/aeif_cond_alpha_multisynapse.cpp b/models/aeif_cond_alpha_multisynapse.cpp index 82643fde31..b36009f47b 100644 --- a/models/aeif_cond_alpha_multisynapse.cpp +++ b/models/aeif_cond_alpha_multisynapse.cpp @@ -486,7 +486,7 @@ aeif_cond_alpha_multisynapse::pre_run_hook() void aeif_cond_alpha_multisynapse::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/aeif_cond_beta_multisynapse.cpp b/models/aeif_cond_beta_multisynapse.cpp index 7de5c41ce0..b7529afb00 100644 --- a/models/aeif_cond_beta_multisynapse.cpp +++ b/models/aeif_cond_beta_multisynapse.cpp @@ -495,7 +495,7 @@ aeif_cond_beta_multisynapse::pre_run_hook() void aeif_cond_beta_multisynapse::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/aeif_cond_exp.cpp b/models/aeif_cond_exp.cpp index ec64b864fc..19200d4f62 100644 --- a/models/aeif_cond_exp.cpp +++ b/models/aeif_cond_exp.cpp @@ -441,7 +441,7 @@ nest::aeif_cond_exp::pre_run_hook() void nest::aeif_cond_exp::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/aeif_psc_alpha.cpp b/models/aeif_psc_alpha.cpp index 687c72574f..a333f3cf4b 100644 --- a/models/aeif_psc_alpha.cpp +++ b/models/aeif_psc_alpha.cpp @@ -438,7 +438,7 @@ nest::aeif_psc_alpha::pre_run_hook() void nest::aeif_psc_alpha::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/aeif_psc_delta.cpp b/models/aeif_psc_delta.cpp index 9c5985d602..7fae1297d1 100644 --- a/models/aeif_psc_delta.cpp +++ b/models/aeif_psc_delta.cpp @@ -416,7 +416,7 @@ nest::aeif_psc_delta::pre_run_hook() void nest::aeif_psc_delta::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); const double h = Time::get_resolution().get_ms(); diff --git a/models/aeif_psc_delta_clopath.cpp b/models/aeif_psc_delta_clopath.cpp index 946e9410e2..552f283d68 100644 --- a/models/aeif_psc_delta_clopath.cpp +++ b/models/aeif_psc_delta_clopath.cpp @@ -475,7 +475,7 @@ nest::aeif_psc_delta_clopath::pre_run_hook() void nest::aeif_psc_delta_clopath::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/aeif_psc_exp.cpp b/models/aeif_psc_exp.cpp index 1904711f42..b6170db245 100644 --- a/models/aeif_psc_exp.cpp +++ b/models/aeif_psc_exp.cpp @@ -431,7 +431,7 @@ nest::aeif_psc_exp::pre_run_hook() void nest::aeif_psc_exp::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/amat2_psc_exp.cpp b/models/amat2_psc_exp.cpp index 62cc7a2d38..fbe1361028 100644 --- a/models/amat2_psc_exp.cpp +++ b/models/amat2_psc_exp.cpp @@ -366,7 +366,7 @@ nest::amat2_psc_exp::pre_run_hook() void nest::amat2_psc_exp::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); // evolve from timestep 'from' to timestep 'to' with steps of h each diff --git a/models/binary_neuron.h b/models/binary_neuron.h index 54ab5f1aef..d5f7f02b1c 100644 --- a/models/binary_neuron.h +++ b/models/binary_neuron.h @@ -456,7 +456,7 @@ template < class TGainfunction > void binary_neuron< TGainfunction >::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/cm_default.cpp b/models/cm_default.cpp index 482f1eda95..44a9755f09 100644 --- a/models/cm_default.cpp +++ b/models/cm_default.cpp @@ -290,7 +290,7 @@ nest::cm_default::pre_run_hook() void nest::cm_default::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/dc_generator.cpp b/models/dc_generator.cpp index 1c1cd4aa80..eda07d7d81 100644 --- a/models/dc_generator.cpp +++ b/models/dc_generator.cpp @@ -162,7 +162,7 @@ nest::dc_generator::pre_run_hook() void nest::dc_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); long start = origin.get_steps(); diff --git a/models/gamma_sup_generator.cpp b/models/gamma_sup_generator.cpp index 0adfa7a9af..4cf3f4e4cc 100644 --- a/models/gamma_sup_generator.cpp +++ b/models/gamma_sup_generator.cpp @@ -232,7 +232,7 @@ nest::gamma_sup_generator::pre_run_hook() void nest::gamma_sup_generator::update( Time const& T, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); if ( P_.rate_ <= 0 || P_.num_targets_ == 0 ) diff --git a/models/gif_cond_exp.cpp b/models/gif_cond_exp.cpp index bc02952f9f..6c68cfabd8 100644 --- a/models/gif_cond_exp.cpp +++ b/models/gif_cond_exp.cpp @@ -478,7 +478,7 @@ void nest::gif_cond_exp::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/gif_cond_exp_multisynapse.cpp b/models/gif_cond_exp_multisynapse.cpp index 647d73cf58..91be1d858d 100644 --- a/models/gif_cond_exp_multisynapse.cpp +++ b/models/gif_cond_exp_multisynapse.cpp @@ -480,7 +480,7 @@ void nest::gif_cond_exp_multisynapse::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/gif_psc_exp.cpp b/models/gif_psc_exp.cpp index 94e6ca306a..614ad7cb81 100644 --- a/models/gif_psc_exp.cpp +++ b/models/gif_psc_exp.cpp @@ -326,7 +326,7 @@ void nest::gif_psc_exp::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/gif_psc_exp_multisynapse.cpp b/models/gif_psc_exp_multisynapse.cpp index 84c59b3c45..3c5d19943a 100644 --- a/models/gif_psc_exp_multisynapse.cpp +++ b/models/gif_psc_exp_multisynapse.cpp @@ -348,7 +348,7 @@ void nest::gif_psc_exp_multisynapse::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/hh_cond_beta_gap_traub.cpp b/models/hh_cond_beta_gap_traub.cpp index 10493561a5..33b8b7e0ad 100644 --- a/models/hh_cond_beta_gap_traub.cpp +++ b/models/hh_cond_beta_gap_traub.cpp @@ -476,7 +476,7 @@ nest::hh_cond_beta_gap_traub::update_( Time const& origin, const bool called_from_wfr_update ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const size_t interpolation_order = kernel().simulation_manager.get_wfr_interpolation_order(); diff --git a/models/hh_cond_exp_traub.cpp b/models/hh_cond_exp_traub.cpp index d3260e8a4e..d65b01c5dc 100644 --- a/models/hh_cond_exp_traub.cpp +++ b/models/hh_cond_exp_traub.cpp @@ -388,7 +388,7 @@ nest::hh_cond_exp_traub::pre_run_hook() void nest::hh_cond_exp_traub::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/hh_psc_alpha.cpp b/models/hh_psc_alpha.cpp index f06e7980c0..64f4964492 100644 --- a/models/hh_psc_alpha.cpp +++ b/models/hh_psc_alpha.cpp @@ -390,7 +390,7 @@ void nest::hh_psc_alpha::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/hh_psc_alpha_clopath.cpp b/models/hh_psc_alpha_clopath.cpp index 51e00f3720..740d5b0384 100644 --- a/models/hh_psc_alpha_clopath.cpp +++ b/models/hh_psc_alpha_clopath.cpp @@ -418,7 +418,7 @@ void nest::hh_psc_alpha_clopath::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/hh_psc_alpha_gap.cpp b/models/hh_psc_alpha_gap.cpp index af42bbab00..4cbc2a44a1 100644 --- a/models/hh_psc_alpha_gap.cpp +++ b/models/hh_psc_alpha_gap.cpp @@ -454,7 +454,7 @@ bool nest::hh_psc_alpha_gap::update_( Time const& origin, const long from, const long to, const bool called_from_wfr_update ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const size_t interpolation_order = kernel().simulation_manager.get_wfr_interpolation_order(); diff --git a/models/ht_neuron.cpp b/models/ht_neuron.cpp index b76a960914..0c4d0099a0 100644 --- a/models/ht_neuron.cpp +++ b/models/ht_neuron.cpp @@ -770,7 +770,7 @@ nest::ht_neuron::set_status( const DictionaryDatum& d ) void ht_neuron::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_chs_2007.cpp b/models/iaf_chs_2007.cpp index a46dcddcbf..dcede39f71 100644 --- a/models/iaf_chs_2007.cpp +++ b/models/iaf_chs_2007.cpp @@ -222,7 +222,7 @@ nest::iaf_chs_2007::pre_run_hook() void nest::iaf_chs_2007::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); // evolve from timestep 'from' to timestep 'to' with steps of h each diff --git a/models/iaf_cond_alpha.cpp b/models/iaf_cond_alpha.cpp index c01844737a..3771cab22f 100644 --- a/models/iaf_cond_alpha.cpp +++ b/models/iaf_cond_alpha.cpp @@ -375,7 +375,7 @@ void nest::iaf_cond_alpha::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_cond_alpha_mc.cpp b/models/iaf_cond_alpha_mc.cpp index 3461f38f71..0e183fa4cd 100644 --- a/models/iaf_cond_alpha_mc.cpp +++ b/models/iaf_cond_alpha_mc.cpp @@ -579,7 +579,7 @@ void nest::iaf_cond_alpha_mc::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_cond_beta.cpp b/models/iaf_cond_beta.cpp index a313a080c9..de71a91546 100644 --- a/models/iaf_cond_beta.cpp +++ b/models/iaf_cond_beta.cpp @@ -388,7 +388,7 @@ void nest::iaf_cond_beta::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_cond_exp.cpp b/models/iaf_cond_exp.cpp index befebba4fe..67ccfbd9e9 100644 --- a/models/iaf_cond_exp.cpp +++ b/models/iaf_cond_exp.cpp @@ -350,7 +350,7 @@ void nest::iaf_cond_exp::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_cond_exp_sfa_rr.cpp b/models/iaf_cond_exp_sfa_rr.cpp index c569a2125c..fac77ae8bd 100644 --- a/models/iaf_cond_exp_sfa_rr.cpp +++ b/models/iaf_cond_exp_sfa_rr.cpp @@ -386,7 +386,7 @@ void nest::iaf_cond_exp_sfa_rr::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_psc_alpha.cpp b/models/iaf_psc_alpha.cpp index e6cf6737c2..c2d0625657 100644 --- a/models/iaf_psc_alpha.cpp +++ b/models/iaf_psc_alpha.cpp @@ -306,7 +306,7 @@ iaf_psc_alpha::pre_run_hook() void iaf_psc_alpha::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_psc_alpha_multisynapse.cpp b/models/iaf_psc_alpha_multisynapse.cpp index 0a16644540..a46920c43d 100644 --- a/models/iaf_psc_alpha_multisynapse.cpp +++ b/models/iaf_psc_alpha_multisynapse.cpp @@ -328,7 +328,7 @@ iaf_psc_alpha_multisynapse::pre_run_hook() void iaf_psc_alpha_multisynapse::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_psc_delta.cpp b/models/iaf_psc_delta.cpp index 5f991e2cc2..cfad028d65 100644 --- a/models/iaf_psc_delta.cpp +++ b/models/iaf_psc_delta.cpp @@ -270,7 +270,7 @@ nest::iaf_psc_delta::pre_run_hook() void nest::iaf_psc_delta::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const double h = Time::get_resolution().get_ms(); diff --git a/models/iaf_psc_exp.cpp b/models/iaf_psc_exp.cpp index e6201d792c..94b2ed6c5b 100644 --- a/models/iaf_psc_exp.cpp +++ b/models/iaf_psc_exp.cpp @@ -287,7 +287,7 @@ nest::iaf_psc_exp::pre_run_hook() void nest::iaf_psc_exp::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const double h = Time::get_resolution().get_ms(); diff --git a/models/iaf_psc_exp_htum.cpp b/models/iaf_psc_exp_htum.cpp index 802a207620..4fdcb362f1 100644 --- a/models/iaf_psc_exp_htum.cpp +++ b/models/iaf_psc_exp_htum.cpp @@ -298,7 +298,7 @@ nest::iaf_psc_exp_htum::pre_run_hook() void nest::iaf_psc_exp_htum::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); // evolve from timestep 'from' to timestep 'to' with steps of h each diff --git a/models/iaf_psc_exp_multisynapse.cpp b/models/iaf_psc_exp_multisynapse.cpp index 5fc12fee74..31bea7a2e0 100644 --- a/models/iaf_psc_exp_multisynapse.cpp +++ b/models/iaf_psc_exp_multisynapse.cpp @@ -305,7 +305,7 @@ nest::iaf_psc_exp_multisynapse::pre_run_hook() void iaf_psc_exp_multisynapse::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); // evolve from timestep 'from' to timestep 'to' with steps of h each diff --git a/models/izhikevich.cpp b/models/izhikevich.cpp index 5dd1710e11..77aca0dba9 100644 --- a/models/izhikevich.cpp +++ b/models/izhikevich.cpp @@ -191,7 +191,7 @@ nest::izhikevich::pre_run_hook() void nest::izhikevich::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const double h = Time::get_resolution().get_ms(); diff --git a/models/mat2_psc_exp.cpp b/models/mat2_psc_exp.cpp index 772c4fc216..70790e147b 100644 --- a/models/mat2_psc_exp.cpp +++ b/models/mat2_psc_exp.cpp @@ -307,7 +307,7 @@ nest::mat2_psc_exp::pre_run_hook() void nest::mat2_psc_exp::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); // evolve from timestep 'from' to timestep 'to' with steps of h each diff --git a/models/noise_generator.cpp b/models/noise_generator.cpp index 6792064db9..de82dc48b7 100644 --- a/models/noise_generator.cpp +++ b/models/noise_generator.cpp @@ -289,7 +289,7 @@ nest::noise_generator::send_test_event( Node& target, rport receptor_type, synin void nest::noise_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const long start = origin.get_steps(); diff --git a/models/parrot_neuron.cpp b/models/parrot_neuron.cpp index fd6962372a..14534bfe9b 100644 --- a/models/parrot_neuron.cpp +++ b/models/parrot_neuron.cpp @@ -58,7 +58,7 @@ parrot_neuron::init_buffers_() void parrot_neuron::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/poisson_generator.cpp b/models/poisson_generator.cpp index 0a6d96c485..27bd098c35 100644 --- a/models/poisson_generator.cpp +++ b/models/poisson_generator.cpp @@ -117,7 +117,7 @@ nest::poisson_generator::pre_run_hook() void nest::poisson_generator::update( Time const& T, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); if ( P_.rate_ <= 0 ) diff --git a/models/poisson_generator_ps.cpp b/models/poisson_generator_ps.cpp index 412673e36d..208a4b5ddb 100644 --- a/models/poisson_generator_ps.cpp +++ b/models/poisson_generator_ps.cpp @@ -178,7 +178,7 @@ nest::poisson_generator_ps::pre_run_hook() void nest::poisson_generator_ps::update( Time const& T, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); if ( P_.rate_ <= 0 || P_.num_targets_ == 0 ) diff --git a/models/pp_cond_exp_mc_urbanczik.cpp b/models/pp_cond_exp_mc_urbanczik.cpp index ffa7a7a14b..d886118a36 100644 --- a/models/pp_cond_exp_mc_urbanczik.cpp +++ b/models/pp_cond_exp_mc_urbanczik.cpp @@ -578,7 +578,7 @@ void nest::pp_cond_exp_mc_urbanczik::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/pp_psc_delta.cpp b/models/pp_psc_delta.cpp index a89354e025..8d906abf07 100644 --- a/models/pp_psc_delta.cpp +++ b/models/pp_psc_delta.cpp @@ -361,7 +361,7 @@ void nest::pp_psc_delta::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/ppd_sup_generator.cpp b/models/ppd_sup_generator.cpp index 3cabd68eff..d45f7dc0e8 100644 --- a/models/ppd_sup_generator.cpp +++ b/models/ppd_sup_generator.cpp @@ -231,7 +231,7 @@ nest::ppd_sup_generator::pre_run_hook() void nest::ppd_sup_generator::update( Time const& T, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); if ( P_.rate_ <= 0 || P_.num_targets_ == 0 ) diff --git a/models/rate_neuron_ipn_impl.h b/models/rate_neuron_ipn_impl.h index 2f316281dd..0c4b7890ff 100644 --- a/models/rate_neuron_ipn_impl.h +++ b/models/rate_neuron_ipn_impl.h @@ -270,7 +270,7 @@ nest::rate_neuron_ipn< TNonlinearities >::update_( Time const& origin, const long to, const bool called_from_wfr_update ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const size_t buffer_size = kernel().connection_manager.get_min_delay(); diff --git a/models/rate_neuron_opn_impl.h b/models/rate_neuron_opn_impl.h index 13aa05b39f..f145318051 100644 --- a/models/rate_neuron_opn_impl.h +++ b/models/rate_neuron_opn_impl.h @@ -246,7 +246,7 @@ nest::rate_neuron_opn< TNonlinearities >::update_( Time const& origin, const long to, const bool called_from_wfr_update ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const size_t buffer_size = kernel().connection_manager.get_min_delay(); diff --git a/models/rate_transformer_node_impl.h b/models/rate_transformer_node_impl.h index 715b2a91c5..1ecbeabfb6 100644 --- a/models/rate_transformer_node_impl.h +++ b/models/rate_transformer_node_impl.h @@ -181,7 +181,7 @@ nest::rate_transformer_node< TNonlinearities >::update_( Time const& origin, const long to, const bool called_from_wfr_update ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const size_t buffer_size = kernel().connection_manager.get_min_delay(); diff --git a/models/siegert_neuron.cpp b/models/siegert_neuron.cpp index 7fd0a31543..1b48a0cb9b 100644 --- a/models/siegert_neuron.cpp +++ b/models/siegert_neuron.cpp @@ -310,7 +310,7 @@ nest::siegert_neuron::pre_run_hook() bool nest::siegert_neuron::update_( Time const& origin, const long from, const long to, const bool called_from_wfr_update ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const size_t buffer_size = kernel().connection_manager.get_min_delay(); diff --git a/models/sinusoidal_gamma_generator.cpp b/models/sinusoidal_gamma_generator.cpp index 08c29220d5..58faeaf349 100644 --- a/models/sinusoidal_gamma_generator.cpp +++ b/models/sinusoidal_gamma_generator.cpp @@ -309,7 +309,7 @@ nest::sinusoidal_gamma_generator::hazard_( port tgt_idx ) const void nest::sinusoidal_gamma_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/sinusoidal_poisson_generator.cpp b/models/sinusoidal_poisson_generator.cpp index deec0ea17c..cbf0d1642e 100644 --- a/models/sinusoidal_poisson_generator.cpp +++ b/models/sinusoidal_poisson_generator.cpp @@ -232,7 +232,7 @@ nest::sinusoidal_poisson_generator::pre_run_hook() void nest::sinusoidal_poisson_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const long start = origin.get_steps(); diff --git a/models/step_current_generator.cpp b/models/step_current_generator.cpp index 086907042b..c1aaddc561 100644 --- a/models/step_current_generator.cpp +++ b/models/step_current_generator.cpp @@ -272,7 +272,7 @@ nest::step_current_generator::pre_run_hook() void nest::step_current_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( P_.amp_time_stamps_.size() == P_.amp_values_.size() ); diff --git a/models/step_rate_generator.cpp b/models/step_rate_generator.cpp index f5e7135284..21f1ae6a60 100644 --- a/models/step_rate_generator.cpp +++ b/models/step_rate_generator.cpp @@ -273,7 +273,7 @@ nest::step_rate_generator::pre_run_hook() void nest::step_rate_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( P_.amp_time_stamps_.size() == P_.amp_values_.size() ); diff --git a/sli/sliarray.cc b/sli/sliarray.cc index 8971de5c40..3774f0e458 100644 --- a/sli/sliarray.cc +++ b/sli/sliarray.cc @@ -106,7 +106,7 @@ SLIArrayModule::RangeFunction::execute( SLIInterpreter* i ) const { IntegerDatum* n1d = dynamic_cast< IntegerDatum* >( ad->get( 0 ).datum() ); IntegerDatum* n2d = dynamic_cast< IntegerDatum* >( ad->get( 1 ).datum() ); - if ( ( n1d ) && ( n2d ) ) + if ( n1d && n2d ) { long n = 1 + n2d->get() - n1d->get(); @@ -130,7 +130,7 @@ SLIArrayModule::RangeFunction::execute( SLIInterpreter* i ) const { DoubleDatum* n1d = dynamic_cast< DoubleDatum* >( ad->get( 0 ).datum() ); DoubleDatum* n2d = dynamic_cast< DoubleDatum* >( ad->get( 1 ).datum() ); - if ( ( n1d ) && ( n2d ) ) + if ( n1d && n2d ) { long n = 1 + static_cast< long >( n2d->get() - n1d->get() ); @@ -161,7 +161,7 @@ SLIArrayModule::RangeFunction::execute( SLIInterpreter* i ) const IntegerDatum* n1d = dynamic_cast< IntegerDatum* >( ad->get( 0 ).datum() ); IntegerDatum* n2d = dynamic_cast< IntegerDatum* >( ad->get( 1 ).datum() ); IntegerDatum* n3d = dynamic_cast< IntegerDatum* >( ad->get( 2 ).datum() ); - if ( ( n1d ) && ( n2d ) && ( n3d ) ) + if ( n1d && n2d && n3d ) { long di = n3d->get(); long start = n1d->get(); @@ -192,7 +192,7 @@ SLIArrayModule::RangeFunction::execute( SLIInterpreter* i ) const DoubleDatum* n1d = dynamic_cast< DoubleDatum* >( ad->get( 0 ).datum() ); DoubleDatum* n2d = dynamic_cast< DoubleDatum* >( ad->get( 1 ).datum() ); DoubleDatum* n3d = dynamic_cast< DoubleDatum* >( ad->get( 2 ).datum() ); - if ( ( n1d ) && ( n2d ) && ( n3d ) ) + if ( n1d && n2d && n3d ) { double di = n3d->get(); double start = n1d->get(); @@ -286,7 +286,7 @@ SLIArrayModule::ArangeFunction::execute( SLIInterpreter* i ) const { IntegerDatum* n1d = dynamic_cast< IntegerDatum* >( ad->get( 0 ).datum() ); IntegerDatum* n2d = dynamic_cast< IntegerDatum* >( ad->get( 1 ).datum() ); - if ( ( n1d ) && ( n2d ) ) + if ( n1d && n2d ) { const long start = n1d->get(); const long stop = n2d->get(); @@ -310,7 +310,7 @@ SLIArrayModule::ArangeFunction::execute( SLIInterpreter* i ) const { DoubleDatum* n1d = dynamic_cast< DoubleDatum* >( ad->get( 0 ).datum() ); DoubleDatum* n2d = dynamic_cast< DoubleDatum* >( ad->get( 1 ).datum() ); - if ( ( n1d ) && ( n2d ) ) + if ( n1d && n2d ) { double start = n1d->get(); double stop = n2d->get(); @@ -338,7 +338,7 @@ SLIArrayModule::ArangeFunction::execute( SLIInterpreter* i ) const IntegerDatum* n1d = dynamic_cast< IntegerDatum* >( ad->get( 0 ).datum() ); IntegerDatum* n2d = dynamic_cast< IntegerDatum* >( ad->get( 1 ).datum() ); IntegerDatum* n3d = dynamic_cast< IntegerDatum* >( ad->get( 2 ).datum() ); - if ( ( n1d ) && ( n2d ) && ( n3d ) ) + if ( n1d && n2d && n3d ) { long di = n3d->get(); long start = n1d->get(); @@ -372,7 +372,7 @@ SLIArrayModule::ArangeFunction::execute( SLIInterpreter* i ) const DoubleDatum* n1d = dynamic_cast< DoubleDatum* >( ad->get( 0 ).datum() ); DoubleDatum* n2d = dynamic_cast< DoubleDatum* >( ad->get( 1 ).datum() ); DoubleDatum* n3d = dynamic_cast< DoubleDatum* >( ad->get( 2 ).datum() ); - if ( ( n1d ) && ( n2d ) && ( n3d ) ) + if ( n1d && n2d && n3d ) { double di = n3d->get(); double start = n1d->get(); diff --git a/sli/token.h b/sli/token.h index a066f83268..8c6f8033dd 100644 --- a/sli/token.h +++ b/sli/token.h @@ -341,7 +341,7 @@ class Token bool contains( const Datum& d ) const { - return ( p ) and p->equals( &d ); + return p and p->equals( &d ); } bool From 60b59ac6be1b0403a00987241b2a3a53404a66a6 Mon Sep 17 00:00:00 2001 From: Jan Vogelsang Date: Thu, 13 Oct 2022 22:21:39 +0200 Subject: [PATCH 3/6] Added back parentheses of old C-style casts --- models/ac_generator.cpp | 2 +- models/aeif_cond_alpha.cpp | 2 +- models/aeif_cond_alpha_multisynapse.cpp | 2 +- models/aeif_cond_beta_multisynapse.cpp | 2 +- models/aeif_cond_exp.cpp | 2 +- models/aeif_psc_alpha.cpp | 2 +- models/aeif_psc_delta.cpp | 2 +- models/aeif_psc_delta_clopath.cpp | 2 +- models/aeif_psc_exp.cpp | 2 +- models/amat2_psc_exp.cpp | 2 +- models/binary_neuron.h | 2 +- models/cm_default.cpp | 2 +- models/dc_generator.cpp | 2 +- models/gamma_sup_generator.cpp | 2 +- models/gif_cond_exp.cpp | 2 +- models/gif_cond_exp_multisynapse.cpp | 2 +- models/gif_psc_exp.cpp | 2 +- models/gif_psc_exp_multisynapse.cpp | 2 +- models/hh_cond_beta_gap_traub.cpp | 2 +- models/hh_cond_exp_traub.cpp | 2 +- models/hh_psc_alpha.cpp | 2 +- models/hh_psc_alpha_clopath.cpp | 2 +- models/hh_psc_alpha_gap.cpp | 2 +- models/ht_neuron.cpp | 2 +- models/iaf_chs_2007.cpp | 2 +- models/iaf_cond_alpha.cpp | 2 +- models/iaf_cond_alpha_mc.cpp | 2 +- models/iaf_cond_beta.cpp | 2 +- models/iaf_cond_exp.cpp | 2 +- models/iaf_cond_exp_sfa_rr.cpp | 2 +- models/iaf_psc_alpha.cpp | 2 +- models/iaf_psc_alpha_multisynapse.cpp | 2 +- models/iaf_psc_delta.cpp | 2 +- models/iaf_psc_exp.cpp | 2 +- models/iaf_psc_exp_htum.cpp | 2 +- models/iaf_psc_exp_multisynapse.cpp | 2 +- models/izhikevich.cpp | 2 +- models/mat2_psc_exp.cpp | 2 +- models/noise_generator.cpp | 2 +- models/parrot_neuron.cpp | 2 +- models/poisson_generator.cpp | 2 +- models/poisson_generator_ps.cpp | 2 +- models/pp_cond_exp_mc_urbanczik.cpp | 2 +- models/pp_psc_delta.cpp | 2 +- models/ppd_sup_generator.cpp | 2 +- models/rate_neuron_ipn_impl.h | 2 +- models/rate_neuron_opn_impl.h | 2 +- models/rate_transformer_node_impl.h | 2 +- models/siegert_neuron.cpp | 2 +- models/sinusoidal_gamma_generator.cpp | 2 +- models/sinusoidal_poisson_generator.cpp | 2 +- models/step_current_generator.cpp | 2 +- models/step_rate_generator.cpp | 2 +- 53 files changed, 53 insertions(+), 53 deletions(-) diff --git a/models/ac_generator.cpp b/models/ac_generator.cpp index 6d727cf435..b1d81ce856 100644 --- a/models/ac_generator.cpp +++ b/models/ac_generator.cpp @@ -202,7 +202,7 @@ nest::ac_generator::pre_run_hook() void nest::ac_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); long start = origin.get_steps(); diff --git a/models/aeif_cond_alpha.cpp b/models/aeif_cond_alpha.cpp index f07e72701e..dfde99fab1 100644 --- a/models/aeif_cond_alpha.cpp +++ b/models/aeif_cond_alpha.cpp @@ -448,7 +448,7 @@ nest::aeif_cond_alpha::pre_run_hook() void nest::aeif_cond_alpha::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/aeif_cond_alpha_multisynapse.cpp b/models/aeif_cond_alpha_multisynapse.cpp index b36009f47b..82643fde31 100644 --- a/models/aeif_cond_alpha_multisynapse.cpp +++ b/models/aeif_cond_alpha_multisynapse.cpp @@ -486,7 +486,7 @@ aeif_cond_alpha_multisynapse::pre_run_hook() void aeif_cond_alpha_multisynapse::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/aeif_cond_beta_multisynapse.cpp b/models/aeif_cond_beta_multisynapse.cpp index b7529afb00..7de5c41ce0 100644 --- a/models/aeif_cond_beta_multisynapse.cpp +++ b/models/aeif_cond_beta_multisynapse.cpp @@ -495,7 +495,7 @@ aeif_cond_beta_multisynapse::pre_run_hook() void aeif_cond_beta_multisynapse::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/aeif_cond_exp.cpp b/models/aeif_cond_exp.cpp index 19200d4f62..ec64b864fc 100644 --- a/models/aeif_cond_exp.cpp +++ b/models/aeif_cond_exp.cpp @@ -441,7 +441,7 @@ nest::aeif_cond_exp::pre_run_hook() void nest::aeif_cond_exp::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/aeif_psc_alpha.cpp b/models/aeif_psc_alpha.cpp index a333f3cf4b..687c72574f 100644 --- a/models/aeif_psc_alpha.cpp +++ b/models/aeif_psc_alpha.cpp @@ -438,7 +438,7 @@ nest::aeif_psc_alpha::pre_run_hook() void nest::aeif_psc_alpha::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/aeif_psc_delta.cpp b/models/aeif_psc_delta.cpp index 7fae1297d1..9c5985d602 100644 --- a/models/aeif_psc_delta.cpp +++ b/models/aeif_psc_delta.cpp @@ -416,7 +416,7 @@ nest::aeif_psc_delta::pre_run_hook() void nest::aeif_psc_delta::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); const double h = Time::get_resolution().get_ms(); diff --git a/models/aeif_psc_delta_clopath.cpp b/models/aeif_psc_delta_clopath.cpp index 552f283d68..946e9410e2 100644 --- a/models/aeif_psc_delta_clopath.cpp +++ b/models/aeif_psc_delta_clopath.cpp @@ -475,7 +475,7 @@ nest::aeif_psc_delta_clopath::pre_run_hook() void nest::aeif_psc_delta_clopath::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/aeif_psc_exp.cpp b/models/aeif_psc_exp.cpp index b6170db245..1904711f42 100644 --- a/models/aeif_psc_exp.cpp +++ b/models/aeif_psc_exp.cpp @@ -431,7 +431,7 @@ nest::aeif_psc_exp::pre_run_hook() void nest::aeif_psc_exp::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( State_::V_M == 0 ); diff --git a/models/amat2_psc_exp.cpp b/models/amat2_psc_exp.cpp index fbe1361028..62cc7a2d38 100644 --- a/models/amat2_psc_exp.cpp +++ b/models/amat2_psc_exp.cpp @@ -366,7 +366,7 @@ nest::amat2_psc_exp::pre_run_hook() void nest::amat2_psc_exp::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); // evolve from timestep 'from' to timestep 'to' with steps of h each diff --git a/models/binary_neuron.h b/models/binary_neuron.h index d5f7f02b1c..54ab5f1aef 100644 --- a/models/binary_neuron.h +++ b/models/binary_neuron.h @@ -456,7 +456,7 @@ template < class TGainfunction > void binary_neuron< TGainfunction >::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/cm_default.cpp b/models/cm_default.cpp index 44a9755f09..482f1eda95 100644 --- a/models/cm_default.cpp +++ b/models/cm_default.cpp @@ -290,7 +290,7 @@ nest::cm_default::pre_run_hook() void nest::cm_default::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/dc_generator.cpp b/models/dc_generator.cpp index eda07d7d81..1c1cd4aa80 100644 --- a/models/dc_generator.cpp +++ b/models/dc_generator.cpp @@ -162,7 +162,7 @@ nest::dc_generator::pre_run_hook() void nest::dc_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); long start = origin.get_steps(); diff --git a/models/gamma_sup_generator.cpp b/models/gamma_sup_generator.cpp index 4cf3f4e4cc..0adfa7a9af 100644 --- a/models/gamma_sup_generator.cpp +++ b/models/gamma_sup_generator.cpp @@ -232,7 +232,7 @@ nest::gamma_sup_generator::pre_run_hook() void nest::gamma_sup_generator::update( Time const& T, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); if ( P_.rate_ <= 0 || P_.num_targets_ == 0 ) diff --git a/models/gif_cond_exp.cpp b/models/gif_cond_exp.cpp index 6c68cfabd8..bc02952f9f 100644 --- a/models/gif_cond_exp.cpp +++ b/models/gif_cond_exp.cpp @@ -478,7 +478,7 @@ void nest::gif_cond_exp::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/gif_cond_exp_multisynapse.cpp b/models/gif_cond_exp_multisynapse.cpp index 91be1d858d..647d73cf58 100644 --- a/models/gif_cond_exp_multisynapse.cpp +++ b/models/gif_cond_exp_multisynapse.cpp @@ -480,7 +480,7 @@ void nest::gif_cond_exp_multisynapse::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/gif_psc_exp.cpp b/models/gif_psc_exp.cpp index 614ad7cb81..94e6ca306a 100644 --- a/models/gif_psc_exp.cpp +++ b/models/gif_psc_exp.cpp @@ -326,7 +326,7 @@ void nest::gif_psc_exp::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/gif_psc_exp_multisynapse.cpp b/models/gif_psc_exp_multisynapse.cpp index 3c5d19943a..84c59b3c45 100644 --- a/models/gif_psc_exp_multisynapse.cpp +++ b/models/gif_psc_exp_multisynapse.cpp @@ -348,7 +348,7 @@ void nest::gif_psc_exp_multisynapse::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/hh_cond_beta_gap_traub.cpp b/models/hh_cond_beta_gap_traub.cpp index 33b8b7e0ad..10493561a5 100644 --- a/models/hh_cond_beta_gap_traub.cpp +++ b/models/hh_cond_beta_gap_traub.cpp @@ -476,7 +476,7 @@ nest::hh_cond_beta_gap_traub::update_( Time const& origin, const bool called_from_wfr_update ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const size_t interpolation_order = kernel().simulation_manager.get_wfr_interpolation_order(); diff --git a/models/hh_cond_exp_traub.cpp b/models/hh_cond_exp_traub.cpp index d65b01c5dc..d3260e8a4e 100644 --- a/models/hh_cond_exp_traub.cpp +++ b/models/hh_cond_exp_traub.cpp @@ -388,7 +388,7 @@ nest::hh_cond_exp_traub::pre_run_hook() void nest::hh_cond_exp_traub::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/hh_psc_alpha.cpp b/models/hh_psc_alpha.cpp index 64f4964492..f06e7980c0 100644 --- a/models/hh_psc_alpha.cpp +++ b/models/hh_psc_alpha.cpp @@ -390,7 +390,7 @@ void nest::hh_psc_alpha::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/hh_psc_alpha_clopath.cpp b/models/hh_psc_alpha_clopath.cpp index 740d5b0384..51e00f3720 100644 --- a/models/hh_psc_alpha_clopath.cpp +++ b/models/hh_psc_alpha_clopath.cpp @@ -418,7 +418,7 @@ void nest::hh_psc_alpha_clopath::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/hh_psc_alpha_gap.cpp b/models/hh_psc_alpha_gap.cpp index 4cbc2a44a1..af42bbab00 100644 --- a/models/hh_psc_alpha_gap.cpp +++ b/models/hh_psc_alpha_gap.cpp @@ -454,7 +454,7 @@ bool nest::hh_psc_alpha_gap::update_( Time const& origin, const long from, const long to, const bool called_from_wfr_update ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const size_t interpolation_order = kernel().simulation_manager.get_wfr_interpolation_order(); diff --git a/models/ht_neuron.cpp b/models/ht_neuron.cpp index 0c4d0099a0..b76a960914 100644 --- a/models/ht_neuron.cpp +++ b/models/ht_neuron.cpp @@ -770,7 +770,7 @@ nest::ht_neuron::set_status( const DictionaryDatum& d ) void ht_neuron::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_chs_2007.cpp b/models/iaf_chs_2007.cpp index dcede39f71..a46dcddcbf 100644 --- a/models/iaf_chs_2007.cpp +++ b/models/iaf_chs_2007.cpp @@ -222,7 +222,7 @@ nest::iaf_chs_2007::pre_run_hook() void nest::iaf_chs_2007::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); // evolve from timestep 'from' to timestep 'to' with steps of h each diff --git a/models/iaf_cond_alpha.cpp b/models/iaf_cond_alpha.cpp index 3771cab22f..c01844737a 100644 --- a/models/iaf_cond_alpha.cpp +++ b/models/iaf_cond_alpha.cpp @@ -375,7 +375,7 @@ void nest::iaf_cond_alpha::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_cond_alpha_mc.cpp b/models/iaf_cond_alpha_mc.cpp index 0e183fa4cd..3461f38f71 100644 --- a/models/iaf_cond_alpha_mc.cpp +++ b/models/iaf_cond_alpha_mc.cpp @@ -579,7 +579,7 @@ void nest::iaf_cond_alpha_mc::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_cond_beta.cpp b/models/iaf_cond_beta.cpp index de71a91546..a313a080c9 100644 --- a/models/iaf_cond_beta.cpp +++ b/models/iaf_cond_beta.cpp @@ -388,7 +388,7 @@ void nest::iaf_cond_beta::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_cond_exp.cpp b/models/iaf_cond_exp.cpp index 67ccfbd9e9..befebba4fe 100644 --- a/models/iaf_cond_exp.cpp +++ b/models/iaf_cond_exp.cpp @@ -350,7 +350,7 @@ void nest::iaf_cond_exp::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_cond_exp_sfa_rr.cpp b/models/iaf_cond_exp_sfa_rr.cpp index fac77ae8bd..c569a2125c 100644 --- a/models/iaf_cond_exp_sfa_rr.cpp +++ b/models/iaf_cond_exp_sfa_rr.cpp @@ -386,7 +386,7 @@ void nest::iaf_cond_exp_sfa_rr::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_psc_alpha.cpp b/models/iaf_psc_alpha.cpp index c2d0625657..e6cf6737c2 100644 --- a/models/iaf_psc_alpha.cpp +++ b/models/iaf_psc_alpha.cpp @@ -306,7 +306,7 @@ iaf_psc_alpha::pre_run_hook() void iaf_psc_alpha::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_psc_alpha_multisynapse.cpp b/models/iaf_psc_alpha_multisynapse.cpp index a46920c43d..0a16644540 100644 --- a/models/iaf_psc_alpha_multisynapse.cpp +++ b/models/iaf_psc_alpha_multisynapse.cpp @@ -328,7 +328,7 @@ iaf_psc_alpha_multisynapse::pre_run_hook() void iaf_psc_alpha_multisynapse::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/iaf_psc_delta.cpp b/models/iaf_psc_delta.cpp index cfad028d65..5f991e2cc2 100644 --- a/models/iaf_psc_delta.cpp +++ b/models/iaf_psc_delta.cpp @@ -270,7 +270,7 @@ nest::iaf_psc_delta::pre_run_hook() void nest::iaf_psc_delta::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const double h = Time::get_resolution().get_ms(); diff --git a/models/iaf_psc_exp.cpp b/models/iaf_psc_exp.cpp index 94b2ed6c5b..e6201d792c 100644 --- a/models/iaf_psc_exp.cpp +++ b/models/iaf_psc_exp.cpp @@ -287,7 +287,7 @@ nest::iaf_psc_exp::pre_run_hook() void nest::iaf_psc_exp::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const double h = Time::get_resolution().get_ms(); diff --git a/models/iaf_psc_exp_htum.cpp b/models/iaf_psc_exp_htum.cpp index 4fdcb362f1..802a207620 100644 --- a/models/iaf_psc_exp_htum.cpp +++ b/models/iaf_psc_exp_htum.cpp @@ -298,7 +298,7 @@ nest::iaf_psc_exp_htum::pre_run_hook() void nest::iaf_psc_exp_htum::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); // evolve from timestep 'from' to timestep 'to' with steps of h each diff --git a/models/iaf_psc_exp_multisynapse.cpp b/models/iaf_psc_exp_multisynapse.cpp index 31bea7a2e0..5fc12fee74 100644 --- a/models/iaf_psc_exp_multisynapse.cpp +++ b/models/iaf_psc_exp_multisynapse.cpp @@ -305,7 +305,7 @@ nest::iaf_psc_exp_multisynapse::pre_run_hook() void iaf_psc_exp_multisynapse::update( const Time& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); // evolve from timestep 'from' to timestep 'to' with steps of h each diff --git a/models/izhikevich.cpp b/models/izhikevich.cpp index 77aca0dba9..5dd1710e11 100644 --- a/models/izhikevich.cpp +++ b/models/izhikevich.cpp @@ -191,7 +191,7 @@ nest::izhikevich::pre_run_hook() void nest::izhikevich::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const double h = Time::get_resolution().get_ms(); diff --git a/models/mat2_psc_exp.cpp b/models/mat2_psc_exp.cpp index 70790e147b..772c4fc216 100644 --- a/models/mat2_psc_exp.cpp +++ b/models/mat2_psc_exp.cpp @@ -307,7 +307,7 @@ nest::mat2_psc_exp::pre_run_hook() void nest::mat2_psc_exp::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); // evolve from timestep 'from' to timestep 'to' with steps of h each diff --git a/models/noise_generator.cpp b/models/noise_generator.cpp index de82dc48b7..6792064db9 100644 --- a/models/noise_generator.cpp +++ b/models/noise_generator.cpp @@ -289,7 +289,7 @@ nest::noise_generator::send_test_event( Node& target, rport receptor_type, synin void nest::noise_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const long start = origin.get_steps(); diff --git a/models/parrot_neuron.cpp b/models/parrot_neuron.cpp index 14534bfe9b..fd6962372a 100644 --- a/models/parrot_neuron.cpp +++ b/models/parrot_neuron.cpp @@ -58,7 +58,7 @@ parrot_neuron::init_buffers_() void parrot_neuron::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/poisson_generator.cpp b/models/poisson_generator.cpp index 27bd098c35..0a6d96c485 100644 --- a/models/poisson_generator.cpp +++ b/models/poisson_generator.cpp @@ -117,7 +117,7 @@ nest::poisson_generator::pre_run_hook() void nest::poisson_generator::update( Time const& T, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); if ( P_.rate_ <= 0 ) diff --git a/models/poisson_generator_ps.cpp b/models/poisson_generator_ps.cpp index 208a4b5ddb..412673e36d 100644 --- a/models/poisson_generator_ps.cpp +++ b/models/poisson_generator_ps.cpp @@ -178,7 +178,7 @@ nest::poisson_generator_ps::pre_run_hook() void nest::poisson_generator_ps::update( Time const& T, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); if ( P_.rate_ <= 0 || P_.num_targets_ == 0 ) diff --git a/models/pp_cond_exp_mc_urbanczik.cpp b/models/pp_cond_exp_mc_urbanczik.cpp index d886118a36..ffa7a7a14b 100644 --- a/models/pp_cond_exp_mc_urbanczik.cpp +++ b/models/pp_cond_exp_mc_urbanczik.cpp @@ -578,7 +578,7 @@ void nest::pp_cond_exp_mc_urbanczik::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/pp_psc_delta.cpp b/models/pp_psc_delta.cpp index 8d906abf07..a89354e025 100644 --- a/models/pp_psc_delta.cpp +++ b/models/pp_psc_delta.cpp @@ -361,7 +361,7 @@ void nest::pp_psc_delta::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/ppd_sup_generator.cpp b/models/ppd_sup_generator.cpp index d45f7dc0e8..3cabd68eff 100644 --- a/models/ppd_sup_generator.cpp +++ b/models/ppd_sup_generator.cpp @@ -231,7 +231,7 @@ nest::ppd_sup_generator::pre_run_hook() void nest::ppd_sup_generator::update( Time const& T, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); if ( P_.rate_ <= 0 || P_.num_targets_ == 0 ) diff --git a/models/rate_neuron_ipn_impl.h b/models/rate_neuron_ipn_impl.h index 0c4b7890ff..2f316281dd 100644 --- a/models/rate_neuron_ipn_impl.h +++ b/models/rate_neuron_ipn_impl.h @@ -270,7 +270,7 @@ nest::rate_neuron_ipn< TNonlinearities >::update_( Time const& origin, const long to, const bool called_from_wfr_update ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const size_t buffer_size = kernel().connection_manager.get_min_delay(); diff --git a/models/rate_neuron_opn_impl.h b/models/rate_neuron_opn_impl.h index f145318051..13aa05b39f 100644 --- a/models/rate_neuron_opn_impl.h +++ b/models/rate_neuron_opn_impl.h @@ -246,7 +246,7 @@ nest::rate_neuron_opn< TNonlinearities >::update_( Time const& origin, const long to, const bool called_from_wfr_update ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const size_t buffer_size = kernel().connection_manager.get_min_delay(); diff --git a/models/rate_transformer_node_impl.h b/models/rate_transformer_node_impl.h index 1ecbeabfb6..715b2a91c5 100644 --- a/models/rate_transformer_node_impl.h +++ b/models/rate_transformer_node_impl.h @@ -181,7 +181,7 @@ nest::rate_transformer_node< TNonlinearities >::update_( Time const& origin, const long to, const bool called_from_wfr_update ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const size_t buffer_size = kernel().connection_manager.get_min_delay(); diff --git a/models/siegert_neuron.cpp b/models/siegert_neuron.cpp index 1b48a0cb9b..7fd0a31543 100644 --- a/models/siegert_neuron.cpp +++ b/models/siegert_neuron.cpp @@ -310,7 +310,7 @@ nest::siegert_neuron::pre_run_hook() bool nest::siegert_neuron::update_( Time const& origin, const long from, const long to, const bool called_from_wfr_update ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const size_t buffer_size = kernel().connection_manager.get_min_delay(); diff --git a/models/sinusoidal_gamma_generator.cpp b/models/sinusoidal_gamma_generator.cpp index 58faeaf349..08c29220d5 100644 --- a/models/sinusoidal_gamma_generator.cpp +++ b/models/sinusoidal_gamma_generator.cpp @@ -309,7 +309,7 @@ nest::sinusoidal_gamma_generator::hazard_( port tgt_idx ) const void nest::sinusoidal_gamma_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); for ( long lag = from; lag < to; ++lag ) diff --git a/models/sinusoidal_poisson_generator.cpp b/models/sinusoidal_poisson_generator.cpp index cbf0d1642e..deec0ea17c 100644 --- a/models/sinusoidal_poisson_generator.cpp +++ b/models/sinusoidal_poisson_generator.cpp @@ -232,7 +232,7 @@ nest::sinusoidal_poisson_generator::pre_run_hook() void nest::sinusoidal_poisson_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); const long start = origin.get_steps(); diff --git a/models/step_current_generator.cpp b/models/step_current_generator.cpp index c1aaddc561..086907042b 100644 --- a/models/step_current_generator.cpp +++ b/models/step_current_generator.cpp @@ -272,7 +272,7 @@ nest::step_current_generator::pre_run_hook() void nest::step_current_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( P_.amp_time_stamps_.size() == P_.amp_values_.size() ); diff --git a/models/step_rate_generator.cpp b/models/step_rate_generator.cpp index 21f1ae6a60..f5e7135284 100644 --- a/models/step_rate_generator.cpp +++ b/models/step_rate_generator.cpp @@ -273,7 +273,7 @@ nest::step_rate_generator::pre_run_hook() void nest::step_rate_generator::update( Time const& origin, const long from, const long to ) { - assert( to >= 0 && delay from < kernel().connection_manager.get_min_delay() ); + assert( to >= 0 && ( delay ) from < kernel().connection_manager.get_min_delay() ); assert( from < to ); assert( P_.amp_time_stamps_.size() == P_.amp_values_.size() ); From 6ddd87f8d5af72203224ad6ebe5a20125358f394 Mon Sep 17 00:00:00 2001 From: Jan Vogelsang Date: Mon, 31 Oct 2022 12:56:03 +0100 Subject: [PATCH 4/6] Removed commented-out asserts, etc. --- .clang-tidy | 1 + libnestutil/lockptr.h | 2 -- sli/sliactions.cc | 4 ---- sli/sliarray.cc | 7 +------ 4 files changed, 2 insertions(+), 12 deletions(-) create mode 100644 .clang-tidy diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000000..6434e2d051 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1 @@ +Checks: '-*,modernize-use-nullptr,modernize-use-override,bugprone,modernize-redundant-void-arg' \ No newline at end of file diff --git a/libnestutil/lockptr.h b/libnestutil/lockptr.h index 339b8dcea2..88c7618864 100644 --- a/libnestutil/lockptr.h +++ b/libnestutil/lockptr.h @@ -266,8 +266,6 @@ class lockPTR bool operator not() const //!< returns true if and only if not obj->pointee { - // assert(obj); - return not obj->get(); } diff --git a/sli/sliactions.cc b/sli/sliactions.cc index b54b612a5d..3e32e572e4 100644 --- a/sli/sliactions.cc +++ b/sli/sliactions.cc @@ -106,7 +106,6 @@ FunctiontypeFunction::execute( SLIInterpreter* i ) const void TrietypeFunction::execute( SLIInterpreter* i ) const { - TrieDatum* tried = static_cast< TrieDatum* >( i->EStack.top().datum() ); i->EStack.top().assign_by_ref( tried->lookup( i->OStack ) ); } @@ -114,14 +113,11 @@ TrietypeFunction::execute( SLIInterpreter* i ) const void CallbacktypeFunction::execute( SLIInterpreter* i ) const { - // assert(i->ct.datum()); // we wouldn't be here otherwise - CallbackDatum* cb = static_cast< CallbackDatum* >( i->ct.datum() ); // Note, although cb is a pointer to a class derived from Datum, // it also has the properties of a token, since it is derived from both. - i->EStack.push_move( i->ct ); // This moves the complete callback datum to the EStack. // Now, the pointer in ct is set to nullptr !! diff --git a/sli/sliarray.cc b/sli/sliarray.cc index 03408efee5..6561321c52 100644 --- a/sli/sliarray.cc +++ b/sli/sliarray.cc @@ -1610,26 +1610,21 @@ void SLIArrayModule::IMapThreadFunction::execute( SLIInterpreter* i ) const { ProcedureDatum* procd = static_cast< ProcedureDatum* >( i->EStack.pick( 1 ).datum() ); - // assert(procd); size_t proclimit = procd->size(); IntegerDatum* argcountd = static_cast< IntegerDatum* >( i->EStack.pick( 2 ).datum() ); - // assert(argcountd); size_t argcount = argcountd->get(); IntegerDatum* proccountd = static_cast< IntegerDatum* >( i->EStack.pick( 3 ).datum() ); - // assert(proccountd); + size_t proccount = proccountd->get(); ArrayDatum* sarray = static_cast< ArrayDatum* >( i->EStack.pick( 4 ).datum() ); - // assert(sarray); ArrayDatum* tarray = static_cast< ArrayDatum* >( i->EStack.pick( 5 ).datum() ); - // assert(tarray); IntegerDatum* limitd = static_cast< IntegerDatum* >( i->EStack.pick( 6 ).datum() ); - // assert(limitd); size_t args = sarray->size(); // number of argument arrays size_t limit = limitd->get(); // number of arguments per array From 9a3cb8ffa02cdf9a0addc37f7773d7819f26dae5 Mon Sep 17 00:00:00 2001 From: Jan Vogelsang Date: Thu, 10 Nov 2022 19:02:13 +0100 Subject: [PATCH 5/6] Applied suggestions --- .clang-tidy | 2 +- doc/htmldoc/static/js/11.1.0_highlight.min.js | 2 +- doc/htmldoc/static/js/highlight.min.js | 2 +- sli/slitype.h | 2 -- sli/token.h | 2 -- sli/typechk.cc | 9 +++------ 6 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 6434e2d051..e02b1c4556 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1 +1 @@ -Checks: '-*,modernize-use-nullptr,modernize-use-override,bugprone,modernize-redundant-void-arg' \ No newline at end of file +Checks: '-*,modernize-use-nullptr,modernize-use-override,bugprone,modernize-redundant-void-arg' diff --git a/doc/htmldoc/static/js/11.1.0_highlight.min.js b/doc/htmldoc/static/js/11.1.0_highlight.min.js index 6ba2180025..6e1c60cd92 100644 --- a/doc/htmldoc/static/js/11.1.0_highlight.min.js +++ b/doc/htmldoc/static/js/11.1.0_highlight.min.js @@ -419,7 +419,7 @@ className:"title",begin:u(t)+e.IDENT_RE,relevance:0 },c=u(t)+e.IDENT_RE+"\\s*\\(",d={ keyword:["asm","auto","break","case","const","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","static","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"], type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","complex","bool","imaginary"], -literal:"true false nullptr", +literal:"true false NULL", built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr" },g=[o,i,n,e.C_BLOCK_COMMENT_MODE,r,s],b={variants:[{begin:/=/,end:/;/},{ begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], diff --git a/doc/htmldoc/static/js/highlight.min.js b/doc/htmldoc/static/js/highlight.min.js index 362585e4a5..da9162bf8e 100644 --- a/doc/htmldoc/static/js/highlight.min.js +++ b/doc/htmldoc/static/js/highlight.min.js @@ -431,7 +431,7 @@ className:"title",begin:n.optional(a)+e.IDENT_RE,relevance:0 },d=n.optional(a)+e.IDENT_RE+"\\s*\\(",g={ keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"], type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"], -literal:"true false nullptr", +literal:"true false NULL", built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr" },u=[l,r,t,e.C_BLOCK_COMMENT_MODE,o,s],b={variants:[{begin:/=/,end:/;/},{ begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}], diff --git a/sli/slitype.h b/sli/slitype.h index eea1523c90..4b38e74199 100644 --- a/sli/slitype.h +++ b/sli/slitype.h @@ -86,8 +86,6 @@ class SLIType SLIFunction* getaction() const { - // assert(defaultaction); - // If this fails, we have created a datum before the types were initialised. return defaultaction; } }; diff --git a/sli/token.h b/sli/token.h index 8c6f8033dd..e5a7be51e2 100644 --- a/sli/token.h +++ b/sli/token.h @@ -373,7 +373,6 @@ class Token Datum* operator->() const { - // assert(p!= nullptr); return p; } @@ -381,7 +380,6 @@ class Token Datum& operator*() const { - // assert(p); return *p; } diff --git a/sli/typechk.cc b/sli/typechk.cc index c28de60efb..5364f78fad 100644 --- a/sli/typechk.cc +++ b/sli/typechk.cc @@ -167,7 +167,6 @@ TypeTrie::getalternative( TypeTrie::TypeNode* pos, const Name& type ) if ( pos->type == empty ) { pos->type = type; - // assert(not pos->next); return pos; } @@ -180,10 +179,8 @@ TypeTrie::getalternative( TypeTrie::TypeNode* pos, const Name& type ) if ( pos->type == sli::any ) { - // any must have been the tail and the previous - // if must have added an extra Node, thus the following - // assertion must hold: - // assert(not pos->alt->alt); + // When entering this if, the previous if added an extra Node, + // thus pos->alt->alt will not be defined yet (nullptr) TypeNode* new_tail = pos->alt; @@ -255,7 +252,7 @@ TypeTrie::insert_move( const TypeArray& a, Token& f ) /* Error conditions: 1. If pos->next!=NULL, the parameter list overlaps with an existing function definition. - 2. If pos->alt, something undefined must have happened. + 2. If pos->alt != nullptr, something undefined must have happened. This should be impossible. */ if ( not pos->next ) From f0da8f7f9856ed453ef24b7bff2cae11eda69567 Mon Sep 17 00:00:00 2001 From: Jan Vogelsang <47158055+JanVogelsang@users.noreply.github.com> Date: Fri, 11 Nov 2022 09:25:50 +0100 Subject: [PATCH 6/6] Update sli/typechk.cc Co-authored-by: Hans Ekkehard Plesser --- sli/typechk.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sli/typechk.cc b/sli/typechk.cc index 5364f78fad..92e055dfab 100644 --- a/sli/typechk.cc +++ b/sli/typechk.cc @@ -250,7 +250,7 @@ TypeTrie::insert_move( const TypeArray& a, Token& f ) } /* Error conditions: - 1. If pos->next!=NULL, the parameter list overlaps with + 1. If pos->next != nullptr, the parameter list overlaps with an existing function definition. 2. If pos->alt != nullptr, something undefined must have happened. This should be impossible.