Branch: Tag:

2001-03-04

2001-03-04 15:27:55 by Mirar (Pontus Hagland) <pike@sort.mirar.org>

modifications to allow for bigger INT_TYPE then the standard 32 bit or 'signed long':
Gmp.mpz modified to create objects from bigger native int types (get_mpz_new)
sprintf and configure modified so it can print bigger ints with then '%d', tests for '%llx' among others
main configure and global.h to allow type setting with --with-long-long-int et al
(default to not use long long is still in global.h)
various warnings fixed (not all)

Rev: src/acconfig.h:1.80
Rev: src/configure.in:1.494
Rev: src/global.h:1.58
Rev: src/modules/Gmp/configure.in:1.25
Rev: src/modules/Gmp/gmp_machine.h.in:1.6
Rev: src/modules/Gmp/mpz_glue.c:1.89
Rev: src/modules/Image/colors.c:1.45
Rev: src/modules/Image/image.c:1.186
Rev: src/modules/Image/image.h:1.47
Rev: src/modules/Image/layers.c:1.62
Rev: src/modules/files/udp.c:1.20
Rev: src/modules/sprintf/acconfig.h:1.2
Rev: src/modules/sprintf/configure.in:1.7
Rev: src/modules/sprintf/sprintf.c:1.76

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: mpz_glue.c,v 1.88 2001/02/20 13:02:12 grubba Exp $"); + RCSID("$Id: mpz_glue.c,v 1.89 2001/03/04 15:27:54 mirar Exp $");   #include "gmp_machine.h"      #if defined(HAVE_GMP2_GMP_H) && defined(HAVE_LIBGMP2)
152:    switch(s->type)    {    case T_INT: + #if BIG_PIKE_INT + /* INT_TYPE is bigger then long int */ +  { +  INT_TYPE x=s->u.integer; + #define SHIFT 24 + #define FILTER ((1<<SHIFT)-1) +  int neg=0; +  int pos=SHIFT; +  if (x<0) neg=1,x=-x; +  mpz_set_ui(tmp,(unsigned long int)(x&FILTER)); +  while ( (x>>=SHIFT) ) +  { +  mpz_t t2,t1; +  mpz_init_set_ui(t2,(unsigned long int)(x&FILTER)); +  mpz_init(t1); +  mpz_mul_2exp(t1,t2,pos); +  mpz_add(t2,tmp,t1); +  mpz_set(tmp,t2); +  mpz_clear(t1); +  mpz_clear(t2); +  } +  if (neg) +  { +  mpz_t t1; +  mpz_init_set(t1,tmp); +  mpz_neg(tmp,t1); +  mpz_clear(t1); +  } +  } + #else    mpz_set_si(tmp, (signed long int) s->u.integer); -  + #endif    break;       case T_FLOAT: