=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/builtin/poly.c,v retrieving revision 1.26 retrieving revision 1.29 diff -u -p -r1.26 -r1.29 --- OpenXM_contrib2/asir2000/builtin/poly.c 2017/02/28 07:06:28 1.26 +++ OpenXM_contrib2/asir2000/builtin/poly.c 2018/03/28 05:27:22 1.29 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/builtin/poly.c,v 1.25 2016/03/31 05:30:32 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/builtin/poly.c,v 1.28 2018/03/27 06:29:19 noro Exp $ */ #include "ca.h" #include "parse.h" @@ -148,7 +148,7 @@ struct ftab poly_tab[] = { {"ch_mv",Pch_mv,2}, {"re_mv",Pre_mv,2}, - {"ptomp",Pptomp,2}, + {"ptomp",Pptomp,-2}, {"mptop",Pmptop,1}, {"ptolmp",Pptolmp,1}, @@ -457,6 +457,9 @@ void Pord(NODE arg,LIST *listp) V *va; V v; +#if 0 +printf("LASTCO="); printv(CO,LASTCO->v); printf("\n"); +#endif if ( current_option ) { for ( opt = current_option; opt; opt = NEXT(opt) ) { p = BDY((LIST)BDY(opt)); @@ -509,6 +512,7 @@ void Pord(NODE arg,LIST *listp) if ( vl ) NEXT(tvl) = 0; CO = vl; + update_LASTCO(); } for ( n = 0, vl = CO; vl; vl = NEXT(vl) ) { NEXTNODE(n,tn); MKV(VR(vl),t); BDY(tn) = (pointer)t; @@ -1139,7 +1143,16 @@ void mergedeglist(NODE d0,NODE d1,NODE *dr) void Pptomp(NODE arg,P *rp) { - ptomp(QTOS((Q)ARG1(arg)),(P)ARG0(arg),rp); + int mod; + + if ( argc(arg) == 1 ) { + if ( !current_mod ) + error("ptomp : current_mod is not set"); + else + mod = current_mod; + } else + mod = QTOS((Q)ARG1(arg)); + ptomp(mod,(P)ARG0(arg),rp); } void Pmptop(NODE arg,P *rp)