pike.git / src / bignum.c

version» Context lines:

pike.git/src/bignum.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: bignum.c,v 1.41 2004/12/30 13:23:20 grubba Exp $ + || $Id: bignum.c,v 1.42 2008/01/26 22:34:17 mast Exp $   */      #include "global.h"      #ifdef AUTO_BIGNUM      #include "interpret.h"   #include "program.h"   #include "object.h"   #include "svalue.h"   #include "pike_error.h"      #define sp Pike_sp      PMOD_EXPORT struct svalue auto_bignum_program = { -  T_INT, 0, +  PIKE_T_FREE, 0,   #ifdef HAVE_UNION_INIT    {0}, /* Only to avoid warnings. */   #endif   };      PMOD_EXPORT struct program *get_auto_bignum_program(void)   {    return program_from_function(&auto_bignum_program);   }      PMOD_EXPORT struct program *get_auto_bignum_program_or_zero(void)   { -  if (auto_bignum_program.type == T_INT) +  if (auto_bignum_program.type == PIKE_T_FREE)    return 0;    return program_from_function(&auto_bignum_program);   }      void exit_auto_bignum(void)   {    free_svalue(&auto_bignum_program); -  auto_bignum_program.type=T_INT; +  mark_free_svalue (&auto_bignum_program);   }      PMOD_EXPORT void convert_stack_top_to_bignum(void)   {    apply_svalue(&auto_bignum_program, 1);       if(sp[-1].type != T_OBJECT) {    if (auto_bignum_program.type!=T_PROGRAM)    Pike_error("Gmp.mpz conversion failed (Gmp.bignum not loaded).\n");    else