~epics-core/epics-base/3.14

« back to all changes in this revision

Viewing changes to src/rec/compressRecord.c

  • Committer: Ralph Lange
  • Date: 2010-04-02 22:03:24 UTC
  • mfrom: (12045.1.1 compress-fix)
  • Revision ID: ralph.lange@bessy.de-20100402220324-7uefqbdycr1pye8t
Merged Ralph Lange's 'compress-fix' branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
80
80
static void reset(compressRecord *prec)
81
81
{
82
82
    prec->nuse = 0;
83
 
    prec->off= 0;
 
83
    prec->off = 0;
84
84
    prec->inx = 0;
85
85
    prec->cvb = 0.0;
86
86
    prec->res = 0;
 
87
    /* allocate memory for the summing buffer for conversions requiring it */
 
88
    if (prec->alg == compressALG_Average && prec->sptr == 0){
 
89
        prec->sptr = (double *)calloc(prec->nsam,sizeof(double));
 
90
    }
87
91
}
88
92
 
89
93
static void monitor(compressRecord *prec)
292
296
    if (pass==0){
293
297
        if(prec->nsam<1) prec->nsam = 1;
294
298
        prec->bptr = (double *)calloc(prec->nsam,sizeof(double));
295
 
        /* allocate memory for the summing buffer for conversions requiring it */
296
 
        if (prec->alg == compressALG_Average){
297
 
                prec->sptr = (double *)calloc(prec->nsam,sizeof(double));
298
 
        }
299
299
        reset(prec);
300
300
    }
301
301
    return(0);