Skip to content

Commit

Permalink
fix linking errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeplf committed Aug 30, 2024
1 parent 8b3e29a commit 5083324
Show file tree
Hide file tree
Showing 10 changed files with 140 additions and 139 deletions.
46 changes: 23 additions & 23 deletions src/oc/code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ void hoc_varpush() {

#define relative(pc) (pc + (pc)->i)

void forcode(void) {
void hoc_forcode(void) {
double d;
Inst* savepc = pc; /* loop body */
int isec;
Expand Down Expand Up @@ -1283,7 +1283,7 @@ void for_segment1(void) {
for_segment2(sym, mode);
}

void ifcode(void) {
void hoc_ifcode(void) {
double d;
Inst* savepc = pc; /* then part */

Expand All @@ -1297,17 +1297,17 @@ void ifcode(void) {
pc = relative(savepc + 2); /* next stmt */
}

void Break(void) /* break statement */
void hoc_Break(void) /* break statement */
{
hoc_returning = 2;
}

void Continue(void) /* continue statement */
void hoc_Continue(void) /* continue statement */
{
hoc_returning = 3;
}

void Stop(void) /* stop statement */
void hoc_Stop(void) /* stop statement */
{
hoc_returning = 4;
}
Expand Down Expand Up @@ -1386,7 +1386,7 @@ void hoc_push_frame(Symbol* sp, int narg) { /* helpful for explicit function cal
fp->ob = hoc_thisobject;
}

void pop_frame(void) {
void hoc_pop_frame(void) {
int i;
frameobj_clean(fp);
for (i = 0; i < fp->nargs; i++) {
Expand Down Expand Up @@ -1518,7 +1518,7 @@ void hoc_ret() {
hoc_returning = 1;
}

void funcret(void) /* return from a function */
void hoc_funcret(void) /* return from a function */
{
double d;
if (fp->sp->type != FUNCTION)
Expand All @@ -1528,7 +1528,7 @@ void funcret(void) /* return from a function */
hoc_pushx(d);
}

void procret(void) /* return from a procedure */
void hoc_procret(void) /* return from a procedure */
{
if (fp->sp->type == FUNCTION)
hoc_execerror(fp->sp->name, "(func) returns no value");
Expand Down Expand Up @@ -1687,7 +1687,7 @@ double hoc_opasgn(int op, double dest, double src) {
}
}

void argassign(void) /* store top of stack in argument */
void hoc_argassign(void) /* store top of stack in argument */
{
double d;
int i, op;
Expand Down Expand Up @@ -1755,7 +1755,7 @@ void hoc_argrefarg(void) {
hoc_pushpx(pd);
}

void bltin(void) /* evaluate built-in on top of stack */
void hoc_bltin(void) /* evaluate built-in on top of stack */
{
double d;
d = hoc_xpop();
Expand Down Expand Up @@ -1824,7 +1824,7 @@ void hoc_autoobject(void) { /* AUTOOBJ symbol at pc+1. */
hoc_pushobj(&(cast<Object*>(fp->argn[obs->u.u_auto])));
}

void eval(void) /* evaluate variable on stack */
void hoc_eval(void) /* evaluate variable on stack */
{
Objectdata* odsav;
Object* obsav = 0;
Expand Down Expand Up @@ -1984,7 +1984,7 @@ void hoc_sub(void) /* subtract top two elems on stack */
hoc_pushx(d1);
}

void mul(void) /* multiply top two elems on stack */
void hoc_mul(void) /* multiply top two elems on stack */
{
double d1, d2;
d2 = hoc_xpop();
Expand Down Expand Up @@ -2036,7 +2036,7 @@ void hoc_negate() {
hoc_pushx(-d);
}

void gt(void) {
void hoc_gt(void) {
double d1, d2;
d2 = hoc_xpop();
d1 = hoc_xpop();
Expand All @@ -2052,15 +2052,15 @@ void hoc_lt() {
hoc_pushx(d1);
}

void ge(void) {
void hoc_ge(void) {
double d1, d2;
d2 = hoc_xpop();
d1 = hoc_xpop();
d1 = (double) (d1 >= d2 - hoc_epsilon);
hoc_pushx(d1);
}

void le(void) {
void hoc_le(void) {
double d1, d2;
d2 = hoc_xpop();
d1 = hoc_xpop();
Expand Down Expand Up @@ -2269,7 +2269,7 @@ void hoc_assign_str(char** cpp, const char* buf) {
}
}

void assstr(void) { /* assign string on top to stack - 1 */
void hoc_assstr(void) { /* assign string on top to stack - 1 */
char **ps1, **ps2;

ps1 = hoc_strpop();
Expand Down Expand Up @@ -2406,7 +2406,7 @@ void hoc_prexpr() {
hoc_plprint(s->buf);
}

void prstr(void) /* print string value */
void hoc_prstr(void) /* print string value */
{
static HocStr* s;
char** cpp;
Expand Down Expand Up @@ -2454,7 +2454,7 @@ void hoc_newline(void) /* print newline */
hoc_plprint("\n");
}

void varread(void) /* read into variable */
void hoc_varread(void) /* read into variable */
{
double d = 0.0;
extern NrnFILEWrap* hoc_fin;
Expand Down Expand Up @@ -2491,12 +2491,12 @@ static Inst* codechk(void) {
return hoc_progp++;
}

Inst* Code(Pfrv f) { /* install one instruction or operand */
Inst* hoc_Code(Pfrv f) { /* install one instruction or operand */
hoc_progp->pf = f;
return codechk();
}

Inst* codei(int f) {
Inst* hoc_codei(int f) {
hoc_progp->pf = NULL; /* zero high order bits to avoid debugzz problem */
hoc_progp->i = f;
return codechk();
Expand All @@ -2507,17 +2507,17 @@ Inst* hoc_codeptr(void* vp) {
return codechk();
}

void codesym(Symbol* f) {
void hoc_codesym(Symbol* f) {
hoc_progp->sym = f;
IGNORE(codechk());
}

void codein(Inst* f) {
void hoc_codein(Inst* f) {
hoc_progp->in = f;
IGNORE(codechk());
}

void insertcode(Inst* begin, Inst* end, Pfrv f) {
void hoc_insertcode(Inst* begin, Inst* end, Pfrv f) {
Inst* i;
for (i = end - 1; i != begin; i--) {
*i = *(i - 1);
Expand Down
6 changes: 3 additions & 3 deletions src/oc/code2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ static int hoc_vsscanf(const char* buf) {
return n;
}

void System(void) {
void hoc_System(void) {
extern int hoc_plttext;
static char stdoutfile[] = "/systmp.tmp";
double d;
Expand Down Expand Up @@ -509,7 +509,7 @@ void System(void) {
hoc_pushx(d);
}

void Xred(void) /* read with prompt string and default and limits */
void hoc_Xred(void) /* read with prompt string and default and limits */
{
double d;

Expand Down Expand Up @@ -589,7 +589,7 @@ static void symdebug(const char* s, Symlist* list) /* for debugging display the
}
}

void symbols(void) /* display the types above */
void hoc_symbols(void) /* display the types above */
{
int i, j;
Symbol* sp;
Expand Down
11 changes: 6 additions & 5 deletions src/oc/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
#include "code.h"
#include "equation.h"
#include <stdio.h>
int zzdebug;

int hoc_zzdebug;

#define prcod(c1, c2) else if (p->pf == c1) Printf("%p %p %s", p, p->pf, c2)

void debug(void) /* print the machine */
void hoc_debug(void) /* print the machine */
{
if (zzdebug == 0)
zzdebug = 1;
if (hoc_zzdebug == 0)
hoc_zzdebug = 1;
else
zzdebug = 0;
hoc_zzdebug = 0;
}

/* running copy of calls to execute */
Expand Down
26 changes: 13 additions & 13 deletions src/oc/fileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
extern char* neuron_home;

NrnFILEWrap* hoc_frin;
FILE* fout;
FILE* hoc_fout;

void hoc_stdout(void) {
static int prev = -1;
Expand Down Expand Up @@ -53,7 +53,7 @@ void hoc_stdout(void) {
hoc_pushx((double) fileno(stdout));
}

void ropen(void) /* open file for reading */
void hoc_ropen(void) /* open file for reading */
{
double d;
const char* fname;
Expand Down Expand Up @@ -81,7 +81,7 @@ void ropen(void) /* open file for reading */
hoc_pushx(d);
}

void wopen(void) /* open file for writing */
void hoc_wopen(void) /* open file for writing */
{
const char* fname;
double d;
Expand All @@ -91,14 +91,14 @@ void wopen(void) /* open file for writing */
else
fname = "";
d = 1.;
if (fout != stdout) {
IGNORE(fclose(fout));
if (hoc_fout != stdout) {
IGNORE(fclose(hoc_fout));
}
fout = stdout;
hoc_fout = stdout;
if (fname[0] != 0) {
if ((fout = fopen(expand_env_var(fname), "w")) == nullptr) {
if ((hoc_fout = fopen(expand_env_var(fname), "w")) == nullptr) {
d = 0.;
fout = stdout;
hoc_fout = stdout;
}
}
errno = 0;
Expand Down Expand Up @@ -225,7 +225,7 @@ int hoc_xopen1(const char* name, const char* rcs) {
return 0;
}

void xopen(void) /* read and execute a hoc program */
void hoc_xopen(void) /* read and execute a hoc program */
{
if (ifarg(2)) {
hoc_xopen1(gargstr(1), gargstr(2));
Expand All @@ -236,18 +236,18 @@ void xopen(void) /* read and execute a hoc program */
hoc_pushx(1.);
}

void Fprint(void) /* fprintf function */
void hoc_Fprint(void) /* fprintf function */
{
char* buf;
double d;

hoc_sprint1(&buf, 1);
d = (double) fprintf(fout, "%s", buf);
d = (double) fprintf(hoc_fout, "%s", buf);
hoc_ret();
hoc_pushx(d);
}

void PRintf(void) /* printf function */
void hoc_PRintf(void) /* printf function */
{
char* buf;
double d;
Expand Down Expand Up @@ -315,7 +315,7 @@ double hoc_fw_scan(NrnFILEWrap* fi) {
return d;
}

void Fscan(void) /* read a number from input file */
void hoc_Fscan(void) /* read a number from input file */
{
double d;
NrnFILEWrap* fi;
Expand Down
Loading

0 comments on commit 5083324

Please sign in to comment.