Merge lp:~ralph-lange/epics-base/compress-fix into lp:~epics-core/epics-base/3.14

Proposed by Ralph Lange
Status: Merged
Approved by: Ralph Lange
Approved revision: 12046
Merged at revision: 12047
Proposed branch: lp:~ralph-lange/epics-base/compress-fix
Merge into: lp:~epics-core/epics-base/3.14
Diff against target: 30 lines (+5/-5)
1 file modified
src/rec/compressRecord.c (+5/-5)
To merge this branch: bzr merge lp:~ralph-lange/epics-base/compress-fix
Reviewer Review Type Date Requested Status
Andrew Johnson Approve
Review via email: mp+22728@code.launchpad.net

Description of the change

Fixed a crash when the ALG (algorithm) field was changed to "Average" at run time.

Fixes bug #552803.

Test by running a single compress record linked to an ai, and set the ALG field to "Average".

To post a comment you must log in.
Revision history for this message
Ralph Lange (ralph-lange) wrote :

(This is trivial. I use it as an example learning how to handle bzr branches, LP bugs, merging etc.)

Revision history for this message
Andrew Johnson (anj) wrote :

Your commit was made by 'Ralph Lange <rlange@controldev32>' whom LP doesn't know.
You might want to re-do it after running
    bzr whoami "Ralph Lange <...@...>"
to fix that.

The content looks fine though.

12046. By Ralph Lange

Fixed crash when ALG (algorithm) was changed to Average at runtime. (Fixes #552803)

Revision history for this message
Ralph Lange (ralph-lange) wrote :

Should be fixed now.
(uncommit / commit / push --overwrite)

On Fri 02 Apr 2010 17:16:41 Andrew Johnson wrote:
> Your commit was made by 'Ralph Lange <rlange@controldev32>' whom LP doesn't know.
> You might want to re-do it after running
> bzr whoami "Ralph Lange <...@...>"
> to fix that.
>
> The content looks fine though.
>
>

Revision history for this message
Andrew Johnson (anj) wrote :

Looks good to me, here's an "approve".

review: Approve
Revision history for this message
Ralph Lange (ralph-lange) wrote :

Oh, I can set the status myself, but how does the actual merge happen?

Revision history for this message
Ralph Lange (ralph-lange) wrote :

I can do it myself ... yay!
Call it a week, then. Happy Easter!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/rec/compressRecord.c'
2--- src/rec/compressRecord.c 2009-04-02 21:41:45 +0000
3+++ src/rec/compressRecord.c 2010-04-02 21:28:27 +0000
4@@ -80,10 +80,14 @@
5 static void reset(compressRecord *prec)
6 {
7 prec->nuse = 0;
8- prec->off= 0;
9+ prec->off = 0;
10 prec->inx = 0;
11 prec->cvb = 0.0;
12 prec->res = 0;
13+ /* allocate memory for the summing buffer for conversions requiring it */
14+ if (prec->alg == compressALG_Average && prec->sptr == 0){
15+ prec->sptr = (double *)calloc(prec->nsam,sizeof(double));
16+ }
17 }
18
19 static void monitor(compressRecord *prec)
20@@ -292,10 +296,6 @@
21 if (pass==0){
22 if(prec->nsam<1) prec->nsam = 1;
23 prec->bptr = (double *)calloc(prec->nsam,sizeof(double));
24- /* allocate memory for the summing buffer for conversions requiring it */
25- if (prec->alg == compressALG_Average){
26- prec->sptr = (double *)calloc(prec->nsam,sizeof(double));
27- }
28 reset(prec);
29 }
30 return(0);

Subscribers

People subscribed via source and target branches