Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Ensure consistent return values in "impossible" situations even if assertions are compiled out #2376

Merged
merged 2 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion models/bernoulli_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class bernoulli_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/clopath_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class clopath_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
16 changes: 8 additions & 8 deletions models/cont_delay_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,42 +147,42 @@ class cont_delay_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( RateEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( DataLoggingRequest&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( CurrentEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( ConductanceEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( DoubleDataEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( DSSpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( DSCurrentEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/gamma_sup_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ gamma_sup_generator::send_test_event( Node& target, rport receptor_type, syninde
SpikeEvent e;
e.set_sender( *this );
const port p = target.handles_test_event( e, receptor_type );
if ( p != invalid_port_ )
if ( p != invalid_port )
{
// count number of targets
++P_.num_targets_;
Expand Down
2 changes: 1 addition & 1 deletion models/ht_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class ht_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/jonke_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ class jonke_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/multimeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ multimeter::send_test_event( Node& target, rport receptor_type, synindex, bool )
DataLoggingRequest e( P_.interval_, P_.offset_, P_.record_from_ );
e.set_sender( *this );
port p = target.handles_test_event( e, receptor_type );
if ( p != invalid_port_ and not is_model_prototype() )
if ( p != invalid_port and not is_model_prototype() )
{
B_.has_targets_ = true;
}
Expand Down
2 changes: 1 addition & 1 deletion models/music_cont_out_proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ nest::music_cont_out_proxy::send_test_event( Node& target, rport receptor_type,
DataLoggingRequest e( P_.interval_, P_.record_from_ );
e.set_sender( *this );
port p = target.handles_test_event( e, receptor_type );
if ( p != invalid_port_ and not is_model_prototype() )
if ( p != invalid_port and not is_model_prototype() )
{
B_.has_targets_ = true;
}
Expand Down
2 changes: 1 addition & 1 deletion models/noise_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ nest::noise_generator::send_test_event( Node& target, rport receptor_type, synin
CurrentEvent e;
e.set_sender( *this );
const port p = target.handles_test_event( e, receptor_type );
if ( p != invalid_port_ and not is_model_prototype() )
if ( p != invalid_port and not is_model_prototype() )
{
++P_.num_targets_;
}
Expand Down
2 changes: 1 addition & 1 deletion models/poisson_generator_ps.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ poisson_generator_ps::send_test_event( Node& target, rport receptor_type, synind
SpikeEvent e;
e.set_sender( *this );
const port p = target.handles_test_event( e, receptor_type );
if ( p != invalid_port_ and not is_model_prototype() )
if ( p != invalid_port and not is_model_prototype() )
{
++P_.num_targets_; // count number of targets
}
Expand Down
2 changes: 1 addition & 1 deletion models/ppd_sup_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ ppd_sup_generator::send_test_event( Node& target, rport receptor_type, synindex
SpikeEvent e;
e.set_sender( *this );
const port p = target.handles_test_event( e, receptor_type );
if ( p != invalid_port_ and not is_model_prototype() )
if ( p != invalid_port and not is_model_prototype() )
{
++P_.num_targets_; // count number of targets
}
Expand Down
2 changes: 1 addition & 1 deletion models/quantal_stp_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class quantal_stp_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/sinusoidal_gamma_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ sinusoidal_gamma_generator::send_test_event( Node& target, rport receptor_type,
SpikeEvent e;
e.set_sender( *this );
const rport r = target.handles_test_event( e, receptor_type );
if ( r != invalid_port_ and not is_model_prototype() )
if ( r != invalid_port and not is_model_prototype() )
{
++P_.num_trains_;
}
Expand Down
16 changes: 8 additions & 8 deletions models/static_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,42 +101,42 @@ class static_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( RateEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( DataLoggingRequest&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( CurrentEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( ConductanceEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( DoubleDataEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( DSSpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( DSCurrentEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
16 changes: 8 additions & 8 deletions models/static_synapse_hom_w.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,42 +87,42 @@ class static_synapse_hom_w : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( RateEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( DataLoggingRequest&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( CurrentEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( ConductanceEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( DoubleDataEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( DSSpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
port
handles_test_event( DSCurrentEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/stdp_dopamine_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class stdp_dopamine_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/stdp_nn_pre_centered_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class stdp_nn_pre_centered_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/stdp_nn_restr_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class stdp_nn_restr_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/stdp_nn_symm_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class stdp_nn_symm_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/stdp_pl_synapse_hom.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class stdp_pl_synapse_hom : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/stdp_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class stdp_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/stdp_synapse_facetshw_hom.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class stdp_facetshw_synapse_hom : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/stdp_synapse_hom.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class stdp_synapse_hom : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/stdp_triplet_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class stdp_triplet_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/tsodyks2_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class tsodyks2_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/tsodyks_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class tsodyks_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/tsodyks_synapse_hom.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class tsodyks_synapse_hom : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/urbanczik_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class urbanczik_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
2 changes: 1 addition & 1 deletion models/vogels_sprekeler_synapse.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class vogels_sprekeler_synapse : public Connection< targetidentifierT >
port
handles_test_event( SpikeEvent&, rport )
{
return invalid_port_;
return invalid_port;
}
};

Expand Down
Loading