pike.git / src / modules / Image / encodings / xcf.c

version» Context lines:

pike.git/src/modules/Image/encodings/xcf.c:1:   #include "global.h" - RCSID("$Id: xcf.c,v 1.39 2002/05/11 00:11:38 nilsson Exp $"); + RCSID("$Id: xcf.c,v 1.40 2002/08/13 17:12:59 grubba Exp $");      #include "image_machine.h"      #include "pike_macros.h"   #include "object.h"   #include "constants.h"   #include "module_support.h"   #include "interpret.h"   #include "object.h"   #include "svalue.h"
pike.git/src/modules/Image/encodings/xcf.c:126:      static void f_substring_get_int( INT32 args )   {    struct substring *s = SS(fp->current_object);    int res;    unsigned char *p;    int x = sp[-1].u.integer;    if( x > s->len>>2 )    Pike_error("Index %d out of range", x );    -  p = s->s->str + s->offset + x*4; +  p = ((unsigned char *)s->s->str) + s->offset + x*4;    res = (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];    push_int( res );   }         static void f_substring_get_uint( INT32 args )   {    struct substring *s = SS(fp->current_object);    unsigned int res;    unsigned char *p;    int x = sp[-1].u.integer;    if( x > s->len>>2 )    Pike_error("Index %d out of range", x );    -  p = s->s->str + s->offset + x*4; +  p = ((unsigned char *)s->s->str) + s->offset + x*4;    res = (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];    push_int64( res );   }      static void f_substring_get_ushort( INT32 args )   {    struct substring *s = SS(fp->current_object);    unsigned short res;    unsigned char *p;    int x = sp[-1].u.integer;    if( x > s->len>>1 )    Pike_error("Index %d out of range", x );    -  p = s->s->str + s->offset + x*2; +  p = ((unsigned char *)s->s->str) + s->offset + x*2;    res = (p[2]<<8) | p[3];    push_int( res );   }      static void f_substring_get_short( INT32 args )   {    struct substring *s = SS(fp->current_object);    short res;    unsigned char *p;    int x = sp[-1].u.integer;    if( x > s->len>>1 )    Pike_error("Index %d out of range", x );    -  p = s->s->str + s->offset + x*2; +  p = ((unsigned char *)s->s->str) + s->offset + x*2;    res = (p[2]<<8) | p[3];    push_int( res );   }      static void push_substring( struct pike_string *s,    ptrdiff_t offset,    ptrdiff_t len )   {    struct object *o = clone_object( substring_program, 0 );    struct substring *ss = SS(o);
pike.git/src/modules/Image/encodings/xcf.c:1228:    struct object *to = tiles->item[l].u.object;    struct substring *tile_ss = SS(to);    struct buffer tile;    char *df = 0;    unsigned int eheight, ewidth;    unsigned char *s;       if(!tile_ss)    continue;    -  tile.str = (tile_ss->s->str + tile_ss->offset); +  tile.str = (unsigned char *)(tile_ss->s->str + tile_ss->offset);    tile.len = tile_ss->len;       ewidth = MINIMUM(TILE_WIDTH, (rxs-x));    eheight = MINIMUM(TILE_HEIGHT, (rys-y));       if(rle)    {    struct buffer s = tile, od, d;    int i;    od.len = eheight*ewidth*bpp; /* Max and only size, really */ -  df = od.str = (unsigned char *)xalloc( eheight*ewidth*bpp+1 ); +  df = (char *)(od.str = (unsigned char *)xalloc( eheight*ewidth*bpp+1 ));    d = od;       for(i=0; i<bpp; i++)    {    int nelems = ewidth*eheight;    int length;    while(nelems)    {    unsigned char val = read_char( &s );    if(!s.len)