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

version» Context lines:

pike.git/src/modules/Image/encodings/xcf.c:94:   }      static void f_substring__sprintf( INT32 args )   {    int x;    struct substring *s = SS(fp->current_object);       if (args != 2 )    SIMPLE_TOO_FEW_ARGS_ERROR("_sprintf",2);    if (TYPEOF(sp[-2]) != T_INT) -  SIMPLE_BAD_ARG_ERROR("_sprintf",0,"integer"); +  SIMPLE_BAD_ARG_ERROR("_sprintf",0,"int");    if (TYPEOF(sp[-1]) != T_MAPPING)    SIMPLE_BAD_ARG_ERROR("_sprintf",1,"mapping");    x = sp[-2].u.integer;    pop_n_elems( args );       switch( x )    {    case 't':    push_text("SubString");    return;
pike.git/src/modules/Image/encodings/xcf.c:506:   }      static struct level read_level( struct buffer *buff,    struct buffer *initial )   {    struct level res;    ONERROR err;    int offset;    struct tile *last_tile = NULL;   /* int all_tiles_eq = 0; */ -  MEMSET(&res, 0, sizeof(res)); +  memset(&res, 0, sizeof(res));    res.width = read_uint( buff );    res.height = read_uint( buff );       SET_ONERROR( err, free_level, &res );    offset = read_uint( buff );    while(offset)    {    struct buffer ob = *initial;    int offset2 = read_uint( buff );    struct tile *tile = xalloc(sizeof(struct tile));
pike.git/src/modules/Image/encodings/xcf.c:538:    return res;   }      static struct hierarchy read_hierarchy( struct buffer *buff,    struct buffer *initial )   {    struct hierarchy res;    unsigned int offset;    struct buffer ob;    -  MEMSET(&res, 0, sizeof(res)); +  memset(&res, 0, sizeof(res));    res.width = read_uint( buff );    res.height = read_uint( buff );    res.bpp = read_uint( buff );    offset = read_uint( buff );    ob = *initial;    read_data( &ob, offset );    res.level = read_level( &ob, initial );    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;    -  MEMSET(&res, 0, sizeof(res)); +  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 );    if(tmp.type)    {
pike.git/src/modules/Image/encodings/xcf.c:594:   }      static struct channel read_channel( struct buffer *buff,    struct buffer *initial )   {    struct channel res;    ONERROR err;    int offset;    struct property tmp;    -  MEMSET(&res, 0, sizeof(res)); +  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 );    if(tmp.type)    {
pike.git/src/modules/Image/encodings/xcf.c:631:   }      static struct layer read_layer( struct buffer *buff, struct buffer *initial )   {    struct layer res;    struct property tmp;    int lm_offset;    int h_offset;    ONERROR err;    -  MEMSET(&res, 0, sizeof(res)); +  memset(&res, 0, sizeof(res));    SET_ONERROR( err, free_layer, &res );    res.width = read_uint( buff );    res.height = read_uint( buff );    res.type = xcf_read_int( buff );    res.name = read_string( buff );          do    {    tmp = read_property( buff );
pike.git/src/modules/Image/encodings/xcf.c:660:       h_offset = xcf_read_int( buff );    lm_offset = xcf_read_int( buff );       if(lm_offset)    {    struct buffer loffset = *initial;    struct layer_mask *m=xalloc(sizeof(struct layer_mask));    res.mask = m;    read_data( &loffset, lm_offset ); -  MEMSET(m, 0, sizeof( struct layer_mask )); +  memset(m, 0, sizeof( struct layer_mask ));    *m = read_layer_mask( &loffset, initial );    }       if(h_offset)    {    struct buffer loffset = *initial;    read_data( &loffset, h_offset );    res.image_data = read_hierarchy( &loffset, initial );    }   
pike.git/src/modules/Image/encodings/xcf.c:684:         static struct gimp_image read_image( struct buffer * data )   {    struct gimp_image res;    struct property tmp;    struct buffer initial;    unsigned int offset;    ONERROR err;    -  MEMSET(&res, 0, sizeof(res)); +  memset(&res, 0, sizeof(res));    initial = *data;    if(data->len < 34)    Pike_error("This is not an xcf file (to little data)\n");    if(!(data->str[0] == 'g' &&    data->str[1] == 'i' &&    data->str[2] == 'm' &&    data->str[3] == 'p' &&    data->str[4] == ' '))    {    if(strlen((char *)data->str) == 13)
pike.git/src/modules/Image/encodings/xcf.c:1489:    add_integer_constant( "GRAYA_GIMAGE", GRAYA_GIMAGE, 0 );    add_integer_constant( "INDEXED_GIMAGE", INDEXED_GIMAGE, 0 );    add_integer_constant( "INDEXEDA_GIMAGE", INDEXEDA_GIMAGE, 0 );      #define STRING(X) s_##X = make_shared_binary_string(#X,sizeof( #X )-sizeof(""))   #include "xcf_constant_strings.h"   #undef STRING       start_new_program();    ADD_STORAGE( struct substring ); -  ADD_FUNCTION("cast", f_substring_cast, tFunc(tStr,tMix), ID_PRIVATE); +  ADD_FUNCTION("cast", f_substring_cast, tFunc(tStr,tStr), ID_PRIVATE);    ADD_FUNCTION("`[]", f_substring_index, tFunc(tInt,tInt), 0);    ADD_FUNCTION("get_short", f_substring_get_short, tFunc(tInt,tInt), 0 );    ADD_FUNCTION("get_ushort", f_substring_get_ushort, tFunc(tInt,tInt), 0 );    ADD_FUNCTION("get_int", f_substring_get_int, tFunc(tInt,tInt), 0 );    ADD_FUNCTION("get_uint", f_substring_get_uint, tFunc(tInt,tInt), 0 );    ADD_FUNCTION("_sprintf",f_substring__sprintf, tFunc(tInt tMapping,tMix), 0);      /* set_init_callback(init_substring); */    set_exit_callback(free_substring);    substring_program = end_program();   }         void exit_image_xcf(void)   {   #define STRING(X) free_string(s_##X)   #include "xcf_constant_strings.h"   #undef STRING    free_program( substring_program );   }