Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[rt #69243] use SysRet for i_addcolors() return value

  • Loading branch information...
commit 42505e61643a55c437a8cd43e8753129dd9f37ae 1 parent 75cebca
@tonycoz authored
Showing with 3 additions and 13 deletions.
  1. +3 −13 Imager.xs
View
16 Imager.xs
@@ -930,6 +930,7 @@ static im_pl_ext_funcs im_perl_funcs =
#define IIM_new i_img_8_new
#define IIM_DESTROY i_img_destroy
+typedef int SysRet;
#ifdef IMEXIF_ENABLE
#define i_exif_enabled() 1
@@ -3103,11 +3104,10 @@ i_ppal_p(im, l, y, data)
OUTPUT:
RETVAL
-SV *
+SysRet
i_addcolors(im, ...)
Imager::ImgRaw im
PREINIT:
- int index;
i_color *colors;
int i;
CODE:
@@ -3125,17 +3125,7 @@ i_addcolors(im, ...)
croak("i_addcolor: pixels must be Imager::Color objects");
}
}
- index = i_addcolors(im, colors, items-1);
- myfree(colors);
- if (index == 0) {
- RETVAL = newSVpv("0 but true", 0);
- }
- else if (index == -1) {
- RETVAL = &PL_sv_undef;
- }
- else {
- RETVAL = newSViv(index);
- }
+ RETVAL = i_addcolors(im, colors, items-1);
OUTPUT:
RETVAL
Please sign in to comment.
Something went wrong with that request. Please try again.