Skip to content

Commit

Permalink
Sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cornu committed Dec 11, 2024
1 parent cee37af commit 6cc0710
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/nrncvode/cvodeobj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ void Cvode::maxstate(double* pd) {

void Cvode::maxacor(double* pd) {
if (maxacor_) {
for (NrnThread* nt: for_threads(nrn_threads, nrn_nthread)) {
for (const NrnThread* nt: for_threads(nrn_threads, nrn_nthread)) {
double* m = n_vector_data(maxacor_, nt->id);
int n = ctd_[nt->id].nvsize_;
int o = ctd_[nt->id].nvoffset_;
Expand Down
2 changes: 0 additions & 2 deletions src/nrncvode/netcvode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,6 @@ bool NetCvode::init_global() {
structure_change_cnt_ = structure_change_cnt;
matrix_change_cnt_ = -1;
playrec_change_cnt_ = 0;
NrnThread* _nt;
// We copy Memb_list* into cml->ml below. At the moment this CVode code
// generates its own complicated set of Memb_list* that operate in
// list-of-handles mode instead of referring to contiguous sets of values.
Expand Down Expand Up @@ -3963,7 +3962,6 @@ void NetCvode::re_init(double t) {
}

void NetCvode::fornetcon_prepare() {
NrnThread* nt;
NrnThreadMembList* tml;
if (fornetcon_change_cnt_ == structure_change_cnt) {
return;
Expand Down
3 changes: 1 addition & 2 deletions src/nrniv/nrncore_write/data/cell_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,9 +552,8 @@ void CellGroup::mk_tml_with_art(neuron::model_sorted_token const& cache_token, C
size_t CellGroup::get_mla_rankbytes(CellGroup* cellgroups_) {
size_t mla_rankbytes = 0;
size_t nbytes;
NrnThread* nt;
NrnThreadMembList* tml;
for (NrnThread* nt: for_threads(nrn_threads, nrn_nthread)) {
for (const NrnThread* nt: for_threads(nrn_threads, nrn_nthread)) {
size_t threadbytes = 0;
size_t npnt = 0;
size_t nart = 0;
Expand Down
3 changes: 1 addition & 2 deletions src/nrniv/savstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ void SaveState::save() {
if (!check(false)) {
alloc();
}
for (NrnThread* nt: for_threads(nrn_threads, nrn_nthread)) {
for (const NrnThread* nt: for_threads(nrn_threads, nrn_nthread)) {
assert(t == nt->_t);
}
t_ = t;
Expand Down Expand Up @@ -1192,7 +1192,6 @@ void SaveState::free_tq() {
void SaveState::alloc_tq() {
free_tq();
tqcnt_ = 0;
NrnThread* nt;
for (NrnThread* nt: for_threads(nrn_threads, nrn_nthread)) {
TQueue* tq = net_cvode_instance_event_queue(nt);
this_savestate = this;
Expand Down
2 changes: 1 addition & 1 deletion src/nrnoc/multicore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ void reorder_secorder() {
in either case, we can then point to v, d, rhs in proper
node order
*/
for (NrnThread* _nt: for_threads(nrn_threads, nrn_nthread))
for (const NrnThread* _nt: for_threads(nrn_threads, nrn_nthread))
for (inode = 0; inode < _nt->end; ++inode) {
_nt->_v_node[inode]->_classical_parent = _nt->_v_parent[inode];
}
Expand Down
2 changes: 1 addition & 1 deletion src/nrnoc/treeset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ int nrn_modeltype(void) {
type = 0;
if (nrn_global_ncell > 0) {
type = 1;
for (NrnThread* nt: for_threads(nrn_threads, nrn_nthread))
for (const NrnThread* nt: for_threads(nrn_threads, nrn_nthread))
if (nt->_ecell_memb_list) {
type = 2;
}
Expand Down

0 comments on commit 6cc0710

Please sign in to comment.