SDL 1.3: X11_CreateWindowFrom broken?

Hi

The X11_CreateWindowFrom() is defined in src/video/x11/SDL_x11window.c:

int X11_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
{
Window w = (Window) data;

window->title = X11_GetWindowTitle(_this, w);

if (SetupWindowData(_this, window, w, SDL_FALSE) < 0) {
    return -1;
}
return 0;

}

The “data” is pointer. Can the “data” be just assigned to Window w?

Unga

The “data” is pointer. Can the “data” be just assigned to Window w?

Yes. “void *” in this case may not be a pointer at all, it’s just there
to allow implementations to pass around a word of data.

(not to say that the value of “data” in this case is valid, but the
approach is okay.)

–ryan.