Skip to content

Commit

Permalink
remove unneeded #include "hoc.h", include exact headers when required
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeplf committed Aug 30, 2024
1 parent 00c147c commit 42dd21f
Show file tree
Hide file tree
Showing 19 changed files with 27 additions and 32 deletions.
1 change: 0 additions & 1 deletion src/oc/axis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ axis.cpp,v
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "hoc.h"
#include "gui-redirect.h"

#define CLIP 1e9
Expand Down
1 change: 0 additions & 1 deletion src/oc/code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "backtrace_utils.h"
#include "bbslsrv2.h"
#include "hoc.h"
#include "cabcode.h"
#include "code.h"
#include "hocstr.h"
Expand Down
1 change: 0 additions & 1 deletion src/oc/code2.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/oc/debug.cpp
Original file line number Diff line number Diff line change
@@ -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 <stdio.h>
Expand Down
1 change: 0 additions & 1 deletion src/oc/fileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "hoc.h"
#include "ocmisc.h"
#include "hocstr.h"
#include "hoclist.h"
Expand Down
3 changes: 2 additions & 1 deletion src/oc/ftime.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "hoc.h"
#include "oc_ansi.h"

#include <chrono>

static double start_time = 0.;

double nrn_time() {
Expand Down
4 changes: 3 additions & 1 deletion src/oc/functabl.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include <../../nrnconf.h>
#include "hoc.h"

#include "hocdec.h"
#include "oc_ansi.h"

struct TableArg {
int nsize;
Expand Down
1 change: 0 additions & 1 deletion src/oc/hoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#endif

#include <../../nrnconf.h>
#include "hoc.h"
#include "hocstr.h"
#include "equation.h"
#include <stdio.h>
Expand Down
4 changes: 2 additions & 2 deletions src/oc/hoc_init.cpp
Original file line number Diff line number Diff line change
@@ -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 <cmath>
#include "equation.h"
#include "nrnunits.h"

Expand All @@ -12,6 +10,8 @@

#include "oc_mcran4.hpp"

#include <cmath>

extern void hoc_nrnmpi_init();

#if PVM
Expand Down
2 changes: 1 addition & 1 deletion src/oc/hocgetsym.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "hoc.h"
#include "hocdec.h"

typedef struct Psym {
Symbol* sym;
Expand Down
4 changes: 1 addition & 3 deletions src/oc/hocparse.h
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
7 changes: 4 additions & 3 deletions src/oc/math.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "oc_ansi.h"
#ifndef __INTEL_LLVM_COMPILER
#pragma STDC FENV_ACCESS ON
#endif
Expand All @@ -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 <cfenv>
#include <cmath>
#include <errno.h>
#include <stdio.h>
#include <cerrno>
#include <cstdio>


#define EPS hoc_epsilon
Expand Down
1 change: 0 additions & 1 deletion src/oc/nonlin.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <../../nrnconf.h>
#include <stdlib.h>
#include <math.h>
#include "hoc.h"
#include "parse.hpp"
#include "hocparse.h"
#include "equation.h"
Expand Down
2 changes: 1 addition & 1 deletion src/oc/oc_ansi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 5 additions & 1 deletion src/oc/parse.ypp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion src/oc/plot.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <../../nrnconf.h>
#include "hoc.h"

#include "hocdec.h"
#include "oc_ansi.h"

/*LINTLIBRARY*/
#undef IGNORE
Expand Down
5 changes: 0 additions & 5 deletions src/oc/plt.cpp
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
7 changes: 3 additions & 4 deletions src/oc/symbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
/* /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"
#include "oc_ansi.h"
#include "ocnotify.h"
#include "parse.hpp"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#if HAVE_MALLOC_H
#include <malloc.h>
Expand Down
4 changes: 2 additions & 2 deletions src/oc/xred.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -48,8 +50,6 @@ xred.cpp,v
*
*/

#include "hoc.h"

#include <cstdio>

/* input a n integer in range > min and < max */
Expand Down

0 comments on commit 42dd21f

Please sign in to comment.