All pastes #69737 Raw Edit

Miscellany

public c v1 · immutable
#69737 ·published 2006-06-23 11:28 UTC
rendered paste body
void *nb_decoder_init(const SpeexMode *m,(DecState *) allocated_state){   DecState *st;   const SpeexNBMode *mode;   int i;   mode=(const SpeexNBMode*)m->mode;//   st = (DecState *)speex_alloc(sizeof(DecState));   st = allocated_state;//-----------------------------------------------------------------------//or:void *nb_decoder_init(const SpeexMode *m,(DecState *) allocated_state){   DecState *st;   DecState sta;   const SpeexNBMode *mode;   int i;   mode=(const SpeexNBMode*)m->mode;//   st = (DecState *)speex_alloc(sizeof(DecState));   st = &sta;//if sta is keept when this function exits//-----------------------------------------------------------------------//or:void *nb_decoder_init(const SpeexMode *m){   DecState *st;   const SpeexNBMode *mode;   int i;   mode=(const SpeexNBMode*)m->mode;   st = (DecState *)speex_alloc(sizeof(DecState),DEC_STATE_ID);}//............speex_alloc(size_t size,int id){   if(id==DEC_STATE_ID){      return alloc_table->DEC_STATE_ID;   } else if(id==...){      return alloc_table->.........   }}