Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24448
Modified Files: Tag: desiredata builtins.c builtins_dsp.c Log Message: cleanup
Index: builtins_dsp.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/builtins_dsp.c,v retrieving revision 1.1.2.19 retrieving revision 1.1.2.20 diff -C2 -d -r1.1.2.19 -r1.1.2.20 *** builtins_dsp.c 9 Jan 2007 22:30:24 -0000 1.1.2.19 --- builtins_dsp.c 28 Jun 2007 16:36:29 -0000 1.1.2.20 *************** *** 19,23 **** #include <string.h> #include <stdlib.h> ! extern "C" int ugen_getsortno(void); #define DEFDELVS 64 /* LATER get this from canvas at DSP time */ #ifdef HAVE_LIBFFTW3F --- 19,23 ---- #include <string.h> #include <stdlib.h> ! extern int ugen_getsortno (); #define DEFDELVS 64 /* LATER get this from canvas at DSP time */ #ifdef HAVE_LIBFFTW3F *************** *** 195,199 **** while (n--) { float g = *in2++; ! *out++ = (g ? *in1++ / g : 0); } return w+5; --- 195,199 ---- while (n--) { float g = *in2++; ! *out++ = (g ? *in1++ / g : 0); } return w+5; *************** *** 227,231 **** int n = (int)w[4]; if(f) f = 1./f; ! while (n--) *out++ = *in++ * f; return w+5; } --- 227,231 ---- int n = (int)w[4]; if(f) f = 1./f; ! while (n--) *out++ = *in++ * f; return w+5; } *************** *** 296,304 **** if (nxfer > n) nxfer = n; phase += nxfer; ! ! if (SIMD_CHKCNT(nxfer)) ! testcopyvec_simd(fp, in, nxfer); ! else ! testcopyvec(fp, in, nxfer); if (phase >= endphase) { tabwrite_tilde_redraw(x); --- 296,301 ---- if (nxfer > n) nxfer = n; phase += nxfer; ! if (SIMD_CHKCNT(nxfer)) testcopyvec_simd(fp, in, nxfer); ! else testcopyvec(fp, in, nxfer); if (phase >= endphase) { tabwrite_tilde_redraw(x); *************** *** 1456,1460 **** int n = (int)w[3]; int count; ! float *sump; in += n; for (count = x->phase, sump = x->sumbuf; --- 1453,1457 ---- int n = (int)w[3]; int count; ! float *sump; in += n; for (count = x->phase, sump = x->sumbuf; *************** *** 1682,1697 **** for (i = x->n, ip = x->vec, sp2 = sp; i--; ip++, sp2++) { int ch = *ip - 1; ! if ((*sp2)->n != sys_dacblocksize) ! error("dac~: bad vector size"); ! else ! if (ch >= 0 && ch < sys_get_outchannels()) ! if(SIMD_CHECK3(sys_dacblocksize,sys_soundout + sys_dacblocksize*ch, ! (*sp2)->v,sys_soundout + sys_dacblocksize*ch)) dsp_add(plus_perf_simd, 4, sys_soundout + sys_dacblocksize*ch, (*sp2)->v, sys_soundout + sys_dacblocksize*ch, sys_dacblocksize); else ! dsp_add(plus_perform, 4, sys_soundout + sys_dacblocksize*ch, ! (*sp2)->v, sys_soundout + sys_dacblocksize*ch, sys_dacblocksize); ! } } static void dac_free(t_dac *x) {free(x->vec);} --- 1679,1691 ---- for (i = x->n, ip = x->vec, sp2 = sp; i--; ip++, sp2++) { int ch = *ip - 1; ! if ((*sp2)->n != sys_dacblocksize) error("dac~: bad vector size"); ! else if (ch >= 0 && ch < sys_get_outchannels()) ! if(SIMD_CHECK3(sys_dacblocksize,sys_soundout + sys_dacblocksize*ch, (*sp2)->v,sys_soundout + sys_dacblocksize*ch)) dsp_add(plus_perf_simd, 4, sys_soundout + sys_dacblocksize*ch, (*sp2)->v, sys_soundout + sys_dacblocksize*ch, sys_dacblocksize); else ! dsp_add(plus_perform, 4, sys_soundout + sys_dacblocksize*ch, (*sp2)->v, sys_soundout + sys_dacblocksize*ch, ! sys_dacblocksize); ! } } static void dac_free(t_dac *x) {free(x->vec);} *************** *** 1728,1732 **** t_float *out = (t_float *)w[2]; int n = (int)w[3]; ! while (n--) *out++ = *in1++; return w+4; } --- 1722,1726 ---- t_float *out = (t_float *)w[2]; int n = (int)w[3]; ! while (n--) *out++ = *in1++; return w+4; } *************** *** 1845,1849 **** } } ! c->c_phase = phase; return w+4; } --- 1839,1843 ---- } } ! c->c_phase = phase; return w+4; } *************** *** 1870,1874 **** } else testcopyvec_8(bp, in, n); ! c->c_phase = phase; return w+4; } --- 1864,1868 ---- } else testcopyvec_8(bp, in, n); ! c->c_phase = phase; return w+4; } *************** *** 2124,2128 **** float *in2 = (t_float *)w[2]; int n = w[3]; ! for (;n--; in1++, in2++) { float f = *in1; *in1 = *in2; --- 2118,2122 ---- float *in2 = (t_float *)w[2]; int n = w[3]; ! for (;n--; in1++, in2++) { float f = *in1; *in1 = *in2; *************** *** 2348,2352 **** static void sigrfftw_free(t_sigrfftw *x) {fftwf_destroy_plan(x->plan);}
! /* for compatibility reasons with the mayer fft, we'll have to invert * some samples ... this is ugly, but someone might rely on that ... */ static void sigrfftw_invert(t_sample * s, t_int n) { --- 2342,2346 ---- static void sigrfftw_free(t_sigrfftw *x) {fftwf_destroy_plan(x->plan);}
! /* for compatibility reasons with the mayer fft, we'll have to invert * some samples ... this is ugly, but someone might rely on that ... */ static void sigrfftw_invert(t_sample * s, t_int n) { *************** *** 2406,2410 **** } static t_int *sigrifftw_perform(t_int *w) { ! sigrfftw_invert((t_sample *)w[2],w[3]); fftwf_execute(*(fftwf_plan*)w[1]); return w+4; --- 2400,2404 ---- } static t_int *sigrifftw_perform(t_int *w) { ! sigrfftw_invert((t_sample *)w[2],w[3]); fftwf_execute(*(fftwf_plan*)w[1]); return w+4; *************** *** 2422,2426 **** x->dim.is=1; x->dim.os=1; ! x->plan = fftwf_plan_guru_split_dft_c2r(1, &(x->dim), 0, NULL, in1, in2, out, FFTW_ESTIMATE | FFTW_PRESERVE_INPUT); dsp_add_zero(in1+ n/2, n/2); --- 2416,2420 ---- x->dim.is=1; x->dim.os=1; ! x->plan = fftwf_plan_guru_split_dft_c2r(1, &(x->dim), 0, NULL, in1, in2, out, FFTW_ESTIMATE | FFTW_PRESERVE_INPUT); dsp_add_zero(in1+ n/2, n/2); *************** *** 2552,2556 **** } if (PD_BIGORSMALL(last)) ! last = 0; c->c_x = last; } else { --- 2546,2550 ---- } if (PD_BIGORSMALL(last)) ! last = 0; c->c_x = last; } else { *************** *** 2605,2612 **** x->hz = f; x->ctl->c_coef = f * (2 * 3.14159) / x->sr; ! if (x->ctl->c_coef > 1) ! x->ctl->c_coef = 1; ! else if (x->ctl->c_coef < 0) ! x->ctl->c_coef = 0; } static void siglop_clear(t_siglop *x, t_floatarg q) { --- 2599,2604 ---- x->hz = f; x->ctl->c_coef = f * (2 * 3.14159) / x->sr; ! if (x->ctl->c_coef > 1) x->ctl->c_coef = 1; ! if (x->ctl->c_coef < 0) x->ctl->c_coef = 0; } static void siglop_clear(t_siglop *x, t_floatarg q) { *************** *** 2628,2635 **** static void siglop_dsp(t_siglop *x, t_signal **sp) { x->sr = sp[0]->sr; ! siglop_ft1(x, x->hz); ! dsp_add(siglop_perform, 4, ! sp[0]->v, sp[1]->v, ! x->ctl, sp[0]->n);
} --- 2620,2625 ---- static void siglop_dsp(t_siglop *x, t_signal **sp) { x->sr = sp[0]->sr; ! siglop_ft1(x, x->hz); ! dsp_add(siglop_perform, 4, sp[0]->v, sp[1]->v, x->ctl, sp[0]->n);
} *************** *** 2693,2698 **** x->ctl->c_coef2 = - r * r; x->ctl->c_gain = 2 * oneminusr * (oneminusr + r * omega); ! /* post("r %f, omega %f, coef1 %f, coef2 %f", ! r, omega, x->ctl->c_coef1, x->ctl->c_coef2); */ } static void sigbp_ft1(t_sigbp *x, t_floatarg f) {sigbp_docoef(x, f, x->q);} --- 2683,2687 ---- x->ctl->c_coef2 = - r * r; x->ctl->c_gain = 2 * oneminusr * (oneminusr + r * omega); ! /* post("r %f, omega %f, coef1 %f, coef2 %f", r, omega, x->ctl->c_coef1, x->ctl->c_coef2); */ } static void sigbp_ft1(t_sigbp *x, t_floatarg f) {sigbp_docoef(x, f, x->q);} *************** *** 2776,2780 **** for (int i = 0; i < n; i++) { float output = *in++ + fb1 * last + fb2 * prev; ! if (PD_BIGORSMALL(output)) output = 0; *out++ = ff1 * output + ff2 * last + ff3 * prev; prev = last; --- 2765,2769 ---- for (int i = 0; i < n; i++) { float output = *in++ + fb1 * last + fb2 * prev; ! if (PD_BIGORSMALL(output)) output = 0; *out++ = ff1 * output + ff2 * last + ff3 * prev; prev = last; *************** *** 3084,3098 **** } static void sigcpole_dsp(t_sigcpole *x, t_signal **sp) { ! dsp_add(sigcpole_perform, 8, ! sp[0]->v, sp[1]->v, sp[2]->v, sp[3]->v, ! sp[4]->v, sp[5]->v, x, sp[0]->n); ! } ! static void sigcpole_clear(t_sigcpole *x) { ! x->lastre = x->lastim = 0; ! } ! static void sigcpole_set(t_sigcpole *x, t_float re, t_float im) { ! x->lastre = re; ! x->lastim = im; } void sigcpole_setup() { sigcpole_class = class_new2("cpole~",sigcpole_new,0,sizeof(t_sigcpole),0,"FF"); --- 3073,3080 ---- } static void sigcpole_dsp(t_sigcpole *x, t_signal **sp) { ! dsp_add(sigcpole_perform, 8, sp[0]->v, sp[1]->v, sp[2]->v, sp[3]->v, sp[4]->v, sp[5]->v, x, sp[0]->n); } + static void sigcpole_clear(t_sigcpole *x) {x->lastre = x->lastim = 0;} + static void sigcpole_set(t_sigcpole *x, t_float re, t_float im) {x->lastre = re; x->lastim = im;} void sigcpole_setup() { sigcpole_class = class_new2("cpole~",sigcpole_new,0,sizeof(t_sigcpole),0,"FF"); *************** *** 3142,3156 **** } static void sigczero_dsp(t_sigczero *x, t_signal **sp) { ! dsp_add(sigczero_perform, 8, ! sp[0]->v, sp[1]->v, sp[2]->v, sp[3]->v, ! sp[4]->v, sp[5]->v, x, sp[0]->n); ! } ! static void sigczero_clear(t_sigczero *x) { ! x->lastre = x->lastim = 0; ! } ! static void sigczero_set(t_sigczero *x, t_float re, t_float im) { ! x->lastre = re; ! x->lastim = im; } void sigczero_setup() { sigczero_class = class_new2("czero~",sigczero_new,0,sizeof(t_sigczero),0,"FF"); --- 3124,3131 ---- } static void sigczero_dsp(t_sigczero *x, t_signal **sp) { ! dsp_add(sigczero_perform, 8, sp[0]->v, sp[1]->v, sp[2]->v, sp[3]->v, sp[4]->v, sp[5]->v, x, sp[0]->n); } + static void sigczero_clear(t_sigczero *x) {x->lastre = x->lastim = 0;} + static void sigczero_set(t_sigczero *x, t_float re, t_float im) {x->lastre = re; x->lastim = im;} void sigczero_setup() { sigczero_class = class_new2("czero~",sigczero_new,0,sizeof(t_sigczero),0,"FF"); *************** *** 3288,3292 **** while (n--) *out++ = *in++; } else { ! while (n--) *out++ = 0; } return w+4; --- 3263,3267 ---- while (n--) *out++ = *in++; } else { ! while (n--) *out++ = 0; } return w+4; *************** *** 3362,3366 **** t_float *out = (t_float *)w[2]; int n = (int)w[3]; ! while (n--) *out++ = *in, *in++ = 0; return w+4; } --- 3337,3341 ---- t_float *out = (t_float *)w[2]; int n = (int)w[3]; ! while (n--) *out++ = *in, *in++ = 0; return w+4; } *************** *** 3495,3499 **** long l = (i ? (i == DUMTAB1SIZE-1 ? DUMTAB1SIZE-2 : i) : 1)<< 23; *(int *)(&f) = l; ! rsqrt_exptab[i] = 1./sqrt(f); } for (int i = 0; i < DUMTAB2SIZE; i++) { --- 3470,3474 ---- long l = (i ? (i == DUMTAB1SIZE-1 ? DUMTAB1SIZE-2 : i) : 1)<< 23; *(int *)(&f) = l; ! rsqrt_exptab[i] = 1./sqrt(f); } for (int i = 0; i < DUMTAB2SIZE; i++) { *************** *** 3521,3527 **** float qrsqrt(float f) {return q8_rsqrt(f);} #endif ! struct t_sigrsqrt : t_object { ! float a; ! }; static t_class *sigrsqrt_class; static void *sigrsqrt_new() { --- 3496,3500 ---- float qrsqrt(float f) {return q8_rsqrt(f);} #endif ! struct t_sigrsqrt : t_object {float a;}; static t_class *sigrsqrt_class; static void *sigrsqrt_new() { *************** *** 3561,3567 ****
/* sigsqrt - square root good to 8 mantissa bits */ ! struct t_sigsqrt : t_object { ! float a; ! }; static t_class *sigsqrt_class; static void *sigsqrt_new() { --- 3534,3538 ----
/* sigsqrt - square root good to 8 mantissa bits */ ! struct t_sigsqrt : t_object {float a;}; static t_class *sigsqrt_class; static void *sigsqrt_new() { *************** *** 3581,3585 **** else { float g = rsqrt_exptab[(l >> 23) & 0xff] * ! rsqrt_mantissatab[(l >> 13) & 0x3ff]; *out++ = f * (1.5 * g - 0.5 * g * g * g * f); } --- 3552,3556 ---- else { float g = rsqrt_exptab[(l >> 23) & 0xff] * ! rsqrt_mantissatab[(l >> 13) & 0x3ff]; *out++ = f * (1.5 * g - 0.5 * g * g * g * f); } *************** *** 3600,3606 ****
/* ------------------------------ wrap~ -------------------------- */ ! struct t_sigwrap : t_object { ! float a; ! }; t_class *sigwrap_class; static void *sigwrap_new() { --- 3571,3575 ----
/* ------------------------------ wrap~ -------------------------- */ ! struct t_sigwrap : t_object {float a;}; t_class *sigwrap_class; static void *sigwrap_new() { *************** *** 3752,3756 **** double phase; float conv; ! float a; /* scalar frequency */ }; static void *phasor_new(t_floatarg f) { --- 3721,3725 ---- double phase; float conv; ! float a; /* scalar frequency */ }; static void *phasor_new(t_floatarg f) { *************** *** 3823,3827 **** normhipart = tf.tf_i[HIOFFSET];
! #if 0 /* this is the readable version of the code. */ while (n--) { dphase = (double)(*in++ * (float)(COSTABSIZE)) + UNITBIT32; --- 3792,3796 ---- normhipart = tf.tf_i[HIOFFSET];
! #if 0 /* this is the readable version of the code. */ while (n--) { dphase = (double)(*in++ * (float)(COSTABSIZE)) + UNITBIT32; *************** *** 3834,3839 **** *out++ = f1 + frac * (f2 - f1); } ! #endif ! #if 1 /* this is the same, unwrapped by hand. */ dphase = (double)(*in++ * (float)(COSTABSIZE)) + UNITBIT32; tf.tf_d = dphase; --- 3803,3807 ---- *out++ = f1 + frac * (f2 - f1); } ! #else /* this is the same, unwrapped by hand. */ dphase = (double)(*in++ * (float)(COSTABSIZE)) + UNITBIT32; tf.tf_d = dphase; *************** *** 3920,3925 **** *out++ = f1 + frac * (f2 - f1); } ! #endif ! #if 1 tf.tf_d = dphase; dphase += *in++ * conv; --- 3888,3892 ---- *out++ = f1 + frac * (f2 - f1); } ! #else tf.tf_d = dphase; dphase += *in++ * conv;
Index: builtins.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/builtins.c,v retrieving revision 1.1.2.18 retrieving revision 1.1.2.19 diff -C2 -d -r1.1.2.18 -r1.1.2.19 *** builtins.c 28 Jun 2007 07:10:42 -0000 1.1.2.18 --- builtins.c 28 Jun 2007 16:36:29 -0000 1.1.2.19 *************** *** 1842,1848 ****
static t_class *spigot_class; ! struct t_spigot : t_object { ! float state; ! }; static void *spigot_new(t_floatarg f) { t_spigot *x = (t_spigot *)pd_new(spigot_class); --- 1842,1846 ----
static t_class *spigot_class; ! struct t_spigot : t_object {float state;}; static void *spigot_new(t_floatarg f) { t_spigot *x = (t_spigot *)pd_new(spigot_class); *************** *** 1875,1881 ****
static t_class *moses_class; ! struct t_moses : t_object { ! float y; ! }; static void *moses_new(t_floatarg f) { t_moses *x = (t_moses *)pd_new(moses_class); --- 1873,1877 ----
static t_class *moses_class; ! struct t_moses : t_object {float y;}; static void *moses_new(t_floatarg f) { t_moses *x = (t_moses *)pd_new(moses_class); *************** *** 1922,1928 ****
static t_class *makefilename_class; ! struct t_makefilename : t_object { ! t_symbol *format; ! }; static void *makefilename_new(t_symbol *s) { t_makefilename *x = (t_makefilename *)pd_new(makefilename_class); --- 1918,1922 ----
static t_class *makefilename_class; ! struct t_makefilename : t_object {t_symbol *format;}; static void *makefilename_new(t_symbol *s) { t_makefilename *x = (t_makefilename *)pd_new(makefilename_class); *************** *** 1999,2005 ****
static t_class *change_class; ! struct t_change : t_object { ! t_float f; ! }; static void *change_new(t_floatarg f) { t_change *x = (t_change *)pd_new(change_class); --- 1993,1997 ----
static t_class *change_class; ! struct t_change : t_object {t_float f;}; static void *change_new(t_floatarg f) { t_change *x = (t_change *)pd_new(change_class); *************** *** 2232,2238 **** }
! struct t_midi2 : t_object { ! t_float ch; ! }; static void *midi2_new(t_class *cl, t_floatarg ch) { t_midi2 *x = (t_midi2 *)pd_new(cl); --- 2224,2228 ---- }
! struct t_midi2 : t_object {t_float ch;}; static void *midi2_new(t_class *cl, t_floatarg ch) { t_midi2 *x = (t_midi2 *)pd_new(cl); *************** *** 2967,2975 **** static t_class *pipe_class; struct t_hang2 { ! t_clock *h_clock; ! t_hang2 *h_next; ! struct t_pipe *h_owner; ! t_gpointer *h_gp; ! union word h_vec[1]; /* not the actual number. */ }; struct t_pipeout { --- 2957,2965 ---- static t_class *pipe_class; struct t_hang2 { ! t_clock *clock; ! t_hang2 *next; ! struct t_pipe *owner; ! t_gpointer *gp; ! union word vec[1]; /* not the actual number. */ }; struct t_pipeout { *************** *** 3046,3070 **** } static void hang_free(t_hang2 *h) { ! t_pipe *x = h->h_owner; ! t_gpointer *gp = h->h_gp; for (int i = x->nptr; i--; gp++) gpointer_unset(gp); ! free(h->h_gp); ! clock_free(h->h_clock); free(h); } static void hang_tick(t_hang2 *h) { ! t_pipe *x = h->h_owner; t_hang2 *h2, *h3; ! t_pipeout *p; ! int i; ! union word *w; ! if (x->hang == h) x->hang = h->h_next; ! else for (h2 = x->hang; (h3 = h2->h_next); h2 = h3) { if (h3 == h) { ! h2->h_next = h3->h_next; break; } } ! for (i = x->n, p = x->vec + (x->n - 1), w = h->h_vec + (x->n - 1); i--; p--, w--) { switch (p->a.a_type) { case A_FLOAT: outlet_float( x->out(i),w->w_float); break; --- 3036,3059 ---- } static void hang_free(t_hang2 *h) { ! t_pipe *x = h->owner; ! t_gpointer *gp = h->gp; for (int i = x->nptr; i--; gp++) gpointer_unset(gp); ! free(h->gp); ! clock_free(h->clock); free(h); } static void hang_tick(t_hang2 *h) { ! t_pipe *x = h->owner; t_hang2 *h2, *h3; ! if (x->hang == h) x->hang = h->next; ! else for (h2 = x->hang; (h3 = h2->next); h2 = h3) { if (h3 == h) { ! h2->next = h3->next; break; } } ! t_pipeout *p = x->vec + (x->n - 1); ! union word *w = h->vec + (x->n - 1); ! for (int i = x->n; i--; p--, w--) { switch (p->a.a_type) { case A_FLOAT: outlet_float( x->out(i),w->w_float); break; *************** *** 3080,3084 **** } static void pipe_list(t_pipe *x, t_symbol *s, int ac, t_atom *av) { ! t_hang2 *h = (t_hang2 *)getbytes(sizeof(*h) + (x->n - 1) * sizeof(*h->h_vec)); t_gpointer *gp, *gp2; t_pipeout *p; --- 3069,3073 ---- } static void pipe_list(t_pipe *x, t_symbol *s, int ac, t_atom *av) { ! t_hang2 *h = (t_hang2 *)getbytes(sizeof(*h) + (x->n - 1) * sizeof(*h->vec)); t_gpointer *gp, *gp2; t_pipeout *p; *************** *** 3086,3090 **** t_atom *ap; t_word *w; ! h->h_gp = (t_gpointer *)getbytes(x->nptr * sizeof(t_gpointer)); if (ac > n) ac = n; for (i = 0, gp = x->gp, p = x->vec, ap = av; i < ac; i++, p++, ap++) { --- 3075,3079 ---- t_atom *ap; t_word *w; ! h->gp = (t_gpointer *)getbytes(x->nptr * sizeof(t_gpointer)); if (ac > n) ac = n; for (i = 0, gp = x->gp, p = x->vec, ap = av; i < ac; i++, p++, ap++) { *************** *** 3103,3107 **** } } ! for (i = 0, gp = x->gp, gp2 = h->h_gp, p = x->vec, w = h->h_vec; i < n; i++, p++, w++) { if (p->a.a_type == A_POINTER) { if (gp->o) gp->o->refcount++; --- 3092,3096 ---- } } ! for (i = 0, gp = x->gp, gp2 = h->gp, p = x->vec, w = h->vec; i < n; i++, p++, w++) { if (p->a.a_type == A_POINTER) { if (gp->o) gp->o->refcount++; *************** *** 3110,3118 **** } else *w = p->a.a_w; } ! h->h_next = x->hang; x->hang = h; ! h->h_owner = x; ! h->h_clock = clock_new(h, (t_method)hang_tick); ! clock_delay(h->h_clock, (x->deltime >= 0 ? x->deltime : 0)); } static void pipe_flush(t_pipe *x) { --- 3099,3107 ---- } else *w = p->a.a_w; } ! h->next = x->hang; x->hang = h; ! h->owner = x; ! h->clock = clock_new(h, (t_method)hang_tick); ! clock_delay(h->clock, (x->deltime >= 0 ? x->deltime : 0)); } static void pipe_flush(t_pipe *x) { *************** *** 3122,3126 **** t_hang2 *hang; while ((hang = x->hang)) { ! x->hang = hang->h_next; hang_free(hang); } --- 3111,3115 ---- t_hang2 *hang; while ((hang = x->hang)) { ! x->hang = hang->next; hang_free(hang); }