return (v1 + (((v2-v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS));
return (v1 + ((resample_t)((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS));
static resample_t resample_lagrange(sample_t *src, splen_t ofs, resample_rec_t *rec){    int32 ofsi, ofsf, v0, v1, v2, v3;    ofsi = ofs >> FRACTION_BITS;    v1 = (int32)src[ofsi];    v2 = (int32)src[ofsi + 1];    if((ofs<rec->loop_start+(1L<<FRACTION_BITS))||       ((ofs+(2L<<FRACTION_BITS))>rec->loop_end)) {	return (v1 + (((v2-v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS));    } else {	v0 = (int32)src[ofsi - 1];	v3 = (int32)src[ofsi + 2];	ofsf = (ofs & FRACTION_MASK) + (1<<FRACTION_BITS);	v3 += -3*v2 + 3*v1 - v0;	v3 *= (ofsf - (2<<FRACTION_BITS)) / 6;	v3 >>= FRACTION_BITS;	v3 += v2 - v1 - v1 + v0;	v3 *= (ofsf - (1<<FRACTION_BITS)) >> 1;	v3 >>= FRACTION_BITS;	v3 += v1 - v0;	v3 *= ofsf;	v3 >>= FRACTION_BITS;	v3 += v0;	return v3;    }}