Permalink
Browse files

[rt #69243] greatly simplify XS for i_gpixf()

  • Loading branch information...
tonycoz committed May 24, 2013
1 parent 5736f58 commit 73d80423249a58de4924523adb881070c7e4d300
Showing with 5 additions and 11 deletions.
  1. +5 −11 Imager.xs
View
@@ -3525,22 +3525,16 @@ i_plinf(im, l, y, ...)
OUTPUT:
RETVAL
-SV *
+Imager::Color::Float
i_gpixf(im, x, y)
Imager::ImgRaw im
i_img_dim x
i_img_dim y;
- PREINIT:
- i_fcolor *color;
CODE:
- color = (i_fcolor *)mymalloc(sizeof(i_fcolor));
- if (i_gpixf(im, x, y, color) == 0) {
- RETVAL = NEWSV(0,0);
- sv_setref_pv(RETVAL, "Imager::Color::Float", (void *)color);
- }
- else {
- myfree(color);
- RETVAL = &PL_sv_undef;
+ RETVAL = (i_fcolor *)mymalloc(sizeof(i_fcolor));
+ if (i_gpixf(im, x, y, RETVAL) != 0) {
+ myfree(RETVAL);
+ XSRETURN_UNDEF;
}
OUTPUT:
RETVAL

0 comments on commit 73d8042

Please sign in to comment.