fix conflict for own shutdown function
This commit is contained in:
parent
16adcce60f
commit
bb1539b666
|
|
@ -1,5 +1,6 @@
|
||||||
2008-01-19 Dietmar Warning
|
2008-01-19 Dietmar Warning
|
||||||
* configure.in: w/o optimization better debug
|
* configure.in: w/o optimization better debug
|
||||||
|
* src/main.c: fix conflict for own shutdown function
|
||||||
* src/frontend/numparam/xpressn.c: more precise recognition of subckt names
|
* src/frontend/numparam/xpressn.c: more precise recognition of subckt names
|
||||||
* src/frontend/numparam/spicenum.c: avoid access to uninitialized memory
|
* src/frontend/numparam/spicenum.c: avoid access to uninitialized memory
|
||||||
because of pascal convention
|
because of pascal convention
|
||||||
|
|
|
||||||
34
src/main.c
34
src/main.c
|
|
@ -158,7 +158,7 @@ static int started = FALSE;
|
||||||
|
|
||||||
/* static functions */
|
/* static functions */
|
||||||
static int SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator);
|
static int SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator);
|
||||||
static int shutdown(int exitval);
|
static int sp_shutdown(int exitval);
|
||||||
static void app_rl_readlines(void);
|
static void app_rl_readlines(void);
|
||||||
|
|
||||||
#if defined(HAVE_GNUREADLINE) || defined(HAVE_BSDEDITLINE)
|
#if defined(HAVE_GNUREADLINE) || defined(HAVE_BSDEDITLINE)
|
||||||
|
|
@ -356,7 +356,7 @@ SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator)
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* Shutdown gracefully. */
|
/* Shutdown gracefully. */
|
||||||
static int
|
static int
|
||||||
shutdown(int exitval)
|
sp_shutdown(int exitval)
|
||||||
{
|
{
|
||||||
cleanvars();
|
cleanvars();
|
||||||
#ifdef PARALLEL_ARCH
|
#ifdef PARALLEL_ARCH
|
||||||
|
|
@ -688,7 +688,7 @@ main(int argc, char **argv)
|
||||||
/* MFB tends to jump to 0 on errors. This tends to catch it. */
|
/* MFB tends to jump to 0 on errors. This tends to catch it. */
|
||||||
if (started) {
|
if (started) {
|
||||||
fprintf(cp_err, "main: Internal Error: jump to zero\n");
|
fprintf(cp_err, "main: Internal Error: jump to zero\n");
|
||||||
shutdown(EXIT_BAD);
|
sp_shutdown(EXIT_BAD);
|
||||||
}
|
}
|
||||||
started = TRUE;
|
started = TRUE;
|
||||||
|
|
||||||
|
|
@ -732,7 +732,7 @@ main(int argc, char **argv)
|
||||||
err = SIMinit(&nutmeginfo,&ft_sim);
|
err = SIMinit(&nutmeginfo,&ft_sim);
|
||||||
if(err != OK) {
|
if(err != OK) {
|
||||||
ft_sperror(err,"SIMinit");
|
ft_sperror(err,"SIMinit");
|
||||||
shutdown(EXIT_BAD);
|
sp_shutdown(EXIT_BAD);
|
||||||
}
|
}
|
||||||
cp_program = ft_sim->simulator;
|
cp_program = ft_sim->simulator;
|
||||||
|
|
||||||
|
|
@ -765,12 +765,12 @@ main(int argc, char **argv)
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 'h': /* Help */
|
case 'h': /* Help */
|
||||||
show_help();
|
show_help();
|
||||||
shutdown (EXIT_NORMAL);
|
sp_shutdown (EXIT_NORMAL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'v': /* Version info */
|
case 'v': /* Version info */
|
||||||
show_version();
|
show_version();
|
||||||
shutdown (EXIT_NORMAL);
|
sp_shutdown (EXIT_NORMAL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'b': /* Batch mode */
|
case 'b': /* Batch mode */
|
||||||
|
|
@ -790,7 +790,7 @@ main(int argc, char **argv)
|
||||||
if (optarg) {
|
if (optarg) {
|
||||||
if (!(circuit_file = fopen(optarg, "r"))) {
|
if (!(circuit_file = fopen(optarg, "r"))) {
|
||||||
perror("circuit file not available");
|
perror("circuit file not available");
|
||||||
shutdown(EXIT_BAD);
|
sp_shutdown(EXIT_BAD);
|
||||||
}
|
}
|
||||||
istty = FALSE;
|
istty = FALSE;
|
||||||
}
|
}
|
||||||
|
|
@ -822,7 +822,7 @@ main(int argc, char **argv)
|
||||||
if (!(freopen (buf, "w", stdout))) {
|
if (!(freopen (buf, "w", stdout))) {
|
||||||
#endif
|
#endif
|
||||||
perror (buf);
|
perror (buf);
|
||||||
shutdown (EXIT_BAD);
|
sp_shutdown (EXIT_BAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAS_WINDOWS
|
#ifdef HAS_WINDOWS
|
||||||
|
|
@ -1021,7 +1021,7 @@ bot:
|
||||||
gotone = TRUE;
|
gotone = TRUE;
|
||||||
}
|
}
|
||||||
if (ft_batchmode && err)
|
if (ft_batchmode && err)
|
||||||
shutdown(EXIT_BAD);
|
sp_shutdown(EXIT_BAD);
|
||||||
} /* --- if (!ft_servermode && !ft_nutmeg) --- */
|
} /* --- if (!ft_servermode && !ft_nutmeg) --- */
|
||||||
|
|
||||||
if (!gotone && ft_batchmode && !ft_nutmeg)
|
if (!gotone && ft_batchmode && !ft_nutmeg)
|
||||||
|
|
@ -1037,17 +1037,17 @@ evl:
|
||||||
|
|
||||||
|
|
||||||
if (st == TRUE) {
|
if (st == TRUE) {
|
||||||
shutdown(EXIT_BAD);
|
sp_shutdown(EXIT_BAD);
|
||||||
}
|
}
|
||||||
st = TRUE;
|
st = TRUE;
|
||||||
if (ft_servermode) {
|
if (ft_servermode) {
|
||||||
if (ft_curckt == NULL) {
|
if (ft_curckt == NULL) {
|
||||||
fprintf(cp_err, "Error: no circuit loaded!\n");
|
fprintf(cp_err, "Error: no circuit loaded!\n");
|
||||||
shutdown(EXIT_BAD);
|
sp_shutdown(EXIT_BAD);
|
||||||
}
|
}
|
||||||
if (ft_dorun(""))
|
if (ft_dorun(""))
|
||||||
shutdown(EXIT_BAD);
|
sp_shutdown(EXIT_BAD);
|
||||||
shutdown(EXIT_NORMAL);
|
sp_shutdown(EXIT_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If -r is specified, then we don't bother with the dot
|
/* If -r is specified, then we don't bother with the dot
|
||||||
|
|
@ -1058,16 +1058,16 @@ evl:
|
||||||
/* saj done already in inp_spsource ft_dotsaves();*/
|
/* saj done already in inp_spsource ft_dotsaves();*/
|
||||||
error2 = ft_dorun(ft_rawfile);
|
error2 = ft_dorun(ft_rawfile);
|
||||||
if (ft_cktcoms(TRUE) || error2)
|
if (ft_cktcoms(TRUE) || error2)
|
||||||
shutdown(EXIT_BAD);
|
sp_shutdown(EXIT_BAD);
|
||||||
} else if (ft_savedotargs()) {
|
} else if (ft_savedotargs()) {
|
||||||
error2 = ft_dorun(NULL);
|
error2 = ft_dorun(NULL);
|
||||||
if (ft_cktcoms(FALSE) || error2)
|
if (ft_cktcoms(FALSE) || error2)
|
||||||
shutdown(EXIT_BAD);
|
sp_shutdown(EXIT_BAD);
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Note: No \".plot\", \".print\", or \".fourier\" lines; "
|
"Note: No \".plot\", \".print\", or \".fourier\" lines; "
|
||||||
"no simulations run\n");
|
"no simulations run\n");
|
||||||
shutdown(EXIT_BAD);
|
sp_shutdown(EXIT_BAD);
|
||||||
}
|
}
|
||||||
} /* --- if (ft_batchmode) --- */
|
} /* --- if (ft_batchmode) --- */
|
||||||
else {
|
else {
|
||||||
|
|
@ -1094,5 +1094,5 @@ evl:
|
||||||
|
|
||||||
#endif /* ~ SIMULATOR */
|
#endif /* ~ SIMULATOR */
|
||||||
|
|
||||||
return shutdown(EXIT_NORMAL);
|
return sp_shutdown(EXIT_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue