From 471843eaad2ff1202773dc0519ca4aa416dc9175 Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Thu, 23 Apr 1992 09:57:53 +0000 Subject: [PATCH] jba: fixed pass test --- src/rec/recAi.c | 2 +- src/rec/recAo.c | 2 +- src/rec/recBi.c | 2 +- src/rec/recBo.c | 2 +- src/rec/recCalc.c | 2 +- src/rec/recEvent.c | 2 +- src/rec/recFanout.c | 2 +- src/rec/recHistogram.c | 29 ++++++++++++++--------------- src/rec/recLongin.c | 2 +- src/rec/recMbbi.c | 2 +- src/rec/recMbbo.c | 2 +- src/rec/recPid.c | 2 +- src/rec/recPulseDelay.c | 2 +- src/rec/recSel.c | 2 +- src/rec/recSteppermotor.c | 2 +- src/rec/recStringin.c | 2 +- src/rec/recTimer.c | 2 +- src/rec/recWaveform.c | 3 ++- 18 files changed, 32 insertions(+), 32 deletions(-) diff --git a/src/rec/recAi.c b/src/rec/recAi.c index c58eeeffa..d4a249243 100644 --- a/src/rec/recAi.c +++ b/src/rec/recAi.c @@ -148,7 +148,7 @@ static long init_record(pai,pass) struct aidset *pdset; long status; - if (pass!=0) return(0); + if (pass==0) return(0); if(!(pdset = (struct aidset *)(pai->dset))) { recGblRecordError(S_dev_noDSET,pai,"ai: init_record"); diff --git a/src/rec/recAo.c b/src/rec/recAo.c index e63c00e27..5c3f81c21 100644 --- a/src/rec/recAo.c +++ b/src/rec/recAo.c @@ -144,7 +144,7 @@ static long init_record(pao,pass) long status=0; double value; - if (pass!=0) return(0); + if (pass==0) return(0); if(!(pdset = (struct aodset *)(pao->dset))) { recGblRecordError(S_dev_noDSET,pao,"ao: init_record"); diff --git a/src/rec/recBi.c b/src/rec/recBi.c index ccd867dce..3d6471cb4 100644 --- a/src/rec/recBi.c +++ b/src/rec/recBi.c @@ -123,7 +123,7 @@ static long init_record(pbi,pass) struct bidset *pdset; long status; - if (pass!=0) return(0); + if (pass==0) return(0); if(!(pdset = (struct bidset *)(pbi->dset))) { recGblRecordError(S_dev_noDSET,pbi,"bi: init_record"); diff --git a/src/rec/recBo.c b/src/rec/recBo.c index 1ea6ec537..fe7be86c7 100644 --- a/src/rec/recBo.c +++ b/src/rec/recBo.c @@ -162,7 +162,7 @@ static long init_record(pbo,pass) long status=0; struct callback *pcallback; - if (pass!=0) return(0); + if (pass==0) return(0); if(!(pdset = (struct bodset *)(pbo->dset))) { recGblRecordError(S_dev_noDSET,pbo,"bo: init_record"); diff --git a/src/rec/recCalc.c b/src/rec/recCalc.c index 351f3db98..5439b2643 100644 --- a/src/rec/recCalc.c +++ b/src/rec/recCalc.c @@ -144,7 +144,7 @@ static long init_record(pcalc,pass) short error_number; char rpbuf[80]; - if (pass!=0) return(0); + if (pass==0) return(0); plink = &pcalc->inpa; pvalue = &pcalc->a; diff --git a/src/rec/recEvent.c b/src/rec/recEvent.c index ca60ced76..6688bf442 100644 --- a/src/rec/recEvent.c +++ b/src/rec/recEvent.c @@ -106,7 +106,7 @@ static long init_record(pevent,pass) struct eventdset *pdset; long status=0; - if (pass!=0) return(0); + if (pass==0) return(0); if( (pdset=(struct eventdset *)(pevent->dset)) && (pdset->init_record) ) status=(*pdset->init_record)(pevent); diff --git a/src/rec/recFanout.c b/src/rec/recFanout.c index 56557d2b2..41215a666 100644 --- a/src/rec/recFanout.c +++ b/src/rec/recFanout.c @@ -111,7 +111,7 @@ static long init_record(pfanout,pass) /* Added for Channel Access Links */ long status; - if (pass!=0) return(0); + if (pass==0) return(0); /* get link selection if sell is a constant and nonzero*/ if (pfanout->sell.type==CONSTANT && pfanout->sell.value.value!=0 ){ diff --git a/src/rec/recHistogram.c b/src/rec/recHistogram.c index 1c52781d6..07ce9638f 100644 --- a/src/rec/recHistogram.c +++ b/src/rec/recHistogram.c @@ -157,9 +157,19 @@ static long init_record(phistogram,pass) float wait_time; void (*process)(); - if (pass==0){ + if (pass==0){ - /* This routine may get called twice. Once by cvt_dbaddr. Once by iocInit*/ + /* allocate space for histogram array */ + if(phistogram->bptr==NULL) { + if(phistogram->nelm<=0) phistogram->nelm=1; + phistogram->bptr = (unsigned long *)calloc(phistogram->nelm,sizeof(long)); + } + + /* calulate width of array element */ + phistogram->wdth=(phistogram->ulim-phistogram->llim)/phistogram->nelm; + + return(0); + } pcallback->process = process; if(phistogram->wdog==NULL && phistogram->sdel!=0) { @@ -173,21 +183,13 @@ static long init_record(phistogram,pass) exit(1); } pcallback->wd_id = wdCreate(); - + /* start new watchdog timer on monitor */ wait_time = (float)(phistogram->sdel * vxTicksPerSecond); wdStart(pcallback->wd_id,wait_time,callbackRequest,(int)pcallback); } - /* allocate space for histogram array */ - if(phistogram->bptr==NULL) { - if(phistogram->nelm<=0) phistogram->nelm=1; - phistogram->bptr = (unsigned long *)calloc(phistogram->nelm,sizeof(long)); - } - - /* calulate width of array element */ - phistogram->wdth=(phistogram->ulim-phistogram->llim)/phistogram->nelm; - + /* must have device support defined */ if(!(pdset = (struct histogramdset *)(phistogram->dset))) { recGblRecordError(S_dev_noDSET,phistogram,"histogram: init_record"); return(S_dev_noDSET); @@ -196,10 +198,7 @@ static long init_record(phistogram,pass) if( (pdset->number < 6) || (pdset->read_histogram == NULL) ) { recGblRecordError(S_dev_missingSup,phistogram,"histogram: init_record"); return(S_dev_missingSup); - } - return(0); } - /* call device support init_record */ if( pdset->init_record ) { if((status=(*pdset->init_record)(phistogram))) return(status); diff --git a/src/rec/recLongin.c b/src/rec/recLongin.c index 075871897..9ca446ba7 100644 --- a/src/rec/recLongin.c +++ b/src/rec/recLongin.c @@ -111,7 +111,7 @@ static long init_record(plongin,pass) struct longindset *pdset; long status; - if (pass!=0) return(0); + if (pass==0) return(0); if(!(pdset = (struct longindset *)(plongin->dset))) { recGblRecordError(S_dev_noDSET,plongin,"longin: init_record"); diff --git a/src/rec/recMbbi.c b/src/rec/recMbbi.c index ca6d32b99..25a5507da 100644 --- a/src/rec/recMbbi.c +++ b/src/rec/recMbbi.c @@ -144,7 +144,7 @@ static long init_record(pmbbi,pass) long status; int i; - if (pass!=0) return(0); + if (pass==0) return(0); if(!(pdset = (struct mbbidset *)(pmbbi->dset))) { recGblRecordError(S_dev_noDSET,pmbbi,"mbbi: init_record"); diff --git a/src/rec/recMbbo.c b/src/rec/recMbbo.c index 64feb6d89..b4c1d950c 100644 --- a/src/rec/recMbbo.c +++ b/src/rec/recMbbo.c @@ -151,7 +151,7 @@ static long init_record(pmbbo,pass) long status; int i; - if (pass!=0) return(0); + if (pass==0) return(0); if(!(pdset = (struct mbbodset *)(pmbbo->dset))) { recGblRecordError(S_dev_noDSET,pmbbo,"mbbo: init_record"); diff --git a/src/rec/recPid.c b/src/rec/recPid.c index d7229cf3f..9f1b70ea0 100644 --- a/src/rec/recPid.c +++ b/src/rec/recPid.c @@ -108,7 +108,7 @@ static long init_record(ppid,pass) /* Added for Channel Access Links */ long status; - if (pass!=0) return(0); + if (pass==0) return(0); /* initialize the setpoint for constant setpoint */ if (ppid->stpl.type == CONSTANT){ diff --git a/src/rec/recPulseDelay.c b/src/rec/recPulseDelay.c index 5b79321d4..09b3d4410 100644 --- a/src/rec/recPulseDelay.c +++ b/src/rec/recPulseDelay.c @@ -109,7 +109,7 @@ static long init_record(ppd,pass) struct pddset *pdset; long status=0; - if (pass!=0) return(0); + if (pass==0) return(0); /* must have device support */ if(!(pdset = (struct pddset *)(ppd->dset))) { diff --git a/src/rec/recSel.c b/src/rec/recSel.c index 7802a7bb1..9d84856df 100644 --- a/src/rec/recSel.c +++ b/src/rec/recSel.c @@ -121,7 +121,7 @@ static long init_record(psel,pass) /* Added for Channel Access Links */ long status; - if (pass!=0) return(0); + if (pass==0) return(0); /* get seln initial value if nvl is a constant*/ if (psel->nvl.type == CONSTANT ) psel->seln = psel->nvl.value.value; diff --git a/src/rec/recSteppermotor.c b/src/rec/recSteppermotor.c index c54f49c59..8537dd778 100644 --- a/src/rec/recSteppermotor.c +++ b/src/rec/recSteppermotor.c @@ -179,7 +179,7 @@ static long init_record(psm,pass) struct smdset *pdset; long status; - if (pass!=0) return(0); + if (pass==0) return(0); if(!(pdset = (struct smdset *)(psm->dset))) { recGblRecordError(S_dev_noDSET,psm,"sm: init_record"); diff --git a/src/rec/recStringin.c b/src/rec/recStringin.c index eb556463c..d62c46ac2 100644 --- a/src/rec/recStringin.c +++ b/src/rec/recStringin.c @@ -108,7 +108,7 @@ static long init_record(pstringin,pass) struct stringindset *pdset; long status; - if (pass!=0) return(0); + if (pass==0) return(0); if(!(pdset = (struct stringindset *)(pstringin->dset))) { recGblRecordError(S_dev_noDSET,pstringin,"stringin: init_record"); diff --git a/src/rec/recTimer.c b/src/rec/recTimer.c index c10408e3c..0bb55aef4 100644 --- a/src/rec/recTimer.c +++ b/src/rec/recTimer.c @@ -146,7 +146,7 @@ static long init_record(ptimer,pass) /* Added for Channel Access Links */ long status; - if (pass!=0) return(0); + if (pass==0) return(0); /* get the delay initial value if torg is a constant*/ if (ptimer->torg.type == CONSTANT ){ diff --git a/src/rec/recWaveform.c b/src/rec/recWaveform.c index 14e0fa072..58003a2f3 100644 --- a/src/rec/recWaveform.c +++ b/src/rec/recWaveform.c @@ -149,11 +149,12 @@ static long init_record(pwf,pass) pwf->nord = 0; return(0); } - /* must have read_wf function defined */ + /* must have dset defined */ if(!(pdset = (struct wfdset *)(pwf->dset))) { recGblRecordError(S_dev_noDSET,pwf,"wf: init_record"); return(S_dev_noDSET); } + /* must have read_wf function defined */ if( (pdset->number < 5) || (pdset->read_wf == NULL) ) { recGblRecordError(S_dev_missingSup,pwf,"wf: init_record"); return(S_dev_missingSup);