Init'ing correction?

Hello all,
I’m working on a smarter initalization for a SDL program of mine, so I’m
making use of functions like SDL_GetVideoInfo() and SDL_VideoModeOK().
It runs fine, but I was wondering about a complier warning, and if
somebody could let me know what’s wrong.

gcc -W -Wall -ggdb sdl-config --cflags -c src/main.c
src/main.c: In function `main’:
src/main.c:25: warning: assignment discards qualifiers from pointer
target type

line 25: video_info = SDL_GetVideoInfo();

and before line 25: SDL_VideoInfo *video_info;

That produces a warning. And also, when I check for something to be
supported, like:

if (video_info->hw_available)
fprintf(stdout, " Hardware surfaces available.\n");
else
fprintf(stdout, " Hardware surfaces not available.\n");

I get not available because it’s X11 … right? lol

Could somebody clear up these confusions for me? :-)–
Chris Thielen
@Christopher_Thielen

gcc -W -Wall -ggdb sdl-config --cflags -c src/main.c
src/main.c: In function `main’:
src/main.c:25: warning: assignment discards qualifiers from pointer
target type

line 25: video_info = SDL_GetVideoInfo();

and before line 25: SDL_VideoInfo *video_info;

Change line 25 to be “const SDL_VideoInfo *video_info;”

The manpages are incorrect here; they neglect to mention the “const” part.

I get not available because it’s X11 … right? lol

Correct. No hardware surfaces with X11 (except when using DGA).

–ryan.