From fee21dc6bcf4e31bce13d0896203063b389e8f62 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Mon, 25 Nov 2024 09:46:19 +0100 Subject: [PATCH 1/7] Clean registering of hoc classes --- src/ivoc/graph.cpp | 2 +- src/ivoc/grglyph.cpp | 6 ++---- src/ivoc/ivocrand.cpp | 2 +- src/ivoc/ivocvect.cpp | 6 +++--- src/ivoc/matrix.cpp | 6 +++--- src/ivoc/mlinedit.cpp | 4 ++-- src/ivoc/mymath.cpp | 4 ++-- src/ivoc/ocbox.cpp | 6 +++--- src/ivoc/ocdeck.cpp | 4 ++-- src/ivoc/ocfile.cpp | 6 +++--- src/ivoc/oclist.cpp | 2 +- src/ivoc/ocpointer.cpp | 4 ++-- src/ivoc/ocptrvector.cpp | 6 +++--- src/ivoc/octimer.cpp | 4 ++-- src/ivoc/pwman.cpp | 6 +++--- src/ivoc/strfun.cpp | 4 ++-- src/ivoc/symchoos.cpp | 4 ++-- src/ivoc/xmenu.cpp | 4 ++-- src/nrncvode/cvodeobj.cpp | 2 +- src/nrncvode/netcvode.cpp | 6 +++--- src/nrniv/bbsavestate.cpp | 4 ++-- src/nrniv/finithnd.cpp | 2 +- src/nrniv/impedanc.cpp | 2 +- src/nrniv/kschan.cpp | 6 +----- src/nrniv/linmod1.cpp | 4 ++-- src/nrniv/nrnmenu.cpp | 4 ++-- src/nrniv/nrnpy.cpp | 3 +-- src/nrniv/nrnste.cpp | 4 ++-- src/nrniv/ppshape.cpp | 4 ++-- src/nrniv/savstate.cpp | 4 ++-- src/nrniv/secbrows.cpp | 4 ++-- src/nrniv/shape.cpp | 6 +++--- src/nrniv/shapeplt.cpp | 6 +++--- src/nrniv/spaceplt.cpp | 6 +++--- src/nrnoc/seclist.cpp | 2 +- src/nrnoc/secref.cpp | 2 +- src/nrnpython/nrnpy_p2h.cpp | 20 +++++++++----------- 37 files changed, 81 insertions(+), 90 deletions(-) diff --git a/src/ivoc/graph.cpp b/src/ivoc/graph.cpp index aef2b933d9..61582a24bb 100644 --- a/src/ivoc/graph.cpp +++ b/src/ivoc/graph.cpp @@ -1194,7 +1194,7 @@ static Member_func gr_members[] = {{"plot", gr_plot}, {"gif", ivoc_gr_gif}, {"menu_remove", ivoc_gr_menu_remove}, {"line_info", gr_line_info}, - {0, 0}}; + {nullptr, nullptr}}; static void* gr_cons(Object* ho) { TRY_GUI_REDIRECT_OBJ("Graph", NULL); diff --git a/src/ivoc/grglyph.cpp b/src/ivoc/grglyph.cpp index 2c5bc94e6d..df245c7017 100644 --- a/src/ivoc/grglyph.cpp +++ b/src/ivoc/grglyph.cpp @@ -184,8 +184,6 @@ static Object** g_gif(void* v) { static Symbol* sggl_; -Member_func members[] = {{0, 0}}; - Member_ret_obj_func objmembers[] = {{"path", g_new_path}, {"m", g_move_to}, {"l", g_line_to}, @@ -197,7 +195,7 @@ Member_ret_obj_func objmembers[] = {{"path", g_new_path}, {"erase", g_erase}, {"gif", g_gif}, {"circle", g_circle}, - {0, 0}}; + {nullptr, nullptr}}; static void* cons(Object* o) { TRY_GUI_REDIRECT_OBJ("Glyph", NULL); @@ -213,7 +211,7 @@ static void destruct(void* v) { } void GrGlyph_reg() { - class2oc("Glyph", cons, destruct, members, objmembers, NULL); + class2oc("Glyph", cons, destruct, nullptr, objmembers, nullptr); sggl_ = hoc_lookup("Glyph"); } diff --git a/src/ivoc/ivocrand.cpp b/src/ivoc/ivocrand.cpp index 0fdb2b33d3..e141d70db3 100644 --- a/src/ivoc/ivocrand.cpp +++ b/src/ivoc/ivocrand.cpp @@ -425,7 +425,7 @@ static Member_func r_members[] = {{"MCellRan4", r_MCellRan4}, {nullptr, nullptr}}; void Random_reg() { - class2oc("Random", r_cons, r_destruct, r_members, NULL, NULL); + class2oc("Random", r_cons, r_destruct, r_members, nullptr, nullptr); random_play_list_ = new RandomPlayList; } diff --git a/src/ivoc/ivocvect.cpp b/src/ivoc/ivocvect.cpp index 9681a6b270..48fff8e45b 100644 --- a/src/ivoc/ivocvect.cpp +++ b/src/ivoc/ivocvect.cpp @@ -3737,7 +3737,7 @@ static Member_func v_members[] = { {"scale", v_scale}, - {0, 0}}; + {nullptr, nullptr}}; static Member_ret_obj_func v_retobj_members[] = {{"c", v_c}, {"cl", v_cl}, @@ -3813,11 +3813,11 @@ static Member_ret_obj_func v_retobj_members[] = {{"c", v_c}, {"to_python", v_to_python}, {"as_numpy", v_as_numpy}, - {0, 0}}; + {nullptr, nullptr}}; static Member_ret_str_func v_retstr_members[] = {{"label", v_label}, - {0, 0}}; + {nullptr, nullptr}}; extern int hoc_araypt(Symbol*, int); diff --git a/src/ivoc/matrix.cpp b/src/ivoc/matrix.cpp index ddc8d41cfa..441fd57ddd 100644 --- a/src/ivoc/matrix.cpp +++ b/src/ivoc/matrix.cpp @@ -657,7 +657,7 @@ static Member_func m_members[] = { {"printf", m_printf}, {"fprint", m_fprint}, {"scanf", m_scanf}, - {0, 0}}; + {nullptr, nullptr}}; static Member_ret_obj_func m_retobj_members[] = { // returns Vector @@ -687,7 +687,7 @@ static Member_ret_obj_func m_retobj_members[] = { {"set", m_set}, {"to_vector", m_to_vector}, {"from_vector", m_from_vector}, - {0, 0}}; + {nullptr, nullptr}}; static void* m_cons(Object* o) { int i = 1, j = 1, storage_type = Matrix::MFULL; @@ -729,7 +729,7 @@ void Matrix_reg(); #endif void Matrix_reg() { - class2oc("Matrix", m_cons, m_destruct, m_members, m_retobj_members, NULL); + class2oc("Matrix", m_cons, m_destruct, m_members, m_retobj_members, nullptr); nrn_matrix_sym = hoc_lookup("Matrix"); // now make the x variable an actual double Symbol* sx = hoc_table_lookup("x", nrn_matrix_sym->u.ctemplate->symtable); diff --git a/src/ivoc/mlinedit.cpp b/src/ivoc/mlinedit.cpp index 489719af73..d4f9db5529 100644 --- a/src/ivoc/mlinedit.cpp +++ b/src/ivoc/mlinedit.cpp @@ -101,9 +101,9 @@ static const char** v_text(void* v) { } -static Member_func members[] = {{"readonly", readonly}, {"map", map}, {0, 0}}; +static Member_func members[] = {{"readonly", readonly}, {"map", map}, {nullptr, nullptr}}; -static Member_ret_str_func retstr_members[] = {{"text", v_text}, {0, 0}}; +static Member_ret_str_func retstr_members[] = {{"text", v_text}, {nullptr, nullptr}}; static void* cons(Object*) { TRY_GUI_REDIRECT_OBJ("TextEditor", NULL); diff --git a/src/ivoc/mymath.cpp b/src/ivoc/mymath.cpp index 13586a43ad..07c62ef077 100644 --- a/src/ivoc/mymath.cpp +++ b/src/ivoc/mymath.cpp @@ -64,7 +64,7 @@ static Member_func members[] = {{"d2line", distance_to_line}, {"d2line_seg", distance_to_line_segment}, {"inside", inside}, {"feround", feround}, - {0, 0}}; + {nullptr, nullptr}}; static void* cons(Object*) { return NULL; @@ -73,7 +73,7 @@ static void* cons(Object*) { static void destruct(void*) {} void GUIMath_reg() { - class2oc("GUIMath", cons, destruct, members, NULL, NULL); + class2oc("GUIMath", cons, destruct, members, nullptr, nullptr); } double MyMath::anint(double x) { diff --git a/src/ivoc/ocbox.cpp b/src/ivoc/ocbox.cpp index 61a1320a96..cf303a0fc7 100644 --- a/src/ivoc/ocbox.cpp +++ b/src/ivoc/ocbox.cpp @@ -426,14 +426,14 @@ static Member_func members[] = {{"intercept", intercept}, // #if HAVE {"dialog", dialog}, // #if HAVE_IV ok {"priority", ses_pri}, {"size", b_size}, - {0, 0}}; + {nullptr, nullptr}}; void HBox_reg() { - class2oc("HBox", hcons, destruct, members, NULL, NULL); + class2oc("HBox", hcons, destruct, members, nullptr, nullptr); } void VBox_reg() { - class2oc("VBox", vcons, destruct, members, NULL, NULL); + class2oc("VBox", vcons, destruct, members, nullptr, nullptr); } #if HAVE_IV OcGlyphContainer::OcGlyphContainer() diff --git a/src/ivoc/ocdeck.cpp b/src/ivoc/ocdeck.cpp index be5d6f32db..872b26d174 100644 --- a/src/ivoc/ocdeck.cpp +++ b/src/ivoc/ocdeck.cpp @@ -236,10 +236,10 @@ static Member_func members[] = {{"flip_to", flip_to}, {"remove_last", remove_last}, {"remove", remove}, {"move_last", move_last}, - {0, 0}}; + {nullptr, nullptr}}; void OcDeck_reg() { - class2oc("Deck", cons, destruct, members, NULL, NULL); + class2oc("Deck", cons, destruct, members, nullptr, nullptr); } #if HAVE_IV OcDeck::OcDeck() diff --git a/src/ivoc/ocfile.cpp b/src/ivoc/ocfile.cpp index fcad2b14ff..e57b484178 100644 --- a/src/ivoc/ocfile.cpp +++ b/src/ivoc/ocfile.cpp @@ -294,12 +294,12 @@ Member_func f_members[] = {{"ropen", f_ropen}, {"mktemp", f_mktemp}, {"unlink", f_unlink}, {"flush", f_flush}, - {0, 0}}; + {nullptr, nullptr}}; -static Member_ret_str_func f_retstr_members[] = {{"getname", f_get_name}, {"dir", f_dir}, {0, 0}}; +static Member_ret_str_func f_retstr_members[] = {{"getname", f_get_name}, {"dir", f_dir}, {nullptr, nullptr}}; void OcFile_reg() { - class2oc("File", f_cons, f_destruct, f_members, NULL, f_retstr_members); + class2oc("File", f_cons, f_destruct, f_members, nullptr, f_retstr_members); file_class_sym_ = hoc_lookup("File"); } diff --git a/src/ivoc/oclist.cpp b/src/ivoc/oclist.cpp index b19e129966..f01d8d76b3 100644 --- a/src/ivoc/oclist.cpp +++ b/src/ivoc/oclist.cpp @@ -454,7 +454,7 @@ OcList::~OcList() { void OcList_reg() { // printf("Oclist_reg\n"); - class2oc("List", l_cons, l_destruct, l_members, l_retobj_members, NULL); + class2oc("List", l_cons, l_destruct, l_members, l_retobj_members, nullptr); list_class_sym_ = hoc_lookup("List"); } diff --git a/src/ivoc/ocpointer.cpp b/src/ivoc/ocpointer.cpp index afe3451316..bc90f21506 100644 --- a/src/ivoc/ocpointer.cpp +++ b/src/ivoc/ocpointer.cpp @@ -68,7 +68,7 @@ static const char** pname(void* v) { static Member_func members[] = {{"val", 0}, // will be changed below {"assign", assign}, // will call assign_stmt if it exists - {0, 0}}; + {nullptr, nullptr}}; static Member_ret_str_func s_memb[] = {{"s", pname}, {nullptr, nullptr}}; @@ -108,7 +108,7 @@ static void steer_val(void* v) { } void OcPointer_reg() { - class2oc("Pointer", cons, destruct, members, NULL, s_memb); + class2oc("Pointer", cons, destruct, members, nullptr, s_memb); // now make the val variable an actual double Symbol* sv = hoc_lookup("Pointer"); Symbol* sx = hoc_table_lookup("val", sv->u.ctemplate->symtable); diff --git a/src/ivoc/ocptrvector.cpp b/src/ivoc/ocptrvector.cpp index d624bce5d9..71f321e356 100644 --- a/src/ivoc/ocptrvector.cpp +++ b/src/ivoc/ocptrvector.cpp @@ -206,9 +206,9 @@ static Member_func members[] = {{"size", get_size}, {"scatter", scatter}, {"gather", gather}, {"plot", ptr_plot}, - {0, 0}}; + {nullptr, nullptr}}; -static Member_ret_str_func retstr_members[] = {{"label", ptr_label}, {0, 0}}; +static Member_ret_str_func retstr_members[] = {{"label", ptr_label}, {nullptr, nullptr}}; static void* cons(Object*) { int sz; @@ -222,6 +222,6 @@ static void destruct(void* v) { } void OcPtrVector_reg() { - class2oc("PtrVector", cons, destruct, members, 0, retstr_members); + class2oc("PtrVector", cons, destruct, members, nullptr, retstr_members); pv_class_sym_ = hoc_lookup("PtrVector"); } diff --git a/src/ivoc/octimer.cpp b/src/ivoc/octimer.cpp index 560394f2a4..04e5a53272 100644 --- a/src/ivoc/octimer.cpp +++ b/src/ivoc/octimer.cpp @@ -96,10 +96,10 @@ static void t_destruct(void* v) { #endif /* HAVE_IV */ } -Member_func t_members[] = {{"seconds", t_seconds}, {"start", t_start}, {"end", t_stop}, {0, 0}}; +Member_func t_members[] = {{"seconds", t_seconds}, {"start", t_start}, {"end", t_stop}, {nullptr, nullptr}}; void OcTimer_reg() { - class2oc("Timer", t_cons, t_destruct, t_members, NULL, NULL); + class2oc("Timer", t_cons, t_destruct, t_members, nullptr, nullptr); } #if HAVE_IV OcTimer::OcTimer(const char* cmd) { diff --git a/src/ivoc/pwman.cpp b/src/ivoc/pwman.cpp index d0ec316a47..e98c1c8d4a 100644 --- a/src/ivoc/pwman.cpp +++ b/src/ivoc/pwman.cpp @@ -794,11 +794,11 @@ static Member_func members[] = {{"count", pwman_count}, {"printfile", pwman_printfile}, {"landscape", pwman_landscape}, {"deco", pwman_deco}, - {0, 0}}; + {nullptr, nullptr}}; -static Member_ret_obj_func retobj_members[] = {{"group", pwman_group}, {0, 0}}; +static Member_ret_obj_func retobj_members[] = {{"group", pwman_group}, {nullptr, nullptr}}; -static Member_ret_str_func s_memb[] = {{"name", pwman_name}, {0, 0}}; +static Member_ret_str_func s_memb[] = {{"name", pwman_name}, {nullptr, nullptr}}; void PWManager_reg() { class2oc("PWManager", pwman_cons, pwman_destruct, members, retobj_members, s_memb); diff --git a/src/ivoc/strfun.cpp b/src/ivoc/strfun.cpp index 721dae09ec..478b9ae05f 100644 --- a/src/ivoc/strfun.cpp +++ b/src/ivoc/strfun.cpp @@ -370,9 +370,9 @@ static Member_func l_members[] = {{"substr", l_substr}, {"references", l_ref}, {"is_point_process", l_is_point}, {"is_artificial", l_is_artificial}, - {0, 0}}; + {nullptr, nullptr}}; -static Member_ret_obj_func l_obj_members[] = {{"alias_list", l_alias_list}, {0, 0}}; +static Member_ret_obj_func l_obj_members[] = {{"alias_list", l_alias_list}, {nullptr, nullptr}}; static void* l_cons(Object*) { return nullptr; diff --git a/src/ivoc/symchoos.cpp b/src/ivoc/symchoos.cpp index f3fe138876..6fcb1fefd4 100644 --- a/src/ivoc/symchoos.cpp +++ b/src/ivoc/symchoos.cpp @@ -207,9 +207,9 @@ static double text(void* v) { return 0.; #endif /* HAVE_IV */ } -static Member_func members[] = {{"run", srun}, {"text", text}, {0, 0}}; +static Member_func members[] = {{"run", srun}, {"text", text}, {nullptr, nullptr}}; void SymChooser_reg() { - class2oc("SymChooser", scons, sdestruct, members, NULL, NULL); + class2oc("SymChooser", scons, sdestruct, members, nullptr, nullptr); } #if HAVE_IV diff --git a/src/ivoc/xmenu.cpp b/src/ivoc/xmenu.cpp index 9c91e93fd8..b728686020 100644 --- a/src/ivoc/xmenu.cpp +++ b/src/ivoc/xmenu.cpp @@ -3125,7 +3125,7 @@ static double vfe_default(void* v) { #endif return x; } -static Member_func vfe_members[] = {{"default", vfe_default}, {0, 0}}; +static Member_func vfe_members[] = {{"default", vfe_default}, {nullptr, nullptr}}; void ValueFieldEditor_reg() { - class2oc("ValueFieldEditor", vfe_cons, vfe_destruct, vfe_members, NULL, NULL); + class2oc("ValueFieldEditor", vfe_cons, vfe_destruct, vfe_members, nullptr, nullptr); } diff --git a/src/nrncvode/cvodeobj.cpp b/src/nrncvode/cvodeobj.cpp index d7fc1660ed..cdb05b511e 100644 --- a/src/nrncvode/cvodeobj.cpp +++ b/src/nrncvode/cvodeobj.cpp @@ -653,7 +653,7 @@ static void destruct(void* v) { #endif } void Cvode_reg() { - class2oc("CVode", cons, destruct, members, omembers, NULL); + class2oc("CVode", cons, destruct, members, omembers, nullptr); net_cvode_instance = new NetCvode(1); Daspk::dteps_ = 1e-9; // change with cvode.dae_init_dteps(newval) } diff --git a/src/nrncvode/netcvode.cpp b/src/nrncvode/netcvode.cpp index 51be002370..1fe933ce9f 100644 --- a/src/nrncvode/netcvode.cpp +++ b/src/nrncvode/netcvode.cpp @@ -763,7 +763,7 @@ static Member_func members[] = {{"active", nc_active}, {"weight", 0}, {"threshold", 0}, {"x", 0}, - {0, 0}}; + {nullptr, nullptr}}; static Member_ret_obj_func omembers[] = {{"syn", nc_syn}, {"pre", nc_pre}, @@ -776,7 +776,7 @@ static Member_ret_obj_func omembers[] = {{"syn", nc_syn}, {"precelllist", nc_precelllist}, {"postcelllist", nc_postcelllist}, {"get_recordvec", nc_get_recordvec}, - {0, 0}}; + {nullptr, nullptr}}; static void steer_val(void* v) { NetCon* d = (NetCon*) v; @@ -848,7 +848,7 @@ static void destruct(void* v) { } void NetCon_reg() { - class2oc("NetCon", cons, destruct, members, omembers, NULL); + class2oc("NetCon", cons, destruct, members, omembers, nullptr); Symbol* nc = hoc_lookup("NetCon"); nc->u.ctemplate->steer = steer_val; Symbol* s; diff --git a/src/nrniv/bbsavestate.cpp b/src/nrniv/bbsavestate.cpp index 0dc6614710..da250dbd79 100644 --- a/src/nrniv/bbsavestate.cpp +++ b/src/nrniv/bbsavestate.cpp @@ -1008,10 +1008,10 @@ static Member_func members[] = {{"save", save}, {"ignore", ppignore}, // allow Vector.play to work {"vector_play_init", vector_play_init}, - {0, 0}}; + {nullptr, nullptr}}; void BBSaveState_reg() { - class2oc("BBSaveState", cons, destruct, members, NULL, NULL); + class2oc("BBSaveState", cons, destruct, members, nullptr, nullptr); } // from savstate.cpp diff --git a/src/nrniv/finithnd.cpp b/src/nrniv/finithnd.cpp index d29e0b4864..7b30c17b33 100644 --- a/src/nrniv/finithnd.cpp +++ b/src/nrniv/finithnd.cpp @@ -89,7 +89,7 @@ static void finithnd_destruct(void* v) { } void FInitializeHandler_reg() { - class2oc("FInitializeHandler", finithnd_cons, finithnd_destruct, members, NULL, NULL); + class2oc("FInitializeHandler", finithnd_cons, finithnd_destruct, members, nullptr, nullptr); } std::vector FInitialHandler::fihlist_[4]; diff --git a/src/nrniv/impedanc.cpp b/src/nrniv/impedanc.cpp index 8d1621a8ec..e11543fe32 100644 --- a/src/nrniv/impedanc.cpp +++ b/src/nrniv/impedanc.cpp @@ -144,7 +144,7 @@ static Member_func members[] = {{"compute", compute}, {"input_phase", input_phase}, {"transfer_phase", transfer_phase}, {"deltafac", deltafac}, - {0, 0}}; + {nullptr, nullptr}}; void Impedance_reg() { class2oc("Impedance", cons, destruct, members, nullptr, nullptr); diff --git a/src/nrniv/kschan.cpp b/src/nrniv/kschan.cpp index a5c8fc8a86..fd5c3e315c 100644 --- a/src/nrniv/kschan.cpp +++ b/src/nrniv/kschan.cpp @@ -734,10 +734,6 @@ static Member_func ksg_dmem[] = {{"nstate", ksg_nstate}, {"index", ksg_index}, {nullptr, nullptr}}; -static Member_ret_obj_func ksg_omem[] = {{nullptr, nullptr}}; - -static Member_ret_str_func ksg_smem[] = {{nullptr, nullptr}}; - static Member_func kst_dmem[] = {{"set_f", kst_set_f}, {"index", kst_index}, {"type", kst_type}, @@ -800,7 +796,7 @@ static void kst_destruct(void*) {} void KSChan_reg() { class2oc("KSChan", ks_cons, ks_destruct, ks_dmem, ks_omem, ks_smem); - class2oc("KSGate", ksg_cons, ksg_destruct, ksg_dmem, ksg_omem, ksg_smem); + class2oc("KSGate", ksg_cons, ksg_destruct, ksg_dmem, nullptr, nullptr); class2oc("KSState", kss_cons, kss_destruct, kss_dmem, kss_omem, kss_smem); class2oc("KSTrans", kst_cons, kst_destruct, kst_dmem, kst_omem, kst_smem); ksstate_sym = hoc_lookup("KSState"); diff --git a/src/nrniv/linmod1.cpp b/src/nrniv/linmod1.cpp index 2df98917fe..053ff068c3 100644 --- a/src/nrniv/linmod1.cpp +++ b/src/nrniv/linmod1.cpp @@ -47,7 +47,7 @@ static double valid(void* v) { return double(((LinearMechanism*) v)->valid()); } -static Member_func members[] = {{"valid", valid}, {0, 0}}; +static Member_func members[] = {{"valid", valid}, {nullptr, nullptr}}; static void* cons(Object*) { LinearMechanism* m = new LinearMechanism(); @@ -61,7 +61,7 @@ static void destruct(void* v) { } void LinearMechanism_reg() { - class2oc("LinearMechanism", cons, destruct, members, NULL, NULL); + class2oc("LinearMechanism", cons, destruct, members, nullptr, nullptr); } LinearMechanism::LinearMechanism() { diff --git a/src/nrniv/nrnmenu.cpp b/src/nrniv/nrnmenu.cpp index 0f8e87f750..6dec4cfe84 100644 --- a/src/nrniv/nrnmenu.cpp +++ b/src/nrniv/nrnmenu.cpp @@ -666,10 +666,10 @@ static Member_func ms_members[] = {{"panel", ms_panel}, {"is_array", ms_is_array}, {"name", ms_name}, {"save", ms_save}, - {0, 0}}; + {nullptr, nullptr}}; void MechanismStandard_reg() { - class2oc("MechanismStandard", ms_cons, ms_destruct, ms_members, NULL, NULL); + class2oc("MechanismStandard", ms_cons, ms_destruct, ms_members, nullptr, nullptr); ms_class_sym_ = hoc_lookup("MechanismStandard"); } diff --git a/src/nrniv/nrnpy.cpp b/src/nrniv/nrnpy.cpp index dec03193e5..6cfebd30c6 100644 --- a/src/nrniv/nrnpy.cpp +++ b/src/nrniv/nrnpy.cpp @@ -52,7 +52,6 @@ static void* p_cons(Object*) { return nullptr; } static void p_destruct(void*) {} -static Member_func p_members[] = {{nullptr, nullptr}}; #ifdef NRNPYTHON_DYNAMICLOAD static std::string nrnpy_pylib{}, nrnpy_pyversion{}; @@ -251,7 +250,7 @@ void nrnpython_reg() { #endif // Stub implementation of PythonObject if Python support was not enabled, or a nrnpython library // could not be loaded. - class2oc("PythonObject", p_cons, p_destruct, p_members, nullptr, nullptr); + class2oc("PythonObject", p_cons, p_destruct, nullptr, nullptr, nullptr); } #ifdef NRNPYTHON_DYNAMICLOAD // to end of file diff --git a/src/nrniv/nrnste.cpp b/src/nrniv/nrnste.cpp index 52a30bfaa0..f4afa418fb 100644 --- a/src/nrniv/nrnste.cpp +++ b/src/nrniv/nrnste.cpp @@ -46,7 +46,7 @@ static double ste_state(void* v) { return (double) state; } -static Member_func members[] = {{"transition", ste_transition}, {"state", ste_state}, {0, 0}}; +static Member_func members[] = {{"transition", ste_transition}, {"state", ste_state}, {nullptr, nullptr}}; static void* ste_cons(Object*) { int nstate = (int) chkarg(1, 1, 1e6); @@ -65,7 +65,7 @@ static void ste_destruct(void* v) { } void StateTransitionEvent_reg() { - class2oc("StateTransitionEvent", ste_cons, ste_destruct, members, NULL, NULL); + class2oc("StateTransitionEvent", ste_cons, ste_destruct, members, nullptr, nullptr); } StateTransitionEvent::StateTransitionEvent(int nstate, Point_process* pnt) diff --git a/src/nrniv/ppshape.cpp b/src/nrniv/ppshape.cpp index a87937ed12..ae75579e5a 100644 --- a/src/nrniv/ppshape.cpp +++ b/src/nrniv/ppshape.cpp @@ -25,7 +25,7 @@ static double pp_append(void* v) { static Member_func pp_members[] = { // {"view", pp_view}, {"append", pp_append}, - {0, 0}}; + {nullptr, nullptr}}; static void* pp_cons(Object* ho) { TRY_GUI_REDIRECT_OBJ("PPShape", NULL); @@ -54,7 +54,7 @@ static void pp_destruct(void* v) { void PPShape_reg() { // printf("PPShape_reg\n"); - class2oc("PPShape", pp_cons, pp_destruct, pp_members, NULL, NULL); + class2oc("PPShape", pp_cons, pp_destruct, pp_members, nullptr, nullptr); } #if HAVE_IV // to end of file diff --git a/src/nrniv/savstate.cpp b/src/nrniv/savstate.cpp index 647e5688e2..31c2bbff9c 100644 --- a/src/nrniv/savstate.cpp +++ b/src/nrniv/savstate.cpp @@ -1274,8 +1274,8 @@ static Member_func members[] = {{"save", save}, {"restore", restore}, {"fread", ssread}, {"fwrite", sswrite}, - {0, 0}}; + {nullptr, nullptr}}; void SaveState_reg() { - class2oc("SaveState", cons, destruct, members, NULL, NULL); + class2oc("SaveState", cons, destruct, members, nullptr, nullptr); } diff --git a/src/nrniv/secbrows.cpp b/src/nrniv/secbrows.cpp index a74ecfd39e..84263229b6 100644 --- a/src/nrniv/secbrows.cpp +++ b/src/nrniv/secbrows.cpp @@ -67,7 +67,7 @@ static double sb_accept_action(void* v) { static Member_func sb_members[] = {{"select", sb_select}, {"select_action", sb_select_action}, {"accept_action", sb_accept_action}, - {0, 0}}; + {nullptr, nullptr}}; static void* sb_cons(Object*) { TRY_GUI_REDIRECT_OBJ("SectionBrowser", NULL); Object* ob; @@ -96,7 +96,7 @@ static void sb_destruct(void* v) { #endif } void SectionBrowser_reg() { - class2oc("SectionBrowser", sb_cons, sb_destruct, sb_members, NULL, NULL); + class2oc("SectionBrowser", sb_cons, sb_destruct, sb_members, nullptr, nullptr); } #if HAVE_IV diff --git a/src/nrniv/shape.cpp b/src/nrniv/shape.cpp index 96eddef0a9..46279966ee 100644 --- a/src/nrniv/shape.cpp +++ b/src/nrniv/shape.cpp @@ -556,11 +556,11 @@ static Member_func sh_members[] = {{"nearest", nrniv_sh_nearest}, {"erase_all", ivoc_erase_all}, {"len_scale", nrniv_len_scale}, {"gif", ivoc_gr_gif}, - {0, 0}}; + {nullptr, nullptr}}; static Member_ret_obj_func retobj_members[] = {{"nearest_seg", nrniv_sh_nearest_seg}, {"selected_seg", nrniv_sh_selected_seg}, - {NULL, NULL}}; + {nullptr, nullptr}}; static void* sh_cons(Object* ho) { @@ -605,7 +605,7 @@ static void sh_destruct(void* v) { } void Shape_reg() { // printf("Shape_reg\n"); - class2oc("Shape", sh_cons, sh_destruct, sh_members, retobj_members, NULL); + class2oc("Shape", sh_cons, sh_destruct, sh_members, retobj_members, nullptr); } #if HAVE_IV diff --git a/src/nrniv/shapeplt.cpp b/src/nrniv/shapeplt.cpp index a35516da96..719b9e85f8 100644 --- a/src/nrniv/shapeplt.cpp +++ b/src/nrniv/shapeplt.cpp @@ -347,11 +347,11 @@ static Member_func sh_members[] = {{"hinton", sh_hinton}, {"erase_all", ivoc_erase_all}, {"len_scale", nrniv_len_scale}, {"gif", ivoc_gr_gif}, - {0, 0}}; + {nullptr, nullptr}}; static Member_ret_obj_func retobj_members[] = {{"nearest_seg", nrniv_sh_nearest_seg}, {"selected_seg", nrniv_sh_selected_seg}, - {NULL, NULL}}; + {nullptr, nullptr}}; static void* sh_cons(Object* ho) { TRY_GUI_REDIRECT_OBJ("PlotShape", NULL); @@ -426,7 +426,7 @@ static void sh_destruct(void* v) { } void PlotShape_reg() { // printf("PlotShape_reg\n"); - class2oc("PlotShape", sh_cons, sh_destruct, sh_members, retobj_members, NULL); + class2oc("PlotShape", sh_cons, sh_destruct, sh_members, retobj_members, nullptr); } void* ShapePlotData::varobj() const { diff --git a/src/nrniv/spaceplt.cpp b/src/nrniv/spaceplt.cpp index 1978cafdfb..49a220aee6 100644 --- a/src/nrniv/spaceplt.cpp +++ b/src/nrniv/spaceplt.cpp @@ -254,9 +254,9 @@ static Member_func s_members[] = {{"begin", s_begin}, {"color", s_color}, {"to_vector", to_vector}, {"from_vector", from_vector}, - {0, 0}}; + {nullptr, nullptr}}; -static Member_ret_obj_func rvp_retobj_members[] = {{"vector", rvp_vector}, {0, 0}}; +static Member_ret_obj_func rvp_retobj_members[] = {{"vector", rvp_vector}, {nullptr, nullptr}}; static void* s_cons(Object*) { char* var = NULL; @@ -291,7 +291,7 @@ static void s_destruct(void* v) { void RangeVarPlot_reg() { // printf("RangeVarPlot_reg\n"); - class2oc("RangeVarPlot", s_cons, s_destruct, s_members, rvp_retobj_members, NULL); + class2oc("RangeVarPlot", s_cons, s_destruct, s_members, rvp_retobj_members, nullptr); } #if HAVE_IV diff --git a/src/nrnoc/seclist.cpp b/src/nrnoc/seclist.cpp index b991580f19..f5562c31ae 100644 --- a/src/nrnoc/seclist.cpp +++ b/src/nrnoc/seclist.cpp @@ -250,7 +250,7 @@ static Member_func members[] = {{"append", append}, {"printnames", printnames}, {"contains", contains}, {"allroots", allroots}, - {0, 0}}; + {nullptr, nullptr}}; extern void class2oc(const char*, diff --git a/src/nrnoc/secref.cpp b/src/nrnoc/secref.cpp index 7b1f5dd793..38a2ad7277 100644 --- a/src/nrnoc/secref.cpp +++ b/src/nrnoc/secref.cpp @@ -297,7 +297,7 @@ static Member_func members[] = {{"sec", s_rename}, /* will actually become a SEC {"rename", s_rename}, {"unname", s_unname}, {"is_cas", s_cas}, - {0, 0}}; + {nullptr, nullptr}}; Section* nrn_sectionref_steer(Section* sec, Symbol* sym, int* pnindex) { Section* s = 0; diff --git a/src/nrnpython/nrnpy_p2h.cpp b/src/nrnpython/nrnpy_p2h.cpp index 8bfce5329a..2ec3af6b42 100644 --- a/src/nrnpython/nrnpy_p2h.cpp +++ b/src/nrnpython/nrnpy_p2h.cpp @@ -31,16 +31,6 @@ struct Py2Nrn final { PyObject* po_{}; }; -static void* p_cons(Object*) { - return new Py2Nrn{}; -} - -static void p_destruct(void* v) { - delete static_cast(v); -} - -Member_func p_members[] = {{nullptr, nullptr}}; - static void call_python_with_section(Object* pyact, Section* sec) { nb::callable po = nb::borrow(((Py2Nrn*) pyact->u.this_pointer)->po_); nanobind::gil_scoped_acquire lock{}; @@ -920,13 +910,21 @@ static void restore_thread(PyThreadState* g) { void nrnpython_reg_real_nrnpython_cpp(neuron::python::impl_ptrs* ptrs); void nrnpython_reg_real_nrnpy_hoc_cpp(neuron::python::impl_ptrs* ptrs); +static void* p_cons(Object*) { + return new Py2Nrn{}; +} + +static void p_destruct(void* v) { + delete static_cast(v); +} + /** * @brief Populate NEURON state with information from a specific Python. * @param ptrs Logically a return value; avoidi */ extern "C" NRN_EXPORT void nrnpython_reg_real(neuron::python::impl_ptrs* ptrs) { assert(ptrs); - class2oc("PythonObject", p_cons, p_destruct, p_members, nullptr, nullptr); + class2oc("PythonObject", p_cons, p_destruct, nullptr, nullptr, nullptr); nrnpy_pyobj_sym_ = hoc_lookup("PythonObject"); assert(nrnpy_pyobj_sym_); ptrs->callable_with_args = callable_with_args; From ec02ad30c0183a7e133f232c520a987c07541ded Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Mon, 25 Nov 2024 09:49:57 +0100 Subject: [PATCH 2/7] Format --- src/ivoc/ocfile.cpp | 4 +++- src/ivoc/octimer.cpp | 5 ++++- src/nrniv/nrnste.cpp | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ivoc/ocfile.cpp b/src/ivoc/ocfile.cpp index e57b484178..d6f3e37c9e 100644 --- a/src/ivoc/ocfile.cpp +++ b/src/ivoc/ocfile.cpp @@ -296,7 +296,9 @@ Member_func f_members[] = {{"ropen", f_ropen}, {"flush", f_flush}, {nullptr, nullptr}}; -static Member_ret_str_func f_retstr_members[] = {{"getname", f_get_name}, {"dir", f_dir}, {nullptr, nullptr}}; +static Member_ret_str_func f_retstr_members[] = {{"getname", f_get_name}, + {"dir", f_dir}, + {nullptr, nullptr}}; void OcFile_reg() { class2oc("File", f_cons, f_destruct, f_members, nullptr, f_retstr_members); diff --git a/src/ivoc/octimer.cpp b/src/ivoc/octimer.cpp index 04e5a53272..d76cc6a8b2 100644 --- a/src/ivoc/octimer.cpp +++ b/src/ivoc/octimer.cpp @@ -96,7 +96,10 @@ static void t_destruct(void* v) { #endif /* HAVE_IV */ } -Member_func t_members[] = {{"seconds", t_seconds}, {"start", t_start}, {"end", t_stop}, {nullptr, nullptr}}; +Member_func t_members[] = {{"seconds", t_seconds}, + {"start", t_start}, + {"end", t_stop}, + {nullptr, nullptr}}; void OcTimer_reg() { class2oc("Timer", t_cons, t_destruct, t_members, nullptr, nullptr); diff --git a/src/nrniv/nrnste.cpp b/src/nrniv/nrnste.cpp index f4afa418fb..36790b7b23 100644 --- a/src/nrniv/nrnste.cpp +++ b/src/nrniv/nrnste.cpp @@ -46,7 +46,9 @@ static double ste_state(void* v) { return (double) state; } -static Member_func members[] = {{"transition", ste_transition}, {"state", ste_state}, {nullptr, nullptr}}; +static Member_func members[] = {{"transition", ste_transition}, + {"state", ste_state}, + {nullptr, nullptr}}; static void* ste_cons(Object*) { int nstate = (int) chkarg(1, 1, 1e6); From d30948ada8556d13e7aa34c5412a3548bba3214e Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Mon, 25 Nov 2024 10:04:18 +0100 Subject: [PATCH 3/7] Include class2oc header directly --- src/nrnoc/seclist.cpp | 11 +---------- src/nrnoc/secref.cpp | 11 +---------- src/oc/classreg.h | 12 ++++++------ 3 files changed, 8 insertions(+), 26 deletions(-) diff --git a/src/nrnoc/seclist.cpp b/src/nrnoc/seclist.cpp index f5562c31ae..d1509e2a00 100644 --- a/src/nrnoc/seclist.cpp +++ b/src/nrnoc/seclist.cpp @@ -6,7 +6,7 @@ #include "parse.hpp" #include "hocparse.h" #include "code.h" -#include "hoc_membf.h" +#include "classreg.h" /* needs trailing '}' */ #define ITERATE_REMOVE(q1, q2, lst) \ @@ -252,15 +252,6 @@ static Member_func members[] = {{"append", append}, {"allroots", allroots}, {nullptr, nullptr}}; - -extern void class2oc(const char*, - void* (*cons)(Object*), - void (*destruct)(void*), - Member_func*, - Member_ret_obj_func*, - Member_ret_str_func*); - - void SectionList_reg(void) { /* printf("SectionList_reg\n");*/ class2oc("SectionList", constructor, destructor, members, nullptr, nullptr); diff --git a/src/nrnoc/secref.cpp b/src/nrnoc/secref.cpp index 38a2ad7277..d835ed4532 100644 --- a/src/nrnoc/secref.cpp +++ b/src/nrnoc/secref.cpp @@ -18,7 +18,7 @@ access s1.sec // soma becomes the default section #include #include "section.h" #include "parse.hpp" -#include "hoc_membf.h" +#include "classreg.h" #include "oc_ansi.h" extern int hoc_return_type_code; @@ -361,15 +361,6 @@ Section* nrn_sectionref_steer(Section* sec, Symbol* sym, int* pnindex) { return s; } - -extern void class2oc(const char*, - void* (*cons)(Object*), - void (*destruct)(void*), - Member_func*, - Member_ret_obj_func*, - Member_ret_str_func*); - - void SectionRef_reg(void) { Symbol *s, *sr; diff --git a/src/oc/classreg.h b/src/oc/classreg.h index 00ee7e9a55..c583d5a0e0 100644 --- a/src/oc/classreg.h +++ b/src/oc/classreg.h @@ -3,9 +3,9 @@ #include #include -extern void class2oc(const char*, - void* (*cons)(Object*), - void (*destruct)(void*), - Member_func*, - Member_ret_obj_func*, - Member_ret_str_func*); +void class2oc(const char*, + void* (*cons)(Object*), + void (*destruct)(void*), + Member_func*, + Member_ret_obj_func*, + Member_ret_str_func*); From 86ed5564f54ad474ae6306bcc78d1e66f155c43d Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Mon, 25 Nov 2024 10:33:10 +0100 Subject: [PATCH 4/7] Add ctor_f and dtor_f --- cmake/NeuronFileLists.cmake | 1 - src/nrnoc/init.cpp | 4 ++-- src/nrnoc/nrniv_mf.h | 6 +++--- src/oc/classreg.h | 24 ++++++++++++++++++++---- src/oc/hoc_membf.h | 18 ------------------ src/oc/hoc_oop.cpp | 8 ++++---- test/unit_tests/oc/hoc_interpreter.cpp | 2 +- 7 files changed, 30 insertions(+), 33 deletions(-) delete mode 100644 src/oc/hoc_membf.h diff --git a/cmake/NeuronFileLists.cmake b/cmake/NeuronFileLists.cmake index 789867c6a3..0810f145fd 100644 --- a/cmake/NeuronFileLists.cmake +++ b/cmake/NeuronFileLists.cmake @@ -36,7 +36,6 @@ set(HEADER_FILES_TO_INSTALL nrnoc/section_fwd.hpp nrnoc/treeset.h oc/hoc.h - oc/hoc_membf.h oc/hocassrt.h oc/hocdec.h oc/hocgetsym.h diff --git a/src/nrnoc/init.cpp b/src/nrnoc/init.cpp index 963736f2b2..5a190ee06f 100644 --- a/src/nrnoc/init.cpp +++ b/src/nrnoc/init.cpp @@ -1021,8 +1021,8 @@ int point_reg_helper(Symbol* s2) { } extern void class2oc_base(const char*, - void* (*cons)(Object*), - void (*destruct)(void*), + ctor_f* cons, + dtor_f* destruct, Member_func*, Member_ret_obj_func*, Member_ret_str_func*); diff --git a/src/nrnoc/nrniv_mf.h b/src/nrnoc/nrniv_mf.h index 1a1c016daa..3d28a0cbec 100644 --- a/src/nrnoc/nrniv_mf.h +++ b/src/nrnoc/nrniv_mf.h @@ -1,5 +1,5 @@ #pragma once -#include "hoc_membf.h" +#include "classreg.h" #include "hocdec.h" #include "membfunc.h" @@ -51,8 +51,8 @@ int point_register_mech(const char**, nrn_init_t, int, int, - void* (*) (Object*), - void (*)(void*), + ctor_f*, + dtor_f*, Member_func*); extern int nrn_get_mechtype(const char*); extern void nrn_writes_conc(int, int); diff --git a/src/oc/classreg.h b/src/oc/classreg.h index c583d5a0e0..6aaea74528 100644 --- a/src/oc/classreg.h +++ b/src/oc/classreg.h @@ -1,11 +1,27 @@ #pragma once -#include -#include +struct Object; +using ctor_f = void*(Object*); +using dtor_f = void(void*); + +struct Member_func { + const char* name; + double (*member)(void*); +}; + +struct Member_ret_obj_func { + const char* name; + struct Object** (*member)(void*); +}; + +struct Member_ret_str_func { + const char* name; + const char** (*member)(void*); +}; void class2oc(const char*, - void* (*cons)(Object*), - void (*destruct)(void*), + ctor_f* cons, + dtor_f* destruct, Member_func*, Member_ret_obj_func*, Member_ret_str_func*); diff --git a/src/oc/hoc_membf.h b/src/oc/hoc_membf.h deleted file mode 100644 index 9ac37cba06..0000000000 --- a/src/oc/hoc_membf.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -struct Object; - -typedef struct Member_func { - const char* name; - double (*member)(void*); -} Member_func; - -typedef struct Member_ret_obj_func { - const char* name; - struct Object** (*member)(void*); -} Member_ret_obj_func; - -typedef struct Member_ret_str_func { - const char* name; - const char** (*member)(void*); -} Member_ret_str_func; diff --git a/src/oc/hoc_oop.cpp b/src/oc/hoc_oop.cpp index bf485698f1..cca4bd8647 100644 --- a/src/oc/hoc_oop.cpp +++ b/src/oc/hoc_oop.cpp @@ -1581,8 +1581,8 @@ void hoc_endtemplate(Symbol* t) { } void class2oc_base(const char* name, - void* (*cons)(Object*), - void (*destruct)(void*), + ctor_f* cons, + dtor_f* destruct, Member_func* m, Member_ret_obj_func* mobjret, Member_ret_str_func* strret) { @@ -1629,8 +1629,8 @@ void class2oc_base(const char* name, void class2oc(const char* name, - void* (*cons)(Object*), - void (*destruct)(void*), + ctor_f* cons, + dtor_f* destruct, Member_func* m, Member_ret_obj_func* mobjret, Member_ret_str_func* strret) { diff --git a/test/unit_tests/oc/hoc_interpreter.cpp b/test/unit_tests/oc/hoc_interpreter.cpp index 3e334bfcb1..21338018d2 100644 --- a/test/unit_tests/oc/hoc_interpreter.cpp +++ b/test/unit_tests/oc/hoc_interpreter.cpp @@ -5,7 +5,7 @@ #include "classreg.h" #include "code.h" #include "hocdec.h" -#include "hoc_membf.h" +#include "classreg.h" #include "ocfunc.h" #include From 9d53ab344ff4445d33294447f993a3626edcf150 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Mon, 25 Nov 2024 10:34:50 +0100 Subject: [PATCH 5/7] Move classreg.h to classreg.hpp --- src/ivoc/graph.cpp | 2 +- src/ivoc/grglyph.cpp | 2 +- src/ivoc/ivocrand.cpp | 2 +- src/ivoc/ivocvect.cpp | 2 +- src/ivoc/matrix.cpp | 2 +- src/ivoc/mlinedit.cpp | 2 +- src/ivoc/mymath.cpp | 2 +- src/ivoc/ocbox.cpp | 2 +- src/ivoc/ocdeck.cpp | 2 +- src/ivoc/ocfile.cpp | 2 +- src/ivoc/oclist.cpp | 2 +- src/ivoc/ocpointer.cpp | 2 +- src/ivoc/ocptrvector.cpp | 2 +- src/ivoc/octimer.cpp | 2 +- src/ivoc/pwman.cpp | 2 +- src/ivoc/strfun.cpp | 2 +- src/ivoc/symchoos.cpp | 2 +- src/ivoc/xmenu.cpp | 2 +- src/nrncvode/cvodeobj.cpp | 2 +- src/nrncvode/cvodestb.cpp | 2 +- src/nrncvode/netcvode.cpp | 2 +- src/nrniv/bbsavestate.cpp | 2 +- src/nrniv/finithnd.cpp | 2 +- src/nrniv/impedanc.cpp | 2 +- src/nrniv/kschan.cpp | 2 +- src/nrniv/linmod1.cpp | 2 +- src/nrniv/ndatclas.cpp | 2 +- src/nrniv/nmodlrandom.cpp | 2 +- src/nrniv/nrnmenu.cpp | 2 +- src/nrniv/nrnpy.cpp | 2 +- src/nrniv/nrnste.cpp | 2 +- src/nrniv/ppshape.cpp | 2 +- src/nrniv/savstate.cpp | 2 +- src/nrniv/secbrows.cpp | 2 +- src/nrniv/shape.cpp | 2 +- src/nrniv/shapeplt.cpp | 2 +- src/nrniv/spaceplt.cpp | 2 +- src/nrnoc/nrniv_mf.h | 2 +- src/nrnoc/seclist.cpp | 2 +- src/nrnoc/secref.cpp | 2 +- src/nrnpython/nrnpy_p2h.cpp | 2 +- src/oc/{classreg.h => classreg.hpp} | 0 src/oc/hoc_oop.cpp | 2 +- src/parallel/ocbbs.cpp | 2 +- test/unit_tests/oc/hoc_interpreter.cpp | 3 +-- 45 files changed, 44 insertions(+), 45 deletions(-) rename src/oc/{classreg.h => classreg.hpp} (100%) diff --git a/src/ivoc/graph.cpp b/src/ivoc/graph.cpp index 61582a24bb..a82e472cb2 100644 --- a/src/ivoc/graph.cpp +++ b/src/ivoc/graph.cpp @@ -46,7 +46,7 @@ extern Image* gif_image(const char*); #include "ivocvect.h" #endif /* HAVE_IV */ -#include "classreg.h" +#include "classreg.hpp" #include "gui-redirect.h" #if HAVE_IV diff --git a/src/ivoc/grglyph.cpp b/src/ivoc/grglyph.cpp index df245c7017..554b818671 100644 --- a/src/ivoc/grglyph.cpp +++ b/src/ivoc/grglyph.cpp @@ -1,7 +1,7 @@ #include <../../nrnconf.h> // hoc level Glyph implementation for graphing #include -#include "classreg.h" +#include "classreg.hpp" #include "oc2iv.h" #if HAVE_IV #include "ivoc.h" diff --git a/src/ivoc/ivocrand.cpp b/src/ivoc/ivocrand.cpp index e141d70db3..3bf58bc222 100644 --- a/src/ivoc/ivocrand.cpp +++ b/src/ivoc/ivocrand.cpp @@ -7,7 +7,7 @@ #include "Rand.hpp" #include -#include "classreg.h" +#include "classreg.hpp" #include "oc2iv.h" #include "utils/enumerate.h" diff --git a/src/ivoc/ivocvect.cpp b/src/ivoc/ivocvect.cpp index 48fff8e45b..9af7bf20b2 100644 --- a/src/ivoc/ivocvect.cpp +++ b/src/ivoc/ivocvect.cpp @@ -27,7 +27,7 @@ #include #endif -#include "classreg.h" +#include "classreg.hpp" #if HAVE_IV #include "apwindow.h" #include "ivoc.h" diff --git a/src/ivoc/matrix.cpp b/src/ivoc/matrix.cpp index 441fd57ddd..c8047bd583 100644 --- a/src/ivoc/matrix.cpp +++ b/src/ivoc/matrix.cpp @@ -1,5 +1,5 @@ #include <../../nrnconf.h> -#include "classreg.h" +#include "classreg.hpp" #include #include diff --git a/src/ivoc/mlinedit.cpp b/src/ivoc/mlinedit.cpp index d4f9db5529..b1db78b24d 100644 --- a/src/ivoc/mlinedit.cpp +++ b/src/ivoc/mlinedit.cpp @@ -13,7 +13,7 @@ extern int hoc_return_type_code; #include "ocglyph.h" #endif -#include "classreg.h" +#include "classreg.hpp" #if HAVE_IV #include "oc2iv.h" #include "apwindow.h" diff --git a/src/ivoc/mymath.cpp b/src/ivoc/mymath.cpp index 07c62ef077..214bae6545 100644 --- a/src/ivoc/mymath.cpp +++ b/src/ivoc/mymath.cpp @@ -5,7 +5,7 @@ #include <../../nrnconf.h> #include #include "mymath.h" -#include "classreg.h" +#include "classreg.hpp" #include "oc2iv.h" #include #include diff --git a/src/ivoc/ocbox.cpp b/src/ivoc/ocbox.cpp index cf303a0fc7..c47f8ee679 100644 --- a/src/ivoc/ocbox.cpp +++ b/src/ivoc/ocbox.cpp @@ -19,7 +19,7 @@ #endif /* HAVE_IV */ #include "oc2iv.h" -#include "classreg.h" +#include "classreg.hpp" #include "gui-redirect.h" diff --git a/src/ivoc/ocdeck.cpp b/src/ivoc/ocdeck.cpp index 872b26d174..b59d4cd989 100644 --- a/src/ivoc/ocdeck.cpp +++ b/src/ivoc/ocdeck.cpp @@ -12,7 +12,7 @@ #include "apwindow.h" #include "oc2iv.h" #endif /* HAVE_IV */ -#include "classreg.h" +#include "classreg.hpp" #include "gui-redirect.h" #if HAVE_IV diff --git a/src/ivoc/ocfile.cpp b/src/ivoc/ocfile.cpp index d6f3e37c9e..5ed25affb5 100644 --- a/src/ivoc/ocfile.cpp +++ b/src/ivoc/ocfile.cpp @@ -23,7 +23,7 @@ extern int hoc_return_type_code; #endif #include "nrnmpi.h" #include "oc2iv.h" -#include "classreg.h" +#include "classreg.hpp" #include "ocfile.h" #include "nrnfilewrap.h" diff --git a/src/ivoc/oclist.cpp b/src/ivoc/oclist.cpp index f01d8d76b3..77c88c2e7d 100644 --- a/src/ivoc/oclist.cpp +++ b/src/ivoc/oclist.cpp @@ -1,7 +1,7 @@ #include <../../nrnconf.h> #include -#include "classreg.h" +#include "classreg.hpp" #include "oclist.h" #include "oc2iv.h" #include "hoclist.h" diff --git a/src/ivoc/ocpointer.cpp b/src/ivoc/ocpointer.cpp index bc90f21506..ac4fa85e1b 100644 --- a/src/ivoc/ocpointer.cpp +++ b/src/ivoc/ocpointer.cpp @@ -11,7 +11,7 @@ */ #include #include -#include "classreg.h" +#include "classreg.hpp" #include "oc_ansi.h" #include "oc2iv.h" #include "ocpointer.h" diff --git a/src/ivoc/ocptrvector.cpp b/src/ivoc/ocptrvector.cpp index 71f321e356..353906de49 100644 --- a/src/ivoc/ocptrvector.cpp +++ b/src/ivoc/ocptrvector.cpp @@ -9,7 +9,7 @@ p.scatter(Vector) p.gather(Vector) */ -#include "classreg.h" +#include "classreg.hpp" #include "oc2iv.h" #include "ocptrvector.h" #include "objcmd.h" diff --git a/src/ivoc/octimer.cpp b/src/ivoc/octimer.cpp index d76cc6a8b2..dd062833d2 100644 --- a/src/ivoc/octimer.cpp +++ b/src/ivoc/octimer.cpp @@ -8,7 +8,7 @@ #include "oc2iv.h" #include "objcmd.h" #endif /* HAVE_IV */ -#include "classreg.h" +#include "classreg.hpp" #ifdef MINGW #include diff --git a/src/ivoc/pwman.cpp b/src/ivoc/pwman.cpp index e98c1c8d4a..fe8c466ac3 100644 --- a/src/ivoc/pwman.cpp +++ b/src/ivoc/pwman.cpp @@ -24,7 +24,7 @@ extern int hoc_return_type_code; #endif // HAVE_IV #include #include -#include "classreg.h" +#include "classreg.hpp" #include "oc2iv.h" #include diff --git a/src/ivoc/strfun.cpp b/src/ivoc/strfun.cpp index 478b9ae05f..3344f1a902 100644 --- a/src/ivoc/strfun.cpp +++ b/src/ivoc/strfun.cpp @@ -1,7 +1,7 @@ #include <../../nrnconf.h> #include #include -#include "classreg.h" +#include "classreg.hpp" #include "oc2iv.h" #include #include diff --git a/src/ivoc/symchoos.cpp b/src/ivoc/symchoos.cpp index 6fcb1fefd4..a54cce99f2 100644 --- a/src/ivoc/symchoos.cpp +++ b/src/ivoc/symchoos.cpp @@ -58,7 +58,7 @@ #include "ivoc.h" #endif /* HAVE_IV */ -#include "classreg.h" +#include "classreg.hpp" #include "gui-redirect.h" #if HAVE_IV diff --git a/src/ivoc/xmenu.cpp b/src/ivoc/xmenu.cpp index b728686020..9cf78cccde 100644 --- a/src/ivoc/xmenu.cpp +++ b/src/ivoc/xmenu.cpp @@ -1,7 +1,7 @@ #include <../../nrnconf.h> #include "oc2iv.h" -#include "classreg.h" +#include "classreg.hpp" #include "gui-redirect.h" #include "utils/enumerate.h" diff --git a/src/nrncvode/cvodeobj.cpp b/src/nrncvode/cvodeobj.cpp index cdb05b511e..d69a8de982 100644 --- a/src/nrncvode/cvodeobj.cpp +++ b/src/nrncvode/cvodeobj.cpp @@ -10,7 +10,7 @@ extern int hoc_return_type_code; #include #include -#include "classreg.h" +#include "classreg.hpp" #include "nrnoc2iv.h" #include "datapath.h" #include "cvodeobj.h" diff --git a/src/nrncvode/cvodestb.cpp b/src/nrncvode/cvodestb.cpp index 6d03820e33..f17274a171 100644 --- a/src/nrncvode/cvodestb.cpp +++ b/src/nrncvode/cvodestb.cpp @@ -2,7 +2,7 @@ // solver CVode stub to allow cvode as dll for mswindows version. #include -#include "classreg.h" +#include "classreg.hpp" #include "cvodeobj.h" #include "nrncvode.h" #include "nrniv_mf.h" diff --git a/src/nrncvode/netcvode.cpp b/src/nrncvode/netcvode.cpp index 1fe933ce9f..52a1ee034f 100644 --- a/src/nrncvode/netcvode.cpp +++ b/src/nrncvode/netcvode.cpp @@ -5,7 +5,7 @@ #include #include "cabcode.h" -#include "classreg.h" +#include "classreg.hpp" #include "parse.hpp" #include "cvodeobj.h" #include "hoclist.h" diff --git a/src/nrniv/bbsavestate.cpp b/src/nrniv/bbsavestate.cpp index da250dbd79..c718f2bc10 100644 --- a/src/nrniv/bbsavestate.cpp +++ b/src/nrniv/bbsavestate.cpp @@ -169,7 +169,7 @@ callback to bbss_early when needed. #include "bbsavestate.h" #include "cabcode.h" -#include "classreg.h" +#include "classreg.hpp" #include "nrncvode.h" #include "nrnoc2iv.h" #include "nrnran123.h" diff --git a/src/nrniv/finithnd.cpp b/src/nrniv/finithnd.cpp index 7b30c17b33..2e6c5cc112 100644 --- a/src/nrniv/finithnd.cpp +++ b/src/nrniv/finithnd.cpp @@ -16,7 +16,7 @@ Type 3 are at the very beginning of finitialize. ie structure changes #include #include #include -#include +#include #include #include "utils/enumerate.h" diff --git a/src/nrniv/impedanc.cpp b/src/nrniv/impedanc.cpp index e11543fe32..aa456c5331 100644 --- a/src/nrniv/impedanc.cpp +++ b/src/nrniv/impedanc.cpp @@ -7,7 +7,7 @@ #include #include #include "nrnoc2iv.h" -#include "classreg.h" +#include "classreg.hpp" #include "membfunc.h" typedef void (*Pfrv4)(int, Node**, double**, Datum**); diff --git a/src/nrniv/kschan.cpp b/src/nrniv/kschan.cpp index fd5c3e315c..7c5c7bbd89 100644 --- a/src/nrniv/kschan.cpp +++ b/src/nrniv/kschan.cpp @@ -3,7 +3,7 @@ #include #include #include "nrnoc2iv.h" -#include "classreg.h" +#include "classreg.hpp" #include "kschan.h" #include "kssingle.h" #include "ocnotify.h" diff --git a/src/nrniv/linmod1.cpp b/src/nrniv/linmod1.cpp index 053ff068c3..16a98cea91 100644 --- a/src/nrniv/linmod1.cpp +++ b/src/nrniv/linmod1.cpp @@ -5,7 +5,7 @@ #if HAVE_IV #include "ivoc.h" #endif -#include "classreg.h" +#include "classreg.hpp" #include "linmod.h" #include "nrnoc2iv.h" diff --git a/src/nrniv/ndatclas.cpp b/src/nrniv/ndatclas.cpp index 2d74ace692..5fda4cad37 100644 --- a/src/nrniv/ndatclas.cpp +++ b/src/nrniv/ndatclas.cpp @@ -2,7 +2,7 @@ #include #include #include "nrnoc2iv.h" -#include "classreg.h" +#include "classreg.hpp" #include "membfunc.h" #include "parse.hpp" diff --git a/src/nrniv/nmodlrandom.cpp b/src/nrniv/nmodlrandom.cpp index 88806ddde9..b700fe0795 100644 --- a/src/nrniv/nmodlrandom.cpp +++ b/src/nrniv/nmodlrandom.cpp @@ -13,7 +13,7 @@ syntax #include #include #include -#include +#include #include struct NMODLRandom { diff --git a/src/nrniv/nrnmenu.cpp b/src/nrniv/nrnmenu.cpp index 6dec4cfe84..d6c3e25ba2 100644 --- a/src/nrniv/nrnmenu.cpp +++ b/src/nrniv/nrnmenu.cpp @@ -13,7 +13,7 @@ #include "nrnoc2iv.h" #include "nrnpy.h" #include "nrnmenu.h" -#include "classreg.h" +#include "classreg.hpp" #include "gui-redirect.h" extern int hoc_return_type_code; diff --git a/src/nrniv/nrnpy.cpp b/src/nrniv/nrnpy.cpp index 6cfebd30c6..0706b6fd3a 100644 --- a/src/nrniv/nrnpy.cpp +++ b/src/nrniv/nrnpy.cpp @@ -8,7 +8,7 @@ #include #include #include "nrnoc2iv.h" -#include "classreg.h" +#include "classreg.hpp" #include "nonvintblock.h" #include "nrnmpi.h" diff --git a/src/nrniv/nrnste.cpp b/src/nrniv/nrnste.cpp index 36790b7b23..7f93db9fa9 100644 --- a/src/nrniv/nrnste.cpp +++ b/src/nrniv/nrnste.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/nrniv/ppshape.cpp b/src/nrniv/ppshape.cpp index ae75579e5a..3bc7e54b5e 100644 --- a/src/nrniv/ppshape.cpp +++ b/src/nrniv/ppshape.cpp @@ -2,7 +2,7 @@ #include #include "oclist.h" #include "nrnoc2iv.h" -#include "classreg.h" +#include "classreg.hpp" #if HAVE_IV #include "ppshape.h" diff --git a/src/nrniv/savstate.cpp b/src/nrniv/savstate.cpp index 31c2bbff9c..7e0b2169f5 100644 --- a/src/nrniv/savstate.cpp +++ b/src/nrniv/savstate.cpp @@ -6,7 +6,7 @@ #include "ocfile.h" #include "nrncvode.h" #include "nrnoc2iv.h" -#include "classreg.h" +#include "classreg.hpp" #include "nrniv_mf.h" #include "tqueue.hpp" diff --git a/src/nrniv/secbrows.cpp b/src/nrniv/secbrows.cpp index 84263229b6..263c2cb640 100644 --- a/src/nrniv/secbrows.cpp +++ b/src/nrniv/secbrows.cpp @@ -1,5 +1,5 @@ #include <../../nrnconf.h> -#include "classreg.h" +#include "classreg.hpp" #include "gui-redirect.h" #if HAVE_IV diff --git a/src/nrniv/shape.cpp b/src/nrniv/shape.cpp index 46279966ee..bd4cee2d8b 100644 --- a/src/nrniv/shape.cpp +++ b/src/nrniv/shape.cpp @@ -1,5 +1,5 @@ #include <../../nrnconf.h> -#include "classreg.h" +#include "classreg.hpp" #include "gui-redirect.h" #if HAVE_IV // to end of file diff --git a/src/nrniv/shapeplt.cpp b/src/nrniv/shapeplt.cpp index 719b9e85f8..65b76cbeec 100644 --- a/src/nrniv/shapeplt.cpp +++ b/src/nrniv/shapeplt.cpp @@ -1,5 +1,5 @@ #include <../../nrnconf.h> -#include "classreg.h" +#include "classreg.hpp" #include "gui-redirect.h" #include "ocnotify.h" diff --git a/src/nrniv/spaceplt.cpp b/src/nrniv/spaceplt.cpp index 49a220aee6..8bc3c0a26b 100644 --- a/src/nrniv/spaceplt.cpp +++ b/src/nrniv/spaceplt.cpp @@ -1,6 +1,6 @@ #include <../../nrnconf.h> #include -#include "classreg.h" +#include "classreg.hpp" #include diff --git a/src/nrnoc/nrniv_mf.h b/src/nrnoc/nrniv_mf.h index 3d28a0cbec..afe4ea91a5 100644 --- a/src/nrnoc/nrniv_mf.h +++ b/src/nrnoc/nrniv_mf.h @@ -1,5 +1,5 @@ #pragma once -#include "classreg.h" +#include "classreg.hpp" #include "hocdec.h" #include "membfunc.h" diff --git a/src/nrnoc/seclist.cpp b/src/nrnoc/seclist.cpp index d1509e2a00..01da6667de 100644 --- a/src/nrnoc/seclist.cpp +++ b/src/nrnoc/seclist.cpp @@ -6,7 +6,7 @@ #include "parse.hpp" #include "hocparse.h" #include "code.h" -#include "classreg.h" +#include "classreg.hpp" /* needs trailing '}' */ #define ITERATE_REMOVE(q1, q2, lst) \ diff --git a/src/nrnoc/secref.cpp b/src/nrnoc/secref.cpp index d835ed4532..33483bff96 100644 --- a/src/nrnoc/secref.cpp +++ b/src/nrnoc/secref.cpp @@ -18,7 +18,7 @@ access s1.sec // soma becomes the default section #include #include "section.h" #include "parse.hpp" -#include "classreg.h" +#include "classreg.hpp" #include "oc_ansi.h" extern int hoc_return_type_code; diff --git a/src/nrnpython/nrnpy_p2h.cpp b/src/nrnpython/nrnpy_p2h.cpp index 2ec3af6b42..7c76203096 100644 --- a/src/nrnpython/nrnpy_p2h.cpp +++ b/src/nrnpython/nrnpy_p2h.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include "nrnpython.h" #include "hoccontext.h" #include "nrnpy.h" diff --git a/src/oc/classreg.h b/src/oc/classreg.hpp similarity index 100% rename from src/oc/classreg.h rename to src/oc/classreg.hpp diff --git a/src/oc/hoc_oop.cpp b/src/oc/hoc_oop.cpp index cca4bd8647..2a551d545d 100644 --- a/src/oc/hoc_oop.cpp +++ b/src/oc/hoc_oop.cpp @@ -5,7 +5,7 @@ #include "utils/formatting.hpp" -#include "classreg.h" +#include "classreg.hpp" #include "hocstr.h" #include "parse.hpp" diff --git a/src/parallel/ocbbs.cpp b/src/parallel/ocbbs.cpp index cafdb082cc..9dd0e18fa6 100644 --- a/src/parallel/ocbbs.cpp +++ b/src/parallel/ocbbs.cpp @@ -1,7 +1,7 @@ #include #include -#include "classreg.h" +#include "classreg.hpp" #include "ivocvect.h" #include "hoclist.h" #include "bbs.h" diff --git a/test/unit_tests/oc/hoc_interpreter.cpp b/test/unit_tests/oc/hoc_interpreter.cpp index 21338018d2..8119b094a5 100644 --- a/test/unit_tests/oc/hoc_interpreter.cpp +++ b/test/unit_tests/oc/hoc_interpreter.cpp @@ -2,10 +2,9 @@ #include #include -#include "classreg.h" +#include "classreg.hpp" #include "code.h" #include "hocdec.h" -#include "classreg.h" #include "ocfunc.h" #include From 55e6f5e2a5f4e7b4f1e9ad7be29e7a6a364dcb76 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Mon, 25 Nov 2024 11:57:09 +0100 Subject: [PATCH 6/7] Install classreg.h --- cmake/NeuronFileLists.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/NeuronFileLists.cmake b/cmake/NeuronFileLists.cmake index 0810f145fd..7138582605 100644 --- a/cmake/NeuronFileLists.cmake +++ b/cmake/NeuronFileLists.cmake @@ -35,6 +35,7 @@ set(HEADER_FILES_TO_INSTALL nrnoc/options.h nrnoc/section_fwd.hpp nrnoc/treeset.h + oc/classreg.hpp oc/hoc.h oc/hocassrt.h oc/hocdec.h From 0fbe3e70250bc834e01e11651a20da31ff2c5b51 Mon Sep 17 00:00:00 2001 From: Nicolas Cornu Date: Mon, 25 Nov 2024 13:57:57 +0100 Subject: [PATCH 7/7] move back classreg.h --- cmake/NeuronFileLists.cmake | 2 +- src/ivoc/graph.cpp | 2 +- src/ivoc/grglyph.cpp | 2 +- src/ivoc/ivocrand.cpp | 2 +- src/ivoc/ivocvect.cpp | 2 +- src/ivoc/matrix.cpp | 2 +- src/ivoc/mlinedit.cpp | 2 +- src/ivoc/mymath.cpp | 2 +- src/ivoc/ocbox.cpp | 2 +- src/ivoc/ocdeck.cpp | 2 +- src/ivoc/ocfile.cpp | 2 +- src/ivoc/oclist.cpp | 2 +- src/ivoc/ocpointer.cpp | 2 +- src/ivoc/ocptrvector.cpp | 2 +- src/ivoc/octimer.cpp | 2 +- src/ivoc/pwman.cpp | 2 +- src/ivoc/strfun.cpp | 2 +- src/ivoc/symchoos.cpp | 2 +- src/ivoc/xmenu.cpp | 2 +- src/nrncvode/cvodeobj.cpp | 2 +- src/nrncvode/cvodestb.cpp | 2 +- src/nrncvode/netcvode.cpp | 2 +- src/nrniv/bbsavestate.cpp | 2 +- src/nrniv/finithnd.cpp | 2 +- src/nrniv/impedanc.cpp | 2 +- src/nrniv/kschan.cpp | 2 +- src/nrniv/linmod1.cpp | 2 +- src/nrniv/ndatclas.cpp | 2 +- src/nrniv/nmodlrandom.cpp | 2 +- src/nrniv/nrnmenu.cpp | 2 +- src/nrniv/nrnpy.cpp | 2 +- src/nrniv/nrnste.cpp | 2 +- src/nrniv/ppshape.cpp | 2 +- src/nrniv/savstate.cpp | 2 +- src/nrniv/secbrows.cpp | 2 +- src/nrniv/shape.cpp | 2 +- src/nrniv/shapeplt.cpp | 2 +- src/nrniv/spaceplt.cpp | 2 +- src/nrnoc/nrniv_mf.h | 2 +- src/nrnoc/seclist.cpp | 2 +- src/nrnoc/secref.cpp | 2 +- src/nrnpython/nrnpy_p2h.cpp | 2 +- src/oc/{classreg.hpp => classreg.h} | 0 src/oc/hoc_oop.cpp | 2 +- src/parallel/ocbbs.cpp | 2 +- test/unit_tests/oc/hoc_interpreter.cpp | 3 ++- 46 files changed, 46 insertions(+), 45 deletions(-) rename src/oc/{classreg.hpp => classreg.h} (100%) diff --git a/cmake/NeuronFileLists.cmake b/cmake/NeuronFileLists.cmake index 7138582605..2c376847e1 100644 --- a/cmake/NeuronFileLists.cmake +++ b/cmake/NeuronFileLists.cmake @@ -35,7 +35,7 @@ set(HEADER_FILES_TO_INSTALL nrnoc/options.h nrnoc/section_fwd.hpp nrnoc/treeset.h - oc/classreg.hpp + oc/classreg.h oc/hoc.h oc/hocassrt.h oc/hocdec.h diff --git a/src/ivoc/graph.cpp b/src/ivoc/graph.cpp index a82e472cb2..61582a24bb 100644 --- a/src/ivoc/graph.cpp +++ b/src/ivoc/graph.cpp @@ -46,7 +46,7 @@ extern Image* gif_image(const char*); #include "ivocvect.h" #endif /* HAVE_IV */ -#include "classreg.hpp" +#include "classreg.h" #include "gui-redirect.h" #if HAVE_IV diff --git a/src/ivoc/grglyph.cpp b/src/ivoc/grglyph.cpp index 554b818671..df245c7017 100644 --- a/src/ivoc/grglyph.cpp +++ b/src/ivoc/grglyph.cpp @@ -1,7 +1,7 @@ #include <../../nrnconf.h> // hoc level Glyph implementation for graphing #include -#include "classreg.hpp" +#include "classreg.h" #include "oc2iv.h" #if HAVE_IV #include "ivoc.h" diff --git a/src/ivoc/ivocrand.cpp b/src/ivoc/ivocrand.cpp index 3bf58bc222..e141d70db3 100644 --- a/src/ivoc/ivocrand.cpp +++ b/src/ivoc/ivocrand.cpp @@ -7,7 +7,7 @@ #include "Rand.hpp" #include -#include "classreg.hpp" +#include "classreg.h" #include "oc2iv.h" #include "utils/enumerate.h" diff --git a/src/ivoc/ivocvect.cpp b/src/ivoc/ivocvect.cpp index 9af7bf20b2..48fff8e45b 100644 --- a/src/ivoc/ivocvect.cpp +++ b/src/ivoc/ivocvect.cpp @@ -27,7 +27,7 @@ #include #endif -#include "classreg.hpp" +#include "classreg.h" #if HAVE_IV #include "apwindow.h" #include "ivoc.h" diff --git a/src/ivoc/matrix.cpp b/src/ivoc/matrix.cpp index c8047bd583..441fd57ddd 100644 --- a/src/ivoc/matrix.cpp +++ b/src/ivoc/matrix.cpp @@ -1,5 +1,5 @@ #include <../../nrnconf.h> -#include "classreg.hpp" +#include "classreg.h" #include #include diff --git a/src/ivoc/mlinedit.cpp b/src/ivoc/mlinedit.cpp index b1db78b24d..d4f9db5529 100644 --- a/src/ivoc/mlinedit.cpp +++ b/src/ivoc/mlinedit.cpp @@ -13,7 +13,7 @@ extern int hoc_return_type_code; #include "ocglyph.h" #endif -#include "classreg.hpp" +#include "classreg.h" #if HAVE_IV #include "oc2iv.h" #include "apwindow.h" diff --git a/src/ivoc/mymath.cpp b/src/ivoc/mymath.cpp index 214bae6545..07c62ef077 100644 --- a/src/ivoc/mymath.cpp +++ b/src/ivoc/mymath.cpp @@ -5,7 +5,7 @@ #include <../../nrnconf.h> #include #include "mymath.h" -#include "classreg.hpp" +#include "classreg.h" #include "oc2iv.h" #include #include diff --git a/src/ivoc/ocbox.cpp b/src/ivoc/ocbox.cpp index c47f8ee679..cf303a0fc7 100644 --- a/src/ivoc/ocbox.cpp +++ b/src/ivoc/ocbox.cpp @@ -19,7 +19,7 @@ #endif /* HAVE_IV */ #include "oc2iv.h" -#include "classreg.hpp" +#include "classreg.h" #include "gui-redirect.h" diff --git a/src/ivoc/ocdeck.cpp b/src/ivoc/ocdeck.cpp index b59d4cd989..872b26d174 100644 --- a/src/ivoc/ocdeck.cpp +++ b/src/ivoc/ocdeck.cpp @@ -12,7 +12,7 @@ #include "apwindow.h" #include "oc2iv.h" #endif /* HAVE_IV */ -#include "classreg.hpp" +#include "classreg.h" #include "gui-redirect.h" #if HAVE_IV diff --git a/src/ivoc/ocfile.cpp b/src/ivoc/ocfile.cpp index 5ed25affb5..d6f3e37c9e 100644 --- a/src/ivoc/ocfile.cpp +++ b/src/ivoc/ocfile.cpp @@ -23,7 +23,7 @@ extern int hoc_return_type_code; #endif #include "nrnmpi.h" #include "oc2iv.h" -#include "classreg.hpp" +#include "classreg.h" #include "ocfile.h" #include "nrnfilewrap.h" diff --git a/src/ivoc/oclist.cpp b/src/ivoc/oclist.cpp index 77c88c2e7d..f01d8d76b3 100644 --- a/src/ivoc/oclist.cpp +++ b/src/ivoc/oclist.cpp @@ -1,7 +1,7 @@ #include <../../nrnconf.h> #include -#include "classreg.hpp" +#include "classreg.h" #include "oclist.h" #include "oc2iv.h" #include "hoclist.h" diff --git a/src/ivoc/ocpointer.cpp b/src/ivoc/ocpointer.cpp index ac4fa85e1b..bc90f21506 100644 --- a/src/ivoc/ocpointer.cpp +++ b/src/ivoc/ocpointer.cpp @@ -11,7 +11,7 @@ */ #include #include -#include "classreg.hpp" +#include "classreg.h" #include "oc_ansi.h" #include "oc2iv.h" #include "ocpointer.h" diff --git a/src/ivoc/ocptrvector.cpp b/src/ivoc/ocptrvector.cpp index 353906de49..71f321e356 100644 --- a/src/ivoc/ocptrvector.cpp +++ b/src/ivoc/ocptrvector.cpp @@ -9,7 +9,7 @@ p.scatter(Vector) p.gather(Vector) */ -#include "classreg.hpp" +#include "classreg.h" #include "oc2iv.h" #include "ocptrvector.h" #include "objcmd.h" diff --git a/src/ivoc/octimer.cpp b/src/ivoc/octimer.cpp index dd062833d2..d76cc6a8b2 100644 --- a/src/ivoc/octimer.cpp +++ b/src/ivoc/octimer.cpp @@ -8,7 +8,7 @@ #include "oc2iv.h" #include "objcmd.h" #endif /* HAVE_IV */ -#include "classreg.hpp" +#include "classreg.h" #ifdef MINGW #include diff --git a/src/ivoc/pwman.cpp b/src/ivoc/pwman.cpp index fe8c466ac3..e98c1c8d4a 100644 --- a/src/ivoc/pwman.cpp +++ b/src/ivoc/pwman.cpp @@ -24,7 +24,7 @@ extern int hoc_return_type_code; #endif // HAVE_IV #include #include -#include "classreg.hpp" +#include "classreg.h" #include "oc2iv.h" #include diff --git a/src/ivoc/strfun.cpp b/src/ivoc/strfun.cpp index 3344f1a902..478b9ae05f 100644 --- a/src/ivoc/strfun.cpp +++ b/src/ivoc/strfun.cpp @@ -1,7 +1,7 @@ #include <../../nrnconf.h> #include #include -#include "classreg.hpp" +#include "classreg.h" #include "oc2iv.h" #include #include diff --git a/src/ivoc/symchoos.cpp b/src/ivoc/symchoos.cpp index a54cce99f2..6fcb1fefd4 100644 --- a/src/ivoc/symchoos.cpp +++ b/src/ivoc/symchoos.cpp @@ -58,7 +58,7 @@ #include "ivoc.h" #endif /* HAVE_IV */ -#include "classreg.hpp" +#include "classreg.h" #include "gui-redirect.h" #if HAVE_IV diff --git a/src/ivoc/xmenu.cpp b/src/ivoc/xmenu.cpp index 9cf78cccde..b728686020 100644 --- a/src/ivoc/xmenu.cpp +++ b/src/ivoc/xmenu.cpp @@ -1,7 +1,7 @@ #include <../../nrnconf.h> #include "oc2iv.h" -#include "classreg.hpp" +#include "classreg.h" #include "gui-redirect.h" #include "utils/enumerate.h" diff --git a/src/nrncvode/cvodeobj.cpp b/src/nrncvode/cvodeobj.cpp index d69a8de982..cdb05b511e 100644 --- a/src/nrncvode/cvodeobj.cpp +++ b/src/nrncvode/cvodeobj.cpp @@ -10,7 +10,7 @@ extern int hoc_return_type_code; #include #include -#include "classreg.hpp" +#include "classreg.h" #include "nrnoc2iv.h" #include "datapath.h" #include "cvodeobj.h" diff --git a/src/nrncvode/cvodestb.cpp b/src/nrncvode/cvodestb.cpp index f17274a171..6d03820e33 100644 --- a/src/nrncvode/cvodestb.cpp +++ b/src/nrncvode/cvodestb.cpp @@ -2,7 +2,7 @@ // solver CVode stub to allow cvode as dll for mswindows version. #include -#include "classreg.hpp" +#include "classreg.h" #include "cvodeobj.h" #include "nrncvode.h" #include "nrniv_mf.h" diff --git a/src/nrncvode/netcvode.cpp b/src/nrncvode/netcvode.cpp index 52a1ee034f..1fe933ce9f 100644 --- a/src/nrncvode/netcvode.cpp +++ b/src/nrncvode/netcvode.cpp @@ -5,7 +5,7 @@ #include #include "cabcode.h" -#include "classreg.hpp" +#include "classreg.h" #include "parse.hpp" #include "cvodeobj.h" #include "hoclist.h" diff --git a/src/nrniv/bbsavestate.cpp b/src/nrniv/bbsavestate.cpp index c718f2bc10..da250dbd79 100644 --- a/src/nrniv/bbsavestate.cpp +++ b/src/nrniv/bbsavestate.cpp @@ -169,7 +169,7 @@ callback to bbss_early when needed. #include "bbsavestate.h" #include "cabcode.h" -#include "classreg.hpp" +#include "classreg.h" #include "nrncvode.h" #include "nrnoc2iv.h" #include "nrnran123.h" diff --git a/src/nrniv/finithnd.cpp b/src/nrniv/finithnd.cpp index 2e6c5cc112..7b30c17b33 100644 --- a/src/nrniv/finithnd.cpp +++ b/src/nrniv/finithnd.cpp @@ -16,7 +16,7 @@ Type 3 are at the very beginning of finitialize. ie structure changes #include #include #include -#include +#include #include #include "utils/enumerate.h" diff --git a/src/nrniv/impedanc.cpp b/src/nrniv/impedanc.cpp index aa456c5331..e11543fe32 100644 --- a/src/nrniv/impedanc.cpp +++ b/src/nrniv/impedanc.cpp @@ -7,7 +7,7 @@ #include #include #include "nrnoc2iv.h" -#include "classreg.hpp" +#include "classreg.h" #include "membfunc.h" typedef void (*Pfrv4)(int, Node**, double**, Datum**); diff --git a/src/nrniv/kschan.cpp b/src/nrniv/kschan.cpp index 7c5c7bbd89..fd5c3e315c 100644 --- a/src/nrniv/kschan.cpp +++ b/src/nrniv/kschan.cpp @@ -3,7 +3,7 @@ #include #include #include "nrnoc2iv.h" -#include "classreg.hpp" +#include "classreg.h" #include "kschan.h" #include "kssingle.h" #include "ocnotify.h" diff --git a/src/nrniv/linmod1.cpp b/src/nrniv/linmod1.cpp index 16a98cea91..053ff068c3 100644 --- a/src/nrniv/linmod1.cpp +++ b/src/nrniv/linmod1.cpp @@ -5,7 +5,7 @@ #if HAVE_IV #include "ivoc.h" #endif -#include "classreg.hpp" +#include "classreg.h" #include "linmod.h" #include "nrnoc2iv.h" diff --git a/src/nrniv/ndatclas.cpp b/src/nrniv/ndatclas.cpp index 5fda4cad37..2d74ace692 100644 --- a/src/nrniv/ndatclas.cpp +++ b/src/nrniv/ndatclas.cpp @@ -2,7 +2,7 @@ #include #include #include "nrnoc2iv.h" -#include "classreg.hpp" +#include "classreg.h" #include "membfunc.h" #include "parse.hpp" diff --git a/src/nrniv/nmodlrandom.cpp b/src/nrniv/nmodlrandom.cpp index b700fe0795..88806ddde9 100644 --- a/src/nrniv/nmodlrandom.cpp +++ b/src/nrniv/nmodlrandom.cpp @@ -13,7 +13,7 @@ syntax #include #include #include -#include +#include #include struct NMODLRandom { diff --git a/src/nrniv/nrnmenu.cpp b/src/nrniv/nrnmenu.cpp index d6c3e25ba2..6dec4cfe84 100644 --- a/src/nrniv/nrnmenu.cpp +++ b/src/nrniv/nrnmenu.cpp @@ -13,7 +13,7 @@ #include "nrnoc2iv.h" #include "nrnpy.h" #include "nrnmenu.h" -#include "classreg.hpp" +#include "classreg.h" #include "gui-redirect.h" extern int hoc_return_type_code; diff --git a/src/nrniv/nrnpy.cpp b/src/nrniv/nrnpy.cpp index 0706b6fd3a..6cfebd30c6 100644 --- a/src/nrniv/nrnpy.cpp +++ b/src/nrniv/nrnpy.cpp @@ -8,7 +8,7 @@ #include #include #include "nrnoc2iv.h" -#include "classreg.hpp" +#include "classreg.h" #include "nonvintblock.h" #include "nrnmpi.h" diff --git a/src/nrniv/nrnste.cpp b/src/nrniv/nrnste.cpp index 7f93db9fa9..36790b7b23 100644 --- a/src/nrniv/nrnste.cpp +++ b/src/nrniv/nrnste.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/nrniv/ppshape.cpp b/src/nrniv/ppshape.cpp index 3bc7e54b5e..ae75579e5a 100644 --- a/src/nrniv/ppshape.cpp +++ b/src/nrniv/ppshape.cpp @@ -2,7 +2,7 @@ #include #include "oclist.h" #include "nrnoc2iv.h" -#include "classreg.hpp" +#include "classreg.h" #if HAVE_IV #include "ppshape.h" diff --git a/src/nrniv/savstate.cpp b/src/nrniv/savstate.cpp index 7e0b2169f5..31c2bbff9c 100644 --- a/src/nrniv/savstate.cpp +++ b/src/nrniv/savstate.cpp @@ -6,7 +6,7 @@ #include "ocfile.h" #include "nrncvode.h" #include "nrnoc2iv.h" -#include "classreg.hpp" +#include "classreg.h" #include "nrniv_mf.h" #include "tqueue.hpp" diff --git a/src/nrniv/secbrows.cpp b/src/nrniv/secbrows.cpp index 263c2cb640..84263229b6 100644 --- a/src/nrniv/secbrows.cpp +++ b/src/nrniv/secbrows.cpp @@ -1,5 +1,5 @@ #include <../../nrnconf.h> -#include "classreg.hpp" +#include "classreg.h" #include "gui-redirect.h" #if HAVE_IV diff --git a/src/nrniv/shape.cpp b/src/nrniv/shape.cpp index bd4cee2d8b..46279966ee 100644 --- a/src/nrniv/shape.cpp +++ b/src/nrniv/shape.cpp @@ -1,5 +1,5 @@ #include <../../nrnconf.h> -#include "classreg.hpp" +#include "classreg.h" #include "gui-redirect.h" #if HAVE_IV // to end of file diff --git a/src/nrniv/shapeplt.cpp b/src/nrniv/shapeplt.cpp index 65b76cbeec..719b9e85f8 100644 --- a/src/nrniv/shapeplt.cpp +++ b/src/nrniv/shapeplt.cpp @@ -1,5 +1,5 @@ #include <../../nrnconf.h> -#include "classreg.hpp" +#include "classreg.h" #include "gui-redirect.h" #include "ocnotify.h" diff --git a/src/nrniv/spaceplt.cpp b/src/nrniv/spaceplt.cpp index 8bc3c0a26b..49a220aee6 100644 --- a/src/nrniv/spaceplt.cpp +++ b/src/nrniv/spaceplt.cpp @@ -1,6 +1,6 @@ #include <../../nrnconf.h> #include -#include "classreg.hpp" +#include "classreg.h" #include diff --git a/src/nrnoc/nrniv_mf.h b/src/nrnoc/nrniv_mf.h index afe4ea91a5..3d28a0cbec 100644 --- a/src/nrnoc/nrniv_mf.h +++ b/src/nrnoc/nrniv_mf.h @@ -1,5 +1,5 @@ #pragma once -#include "classreg.hpp" +#include "classreg.h" #include "hocdec.h" #include "membfunc.h" diff --git a/src/nrnoc/seclist.cpp b/src/nrnoc/seclist.cpp index 01da6667de..d1509e2a00 100644 --- a/src/nrnoc/seclist.cpp +++ b/src/nrnoc/seclist.cpp @@ -6,7 +6,7 @@ #include "parse.hpp" #include "hocparse.h" #include "code.h" -#include "classreg.hpp" +#include "classreg.h" /* needs trailing '}' */ #define ITERATE_REMOVE(q1, q2, lst) \ diff --git a/src/nrnoc/secref.cpp b/src/nrnoc/secref.cpp index 33483bff96..d835ed4532 100644 --- a/src/nrnoc/secref.cpp +++ b/src/nrnoc/secref.cpp @@ -18,7 +18,7 @@ access s1.sec // soma becomes the default section #include #include "section.h" #include "parse.hpp" -#include "classreg.hpp" +#include "classreg.h" #include "oc_ansi.h" extern int hoc_return_type_code; diff --git a/src/nrnpython/nrnpy_p2h.cpp b/src/nrnpython/nrnpy_p2h.cpp index 7c76203096..2ec3af6b42 100644 --- a/src/nrnpython/nrnpy_p2h.cpp +++ b/src/nrnpython/nrnpy_p2h.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include "nrnpython.h" #include "hoccontext.h" #include "nrnpy.h" diff --git a/src/oc/classreg.hpp b/src/oc/classreg.h similarity index 100% rename from src/oc/classreg.hpp rename to src/oc/classreg.h diff --git a/src/oc/hoc_oop.cpp b/src/oc/hoc_oop.cpp index 2a551d545d..cca4bd8647 100644 --- a/src/oc/hoc_oop.cpp +++ b/src/oc/hoc_oop.cpp @@ -5,7 +5,7 @@ #include "utils/formatting.hpp" -#include "classreg.hpp" +#include "classreg.h" #include "hocstr.h" #include "parse.hpp" diff --git a/src/parallel/ocbbs.cpp b/src/parallel/ocbbs.cpp index 9dd0e18fa6..cafdb082cc 100644 --- a/src/parallel/ocbbs.cpp +++ b/src/parallel/ocbbs.cpp @@ -1,7 +1,7 @@ #include #include -#include "classreg.hpp" +#include "classreg.h" #include "ivocvect.h" #include "hoclist.h" #include "bbs.h" diff --git a/test/unit_tests/oc/hoc_interpreter.cpp b/test/unit_tests/oc/hoc_interpreter.cpp index 8119b094a5..21338018d2 100644 --- a/test/unit_tests/oc/hoc_interpreter.cpp +++ b/test/unit_tests/oc/hoc_interpreter.cpp @@ -2,9 +2,10 @@ #include #include -#include "classreg.hpp" +#include "classreg.h" #include "code.h" #include "hocdec.h" +#include "classreg.h" #include "ocfunc.h" #include