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

Reduce warnings nrniv #3157

Open
wants to merge 3 commits into
base: cornu/reduce_warnings
Choose a base branch
from
Open
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
3 changes: 0 additions & 3 deletions src/nrniv/kschan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1093,7 +1093,6 @@ void KSChan::update_prop() {
Symbol* gsym = rlsym_->u.ppsym[soffset_ - 2];
Symbol* isym = rlsym_->u.ppsym[soffset_ - 1];
Symbol* esym = ion_sym_ ? NULL : rlsym_->u.ppsym[gmaxoffset_ + 1];
int old_gmaxoffset = gmaxoffset_;
int old_soffset = soffset_;
int old_svarn = rlsym_->s_varn;

Expand Down Expand Up @@ -2183,7 +2182,6 @@ void KSChan::fillmat(double v, Datum* pd) {
void KSChan::mat_dt(double dt, Memb_list* ml, std::size_t instance, std::size_t offset) {
// y' = m*y this part add the dt for the form ynew/dt - yold/dt =m*ynew
// the matrix ends up as (m-1/dt)ynew = -1/dt*yold
int i;
double dt1 = -1. / dt;
for (int i = 0; i < nksstate_; ++i) {
*(diag_[i]) += dt1;
Expand Down Expand Up @@ -2422,7 +2420,6 @@ void KSChan::ion_consist() {
for (i = iligtrans_; i < ntrans_; ++i) {
trans_[i].lig2pd(poff);
}
int ppsize = poff + 2 * nligand_;
// ForAllSections(sec)
ITERATE(qsec, section_list) {
Section* sec = hocSEC(qsec);
Expand Down
2 changes: 0 additions & 2 deletions src/nrniv/kssingle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ void KSSingleNodeData::pr(const char* s, double tt, NetCvode* nc) {

void KSSingle::state(Node* nd, Datum* pd, NrnThread* nt) {
// integrate from t-dt to t
int i;
double v = NODEV(nd);
auto* snd = pd[sndindex_].get<KSSingleNodeData*>();
// if truly single channel, as opposed to N single channels
Expand All @@ -254,7 +253,6 @@ void KSSingle::state(Node* nd, Datum* pd, NrnThread* nt) {
void KSSingle::cv_update(Node* nd, Datum* pd, NrnThread* nt) {
// if v changed then need to move the outstanding
// single channel event time to a recalculated time
int i;
double v = NODEV(nd);
auto* snd = pd[sndindex_].get<KSSingleNodeData*>();
if (uses_ligands_ || !vsame(v, snd->vlast_)) {
Expand Down
6 changes: 5 additions & 1 deletion src/nrniv/multisend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,12 @@ void nrn_multisend_receive(NrnThread* nt) {
assert(nt == nrn_threads);
TBUF
double w2;
int ncons = 0;
int& s = multisend_receive_buffer[current_rbuf]->nsend_;
int& r = multisend_receive_buffer[current_rbuf]->nrecv_;
double w1 = nrnmpi_wtime();
#if TBUFSIZE
int ncons = 0;
#endif
if (use_multisend_) {
nrn_multisend_advance();
TBUF
Expand All @@ -489,7 +491,9 @@ void nrn_multisend_receive(NrnThread* nt) {
TBUF
while (nrnmpi_multisend_conserve(s, r) != 0) {
nrn_multisend_advance();
#if TBUFSIZE
++ncons;
#endif
}
TBUF
}
Expand Down
7 changes: 0 additions & 7 deletions src/nrniv/netpar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,6 @@ static int weightcnt(NetCon* nc) {
size_t nrncore_netpar_bytes() {
size_t ntot, nin, nout, nnet, nweight;
ntot = nin = nout = nnet = nweight = 0;
size_t npnt = 0;
if (0 && nrnmpi_myid == 0) {
printf("size Presyn=%ld NetCon=%ld Point_process=%ld Prop=%ld\n",
sizeof(PreSyn),
Expand All @@ -1611,9 +1610,6 @@ size_t nrncore_netpar_bytes() {
nnet += n;
for (auto nc: ps->dil_) {
nweight += weightcnt(nc);
if (nc->target_) {
npnt += 1;
}
}
}
}
Expand All @@ -1626,9 +1622,6 @@ size_t nrncore_netpar_bytes() {
nnet += n;
for (auto nc: ps->dil_) {
nweight += weightcnt(nc);
if (nc->target_) {
npnt += 1;
}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/nrniv/nonlinz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,6 @@ void NonLinImpRep::dsds() {
// store element and restore s
// fill the ds/dv elements
for (in = 0; in < ml->nodecount; ++in) {
Node* nd = ml->nodelist[in];
ks = ieq + in * cnt + kks;
for (is = ieq + in * cnt, iis = 0; iis < cnt; ++iis, ++is) {
double ds = (*pvdot_[is] - v_[is].imag()) / deltavec_[is];
Expand Down
11 changes: 0 additions & 11 deletions src/nrniv/nrncore_write/data/cell_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ void CellGroup::mk_cellgroups(neuron::model_sorted_token const& cache_token, Cel
void CellGroup::datumtransform(CellGroup* cgs) {
// ions, area, and POINTER to v or mechanism data.
for (int ith = 0; ith < nrn_nthread; ++ith) {
NrnThread& nt = nrn_threads[ith];
CellGroup& cg = cgs[ith];
// how many mechanisms in use and how many DatumIndices do we need.
MlWithArt& mla = cgs[ith].mlwithart;
Expand Down Expand Up @@ -246,7 +245,6 @@ void CellGroup::datumtransform(CellGroup* cgs) {

void CellGroup::datumindex_fill(int ith, CellGroup& cg, DatumIndices& di, Memb_list* ml) {
NrnThread& nt = nrn_threads[ith];
int nnode = nt.end;
int mcnt = ml->nodecount;
int dsize = bbcore_dparam_size[di.type];
if (dsize == 0) {
Expand Down Expand Up @@ -553,33 +551,24 @@ size_t CellGroup::get_mla_rankbytes(CellGroup* cellgroups_) {
size_t mla_rankbytes = 0;
size_t nbytes;
NrnThread* nt;
NrnThreadMembList* tml;
FOR_THREADS(nt) {
size_t threadbytes = 0;
size_t npnt = 0;
size_t nart = 0;
int ith = nt->id;
nbytes = nt->end * (1 * sizeof(int) + 3 * sizeof(double));
threadbytes += nbytes;

int mechcnt = 0;
size_t mechcnt_instances = 0;
MlWithArt& mla = cellgroups_[ith].mlwithart;
for (size_t i = 0; i < mla.size(); ++i) {
int type = mla[i].first;
Memb_list* ml = mla[i].second;
++mechcnt;
mechcnt_instances += ml->nodecount;
npnt += (memb_func[type].is_point ? ml->nodecount : 0);
int psize = nrn_prop_param_size_[type];
int dpsize = nrn_prop_dparam_size_[type]; // includes cvodeieq if present
// printf("%d %s ispnt %d cnt %d psize %d dpsize %d\n",tml->index,
// memb_func[type].sym->name, memb_func[type].is_point, ml->nodecount, psize, dpsize);
// nodeindices, data, pdata + pnt with prop
int notart = nrn_is_artificial_[type] ? 0 : 1;
if (nrn_is_artificial_[type]) {
nart += ml->nodecount;
}
nbytes = ml->nodecount *
(notart * sizeof(int) + 1 * sizeof(double*) + 1 * sizeof(Datum*) +
psize * sizeof(double) + dpsize * sizeof(Datum));
Expand Down
1 change: 0 additions & 1 deletion src/nrniv/nrncore_write/utils/nrncore_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ int nrn_dblpntr2nrncore(neuron::container::data_handle<double> dh,
NrnThread& nt,
int& type,
int& index) {
int nnode = nt.end;
type = 0;
if (dh.refers_to<neuron::container::Node::field::Voltage>(neuron::model().node_data())) {
auto const cache_token = nrn_ensure_model_data_are_sorted();
Expand Down
1 change: 0 additions & 1 deletion src/nrniv/nrnmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ static void point_menu(Object* ob, int make_label) {
deflt = false;
}
if (is_array(*vsym)) {
Arrayinfo* a = vsym->arayinfo;
for (m = 0; m < vsym->arayinfo->sub[0]; m++) {
if (m > 5)
break;
Expand Down
6 changes: 1 addition & 5 deletions src/nrniv/nvector_nrnparallel_ld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,7 @@ void N_VDestroy_NrnParallelLD(N_Vector v) {
}

void N_VSpace_NrnParallelLD(N_Vector v, long int* lrw, long int* liw) {
MPI_Comm comm;
int npes;

comm = NV_COMM_P_LD(v);
npes = nrnmpi_numprocs;
int npes = nrnmpi_numprocs;

*lrw = NV_GLOBLENGTH_P_LD(v);
*liw = 2 * npes;
Expand Down
3 changes: 0 additions & 3 deletions src/nrniv/nvector_nrnthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ N_Vector N_VNew_NrnThread(long int length, int nthread, long int* sizes) {
int i;
N_Vector v;
N_Vector data;
N_VectorContent_NrnThread* content;

v = N_VNewEmpty_NrnThread(length, nthread, sizes);
if (v == NULL)
Expand Down Expand Up @@ -696,10 +695,8 @@ static void* vwl2norm(NrnThread* nt) {
return nullptr;
}
realtype N_VWL2Norm_NrnThread(N_Vector x, N_Vector w) {
long int N;
retval = ZERO;
xpass wpass nrn_multithread_job(vwl2norm);
N = NV_LENGTH_NT(x);
mydebug2("vwl2norm %.20g\n", RSqrt(retval));
return (RSqrt(retval));
}
Expand Down
3 changes: 0 additions & 3 deletions src/nrniv/nvector_nrnthread_ld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ N_Vector N_VNew_NrnThreadLD(long int length, int nthread, long int* sizes) {
int i;
N_Vector v;
N_Vector data;
N_VectorContent_NrnThreadLD* content;

v = N_VNewEmpty_NrnThreadLD(length, nthread, sizes);
if (v == NULL)
Expand Down Expand Up @@ -707,10 +706,8 @@ static void* vwl2norm(NrnThread* nt) {
return nullptr;
}
realtype N_VWL2Norm_NrnThreadLD(N_Vector x, N_Vector w) {
long int N;
retval = ZERO;
xpass wpass nrn_multithread_job(vwl2norm);
N = NV_LENGTH_NT_LD(x);
mydebug2("vwl2norm %.20g\n", RSqrt(retval));
return (RSqrt(retval));
}
Expand Down
5 changes: 0 additions & 5 deletions src/nrniv/secbrows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,6 @@ SectionBrowserImpl::SectionBrowserImpl() {
scnt_ = 0;
// ForAllSections(sec) //{
ITERATE(qsec, section_list) {
Section* sec = hocSEC(qsec);
++scnt_;
}
psec_ = new Section*[scnt_];
Expand All @@ -390,8 +389,6 @@ SectionBrowserImpl::~SectionBrowserImpl() {

SectionBrowser::SectionBrowser()
: OcBrowser(new BrowserAccept(this), NULL) {
LayoutKit& lk = *LayoutKit::instance();
WidgetKit& wk = *WidgetKit::instance();
sbi_ = new SectionBrowserImpl;
for (int i = 0; i < sbi_->scnt_; ++i) {
append_item(secname(sbi_->psec_[i]));
Expand Down Expand Up @@ -436,7 +433,6 @@ void SectionBrowser::select(GlyphIndex i) {

void SectionBrowser::make_section_browser() {
LayoutKit& lk = *LayoutKit::instance();
WidgetKit& wk = *WidgetKit::instance();
SectionBrowser* sb = new SectionBrowser();
Window* w = new StandardWindow(lk.hbox(sb->standard_glyph(),
lk.hspace(5),
Expand Down Expand Up @@ -492,7 +488,6 @@ PointProcessBrowser::~PointProcessBrowser() {

void PointProcessBrowser::make_point_process_browser(OcList* ocl) {
LayoutKit& lk = *LayoutKit::instance();
WidgetKit& wk = *WidgetKit::instance();
PointProcessBrowser* ppb = new PointProcessBrowser(ocl);
SectionBrowser* sb = new SectionBrowser();
Window* w = new StandardWindow(
Expand Down
15 changes: 4 additions & 11 deletions src/nrniv/shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,6 @@ void OcShape::sel_color(ShapeSection* sold, ShapeSection* snew) {
void OcShape::select_section(Section* sec) {
ShapeSection* s1 = ShapeScene::selected();
ShapeSection* ss;
Section* s;
const Color* c;
ss = shape_section(sec);
sel_color(s1, ss);
if (ss) {
Expand Down Expand Up @@ -829,7 +827,7 @@ declareActionCallback(ShapeScene)
implementActionCallback(ShapeScene)

void ShapeScene::observe(SectionList* sl) {
GlyphIndex i, cnt;
GlyphIndex i;
hoc_Item* qsec;
Section* sec;
ShapeSection* gl;
Expand Down Expand Up @@ -991,7 +989,6 @@ void ShapeScene::rotate(Coord xorg, Coord yorg, Coord zorg, float xrad, float yr

void ShapeScene::transform3d(Rubberband*) {
Rotation3d* rot = r3b_->rotation();
Coord x, y;
// rb->transformer().inverse_transform(rb->x_begin(), rb->y_begin(), x, y);
// printf("ShapeScene::transform3d %g %g\n", x, y);
long i, n;
Expand All @@ -1016,7 +1013,7 @@ void ShapeScene::flush() {
}

void ShapeScene::wholeplot(Coord& x1, Coord& y1, Coord& x2, Coord& y2) const {
long i, j, n = sg_->count();
long i, n = sg_->count();
Coord l, b, r, t;
x1 = y1 = 1e9;
x2 = y2 = -1e9;
Expand Down Expand Up @@ -1280,7 +1277,6 @@ ShapeSection::ShapeSection(Section* sec) {

ShapeSection::~ShapeSection() {
color_->unref();
int n = sec_->npt3d - 1;
delete[] x_;
delete[] y_;
clear_variable();
Expand Down Expand Up @@ -1520,8 +1516,8 @@ void ShapeSection::draw(Canvas* c, const Allocation& a) const {
if (!good()) {
return;
}
float e = 1e-2;
#if 0
float e = 1e-2;
// fails when length very long > 100000. If checking important
// then should use relative comparison
if (!(
Expand Down Expand Up @@ -1578,7 +1574,6 @@ void ShapeSection::fast_draw(Canvas* c, Coord x, Coord y, bool b) const {
double xbegin; // end location already drawn
double xend; // location we'd like to draw to
double dseg; // accurate desired length of segment
double a3dold; // the arc length at i3d-1
double a3dnew; // the arc length at i3d
double frac; // fraction of a segment length of the a3dnew point from
// xend when a3dnew > xend
Expand All @@ -1590,7 +1585,6 @@ void ShapeSection::fast_draw(Canvas* c, Coord x, Coord y, bool b) const {
// a complete a3d interval. We might draw something up to 1.1*dseg in length.
dseg = section_length(sec_) / double(sec_->nnode - 1);
xbegin = 0.;
a3dold = 0.;
i3d = 1;
for (iseg = 0; iseg < sec->nnode - 1; ++iseg) {
if (colorseg_) {
Expand All @@ -1608,7 +1602,6 @@ void ShapeSection::fast_draw(Canvas* c, Coord x, Coord y, bool b) const {
}
xend = double(iseg + 1) * dseg;
for (; i3d < sec->npt3d; ++i3d) {
a3dold = sec_->pt3d[i3d - 1].arc;
a3dnew = sec_->pt3d[i3d].arc;
if (a3dnew > xend) {
frac = (a3dnew - xend) / dseg;
Expand Down Expand Up @@ -1668,7 +1661,7 @@ void ShapeSection::fastidious_draw(Canvas* c,
float a1,
float a2) const {
int i;
float len, f1, f2, d, x1, x2, y1, y2, a, aa;
float f1, f2, d, x1, x2, y1, y2, a, aa;
if (!color) {
return;
}
Expand Down
1 change: 0 additions & 1 deletion src/nrniv/shapeplt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,6 @@ void ColorValueGlyphItem::draw(Canvas* c, const Allocation& a) const {

Glyph* ColorValue::make_glyph() {
LayoutKit& lk = *LayoutKit::instance();
WidgetKit& wk = *WidgetKit::instance();
PolyGlyph* box = lk.vbox(csize + 2);
int c = csize_ ? csize_ : csize;
for (int i = c - 1; i >= 0; --i) {
Expand Down
2 changes: 0 additions & 2 deletions src/nrniv/symdir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ SymDirectory::SymDirectory(Object* ob) {
impl_->sec_ = NULL;
impl_->obj_ = ob;
impl_->t_ = NULL;
int suffix = '.';
impl_->make_pathname("", hoc_object_name(ob), "", '.');
ObjObservable::Attach(impl_->obj_, impl_);
impl_->load_object();
Expand Down Expand Up @@ -487,7 +486,6 @@ void SymDirectoryImpl::load_section() {
char xarg[20];
char buf[100];
Section* sec = sec_;
int n = sec->nnode;

int i = 0;
double x = nrn_arc_position(sec, sec->pnode[0]);
Expand Down