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

1:   /*   **! module Image   **! note - **! $Id: layers.c,v 1.61 2001/01/19 22:18:42 grubba Exp $ + **! $Id: layers.c,v 1.62 2001/03/04 15:27:55 mirar Exp $   **! class Layer   **! see also: layers   **!
215:      #include <math.h> /* floor */    - RCSID("$Id: layers.c,v 1.61 2001/01/19 22:18:42 grubba Exp $"); + RCSID("$Id: layers.c,v 1.62 2001/03/04 15:27:55 mirar Exp $");      #include "image_machine.h"   
268:      struct layer   { -  INT_TYPE xsize; /* underlaying image size */ -  INT_TYPE ysize; +  INT32 xsize; /* underlaying image size */ +  INT32 ysize;    -  INT_TYPE xoffs,yoffs; /* clip offset */ +  INT32 xoffs,yoffs; /* clip offset */       struct object *image; /* image object */    struct object *alpha; /* alpha object or null */
287:    rgb_group sfill[SNUMPIXS]; /* pre-calculated rows */    rgb_group sfill_alpha[SNUMPIXS];    -  INT_TYPE tiled; /* true if tiled */ +  int tiled; /* true if tiled */       lm_row_func *row_func;/* layer mode */ -  INT_TYPE optimize_alpha; -  INT_TYPE really_optimize_alpha; +  int optimize_alpha; +  int really_optimize_alpha;       struct mapping *misc; /* Misc associated data. Added by per,    rather useful for some things... */
2771:    if (img->xsize!=xz || img->ysize!=yz)    Pike_error("Image returned from image->copy had "    "unexpected size (%d,%d, expected %d,%d)\n", -  img->xsize,img->ysize,xz,yz); +  img->xsize,img->ysize,(INT32)xz,(INT32)yz);       free_object(l->image);    l->image=Pike_sp[-1].u.object;
2799:    if (img->xsize!=xz || img->ysize!=yz)    Pike_error("Image returned from alpha->copy had "    "unexpected size (%d,%d, expected %d,%d)\n", -  img->xsize,img->ysize,xz,yz); +  img->xsize,img->ysize,(INT32)xz,(INT32)yz);    free_object(l->alpha);    l->alpha=Pike_sp[-1].u.object;    Pike_sp--;
2841:      static void image_layer_find_autocrop(INT32 args)   { -  INT_TYPE x1=0,y1=0,x2=THIS->xsize-1,y2=THIS->ysize-1; +  INT32 x1=0,y1=0,x2=THIS->xsize-1,y2=THIS->ysize-1;    INT_TYPE l=1,r=1,t=1,b=1;       if (args>3)
2857:    THIS->fill_alpha.g!=0 || /* non-transparent fill */    THIS->fill_alpha.b!=0)) /* check image too */    { -  int ix1,iy1,ix2,iy2; +  INT32 ix1,iy1,ix2,iy2;    img_find_autocrop(THIS->img, &ix1,&iy1,&ix2,&iy2, -  0,l,r,t,b,1,THIS->fill); +  0,(int)l,(int)r,(int)t,(int)b,1,THIS->fill);    if (ix1<x1) x1=ix1;    if (ix2>x2) x2=ix2;    if (iy1<y1) y1=iy1;
2872:    THIS->fill_alpha.b==255)) /* we may be able to crop */    {    img_find_autocrop(THIS->img, &x1,&y1,&x2,&y2, -  0,l,r,t,b,1,THIS->fill); +  0,(int)l,(int)r,(int)t,(int)b,1,THIS->fill);    }    }    push_int(x1+THIS->xoffs);