diff --git a/ChangeLog b/ChangeLog index 18123823e..7eec54ed2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2011-10-31 Robert Larice + * src/spicelib/devices/hisim2/hisim2.h , + * src/spicelib/devices/hisim2/hsm2ld.c , + * src/spicelib/devices/hisimhv/hisimhv.h , + * src/spicelib/devices/hisimhv/hsmhvld.c , + * src/spicelib/devices/hisimhv/hsmhvnoi.c , + * src/spicelib/devices/hisimhv/hsmhvset.c : + swallow warnings in hisimhv and hisim2 code + 2011-10-31 Robert Larice * devices/mos2/mos2ask.c: Fix the source/drain typo for overlap cap's, for mos2 as well diff --git a/src/spicelib/devices/hisim2/hisim2.h b/src/spicelib/devices/hisim2/hisim2.h index b5cae4e20..0b0b81306 100644 --- a/src/spicelib/devices/hisim2/hisim2.h +++ b/src/spicelib/devices/hisim2/hisim2.h @@ -51,6 +51,10 @@ #define HiSIM_FALSE 0 #define HiSIM_TRUE 1 +#ifndef return_if_error +#define return_if_error(s) { int error = s; if(error) return(error); } +#endif + extern int HSM2evaluate ( double ivds, diff --git a/src/spicelib/devices/hisim2/hsm2ld.c b/src/spicelib/devices/hisim2/hsm2ld.c index 95db57993..a461f083b 100644 --- a/src/spicelib/devices/hisim2/hsm2ld.c +++ b/src/spicelib/devices/hisim2/hsm2ld.c @@ -207,7 +207,7 @@ int HSM2load( double vges, vged, delvges, delvged, vgedo; double vsbdo, vsbd; double vbs_jct, vbd_jct, delvbs_jct, delvbd_jct; - int ByPass, Check, Check1, Check2, error; + int ByPass, Check, Check1, Check2; int BYPASS_enable ; #ifndef NOBYPASS double tempv; @@ -907,13 +907,13 @@ tm0 = gtodsecld() ; *(ckt->CKTstate1 + here->HSM2qbd) = *(ckt->CKTstate0 + here->HSM2qbd); } } - - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSM2qb))) return(error); - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSM2qg))) return(error); - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSM2qd))) return(error); + + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSM2qb)); + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSM2qg)); + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSM2qd)); if ( here->HSM2_corbnet ) { - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSM2qbs))) return(error); - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSM2qbd))) return(error); + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSM2qbs)); + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSM2qbd)); } goto line860; diff --git a/src/spicelib/devices/hisimhv/hisimhv.h b/src/spicelib/devices/hisimhv/hisimhv.h index e9d9d7f55..94d85a9b4 100644 --- a/src/spicelib/devices/hisimhv/hisimhv.h +++ b/src/spicelib/devices/hisimhv/hisimhv.h @@ -53,6 +53,10 @@ #define HiSIM_FALSE 0 #define HiSIM_TRUE 1 +#ifndef return_if_error +#define return_if_error(s) { int error = s; if(error) return(error); } +#endif + extern int HSMHVevaluate ( double ivds, diff --git a/src/spicelib/devices/hisimhv/hsmhvld.c b/src/spicelib/devices/hisimhv/hsmhvld.c index 3d7ef3ccb..cfdb267e8 100644 --- a/src/spicelib/devices/hisimhv/hsmhvld.c +++ b/src/spicelib/devices/hisimhv/hsmhvld.c @@ -306,7 +306,7 @@ int HSMHVload( double ydyn_bP[XDIM], ydyn_b[XDIM], ydyn_db[XDIM], ydyn_sb[XDIM], ydyn_t[XDIM], ydyn_qi[XDIM], ydyn_qb[XDIM] ; /* limiter, bypass, and convergence */ - int ByPass=0, Check=0, Check1=0, Check2=0, Check3=0, error=0 ; + int ByPass=0, Check=0, Check1=0, Check2=0, Check3=0; double von=0.0, limval =0.0 ; double i_dP_hat=0.0, i_gP_hat=0.0, i_sP_hat=0.0, i_db_hat=0.0, i_sb_hat =0.0 ; @@ -2257,21 +2257,21 @@ line755: /* standard entry if HSMHVevaluate is bypassed */ *(ckt->CKTstate1 + here->HSMHVqb_nqs) = *(ckt->CKTstate0 + here->HSMHVqb_nqs); } } - - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqb))) return(error); - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqg))) return(error); - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqd))) return(error); - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqbs))) return(error); - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqbd))) return(error); - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqth))) return(error); + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqb)); + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqg)); + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqd)); + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqbs)); + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqbd)); - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqfd))) return(error); - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqfs))) return(error); + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqth)); + + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqfd)); + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqfs)); if (flg_nqs) { - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqi_nqs))) return(error); - if ((error = NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqb_nqs))) return(error); + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqi_nqs)); + return_if_error (NIintegrate(ckt, &geq, &ceq, 0.0, here->HSMHVqb_nqs)); } if (ckt->CKTmode & MODEINITTRAN) { diff --git a/src/spicelib/devices/hisimhv/hsmhvnoi.c b/src/spicelib/devices/hisimhv/hsmhvnoi.c index def4fa11b..67c20f663 100644 --- a/src/spicelib/devices/hisimhv/hsmhvnoi.c +++ b/src/spicelib/devices/hisimhv/hsmhvnoi.c @@ -80,9 +80,7 @@ int HSMHVnoise ( for ( i = 0; i < HSMHVNSRCS; i++ ) { (void) sprintf(name, "onoise.%s%s", (char *)here->HSMHVname, HSMHVnNames[i]); - data->namelist = - (IFuid *) trealloc((char *) data->namelist, - (data->numPlots + 1) * sizeof(IFuid)); + data->namelist = TREALLOC(IFuid, data->namelist, data->numPlots + 1); if (!data->namelist) return(E_NOMEM); (*(SPfrontEnd->IFnewUid)) @@ -94,9 +92,7 @@ int HSMHVnoise ( for ( i = 0; i < HSMHVNSRCS; i++ ) { (void) sprintf(name, "onoise_total.%s%s", (char *)here->HSMHVname, HSMHVnNames[i]); - data->namelist = - (IFuid *) trealloc((char *) data->namelist, - (data->numPlots + 1) * sizeof(IFuid)); + data->namelist = TREALLOC(IFuid, data->namelist, data->numPlots + 1); if (!data->namelist) return(E_NOMEM); (*(SPfrontEnd->IFnewUid)) @@ -105,9 +101,7 @@ int HSMHVnoise ( (void) sprintf(name, "inoise_total.%s%s", (char *)here->HSMHVname, HSMHVnNames[i]); - data->namelist = - (IFuid *) trealloc((char *) data->namelist, - (data->numPlots + 1) * sizeof(IFuid)); + data->namelist = TREALLOC(IFuid, data->namelist, data->numPlots + 1); if (!data->namelist) return(E_NOMEM); (*(SPfrontEnd->IFnewUid)) diff --git a/src/spicelib/devices/hisimhv/hsmhvset.c b/src/spicelib/devices/hisimhv/hsmhvset.c index 2969e2a52..0b5d4e0ab 100644 --- a/src/spicelib/devices/hisimhv/hsmhvset.c +++ b/src/spicelib/devices/hisimhv/hsmhvset.c @@ -35,7 +35,7 @@ #define RANGECHECK(param, min, max, pname) \ if ( (param) < (min) || (param) > (max) ) { \ printf("warning(HiSIMHV): The model/instance parameter %s (= %e) must be in the range [%e , %e].\n", \ - (pname), (param), (min), (max) ); \ + (pname), (param), (double) (min), (double) (max) ); \ } #define MINCHECK(param, min, pname) \ if ( (param) < (min) ) { \