mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 01:16:26 +00:00
Change return type from void to int, for functions that set an error
(SDL_SetError(), SDL_OutOfMemory(), SDL_Unsupported(), SDL_InvalidParam()) Update prototype to forward errors to generic layer, for the functions: MoveCursor, WarpMouse, GL_DeleteContext, GetDisplayModes. Check invalid parameter in SDL_SetTextInputRect() generic layer.
This commit is contained in:
@@ -1256,13 +1256,13 @@ SDL_CreateSystemCursor(SDL_SystemCursor id)
|
||||
if this is desired for any reason. This is used when setting
|
||||
the video mode and when the SDL window gains the mouse focus.
|
||||
*/
|
||||
void SDL_SetCursor(SDL_Cursor *cursor)
|
||||
int SDL_SetCursor(SDL_Cursor *cursor)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
/* Return immediately if setting the cursor to the currently set one (fixes #7151) */
|
||||
if (cursor == mouse->cur_cursor) {
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Set the new cursor */
|
||||
@@ -1276,8 +1276,7 @@ void SDL_SetCursor(SDL_Cursor *cursor)
|
||||
}
|
||||
}
|
||||
if (found == NULL) {
|
||||
SDL_SetError("Cursor not associated with the current mouse");
|
||||
return;
|
||||
return SDL_SetError("Cursor not associated with the current mouse");
|
||||
}
|
||||
}
|
||||
mouse->cur_cursor = cursor;
|
||||
@@ -1298,6 +1297,7 @@ void SDL_SetCursor(SDL_Cursor *cursor)
|
||||
mouse->ShowCursor(NULL);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_Cursor *
|
||||
|
Reference in New Issue
Block a user