From: Kartik Thakore Date: Fri, 23 Oct 2009 19:39:16 +0000 (-0400) Subject: I think a part of my soul died when I had to cast a const foo * to a foo * :( X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=babb07ed9fd8bafa78e6e1b0e6b17ed69d60ea84;p=sdlgit%2FSDL_perl.git I think a part of my soul died when I had to cast a const foo * to a foo * :( --- diff --git a/src/Core/Video.xs b/src/Core/Video.xs index 3c964e7..b0f9d2b 100644 --- a/src/Core/Video.xs +++ b/src/Core/Video.xs @@ -35,21 +35,21 @@ video_get_video_info() PREINIT: char* CLASS = "SDL::VideoInfo"; CODE: - RETVAL = SDL_GetVideoInfo; + RETVAL = (SDL_VideoInfo *) SDL_GetVideoInfo(); OUTPUT: - RETVAL + RETVAL char * video_video_driver_name( maxlen ) int maxlen CODE: - char* buffer = safemalloc( sizeof(char) * maxlen); + char* buffer = safemalloc(sizeof(char) * maxlen); char* str = SvPV( newSVpvn( buffer , maxlen), maxlen ); - RETVAL = SDL_VideoDriverName( str , maxlen); - - sv_2mortal(buffer); + RETVAL = (char* )SDL_VideoDriverName( str , maxlen); + sv_2mortal(buffer); + sv_2mortal(str); OUTPUT: RETVAL