pike.git / src / modules / Image / layers.c

version» Context lines:

pike.git/src/modules/Image/layers.c:727:    THIS->alp=NULL;       if (args>=1) {    if ( TYPEOF(Pike_sp[-args]) != T_OBJECT )    {    if (TYPEOF(Pike_sp[-args]) != T_INT ||    Pike_sp[-args].u.integer!=0)    SIMPLE_BAD_ARG_ERROR("Image.Layer->set_image",1,    "object(Image)|int(0)");    } -  else if ((img=(struct image*) -  get_storage(Pike_sp[-args].u.object,image_program))) +  else if ((img=get_storage(Pike_sp[-args].u.object,image_program)))    {    THIS->image=Pike_sp[-args].u.object;    add_ref(THIS->image);    THIS->img=img;    THIS->xsize=img->xsize;    THIS->ysize=img->ysize;    }    else    SIMPLE_BAD_ARG_ERROR("Image.Layer->set_image",1,    "object(Image)|int(0)");    }       if (args>=2) {    if ( TYPEOF(Pike_sp[1-args]) != T_OBJECT )    {    if (TYPEOF(Pike_sp[1-args]) != T_INT ||    Pike_sp[1-args].u.integer!=0)    SIMPLE_BAD_ARG_ERROR("Image.Layer->set_image",2,    "object(Image)|int(0)");    } -  else if ((img=(struct image*) -  get_storage(Pike_sp[1-args].u.object,image_program))) +  else if ((img=get_storage(Pike_sp[1-args].u.object,image_program)))    {    if (THIS->img &&    (img->xsize!=THIS->xsize ||    img->ysize!=THIS->ysize))    SIMPLE_BAD_ARG_ERROR("Image.Layer->set_image",2,    "image of same size");    if (!THIS->img)    {    THIS->xsize=img->xsize;    THIS->ysize=img->ysize;
pike.git/src/modules/Image/layers.c:2932:    }       l=(struct layer**)xalloc(sizeof(struct layer *)*layers);       SET_ONERROR(err, free, l);       for (i=j=0; i<layers; i++)    {    if (TYPEOF(a->item[i]) == T_OBJECT)    { -  if (!(l[j]=(struct layer*)get_storage(a->item[i].u.object, +  if (!(l[j]=get_storage(a->item[i].u.object,    image_layer_program)))    SIMPLE_BAD_ARG_ERROR("Image.lay",1,    "array(Image.Layer|mapping)");    }    else if (TYPEOF(a->item[i]) == T_MAPPING)    {    push_svalue(a->item+i);    push_object(o=clone_object(image_layer_program,1));    args++; -  l[j]=(struct layer*)get_storage(o,image_layer_program); +  l[j]=get_storage(o,image_layer_program);    }    else    SIMPLE_BAD_ARG_ERROR("Image.lay",1,    "array(Image.Layer|mapping)");    if (l[j]->xsize && l[j]->ysize)    j++;    }       if (!(layers = j)) /* dummy return empty layer */    {
pike.git/src/modules/Image/layers.c:2998:    if (l[i]->ysize+l[i]->yoffs-yoffset>ysize)    ysize=l[i]->ysize+l[i]->yoffs-yoffset;    }    }       /* get destination layer */    push_int(xsize);    push_int(ysize);    push_object(o=clone_object(image_layer_program,2));    -  dest=(struct layer*)get_storage(o,image_layer_program); +  dest=get_storage(o,image_layer_program);    dest->xoffs=xoffset;    dest->yoffs=yoffset;       /* ok, do it! */    img_lay(l,layers,dest);       CALL_AND_UNSET_ONERROR(err);       Pike_sp--;    pop_n_elems(args);    push_object(o);   }      /** image-object operations *************************/      static INLINE struct layer *push_new_layer(void)   {    push_object(clone_object(image_layer_program,0)); -  return (struct layer*)get_storage(Pike_sp[-1].u.object,image_layer_program); +  return get_storage(Pike_sp[-1].u.object,image_layer_program);   }      static INLINE struct layer *clone_this_layer(void)   {    struct layer *l;    l=push_new_layer();    l->xsize=THIS->xsize;    l->ysize=THIS->ysize;    l->xoffs=THIS->xoffs;    l->yoffs=THIS->yoffs;
pike.git/src/modules/Image/layers.c:3111:    f_index(2);    push_int(xi);    push_int(yi);    push_int(xz+xi-1);    push_int(yz+yi-1);    push_int(THIS->fill.r);    push_int(THIS->fill.g);    push_int(THIS->fill.b);    f_call_function(8);    if (TYPEOF(Pike_sp[-1]) != T_OBJECT || -  !(img=(struct image*)get_storage(Pike_sp[-1].u.object,image_program))) +  !(img=get_storage(Pike_sp[-1].u.object,image_program)))    Pike_error("No image returned from image->copy\n");    if (img->xsize!=xz || img->ysize!=yz)    Pike_error("Image returned from image->copy had "    "unexpected size (%"PRINTPIKEINT"d,%"PRINTPIKEINT"d,"    " expected %"PRINTPIKEINT"d,%"PRINTPIKEINT"d)\n",    img->xsize,img->ysize,xz,yz);       free_object(l->image);    l->image=Pike_sp[-1].u.object;    Pike_sp--;
pike.git/src/modules/Image/layers.c:3140:    f_index(2);    push_int(xi);    push_int(yi);    push_int(xz+xi-1);    push_int(yz+yi-1);    push_int(THIS->fill_alpha.r);    push_int(THIS->fill_alpha.g);    push_int(THIS->fill_alpha.b);    f_call_function(8);    if (TYPEOF(Pike_sp[-1]) != T_OBJECT || -  !(img=(struct image*)get_storage(Pike_sp[-1].u.object,image_program))) +  !(img=get_storage(Pike_sp[-1].u.object,image_program)))    Pike_error("No image returned from alpha->copy\n");    if (img->xsize!=xz || img->ysize!=yz)    Pike_error("Image returned from alpha->copy had "    "unexpected size (%"PRINTPIKEINT"d,%"PRINTPIKEINT"d, "    "expected %"PRINTPIKEINT"d,%"PRINTPIKEINT"d)\n",    img->xsize,img->ysize,xz,yz);    free_object(l->alpha);    l->alpha=Pike_sp[-1].u.object;    Pike_sp--;    dmalloc_touch_svalue(Pike_sp);