diff --git a/ChangeLog b/ChangeLog index 0db8a3220..b26845663 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-08-10 Holger Vogt + * evtplot.c: initilize 'value' to 0 + * xpressn.c: improved error message + * misccoms.c, main.c, error.c, fteext.h: flag ft_pipemode set + in main.c, used to optimize or suppress output messages + 2011-08-09 Holger Vogt * inp2dot.c: align spaces and braces * inp2dot.c, examples/pss/*.cir: uic for pss to end of line diff --git a/src/frontend/error.c b/src/frontend/error.c index 49f8b8777..d7741f7e7 100644 --- a/src/frontend/error.c +++ b/src/frontend/error.c @@ -26,11 +26,18 @@ void winmessage(char* new_msg); void controlled_exit(int status) { + if (status != 0) #ifdef HAS_WINDOWS - winmessage("Fatal error in NGSPICE"); + winmessage("Fatal error in NGSPICE"); #else - fprintf(stderr, "Fatal error in NGSPICE - Return"); - getc(stdin); + { + if (!ft_pipemode) { + fprintf(stderr, " Fatal error in NGSPICE - Press Return to exit\n"); + getc(stdin); + } + else + fprintf(stderr, " Fatal error in NGSPICE - Exit\n"); + } #endif exit(status); } @@ -73,7 +80,7 @@ void internalerror(char *message) { - fprintf(stderr, "internal error: %s\n", message); + fprintf(stderr, "ERROR: (internal) %s\n", message); } @@ -82,6 +89,6 @@ void externalerror(char *message) { - fprintf(stderr, "external error: %s\n", message); + fprintf(stderr, "ERROR: (external) %s\n", message); } diff --git a/src/frontend/misccoms.c b/src/frontend/misccoms.c index d1a52a885..a3b7466a9 100644 --- a/src/frontend/misccoms.c +++ b/src/frontend/misccoms.c @@ -144,18 +144,23 @@ com_bug(wordlist *wl) { NG_IGNORE(wl); - fprintf(cp_out, "Send mail to the address ngspice-devel@lists.sourceforge.net\n"); + fprintf(cp_out, "Please use the ngspice bug tracker at:\n"); + fprintf(cp_out, "http://sourceforge.net/tracker/?group_id=38962&atid=423915\n"); return; } #endif /* SYSTEM_MAIL */ +/* printout upon startup or 'version' command. options to version are -s (short) + or -f (full). 'version' with options may also be used in ngspice pipe mode. */ void com_version(wordlist *wl) { char *s; if (!wl) { + /* no printout in pipe mode (-p) */ + if (ft_pipemode) return; fprintf(cp_out, "******\n"); fprintf(cp_out, "** %s-%s : %s\n", ft_sim->simulator, @@ -204,6 +209,18 @@ com_version(wordlist *wl) fprintf(cp_out,"** XSPICE extensions included\n"); #endif fprintf(cp_out,"** Relevant compilation options (refer to user's manual):\n"); +#ifdef NGDEBUG + fprintf(cp_out,"** Debugging option (-g) enabled\n"); +#endif +#ifdef ADMS + fprintf(cp_out,"** Adms interface enabled\n"); +#endif +#ifdef USE_OMP + fprintf(cp_out,"** OpenMP multithreading for BSIM3, BSIM4 enabled\n"); +#endif +#if defined(X_DISPLAY_MISSING) && !defined(HAS_WINDOWS) + fprintf(cp_out,"** X11 interface not compiled into ngspice\n"); +#endif #ifdef NOBYPASS fprintf(cp_out,"** --enable-nobypass\n"); #endif diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index d339a893e..1103d4039 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -16,6 +16,7 @@ #include "dvec.h" #include "../frontend/variable.h" #include "compatmode.h" +#include "error.h" /* random numbers in /maths/misc/randnumb.c */ extern double gauss0(void); @@ -1394,8 +1395,8 @@ evaluate (tdico * dico, SPICE_DSTRINGPTR qstr_p, char *t, unsigned char mode) char buf[17+1]; if(snprintf(buf, sizeof(buf), "% 17.9le", u) != 17) { - fprintf(stderr, "internal ERROR in %s(%d)\n", __FUNCTION__, __LINE__); - exit(1); + fprintf(stderr, "ERROR: xpressn.c, %s(%d)\n", __FUNCTION__, __LINE__); + controlled_exit(1); } scopys(qstr_p, buf); } diff --git a/src/include/fteext.h b/src/include/fteext.h index 6bffa2fa1..318ac7a6c 100644 --- a/src/include/fteext.h +++ b/src/include/fteext.h @@ -147,7 +147,8 @@ extern void fperror(char *mess, int code); extern void ft_sperror(int code, char *mess); extern char ErrorMessage[]; extern void internalerror(char *); -extern void externalerror(char *); +extern void externalerror(char *); +extern bool ft_pipemode; diff --git a/src/main.c b/src/main.c index 09e7959ce..f82335b1c 100644 --- a/src/main.c +++ b/src/main.c @@ -94,6 +94,7 @@ /* Main options */ static bool ft_servermode = FALSE; bool ft_batchmode = FALSE; +bool ft_pipemode = FALSE; bool rflag = FALSE; /* has rawfile */ /* Frontend options */ @@ -946,6 +947,7 @@ main(int argc, char **argv) case 'p': /* Run in pipe mode */ iflag = TRUE; istty = TRUE; + ft_pipemode = TRUE; break; case 'q': /* Command completion */ diff --git a/src/xspice/evt/evtplot.c b/src/xspice/evt/evtplot.c index 1119dca86..2ff86f2ab 100755 --- a/src/xspice/evt/evtplot.c +++ b/src/xspice/evt/evtplot.c @@ -98,7 +98,7 @@ struct dvec *EVTfindvec( double *anal_point_vec; double *value_vec; - double value; + double value = 0; struct dvec *d; struct dvec *scale;