bridge/class-master/depend/pari/src/basemath/gen2.c
/* return a copy fully allocated on stack. gclone from changevalue is
 * supposed to malloc() it */
return a copy fully allocated on stack. gclone from changevalue is
supposed to malloc() it
return a copy fully allocated on stack . gclone from changevalue is supposed to malloc () it
GEN
gtolist(GEN x)
{
  GEN y;
  if (!x) return mklist();
  switch(typ(x))
  {
    case t_VEC: case t_COL:
      y = mklist();
      if (lg(x) == 1) return y;
      list_data(y) = gcopy(x);
      settyp(list_data(y), t_VEC);
      return y;
    case t_LIST:
      y = mklist();
      list_data(y) = list_data(x)? gcopy(list_data(x)): NULL;
      return y;
    default:
      return mklistcopy(x);
  }
}
GEN gtolist ( GEN x ) { GEN y ; if ( ! x ) return mklist ( ) ; switch ( typ ( x ) ) { case t_VEC : case t_COL : y = mklist ( ) ; if ( lg ( x ) == 1 ) return y ; list_data ( y ) = gcopy ( x ) ; settyp ( list_data ( y ) , t_VEC ) ; return y ; case t_LIST : y = mklist ( ) ; list_data ( y ) = list_data ( x ) ? gcopy ( list_data ( x ) ) : NULL ; return y ; default : return mklistcopy ( x ) ; } }
return a copy fully allocated on stack.
return a copy fully allocated on stack .