From 42dd21f1cd95380ec4c6c2a30d054a5071f339b0 Mon Sep 17 00:00:00 2001 From: Mike Gevaert Date: Fri, 30 Aug 2024 17:32:38 +0200 Subject: [PATCH] remove unneeded `#include "hoc.h"`, include exact headers when required --- src/oc/axis.cpp | 1 - src/oc/code.cpp | 1 - src/oc/code2.cpp | 1 - src/oc/debug.cpp | 2 +- src/oc/fileio.cpp | 1 - src/oc/ftime.cpp | 3 ++- src/oc/functabl.cpp | 4 +++- src/oc/hoc.cpp | 1 - src/oc/hoc_init.cpp | 4 ++-- src/oc/hocgetsym.h | 2 +- src/oc/hocparse.h | 4 +--- src/oc/math.cpp | 7 ++++--- src/oc/nonlin.cpp | 1 - src/oc/oc_ansi.h | 2 +- src/oc/parse.ypp | 6 +++++- src/oc/plot.cpp | 3 ++- src/oc/plt.cpp | 5 ----- src/oc/symbol.cpp | 7 +++---- src/oc/xred.cpp | 4 ++-- 19 files changed, 27 insertions(+), 32 deletions(-) diff --git a/src/oc/axis.cpp b/src/oc/axis.cpp index c709544936..ea8d4e90dd 100644 --- a/src/oc/axis.cpp +++ b/src/oc/axis.cpp @@ -134,7 +134,6 @@ axis.cpp,v #include #include #include -#include "hoc.h" #include "gui-redirect.h" #define CLIP 1e9 diff --git a/src/oc/code.cpp b/src/oc/code.cpp index f89fcd5f38..05c157b61d 100644 --- a/src/oc/code.cpp +++ b/src/oc/code.cpp @@ -3,7 +3,6 @@ #include "backtrace_utils.h" #include "bbslsrv2.h" -#include "hoc.h" #include "cabcode.h" #include "code.h" #include "hocstr.h" diff --git a/src/oc/code2.cpp b/src/oc/code2.cpp index fc89f53b70..7f158c6910 100644 --- a/src/oc/code2.cpp +++ b/src/oc/code2.cpp @@ -1,7 +1,6 @@ #include <../../nrnconf.h> /* /local/src/master/nrn/src/oc/code2.cpp,v 1.12 1999/06/08 17:48:26 hines Exp */ -#include "hoc.h" #include "hocstr.h" #include "parse.hpp" #include "hocparse.h" diff --git a/src/oc/debug.cpp b/src/oc/debug.cpp index f46311bb55..81cf005677 100644 --- a/src/oc/debug.cpp +++ b/src/oc/debug.cpp @@ -1,6 +1,6 @@ #include <../../nrnconf.h> /* /local/src/master/nrn/src/oc/debug.cpp,v 1.7 1996/04/09 16:39:14 hines Exp */ -#include "hoc.h" +#include "hocdec.h" #include "code.h" #include "equation.h" #include diff --git a/src/oc/fileio.cpp b/src/oc/fileio.cpp index e62e2c7ea8..e577129480 100644 --- a/src/oc/fileio.cpp +++ b/src/oc/fileio.cpp @@ -7,7 +7,6 @@ #ifdef HAVE_UNISTD_H #include #endif -#include "hoc.h" #include "ocmisc.h" #include "hocstr.h" #include "hoclist.h" diff --git a/src/oc/ftime.cpp b/src/oc/ftime.cpp index 7a6daac9fb..731038e899 100644 --- a/src/oc/ftime.cpp +++ b/src/oc/ftime.cpp @@ -1,6 +1,7 @@ -#include "hoc.h" +#include "oc_ansi.h" #include + static double start_time = 0.; double nrn_time() { diff --git a/src/oc/functabl.cpp b/src/oc/functabl.cpp index cb4f430419..c8aa452989 100644 --- a/src/oc/functabl.cpp +++ b/src/oc/functabl.cpp @@ -1,5 +1,7 @@ #include <../../nrnconf.h> -#include "hoc.h" + +#include "hocdec.h" +#include "oc_ansi.h" struct TableArg { int nsize; diff --git a/src/oc/hoc.cpp b/src/oc/hoc.cpp index ae76892f9d..407054e561 100644 --- a/src/oc/hoc.cpp +++ b/src/oc/hoc.cpp @@ -3,7 +3,6 @@ #endif #include <../../nrnconf.h> -#include "hoc.h" #include "hocstr.h" #include "equation.h" #include diff --git a/src/oc/hoc_init.cpp b/src/oc/hoc_init.cpp index 4172cafe96..719d712590 100644 --- a/src/oc/hoc_init.cpp +++ b/src/oc/hoc_init.cpp @@ -1,9 +1,7 @@ #include <../../nrnconf.h> /* /local/src/master/nrn/src/oc/hoc_init.cpp,v 1.25 1999/11/08 17:48:58 hines Exp */ -#include "hoc.h" #include "parse.hpp" -#include #include "equation.h" #include "nrnunits.h" @@ -12,6 +10,8 @@ #include "oc_mcran4.hpp" +#include + extern void hoc_nrnmpi_init(); #if PVM diff --git a/src/oc/hocgetsym.h b/src/oc/hocgetsym.h index 30069ca3b9..166b8b632d 100644 --- a/src/oc/hocgetsym.h +++ b/src/oc/hocgetsym.h @@ -1,6 +1,6 @@ #pragma once -#include "hoc.h" +#include "hocdec.h" typedef struct Psym { Symbol* sym; diff --git a/src/oc/hocparse.h b/src/oc/hocparse.h index 1c0e04837e..244aebbefe 100644 --- a/src/oc/hocparse.h +++ b/src/oc/hocparse.h @@ -1,9 +1,7 @@ #pragma once -#include "hoc.h" +#include "hocdec.h" - -/* do not know why this is not in parse.hpp */ extern int yyparse(void); extern int yylex(void); diff --git a/src/oc/math.cpp b/src/oc/math.cpp index 8814ee6621..a568087679 100644 --- a/src/oc/math.cpp +++ b/src/oc/math.cpp @@ -1,3 +1,4 @@ +#include "oc_ansi.h" #ifndef __INTEL_LLVM_COMPILER #pragma STDC FENV_ACCESS ON #endif @@ -6,13 +7,13 @@ /* a fake change */ /* /local/src/master/nrn/src/oc/math.cpp,v 1.6 1999/07/16 13:43:10 hines Exp */ -#include "hoc.h" #include "nrnmpiuse.h" #include "ocfunc.h" + #include #include -#include -#include +#include +#include #define EPS hoc_epsilon diff --git a/src/oc/nonlin.cpp b/src/oc/nonlin.cpp index e98969f293..467ac07349 100644 --- a/src/oc/nonlin.cpp +++ b/src/oc/nonlin.cpp @@ -1,7 +1,6 @@ #include <../../nrnconf.h> #include #include -#include "hoc.h" #include "parse.hpp" #include "hocparse.h" #include "equation.h" diff --git a/src/oc/oc_ansi.h b/src/oc/oc_ansi.h index afebcfd105..0279449376 100644 --- a/src/oc/oc_ansi.h +++ b/src/oc/oc_ansi.h @@ -345,7 +345,7 @@ void hoc_last_init(); void hoc_obj_notify(Object*); int ivoc_list_count(Object*); Object* ivoc_list_item(Object*, int); -double hoc_func_table(void* functable, int n, double* args); +double hoc_func_table(void* vpft, int n, double* args); void hoc_spec_table(void** pfunctable, int n); void* hoc_sec_internal_name2ptr(const char* s, int eflag); void* hoc_pysec_name2ptr(const char* s, int eflag); diff --git a/src/oc/parse.ypp b/src/oc/parse.ypp index 81cdb81786..715715f58d 100755 --- a/src/oc/parse.ypp +++ b/src/oc/parse.ypp @@ -1,11 +1,15 @@ /* /local/src/master/nrn/src/oc/parse.y,v 1.29 1998/11/27 13:11:48 hines Exp */ +%code requires{ +union Inst; +struct Symbol; +} + %{ #include <../../nrnconf.h> /* changes as of 2-jan-89 */ /* version 7.2.1 2-jan-89 short form of the for statement */ -#include "hoc.h" #include "hocdec.h" #include "ocmisc.h" #include "hocparse.h" diff --git a/src/oc/plot.cpp b/src/oc/plot.cpp index e62f36c58c..a0bffdcec6 100644 --- a/src/oc/plot.cpp +++ b/src/oc/plot.cpp @@ -1,6 +1,7 @@ #include <../../nrnconf.h> -#include "hoc.h" +#include "hocdec.h" +#include "oc_ansi.h" /*LINTLIBRARY*/ #undef IGNORE diff --git a/src/oc/plt.cpp b/src/oc/plt.cpp index 89bf8561ff..08088dd9cd 100644 --- a/src/oc/plt.cpp +++ b/src/oc/plt.cpp @@ -1,10 +1,5 @@ #include <../../nrnconf.h> -#define FIG \ - 1 /* version 7.1.1 12/8/88 \ -added plots in fig format \ -*/ -#include "hoc.h" #include "gui-redirect.h" extern void Fig_file(const char*, int); diff --git a/src/oc/symbol.cpp b/src/oc/symbol.cpp index 0574c8c343..5c68322626 100644 --- a/src/oc/symbol.cpp +++ b/src/oc/symbol.cpp @@ -2,7 +2,6 @@ /* /local/src/master/nrn/src/oc/symbol.cpp,v 1.9 1999/02/25 18:01:58 hines Exp */ /* version 7.2.1 2-jan-89 */ -#include "hoc.h" #include "hocdec.h" #include "hoclist.h" #include "nrncore_write/utils/nrncore_utils.h" @@ -10,9 +9,9 @@ #include "ocnotify.h" #include "parse.hpp" -#include -#include -#include +#include +#include +#include #if HAVE_MALLOC_H #include diff --git a/src/oc/xred.cpp b/src/oc/xred.cpp index d3bd620796..8a9145d390 100644 --- a/src/oc/xred.cpp +++ b/src/oc/xred.cpp @@ -1,4 +1,6 @@ #include <../../nrnconf.h> + +#include "hocdec.h" /* /local/src/master/nrn/src/oc/xred.cpp,v 1.3 1996/02/16 16:19:33 hines Exp */ /* xred.cpp,v @@ -48,8 +50,6 @@ xred.cpp,v * */ -#include "hoc.h" - #include /* input a n integer in range > min and < max */