Permalink
Browse files

renamed surface in assert_surface

  • Loading branch information...
1 parent 1d178b5 commit 0016791fd1bad679185338966fa756163b2a3f46 @dod38fr dod38fr committed Oct 15, 2011
Showing with 6 additions and 5 deletions.
  1. +3 −2 src/SDLx/Surface.xs
  2. +3 −3 src/SDLx/Validate.h
View
5 src/SDLx/Surface.xs
@@ -239,8 +239,8 @@ surfacex_blit( src, dest, ... )
SV *src
SV *dest
CODE:
- src = surface(src);
- dest = surface(dest);
+ assert_surface(src);
+ assert_surface(dest);
SDL_Surface *_src = (SDL_Surface *)bag2obj(src);
SDL_Surface *_dest = (SDL_Surface *)bag2obj(dest);
@@ -249,6 +249,7 @@ surfacex_blit( src, dest, ... )
int newly_created_rect = 0;
SV* s_rect_sv, *d_rect_sv;
int mall_sr = 0; int mall_dr = 0;
+
if( items > 2 && SvOK(ST(2)) )
{
s_rect_sv = rect(ST(2), &newly_created_rect);
View
6 src/SDLx/Validate.h
@@ -53,16 +53,16 @@ SV *rect( SV *rect, int* new_rect_made)
return retval;
}
-SV *surface( SV *surface )
+void assert_surface( SV *surface )
{
if( sv_isobject(surface) && sv_derived_from(surface, "SDL::Surface"))
{
/* memory leak detected by Test::LeakTrace */
/* SvREFCNT_inc(surface); */
- return surface;
+ return ;
}
croak("Surface must be SDL::Surface or SDLx::Surface");
- return NULL;
+ /* does not return */
}
char *_color_format( SV *color )

0 comments on commit 0016791

Please sign in to comment.