Skip to content

Consistent use of NrnThread, better declarations.#1609

Merged
nrnhines merged 9 commits into
masterfrom
olupton/NrnThread-consistency
Jan 31, 2022
Merged

Consistent use of NrnThread, better declarations.#1609
nrnhines merged 9 commits into
masterfrom
olupton/NrnThread-consistency

Conversation

@olupton

@olupton olupton commented Jan 31, 2022

Copy link
Copy Markdown
Collaborator

This is another precursor to #1597 -- we still generate C code for mechanisms, but it is closer to being valid C++.

Changes in this PR:

  • Delete src/nrnoc/nrnnoiv.cpp, which does not seem to be used or referenced anywhere.
  • Consistently use the name NrnThread, instead of using _NrnThread in some places. Drop #define NrnThread _NrnThread magic.
  • When nocmodl generates function declarations, add the full prototype instead of using C-style declarations that do not specify the number of types of parameters. (double _hoc_%s, static void _ba%d)
  • Do not generate obsolete K&R-style function definitions ((Point_process* _pnt, double* _args, double _lflag), double _watch%d_cond(Point_process* _pnt))
  • When function prototypes do list parameters' number and type, make them correct (_nrn_thread_getelm, check_table_thread_, bbcore_write_t)
  • Fix a compile warning from matherr1 by correcting its return type.
  • Fix a compile warning by undefining _XOPEN_SOURCE before defining it.

@alkino alkino left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIce patch!

Comment thread src/nrnoc/init.cpp Outdated
Comment thread src/nrnoc/init.cpp Outdated
@olupton olupton requested a review from nrnhines January 31, 2022 11:07
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Merging #1609 (3f959d0) into master (6343d30) will decrease coverage by 0.03%.
The diff coverage is 93.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1609      +/-   ##
==========================================
- Coverage   45.18%   45.14%   -0.04%     
==========================================
  Files         551      551              
  Lines      111191   111190       -1     
==========================================
- Hits        50242    50198      -44     
- Misses      60949    60992      +43     
Impacted Files Coverage Δ
src/nrniv/nvector_nrnserial_ld.cpp 59.48% <ø> (ø)
src/oc/hoc.cpp 64.80% <0.00%> (ø)
src/oc/symbol.cpp 68.66% <ø> (ø)
src/scopmath/newton_thread.c 79.26% <ø> (ø)
src/sundials/shared/nvector_serial.c 59.20% <ø> (ø)
src/nrnoc/init.cpp 87.82% <75.00%> (+0.17%) ⬆️
src/nmodl/nocpout.cpp 93.12% <93.33%> (ø)
src/nmodl/deriv.cpp 53.49% <100.00%> (ø)
src/nmodl/kinetic.cpp 84.02% <100.00%> (ø)
src/nmodl/noccout.cpp 94.34% <100.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6343d30...3f959d0. Read the comment docs.

Comment thread src/nrnoc/md1redef.h

@alexsavulescu alexsavulescu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nrnhines nrnhines merged commit db37a42 into master Jan 31, 2022
@nrnhines nrnhines deleted the olupton/NrnThread-consistency branch January 31, 2022 13:34
@olupton olupton mentioned this pull request Feb 1, 2022
6 tasks
@alexsavulescu alexsavulescu mentioned this pull request Mar 22, 2022
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants