[BACK]Return to user.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2018 / builtin

Diff for /OpenXM_contrib2/asir2018/builtin/user.c between version 1.1 and 1.3

version 1.1, 2018/09/19 05:45:06 version 1.3, 2018/09/28 08:20:27
Line 1 
Line 1 
 /* $OpenXM$ */  /* $OpenXM: OpenXM_contrib2/asir2018/builtin/user.c,v 1.2 2018/09/24 22:26:43 noro Exp $ */
   
 /* a sample file for adding builtin functions */  /* a sample file for adding builtin functions */
   
Line 31  void Pcomp_f(NODE arg,Z *rp)
Line 31  void Pcomp_f(NODE arg,Z *rp)
     e1 = BDY((LIST)BDY(l1));      e1 = BDY((LIST)BDY(l1));
     e2 = BDY((LIST)BDY(l2));      e2 = BDY((LIST)BDY(l2));
     r = compp(CO,(P)ARG0(e1),(P)ARG0(e2));      r = compp(CO,(P)ARG0(e1),(P)ARG0(e2));
     if ( r ) { STOQ(r,*rp); return; }      if ( r ) { STOZ(r,*rp); return; }
     m1 = QTOS((Q)ARG1(e1));      m1 = ZTOS((Q)ARG1(e1));
     m2 = QTOS((Q)ARG1(e2));      m2 = ZTOS((Q)ARG1(e2));
   r = m1>m2?1:(m1<m2?-1:0);    r = m1>m2?1:(m1<m2?-1:0);
   if ( r ) { STOQ(r,*rp); return; }    if ( r ) { STOZ(r,*rp); return; }
   }    }
   r = l1?1:(l2?-1:0);    r = l1?1:(l2?-1:0);
   STOQ(r,*rp);    STOZ(r,*rp);
 }  }
   
 /*  /*
Line 74  void partial_derivative(VL vl,P p,V v,P *r)
Line 74  void partial_derivative(VL vl,P p,V v,P *r)
   }    }
 }  }
 */  */
   
   void dsave(char *name,Obj a)
   {
     extern int ox_file_io;
     VL vl;
     FILE *fp = fopen(name,"wb");
     ox_file_io = 1; /* network byte order is used */
     get_vars_recursive(a,&vl);
     savevl(fp,CO);
     saveobj(fp,a);
     fclose(fp);
     ox_file_io = 0;
   }
   

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>