[PATCH] Limit to 4 the number of cylinders shown in the data frame

Dirk Hohndel dirk at hohndel.org
Wed Jan 2 13:14:06 PST 2013


Salvador,

I applied and pushed out the patch, but I noticed something that had
escaped my attention before. You are making an incorrect assumption on
how you can tell that tank data exists...


Salvador Cuñat <salvador.cunat at gmail.com> writes:
> +static void show_dive_tanks(struct dive *dive, cairo_t *cr, double w,
> +	double h, PangoFontDescription *font)
> +{
> +	int maxwidth, maxheight, height, tank_count;
> +	
> +	maxwidth = w * PANGO_SCALE;
> +	maxheight = h * PANGO_SCALE * 0.9;
> +
> +	/* We need to know how many cylinders we used*/
> +	for ( tank_count = 0; tank_count < MAX_CYLINDERS; tank_count++ ){
> +		if (dive->cylinder[tank_count].start.mbar == 0) {
> +			break;
> +		}
> +	}

If the user has air integration, then start.mbar will be 0.

We have a function cylinder_nodata(cylinder_t *cyl) in equipment.c that
you should call instead.


/D


More information about the subsurface mailing list