diff options
| author | Keith Packard <keithp@keithp.com> | 2009-09-05 22:45:49 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2009-09-05 22:45:49 -0700 | 
| commit | 6d018ab933832e2d80bb1564c339d9fb18b57be2 (patch) | |
| tree | 918ddb35a65374c6dd52fe726ae9989e12876bcd /ao-tools/lib/cc-analyse.c | |
| parent | c46e832b28820d7c5be4efaacbbd7c0607927fe5 (diff) | |
Handle vageries of .telem files in ao-postflight
Telem files have multiple entries of the same state, and sometimes
long gaps between recordings. Deal with this as best as possible.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-tools/lib/cc-analyse.c')
| -rw-r--r-- | ao-tools/lib/cc-analyse.c | 8 | 
1 files changed, 4 insertions, 4 deletions
| diff --git a/ao-tools/lib/cc-analyse.c b/ao-tools/lib/cc-analyse.c index 6fd36cdc..fc8a8417 100644 --- a/ao-tools/lib/cc-analyse.c +++ b/ao-tools/lib/cc-analyse.c @@ -22,11 +22,11 @@ cc_timedata_min(struct cc_timedata *d, double min_time, double max_time)  {  	int	i;  	int	set = 0; -	int	min_i; +	int	min_i = -1;  	double	min;  	if (d->num == 0) -		return 0; +		return -1;  	for (i = 0; i < d->num; i++)  		if (min_time <= d->data[i].time && d->data[i].time <= max_time)  			if (!set || d->data[i].value < min) { @@ -42,11 +42,11 @@ cc_timedata_max(struct cc_timedata *d, double min_time, double max_time)  {  	int	i;  	double	max; -	int	max_i; +	int	max_i = -1;  	int	set = 0;  	if (d->num == 0) -		return 0; +		return -1;  	for (i = 0; i < d->num; i++)  		if (min_time <= d->data[i].time && d->data[i].time <= max_time)  			if (!set || d->data[i].value > max) { | 
