newlen = sp->data_length / a; dest = newdata = safe_malloc(newlen >> (FRACTION_BITS - 1)); 
newlen = (int32)(sp->data_length / a); dest = newdata = safe_malloc((newlen >> (FRACTION_BITS - 1)) + 2); 
void pre_resample(Sample * sp){  double a, xdiff;  int32 incr, ofs, newlen, count;  int16 *newdata, *dest, *src = (int16 *) sp->data;  int16 v1, v2, v3, v4, *vptr;  static const char note_name[12][3] =  {    "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"  };  ctl->cmsg(CMSG_INFO, VERB_NOISY, " * pre-resampling for note %d (%s%d)",	    sp->note_to_use,	    note_name[sp->note_to_use % 12], (sp->note_to_use & 0x7F) / 12);  a = ((double) (sp->sample_rate) * freq_table[(int) (sp->note_to_use)]) /    ((double) (sp->root_freq) * play_mode->rate);  newlen = sp->data_length / a;  dest = newdata = safe_malloc(newlen >> (FRACTION_BITS - 1));  count = (newlen >> FRACTION_BITS) - 1;  ofs = incr = (sp->data_length - (1 << FRACTION_BITS)) / count;  if (--count)    *dest++ = src[0];  /* Since we're pre-processing and this doesn't have to be done in     real-time, we go ahead and do the full sliding cubic interpolation. */  while (--count)    {      vptr = src + (ofs >> FRACTION_BITS);      v1 = *(vptr - 1);      v2 = *vptr;      v3 = *(vptr + 1);      v4 = *(vptr + 2);      xdiff = FSCALENEG(ofs & FRACTION_MASK, FRACTION_BITS);      *dest++ = v2 + (xdiff / 6.0) * (-2 * v1 - 3 * v2 + 6 * v3 - v4 +      xdiff * (3 * (v1 - 2 * v2 + v3) + xdiff * (-v1 + 3 * (v2 - v3) + v4)));      ofs += incr;    }  if (ofs & FRACTION_MASK)    {      v1 = src[ofs >> FRACTION_BITS];      v2 = src[(ofs >> FRACTION_BITS) + 1];      *dest++ = v1 + (((v2 - v1) * (ofs & FRACTION_MASK)) >> FRACTION_BITS);    }  else    *dest++ = src[ofs >> FRACTION_BITS];  sp->data_length = newlen;  sp->loop_start = sp->loop_start / a;  sp->loop_end = sp->loop_end / a;  free(sp->data);  sp->data = (sample_t *) newdata;  sp->sample_rate = 0;}
4357	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4357/cb293c4705e0c7b93d3269c59bcf9bbcab7f6278/resample.c/clean/resample.c