From: Kartik Thakore Date: Fri, 23 Oct 2009 19:17:13 +0000 (-0400) Subject: This work but I warnings of incompatible pointer to sv_2mortal X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8a2411d0d946d83256c0b781d09ec76eae19275a;p=sdlgit%2FSDL_perl.git This work but I warnings of incompatible pointer to sv_2mortal --- diff --git a/src/Core/Video.xs b/src/Core/Video.xs index 289d749..3c964e7 100644 --- a/src/Core/Video.xs +++ b/src/Core/Video.xs @@ -36,5 +36,20 @@ video_get_video_info() char* CLASS = "SDL::VideoInfo"; CODE: RETVAL = SDL_GetVideoInfo; - OUTPUT: + + OUTPUT: RETVAL + +char * +video_video_driver_name( maxlen ) + int maxlen + CODE: + char* buffer = safemalloc( sizeof(char) * maxlen); + char* str = SvPV( newSVpvn( buffer , maxlen), maxlen ); + + RETVAL = SDL_VideoDriverName( str , maxlen); + + sv_2mortal(buffer); + + OUTPUT: + RETVAL diff --git a/t/core_video.t b/t/core_video.t index 52b4d0b..a0e45c2 100644 --- a/t/core_video.t +++ b/t/core_video.t @@ -12,6 +12,7 @@ use_ok( 'SDL::Video' ); can_ok ('SDL::Video', qw/ get_video_surface get_video_info + video_driver_name /); #testing get_video_surface @@ -24,7 +25,6 @@ isa_ok(SDL::Video::get_video_surface(), 'SDL::Surface', 'Checking if we get a su isa_ok(SDL::Video::get_video_info(), 'SDL::VideoInfo', 'Checking if we get videoinfo ref back'); =skip - video_driver_name list_modes video_mode_ok set_video_mode