code cleanup, some warnings, some casts, ...
This commit is contained in:
parent
23056573d8
commit
b778c50bd6
12
ChangeLog
12
ChangeLog
|
|
@ -1,3 +1,15 @@
|
||||||
|
2011-04-27 Robert Larice
|
||||||
|
* src/main.c ,
|
||||||
|
* src/frontend/com_measure2.c ,
|
||||||
|
* src/frontend/inpcom.c ,
|
||||||
|
* src/spicelib/analysis/noisean.c ,
|
||||||
|
* src/spicelib/analysis/pzan.c ,
|
||||||
|
* src/spicelib/analysis/tfanal.c ,
|
||||||
|
* src/spicelib/devices/cpl/cplsetup.c ,
|
||||||
|
* src/spicelib/devices/isrc/isrcacct.c ,
|
||||||
|
* src/spicelib/devices/vsrc/vsrcacct.c :
|
||||||
|
code cleanup, some warnings, some casts, ...
|
||||||
|
|
||||||
2011-04-27 Robert Larice
|
2011-04-27 Robert Larice
|
||||||
* */** :
|
* */** :
|
||||||
code cleanup, drop NULL pointer casts
|
code cleanup, drop NULL pointer casts
|
||||||
|
|
|
||||||
|
|
@ -476,7 +476,7 @@ static void com_measure_when(
|
||||||
if ((first > 1) && (dc_check && (meas->m_td == scaleValue)))
|
if ((first > 1) && (dc_check && (meas->m_td == scaleValue)))
|
||||||
first = 1;
|
first = 1;
|
||||||
|
|
||||||
if (first == 1)
|
if (first == 1) {
|
||||||
if (has_d2) {
|
if (has_d2) {
|
||||||
// initialise
|
// initialise
|
||||||
crossCnt =0;
|
crossCnt =0;
|
||||||
|
|
@ -515,6 +515,7 @@ static void com_measure_when(
|
||||||
}
|
}
|
||||||
fflush( stdout ) ;
|
fflush( stdout ) ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (first > 1) {
|
if (first > 1) {
|
||||||
if (has_d2) {
|
if (has_d2) {
|
||||||
|
|
|
||||||
|
|
@ -1205,7 +1205,7 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c
|
||||||
/* only the last title line remains valid */
|
/* only the last title line remains valid */
|
||||||
if (new_title != NULL) tfree(new_title);
|
if (new_title != NULL) tfree(new_title);
|
||||||
new_title = copy(s);
|
new_title = copy(s);
|
||||||
if (s=strstr(new_title, "\n"))
|
if ((s = strstr(new_title, "\n")) != NULL)
|
||||||
*s = ' ';
|
*s = ' ';
|
||||||
*buffer = '*'; /* change .TITLE line to comment line */
|
*buffer = '*'; /* change .TITLE line to comment line */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
31
src/main.c
31
src/main.c
|
|
@ -760,8 +760,6 @@ main(int argc, char **argv)
|
||||||
#endif /* HAS_WINDOWS */
|
#endif /* HAS_WINDOWS */
|
||||||
{
|
{
|
||||||
int c, err;
|
int c, err;
|
||||||
unsigned int rseed;
|
|
||||||
time_t acttime;
|
|
||||||
bool gotone = FALSE;
|
bool gotone = FALSE;
|
||||||
char* copystring;
|
char* copystring;
|
||||||
bool addctrlsect = TRUE; /* PN: for autorun */
|
bool addctrlsect = TRUE; /* PN: for autorun */
|
||||||
|
|
@ -1111,21 +1109,26 @@ bot:
|
||||||
#ifdef SIMULATOR
|
#ifdef SIMULATOR
|
||||||
#ifdef FastRand
|
#ifdef FastRand
|
||||||
// initialization and seed for FastNorm Gaussian random generator
|
// initialization and seed for FastNorm Gaussian random generator
|
||||||
initnorm (0, 0);
|
{
|
||||||
rseed = 66;
|
unsigned int rseed = 66;
|
||||||
if (!cp_getvar("rndseed", CP_NUM, (char *) &rseed)) {
|
initnorm (0, 0);
|
||||||
acttime = time(NULL);
|
if (!cp_getvar("rndseed", CP_NUM, &rseed)) {
|
||||||
rseed = (int)acttime;
|
time_t acttime = time(NULL);
|
||||||
|
rseed = (int) acttime;
|
||||||
|
}
|
||||||
|
initnorm (rseed, 2);
|
||||||
|
fprintf (cp_out, "SoS %f, seed value: %ld\n", renormalize(), rseed);
|
||||||
}
|
}
|
||||||
initnorm (rseed, 2);
|
|
||||||
fprintf (cp_out, "SoS %f, seed value: %ld\n", renormalize(), rseed);
|
|
||||||
#elif defined (WaGauss)
|
#elif defined (WaGauss)
|
||||||
if (!cp_getvar("rndseed", CP_NUM, (char *) &rseed)) {
|
{
|
||||||
acttime = time(NULL);
|
unsigned int rseed = 66;
|
||||||
rseed = (int)acttime;
|
if (!cp_getvar("rndseed", CP_NUM, &rseed)) {
|
||||||
|
time_t acttime = time(NULL);
|
||||||
|
rseed = (int) acttime;
|
||||||
|
}
|
||||||
|
srand(rseed);
|
||||||
|
initw();
|
||||||
}
|
}
|
||||||
srand(rseed);
|
|
||||||
initw();
|
|
||||||
#endif
|
#endif
|
||||||
if (!ft_servermode && !ft_nutmeg) {
|
if (!ft_servermode && !ft_nutmeg) {
|
||||||
/* Concatenate all non-option arguments into a temporary file
|
/* Concatenate all non-option arguments into a temporary file
|
||||||
|
|
|
||||||
|
|
@ -279,7 +279,7 @@ NOISEan (CKTcircuit *ckt, int restart)
|
||||||
|
|
||||||
SPfrontEnd->OUTpBeginPlot (ckt, ckt->CKTcurJob,
|
SPfrontEnd->OUTpBeginPlot (ckt, ckt->CKTcurJob,
|
||||||
"Integrated Noise - V^2 or A^2",
|
"Integrated Noise - V^2 or A^2",
|
||||||
NULL, (int)0, data->numPlots, data->namelist, IF_REAL,
|
NULL, 0, data->numPlots, data->namelist, IF_REAL,
|
||||||
&(data->NplotPtr));
|
&(data->NplotPtr));
|
||||||
|
|
||||||
error = CKTnoise(ckt,INT_NOIZ,N_CALC,data);
|
error = CKTnoise(ckt,INT_NOIZ,N_CALC,data);
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ PZpost(CKTcircuit *ckt)
|
||||||
}
|
}
|
||||||
|
|
||||||
SPfrontEnd->OUTpBeginPlot (ckt, (JOB *)pzan, pzan->JOBname,
|
SPfrontEnd->OUTpBeginPlot (ckt, (JOB *)pzan, pzan->JOBname,
|
||||||
NULL, (int)0, pzan->PZnPoles + pzan->PZnZeros, namelist,
|
NULL, 0, pzan->PZnPoles + pzan->PZnZeros, namelist,
|
||||||
IF_COMPLEX, &pzPlotPtr);
|
IF_COMPLEX, &pzPlotPtr);
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ TFanal(CKTcircuit *ckt, int restart)
|
||||||
}
|
}
|
||||||
|
|
||||||
error = SPfrontEnd->OUTpBeginPlot (ckt, ckt->CKTcurJob,
|
error = SPfrontEnd->OUTpBeginPlot (ckt, ckt->CKTcurJob,
|
||||||
((TFan*)(ckt->CKTcurJob))->JOBname, NULL, (int)0, 3,
|
((TFan*)(ckt->CKTcurJob))->JOBname, NULL, 0, 3,
|
||||||
uids,IF_REAL,&plotptr);
|
uids,IF_REAL,&plotptr);
|
||||||
if(error) return(error);
|
if(error) return(error);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1291,8 +1291,8 @@ coupled(int dim)
|
||||||
loop_ZY(dim, 0.0);
|
loop_ZY(dim, 0.0);
|
||||||
eval_frequency(dim, deg_o);
|
eval_frequency(dim, deg_o);
|
||||||
eval_Si_Si_1(dim, 0.0);
|
eval_Si_Si_1(dim, 0.0);
|
||||||
store_SiSv_1(dim, (int) 0);
|
store_SiSv_1(dim, 0);
|
||||||
store(dim, (int) 0);
|
store(dim, 0);
|
||||||
|
|
||||||
/*** Step 1 ***/
|
/*** Step 1 ***/
|
||||||
/*** Step 2 ***/
|
/*** Step 2 ***/
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ Author: 1985 Thomas L. Quarles
|
||||||
extern int fftInit(long M);
|
extern int fftInit(long M);
|
||||||
extern void fftFree(void);
|
extern void fftFree(void);
|
||||||
extern void rffts(float *data, long M, long Rows);
|
extern void rffts(float *data, long M, long Rows);
|
||||||
extern double exprand(double);
|
|
||||||
|
|
||||||
#define SAMETIME(a,b) (fabs((a)-(b))<= TIMETOL * PW)
|
#define SAMETIME(a,b) (fabs((a)-(b))<= TIMETOL * PW)
|
||||||
#define TIMETOL 1e-7
|
#define TIMETOL 1e-7
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ Author: 1985 Thomas L. Quarles
|
||||||
extern int fftInit(long M);
|
extern int fftInit(long M);
|
||||||
extern void fftFree(void);
|
extern void fftFree(void);
|
||||||
extern void rffts(float *data, long M, long Rows);
|
extern void rffts(float *data, long M, long Rows);
|
||||||
extern double exprand(double);
|
|
||||||
|
|
||||||
#define SAMETIME(a,b) (fabs((a)-(b))<= TIMETOL * PW)
|
#define SAMETIME(a,b) (fabs((a)-(b))<= TIMETOL * PW)
|
||||||
#define TIMETOL 1e-7
|
#define TIMETOL 1e-7
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue