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.37 2001/04/15 13:21:13 mirar Exp $"); + RCSID("$Id: xcf.c,v 1.38 2001/06/13 13:00:21 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:333:    res.str = (unsigned char *)read_data( data, res.len );    if(res.len > 0) res.len--; /* len includes ending \0 */    res.base_len = res.len;    if(!res.str)    Pike_error("String read failed\n");    return res;   }      static struct property read_property( struct buffer * data )   { -  int i; +     struct property res;    res.type = read_uint( data );    if(res.type == PROP_COLORMAP)    {    unsigned int foo;    read_uint(data); /* bogus 'len'... */    foo = read_uint( data );    res.data.len = foo*3;    res.data.base_offset = data->base_offset+(data->base_len-data->len);    res.data.base_len = res.data.len;
pike.git/src/modules/Image/encodings/xcf.c:559:    return res;   }      static struct layer_mask read_layer_mask( struct buffer *buff,    struct buffer *initial )   {    struct layer_mask res;    ONERROR err;    int offset;    struct property tmp; -  struct buffer ob; +        MEMSET(&res, 0, sizeof(res));    res.width = read_uint( buff );    res.height = read_uint( buff );    res.name = read_string( buff );       SET_ONERROR( err, free_layer_mask, &res );    do    {    tmp = read_property( buff );
pike.git/src/modules/Image/encodings/xcf.c:597:    return res;   }      static struct channel read_channel( struct buffer *buff,    struct buffer *initial )   {    struct channel res;    ONERROR err;    int offset;    struct property tmp; -  struct buffer ob; +        MEMSET(&res, 0, sizeof(res));    res.width = read_uint( buff );    res.height = read_uint( buff );    res.name = read_string( buff );       SET_ONERROR( err, free_channel, &res );    do    {    tmp = read_property( buff );
pike.git/src/modules/Image/encodings/xcf.c:773:   static void push_properties( struct property *p )   {    struct svalue *osp = sp;    while(p)    {    ref_push_string( s_type ); push_int( p->type );    ref_push_string( s_data ); push_buffer( &p->data );    f_aggregate_mapping( 4 );    p = p->next;    } -  f_aggregate(DO_NOT_WARN(sp - osp)); +  f_aggregate(DO_NOT_WARN((INT32)(sp - osp)));   }      static void push_tile( struct tile *t )   {    push_buffer( &t->data );   }      static void push_hierarchy( struct hierarchy * h )   {    struct tile *t = h->level.first_tile;
pike.git/src/modules/Image/encodings/xcf.c:800:    ref_push_string( s_height ); push_int( h->height );    ref_push_string( s_bpp ); push_int( h->bpp );       ref_push_string( s_tiles );    tsp = sp;    while(t)    {    push_tile( t );    t=t->next;    } -  f_aggregate(DO_NOT_WARN(sp - tsp)); -  f_aggregate_mapping(DO_NOT_WARN(sp - osp)); +  f_aggregate(DO_NOT_WARN((INT32)(sp - tsp))); +  f_aggregate_mapping(DO_NOT_WARN((INT32)(sp - osp)));   }      static void push_layer_mask(struct layer_mask *i)   {    struct svalue *osp = sp;    ref_push_string( s_width ); push_int( i->width );    ref_push_string( s_height ); push_int( i->height );    ref_push_string( s_properties );    push_properties( i->first_property );    ref_push_string( s_name ); push_buffer( &i->name );    ref_push_string( s_image_data );    push_hierarchy( &i->image_data ); -  f_aggregate_mapping(DO_NOT_WARN(sp-osp)); +  f_aggregate_mapping(DO_NOT_WARN((INT32)(sp-osp)));   }      static void push_channel(struct channel *i)   {    struct svalue *osp = sp;    ref_push_string( s_width ); push_int( i->width );    ref_push_string( s_height ); push_int( i->height );    ref_push_string( s_properties );    push_properties( i->first_property );    ref_push_string( s_name ); push_buffer( &i->name );    ref_push_string( s_image_data );    push_hierarchy( &i->image_data ); -  f_aggregate_mapping(DO_NOT_WARN(sp-osp)); +  f_aggregate_mapping(DO_NOT_WARN((INT32)(sp-osp)));   }      static void push_layer(struct layer *i)   {    struct svalue *osp = sp;    ref_push_string( s_width ); push_int( i->width );    ref_push_string( s_height ); push_int( i->height );    ref_push_string( s_type ); push_int( i->type );    ref_push_string( s_properties );    push_properties( i->first_property );    ref_push_string( s_name ); push_buffer( &i->name );    ref_push_string( s_image_data );    push_hierarchy( &i->image_data );    if( i->mask )    {    ref_push_string( s_mask );    push_layer_mask( i->mask );    } -  f_aggregate_mapping(DO_NOT_WARN(sp - osp)); +  f_aggregate_mapping(DO_NOT_WARN((INT32)(sp - osp)));   }         static void push_image( struct gimp_image *i )   {    struct layer *l;    struct channel *c;    int nitems = 0;    struct svalue *osp = sp;    ref_push_string( s_width ); push_int( i->width );
pike.git/src/modules/Image/encodings/xcf.c:881:    ref_push_string( s_channels );    nitems=0;    c = i->first_channel;    while(c)    {    nitems++;    push_channel( c );    c = c->next;    }    f_aggregate( nitems ); -  f_aggregate_mapping(DO_NOT_WARN(sp-osp)); +  f_aggregate_mapping(DO_NOT_WARN((INT32)(sp-osp)));   }         static void image_xcf____decode( INT32 args )   {    struct pike_string *s;    struct buffer b;    struct gimp_image res;    ONERROR err;    get_all_args( "___decode", args, "%S", &s );