Merge branch 'pre-master' into bt_dev
This commit is contained in:
commit
8162418df9
|
|
@ -44,6 +44,7 @@ canonical_name(const char *name, DSTRINGPTR dbuf_p,
|
|||
f_ok &= ds_cat_mem(dbuf_p, sz_branch,
|
||||
sizeof sz_branch / sizeof *sz_branch - 1) == DS_E_OK;
|
||||
if (!f_ok) {
|
||||
fprintf(stderr, "Error: DS could not convert %s\n", name);
|
||||
controlled_exit(-1);
|
||||
}
|
||||
return ds_get_buf(dbuf_p);
|
||||
|
|
@ -56,6 +57,7 @@ canonical_name(const char *name, DSTRINGPTR dbuf_p,
|
|||
f_ok &= ds_cat_str(dbuf_p, name) == DS_E_OK;
|
||||
f_ok &= ds_cat_char(dbuf_p, ')') == DS_E_OK;
|
||||
if (!f_ok) {
|
||||
fprintf(stderr, "Error: DS could not convert %s\n", name);
|
||||
controlled_exit(-1);
|
||||
}
|
||||
return ds_get_buf(dbuf_p);
|
||||
|
|
@ -68,6 +70,7 @@ canonical_name(const char *name, DSTRINGPTR dbuf_p,
|
|||
* changing the original, but in the current use cases that is
|
||||
* not an issue. */
|
||||
if (ds_cat_str(dbuf_p, name) != DS_E_OK) {
|
||||
fprintf(stderr, "Error: DS could not convert %s\n", name);
|
||||
controlled_exit(-1);
|
||||
}
|
||||
return ds_get_buf(dbuf_p);
|
||||
|
|
|
|||
|
|
@ -1307,6 +1307,12 @@ inp_dodeck(
|
|||
if (strstr(dd->line, ".model"))
|
||||
fprintf(stderr, "Warning: Model issue on line %d :\n %.*s ...\n%s\n",
|
||||
dd->linenum_orig, 72, dd->line, dd->error);
|
||||
else if (dd->linenum_orig == 0) {
|
||||
fprintf(stderr, "Error on line:\n %s\n%s\n",
|
||||
dd->line, dd->error);
|
||||
have_err = TRUE;
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Error on line %d or its substitute:\n %s\n%s\n",
|
||||
dd->linenum_orig, dd->line, dd->error);
|
||||
|
|
|
|||
|
|
@ -1273,6 +1273,7 @@ struct inp_read_t inp_read( FILE *fp, int call_depth, const char *dir_name,
|
|||
strcat(buffer, "\n");
|
||||
}
|
||||
else { /* No good way to report this so just die */
|
||||
fprintf(stderr, "Error: IPC status not o.k.\n");
|
||||
controlled_exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
|
@ -1758,7 +1759,7 @@ static char *inp_pathresolve(const char *name)
|
|||
name[2] == DIR_TERM_LINUX) {
|
||||
DS_CREATE(ds, 100);
|
||||
if (ds_cat_str(&ds, name) != 0) {
|
||||
fprintf(stderr, "Unable to copy string while resolving path");
|
||||
fprintf(stderr, "Error: Unable to copy string while resolving path");
|
||||
controlled_exit(EXIT_FAILURE);
|
||||
}
|
||||
char *const buf = ds_get_buf(&ds);
|
||||
|
|
@ -1821,7 +1822,7 @@ static char *inp_pathresolve(const char *name)
|
|||
|
||||
if (rc_ds != 0) { /* unable to build string */
|
||||
(void) fprintf(cp_err,
|
||||
"Unable to build path name in inp_pathresolve");
|
||||
"Error: Unable to build path name in inp_pathresolve");
|
||||
controlled_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
|
@ -1873,7 +1874,7 @@ static char *inp_pathresolve_at(const char *name, const char *dir)
|
|||
DS_CREATE(ds, 100);
|
||||
if (ds_cat_printf(&ds, ".%c%s", DIR_TERM, name) != 0) {
|
||||
(void) fprintf(cp_err,
|
||||
"Unable to build \".\" path name in inp_pathresolve_at");
|
||||
"Error: Unable to build \".\" path name in inp_pathresolve_at");
|
||||
controlled_exit(EXIT_FAILURE);
|
||||
}
|
||||
char * const r = inp_pathresolve(ds_get_buf(&ds));
|
||||
|
|
@ -1901,7 +1902,7 @@ static char *inp_pathresolve_at(const char *name, const char *dir)
|
|||
rc_ds |= ds_cat_str(&ds, name); /* append the file name */
|
||||
|
||||
if (rc_ds != 0) {
|
||||
(void) fprintf(cp_err, "Unable to build \"dir\" path name "
|
||||
(void) fprintf(cp_err, "Error: Unable to build \"dir\" path name "
|
||||
"in inp_pathresolve_at");
|
||||
controlled_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
@ -3051,7 +3052,7 @@ static void inp_change_quotes(char *s)
|
|||
static void add_name(struct names *p, char *name)
|
||||
{
|
||||
if (p->num_names >= N_SUBCKT_W_PARAMS) {
|
||||
fprintf(stderr, "ERROR, N_SUBCKT_W_PARMS overflow\n");
|
||||
fprintf(stderr, "ERROR: N_SUBCKT_W_PARMS overflow, more than %d subcircuits\n", N_SUBCKT_W_PARAMS);
|
||||
controlled_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
|
@ -3748,7 +3749,7 @@ static void free_function(struct function *fcn)
|
|||
static void new_function_parameter(struct function *fcn, char *parameter)
|
||||
{
|
||||
if (fcn->num_parameters >= N_PARAMS) {
|
||||
fprintf(stderr, "ERROR, N_PARAMS overflow\n");
|
||||
fprintf(stderr, "ERROR, N_PARAMS overflow, more than %d parameters\n", N_PARAMS);
|
||||
controlled_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
|
@ -4926,6 +4927,7 @@ static struct card *inp_reorder_params_subckt(
|
|||
}
|
||||
|
||||
/* the terminating `.ends' deck wasn't found */
|
||||
fprintf(stderr, "Error: Missing .ends statement\n");
|
||||
controlled_exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
|
@ -10091,7 +10093,7 @@ struct nscope *inp_add_levels(struct card *deck)
|
|||
}
|
||||
else if (ciprefix(".ends", curr_line)) {
|
||||
if (lvl == root) {
|
||||
fprintf(stderr, ".subckt/.ends not balanced\n");
|
||||
fprintf(stderr, "Error: .subckt/.ends not balanced\n");
|
||||
controlled_exit(1);
|
||||
}
|
||||
card->level = lvl;
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ void
|
|||
sadd(DSTRINGPTR dstr_p, const char *t)
|
||||
{
|
||||
if (ds_cat_str(dstr_p, t) != DS_E_OK) {
|
||||
fprintf(stderr, "Error: DS could not add string %s\n", t);
|
||||
controlled_exit(-1);
|
||||
}
|
||||
}
|
||||
|
|
@ -86,6 +87,7 @@ void
|
|||
cadd(DSTRINGPTR dstr_p, char c)
|
||||
{
|
||||
if (ds_cat_char(dstr_p, c) != DS_E_OK) {
|
||||
fprintf(stderr, "Error: DS could not add character %c\n", c);
|
||||
controlled_exit(-1);
|
||||
}
|
||||
}
|
||||
|
|
@ -100,6 +102,7 @@ scopyd(DSTRINGPTR dst, const DSTRINGPTR src) /* returns success flag */
|
|||
{
|
||||
ds_clear(dst);
|
||||
if (ds_cat_ds(dst, src) != DS_E_OK) {
|
||||
fprintf(stderr, "Error: DS could not copy string\n");
|
||||
controlled_exit(-1);
|
||||
}
|
||||
}
|
||||
|
|
@ -114,6 +117,7 @@ scopys(DSTRINGPTR s, const char *t) /* returns success flag */
|
|||
{
|
||||
ds_clear(s);
|
||||
if (ds_cat_str(s, t) != DS_E_OK) {
|
||||
fprintf(stderr, "Error: DS could not copy string %s\n", t);
|
||||
controlled_exit(-1);
|
||||
}
|
||||
}
|
||||
|
|
@ -129,6 +133,7 @@ pscopy(DSTRINGPTR dstr_p, const char *t, const char *stop)
|
|||
|
||||
ds_clear(dstr_p);
|
||||
if (ds_cat_mem(dstr_p, t, (size_t) (stop - t)) != DS_E_OK) {
|
||||
fprintf(stderr, "Error: DS could not copy partially string %s\n", t);
|
||||
controlled_exit(-1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -336,6 +336,7 @@ dicostack_pop(dico_t *dico)
|
|||
ds_clear(¶m_name);
|
||||
if (ds_cat_printf(¶m_name, "%s.%s",
|
||||
inst_name, entry->symbol) != DS_E_OK) {
|
||||
fprintf(stderr, "Error: DS could not add string %s\n", inst_name);
|
||||
controlled_exit(-1);
|
||||
}
|
||||
nupa_add_inst_param(ds_get_buf(¶m_name), entry->vl);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ Modified: 2000 AlansFixes
|
|||
static int dosim(char *what, wordlist *wl);
|
||||
extern struct INPmodel *modtab;
|
||||
extern struct dbcomm *dbs;
|
||||
extern void NIresetwarnmsg(void);
|
||||
|
||||
/* Routines for the commands op, tran, ac, dc, listing, device, state,
|
||||
* resume, stop, trace, run, end. Op, tran, ac, and dc cause the action
|
||||
|
|
@ -261,6 +262,8 @@ static int dosim(
|
|||
return 0;
|
||||
}
|
||||
|
||||
NIresetwarnmsg();
|
||||
|
||||
/* From now on until the next prompt, an interrupt will just
|
||||
* set a flag and let spice finish up, then control will be
|
||||
* passed back to the user.
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ static void vec_rebuild_lookup_table(struct plot *pl)
|
|||
for (d = pl->pl_dvecs; d; d = d->v_next) {
|
||||
ds_clear(&dbuf);
|
||||
if (ds_cat_str_case(&dbuf, d->v_name, ds_case_lower) != DS_E_OK) {
|
||||
fprintf(stderr, "Error: DS could not add string %s\n", d->v_name);
|
||||
controlled_exit(-1);
|
||||
}
|
||||
char * const lower_name = ds_get_buf(&dbuf);
|
||||
|
|
@ -181,6 +182,7 @@ static struct dvec *findvec(char *word, struct plot *pl)
|
|||
|
||||
DS_CREATE(dbuf, 200); /* make dynamic buffer */
|
||||
if (ds_cat_str_case(&dbuf, word, ds_case_lower) != DS_E_OK) {
|
||||
fprintf(stderr, "Error: DS could not add string %s\n", word);
|
||||
controlled_exit(-1);
|
||||
}
|
||||
char * const lower_name = ds_get_buf(&dbuf);
|
||||
|
|
@ -197,6 +199,7 @@ static struct dvec *findvec(char *word, struct plot *pl)
|
|||
ds_case_lower) == DS_E_OK;
|
||||
f_ok &= ds_cat_char(&dbuf, ')') == DS_E_OK;
|
||||
if (!f_ok) {
|
||||
fprintf(stderr, "Error: DS could not add string V() around %s\n", word);
|
||||
controlled_exit(-1);
|
||||
}
|
||||
char * const node_name = ds_get_buf(&dbuf);
|
||||
|
|
|
|||
|
|
@ -480,6 +480,7 @@ extern void NIdestroy(CKTcircuit *);
|
|||
extern int NIinit(CKTcircuit *);
|
||||
extern int NIintegrate(CKTcircuit *, double *, double *, double , int);
|
||||
extern int NIiter(CKTcircuit * , int);
|
||||
extern void NIresetwarnmsg(void);
|
||||
extern int NIpzMuller(PZtrial **, PZtrial *);
|
||||
extern int NIpzComplex(PZtrial **, PZtrial *);
|
||||
extern int NIpzSym(PZtrial **, PZtrial *);
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ Modified: 2001 AlansFixes
|
|||
#include "ngspice/sperror.h"
|
||||
#include "ngspice/fteext.h"
|
||||
|
||||
/* Limit the number of 'singular matrix' warnings */
|
||||
static int msgcount = 0;
|
||||
void NIresetwarnmsg(void);
|
||||
|
||||
/* NIiter() - return value is non-zero for convergence failure */
|
||||
|
||||
|
|
@ -32,8 +35,6 @@ NIiter(CKTcircuit *ckt, int maxIter)
|
|||
int iterno = 0;
|
||||
int ipass = 0;
|
||||
|
||||
static int msgcount = 0;
|
||||
|
||||
/* some convergence issues that get resolved by increasing max iter */
|
||||
if (maxIter < 100)
|
||||
maxIter = 100;
|
||||
|
|
@ -123,7 +124,10 @@ NIiter(CKTcircuit *ckt, int maxIter)
|
|||
*/
|
||||
if (ft_ngdebug || msgcount < 6) {
|
||||
SMPgetError(ckt->CKTmatrix, &i, &j);
|
||||
SPfrontEnd->IFerrorf(ERR_WARNING, "singular matrix: check nodes %s and %s\n", NODENAME(ckt, i), NODENAME(ckt, j));
|
||||
if(eq(NODENAME(ckt, i), NODENAME(ckt, j)))
|
||||
SPfrontEnd->IFerrorf(ERR_WARNING, "singular matrix: check node %s\n", NODENAME(ckt, i));
|
||||
else
|
||||
SPfrontEnd->IFerrorf(ERR_WARNING, "singular matrix: check nodes %s and %s\n", NODENAME(ckt, i), NODENAME(ckt, j));
|
||||
msgcount += 1;
|
||||
}
|
||||
ckt->CKTstat->STATnumIter += iterno;
|
||||
|
|
@ -280,3 +284,7 @@ NIiter(CKTcircuit *ckt, int maxIter)
|
|||
}
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
void NIresetwarnmsg(void) {
|
||||
msgcount = 0;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ char *tvprintf(const char *fmt, va_list args)
|
|||
* memory was exhausted) with the old behavior */
|
||||
|
||||
if (nchars < 0) {
|
||||
fprintf(stderr, "Error: tvprintf failed\n");
|
||||
controlled_exit(-1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,8 +86,9 @@ ACan(CKTcircuit *ckt, int restart)
|
|||
fprintf(stderr, "ERROR: AC startfreq <= 0\n");
|
||||
return E_PARMVAL;
|
||||
}
|
||||
job->ACfreqDelta =
|
||||
exp(log(10.0)/job->ACnumberSteps);
|
||||
double num_steps = floor(fabs(log10(job->ACstopFreq/job->ACstartFreq))*job->ACnumberSteps);
|
||||
job->ACfreqDelta = exp((log(job->ACstopFreq/job->ACstartFreq))/ num_steps);
|
||||
|
||||
break;
|
||||
case OCTAVE:
|
||||
if (job->ACstartFreq <= 0) {
|
||||
|
|
|
|||
|
|
@ -296,6 +296,7 @@ copy_tx(TXLine *new, TXLine *old)
|
|||
new->ifImg = old->ifImg;
|
||||
if (new->vi_tail != old->vi_tail) {
|
||||
/* someting wrong */
|
||||
fprintf(stderr, "Error during evaluating TXL line\n");
|
||||
controlled_exit(0);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue