Skip to content

Commit

Permalink
OCSMALL is never set and never used
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Cornu committed Oct 8, 2024
1 parent ab0a571 commit 9c6065f
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 100 deletions.
18 changes: 0 additions & 18 deletions src/ivoc/ivocmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,6 @@ std::ostream* OcIdraw::idraw_stream = 0;
#endif
/*****************************************************************************/
extern void ivoc_cleanup();
#if OCSMALL
static char* ocsmall_argv[] = {0, "difus.hoc"};
#endif
#if defined(WIN32) && HAVE_IV
extern HWND hCurrWnd;
#endif
Expand Down Expand Up @@ -538,13 +535,6 @@ int ivocmain_session(int argc, const char** argv, const char** env, int start_se
#endif // !unix.

#if HAVE_IV
#if OCSMALL
our_argc = 2;
our_argv = new char*[2];
our_argv[0] = "Neuron";
our_argv[1] = ":lib:hoc:macload.hoc";
session = new Session("NEURON", our_argc, our_argv, options, properties);
#else
#if defined(WIN32)
if (hoc_usegui) {
session = new Session("NEURON", our_argc, (char**) our_argv, options, properties);
Expand Down Expand Up @@ -596,8 +586,6 @@ int ivocmain_session(int argc, const char** argv, const char** env, int start_se
}
delete[] nrn_props;

#endif /*OCSMALL*/

if (session) {
session->style()->find_attribute("NSTACK", hoc_nstack);
session->style()->find_attribute("NFRAME", hoc_nframe);
Expand Down Expand Up @@ -711,12 +699,6 @@ int ivocmain_session(int argc, const char** argv, const char** env, int start_se
#if USENRNJAVA
nrn_InitializeJavaVM();
#endif
#if OCSMALL
if (argc == 1) {
ocsmall_argv[0] = our_argv[0];
exit_status = oc.run(2, ocsmall_argv);
} else
#endif
#if defined(USE_PYTHON)
#if HAVE_IV
if (session && session->style()->value_is_on("python")) {
Expand Down
4 changes: 0 additions & 4 deletions src/ivoc/pwman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1272,11 +1272,7 @@ PrintableWindowManager::PrintableWindowManager() {
if (PrintableWindow::leader() != pwmi_->w_) {
pwmi_->w_->replace_dismiss_action(NULL);
}
#if OCSMALL
pwmi_->w_->xplace(-800, 0);
#else
pwmi_->w_->xplace(0, 0);
#endif
// pwmi_->w_->map();
PrintableWindow::intercept(ocg);
}
Expand Down
28 changes: 0 additions & 28 deletions src/oc/audit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ maintain a list of xopen statements with the proper rcs version number.


static void hoc_audit_init(void) {
#if !OCSMALL
if (retrieve_audit.mode) {
/* clean up. there must have been an execerror */
retrieve_audit.mode = 0;
Expand All @@ -50,11 +49,9 @@ static void hoc_audit_init(void) {
retrieve_audit.pipe = (FILE*) 0;
}
}
#endif
}

void hoc_audit_from_hoc_main1(int argc, const char** argv, const char** envp) {
#if !OCSMALL
/*ARGSUSED*/
int i;
char buf[200];
Expand Down Expand Up @@ -101,10 +98,8 @@ void hoc_audit_from_hoc_main1(int argc, const char** argv, const char** envp) {
}
}
fprintf(faudit, "\n");
#endif
}

#if !OCSMALL
static void pipesend(int type, const char* s) {
int err;
if (audit_pipe) {
Expand All @@ -118,25 +113,19 @@ static void pipesend(int type, const char* s) {
fflush(audit_pipe);
}
}
#endif
void hoc_audit_command(const char* buf) {
#if !OCSMALL
if (doaudit) {
fprintf(faudit, "%s", buf);
}
#endif
}

void hoc_audit_from_xopen1(const char* fname, const char* rcs) {
#if !OCSMALL
if (!hoc_retrieving_audit() && doaudit && !rcs) {
pipesend(1, fname);
}
#endif
}

void hoc_audit_from_final_exit(void) {
#if !OCSMALL
if (faudit) {
fclose(faudit);
faudit = 0;
Expand All @@ -146,20 +135,16 @@ void hoc_audit_from_final_exit(void) {
audit_pipe = 0;
}
doaudit = 0;
#endif
}

void hoc_Saveaudit(void) {
int err;
#if !OCSMALL
err = hoc_saveaudit();
#endif
hoc_ret();
hoc_pushx((double) err);
}

int hoc_saveaudit(void) {
#if !OCSMALL
static int n = 0;
char buf[200];
if (hoc_retrieving_audit() || !doaudit) {
Expand All @@ -178,34 +163,26 @@ int hoc_saveaudit(void) {
doaudit = 0;
return 0;
}
#endif
return 1;
}

int hoc_retrieving_audit(void) {
#if !OCSMALL
return retrieve_audit.mode;
#else
return 0;
#endif
}

void hoc_Retrieveaudit(void) {
int err, id;
#if !OCSMALL
if (ifarg(1)) {
id = (int) chkarg(1, 0., 1e7);
} else {
id = 0;
}
#endif
err = hoc_retrieve_audit(id);
hoc_ret();
hoc_pushx((double) err);
}

static void xopen_audit(void) {
#if !OCSMALL
char buf[200], *bp;
constexpr auto rm_str = "rm ";
strcpy(buf, rm_str);
Expand All @@ -218,11 +195,9 @@ static void xopen_audit(void) {
#if 1
nrn_assert(system(buf) >= 0);
#endif
#endif
}

int hoc_retrieve_audit(int id) {
#if !OCSMALL
RetrieveAudit save;
char buf[200];
char retdir[200];
Expand All @@ -241,12 +216,10 @@ int hoc_retrieve_audit(int id) {
/* pclose(retrieve_audit.pipe);*/
retrieve_audit = save;
fprintf(stderr, "should now delete %s", retdir);
#endif
return 1;
}

void hoc_xopen_from_audit(const char* fname) {
#if !OCSMALL
char buf[200];
/* check the synchronization */
nrn_assert(fgets(buf, 200, retrieve_audit.pipe));
Expand All @@ -255,5 +228,4 @@ void hoc_xopen_from_audit(const char* fname) {
fprintf(stderr, "Warning: xopen_from_audit files have different names %s %s\n", fname, buf);
}
xopen_audit();
#endif
}
2 changes: 0 additions & 2 deletions src/oc/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ void hoc_debug(void) /* print the machine */

/* running copy of calls to execute */
void debugzz(Inst* p) {
#if !OCSMALL
{
if (p->in == STOP)
Printf("STOP\n");
Expand Down Expand Up @@ -142,5 +141,4 @@ void debugzz(Inst* p) {
}
p++;
}
#endif /*OCSMALL*/
}
7 changes: 0 additions & 7 deletions src/oc/getsym.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
/* /local/src/master/nrn/src/oc/getsym.cpp,v 1.2 1996/02/16 16:19:26 hines Exp */
/*
getsym.cpp,v
* Revision 1.2 1996/02/16 16:19:26 hines
* OCSMALL used to throw out things not needed by teaching programs
*
* Revision 1.1.1.1 1994/10/12 17:22:08 hines
* NEURON 3.0 distribution
*
Expand Down Expand Up @@ -59,9 +56,6 @@ getsym.cpp,v
hoc_execstr(char *s) compiles and executes the string
*/
#if OCSMALL
#else

#include "hocgetsym.h"
#include "parse.hpp"
#include "hocparse.h"
Expand Down Expand Up @@ -172,4 +166,3 @@ void hoc_execstr(const char* cp) {
hoc_pc = pcsav;
hoc_free_list(&symlist);
}
#endif /*OCSMALL*/
4 changes: 0 additions & 4 deletions src/oc/hoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ void start_profile(int i) {}
void add_profile(int i) {}
void pr_profile(void) {}

#if OCSMALL
#define READLINE 0
#endif

#ifndef READLINE
#define READLINE 1
#endif
Expand Down
23 changes: 0 additions & 23 deletions src/oc/nonlin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ typedef struct elm* Elm;

void hoc_dep_make(void) /* tag the variable as dependent with a variable number */
{
#if !OCSMALL
Symbol* sym;
unsigned* numpt = 0;

Expand Down Expand Up @@ -58,18 +57,15 @@ void hoc_dep_make(void) /* tag the variable as dependent with a variable number
if (*numpt > 0)
hoc_execerror(sym->name, "made dependent twice");
*numpt = ++neqn;
#endif
}


void init_access(void) /* zero the access array */
{
#if !OCSMALL
if (hoc_access != (int*) 0)
free((char*) hoc_access);
hoc_access = (int*) ecalloc((neqn + 1), sizeof(int));
hoc_var_access = -1;
#endif
}

static void eqn_space(void); /* reallocate space for matrix */
Expand All @@ -80,8 +76,6 @@ static unsigned maxeqn;

void hoc_eqn_name(void) /* save row number for lhs and/or rhs */
{
#if !OCSMALL

if (maxeqn != neqn) /* discard equations and reallocate space */
{
eqn_space();
Expand All @@ -95,11 +89,9 @@ void hoc_eqn_name(void) /* save row number for lhs and/or rhs */
hoc_execerror("illegal equation name", (hoc_pc - 2)->sym->name);
row = hoc_var_access;
hoc_nopop();
#endif
}

static void set_varble(void) { /* set up varble array by searching for tags */
#if !OCSMALL
Symbol* sp;

for (sp = hoc_symlist->first; sp != (Symbol*) 0; sp = sp->next) {
Expand All @@ -117,14 +109,12 @@ static void set_varble(void) { /* set up varble array by searching for tags */
}
}
}
#endif
}

static double Delta = .001; /* variable variation */

void hoc_eqinit(void) /* built in function to initialize equation solver */
{
#if !OCSMALL
Symbol* sp;

if (ifarg(1))
Expand All @@ -140,20 +130,17 @@ void hoc_eqinit(void) /* built in function to initialize equation solver */
}
neqn = 0;
eqn_space();
#endif
hoc_ret();
hoc_pushx(0.);
}

void hoc_eqn_init(void) /* initialize equation row */
{
#if !OCSMALL
struct elm* el;

for (el = rowst[row]; el != (struct elm*) 0; el = el->c_right)
el->value = 0.;
rhs[row] = 0.;
#endif
}

void hoc_eqn_lhs(void) /* add terms to left hand side */
Expand All @@ -168,7 +155,6 @@ void hoc_eqn_rhs(void) /* add terms to right hand side */


static void eqn_side(int lhs) {
#if !OCSMALL
int i;
struct elm* el;
double f0, f1;
Expand Down Expand Up @@ -199,11 +185,9 @@ static void eqn_side(int lhs) {
el->value += (f1 - f0) / Delta;
}
hoc_pc++;
#endif
}

static void eqn_space(void) { /* reallocate space for matrix */
#if !OCSMALL
int i;
struct elm* el;

Expand Down Expand Up @@ -239,19 +223,15 @@ static void eqn_space(void) { /* reallocate space for matrix */
eqord[i] = i;
varord[i] = i;
}
#endif
}

void hoc_Prmat(void) {
#if !OCSMALL
prmat();
#endif
hoc_ret();
hoc_pushx(1.);
}

void hoc_solve(void) {
#if !OCSMALL
/* Sum is a measure of the dependent variable accuracy
and how well the equations are solved */

Expand All @@ -277,9 +257,6 @@ void hoc_solve(void) {
}
rowst[i] = colst[i] = (struct elm*) 0;
}
#else
double sum = 0;
#endif
hoc_ret();
hoc_pushx(sum);
}
Loading

0 comments on commit 9c6065f

Please sign in to comment.