Commited in https://github.com/grame-cncm/faust/commit/8f0e49735e62c79331d4e2121ed10be4ea6d8340
Thanks. Stéphane > Le 22 mars 2023 à 18:58, Oleg Nesterov <o...@redhat.com> a écrit : > > This trivial code > > process = ffunction(float func(float), "",""); > > compiled with "-fx" results in > > output0[i0] = FAUSTFLOAT(nil(fixpoint_t(input0[i0]))); > > because ffname() always returns "nil" with -fx. > > Why is that? > > const char* ffname(Tree t) > { > Tree namelist = nth(ffsignature(t), 1); > return tree2str(nth(namelist, gGlobal->gFloatSize - 1)); > } > > assumes that "signature" in compiler/parser/faustparser.y creates the "name" > for every gFloatSize, but the gFloatSize == 4 case is not covered. > > The patch below seems to fix the problem, but needs more documentation. With > this patch you can do > > ffunction(float fun_single|fun_double|fun_quad|fun_fixpoint (...), ...); > > IOW, you can also specify the name of "fixpoint" variant of foreign function. > > Oleg. > > diff --git a/compiler/parser/faustparser.y b/compiler/parser/faustparser.y > index ce1b60858..cc88db4a4 100644 > --- a/compiler/parser/faustparser.y > +++ b/compiler/parser/faustparser.y > @@ -719,13 +719,15 @@ soundfile : SOUNDFILE LPAR uqstring PAR > argument RPAR > /* Description of foreign functions */ > /* float sinhf|sinh|sinhl(float) */ > > -signature : type fun LPAR typelist RPAR { $$ = > cons($1, cons(cons($2,cons($2,cons($2,gGlobal->nil))), $4)); } > - | type fun OR fun LPAR typelist RPAR { $$ = cons($1, > cons(cons($2,cons($4,cons($4,gGlobal->nil))), $6)); } > - | type fun OR fun OR fun LPAR typelist RPAR { $$ = cons($1, > cons(cons($2,cons($4,cons($6,gGlobal->nil))), $8)); } > - > - | type fun LPAR RPAR { $$ = cons($1, > cons(cons($2,cons($2,cons($2,gGlobal->nil))), gGlobal->nil)); } > - | type fun OR fun LPAR RPAR { $$ = cons($1, > cons(cons($2,cons($4,cons($4,gGlobal->nil))), gGlobal->nil)); } > - | type fun OR fun OR fun LPAR RPAR { $$ = > cons($1, cons(cons($2,cons($4,cons($6,gGlobal->nil))), gGlobal->nil)); } > +signature : type fun LPAR typelist RPAR { $$ > = cons($1, cons(cons($2,cons($2,cons($2,cons($2,gGlobal->nil)))), $4)); } > + | type fun OR fun LPAR typelist RPAR { $$ = > cons($1, cons(cons($2,cons($4,cons($4,cons($4,gGlobal->nil)))), $6)); } > + | type fun OR fun OR fun LPAR typelist RPAR { $$ = > cons($1, cons(cons($2,cons($4,cons($6,cons($6,gGlobal->nil)))), $8)); } > + | type fun OR fun OR fun OR fun LPAR typelist RPAR { $$ = > cons($1, cons(cons($2,cons($4,cons($6,cons($8,gGlobal->nil)))), $10)); } > + > + | type fun LPAR RPAR { $$ = > cons($1, cons(cons($2,cons($2,cons($2,cons($2,gGlobal->nil)))), > gGlobal->nil)); } > + | type fun OR fun LPAR RPAR { $$ = > cons($1, cons(cons($2,cons($4,cons($4,cons($4,gGlobal->nil)))), > gGlobal->nil)); } > + | type fun OR fun OR fun LPAR RPAR { $$ = > cons($1, cons(cons($2,cons($4,cons($6,cons($6,gGlobal->nil)))), > gGlobal->nil)); } > + | type fun OR fun OR fun OR fun LPAR RPAR { $$ = > cons($1, cons(cons($2,cons($4,cons($6,cons($8,gGlobal->nil)))), > gGlobal->nil)); } > ; > > fun : IDENT > { $$ = tree(FAUSTtext); } > Stéphane Letz Responsable recherche l...@grame.fr T : +33 (0) 4 72 07 43 12 / 06 41 81 15 69 GRAME - Centre national de création musicale 26 rue Emile Decorps - 69100 Villeurbanne www.grame.fr | facebook | instagram | twitter _______________________________________________ Faudiostream-devel mailing list Faudiostream-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/faudiostream-devel