Add error returns to void functions that can fail/set errors.

This takes care of the last set of void functions that could
potentially be shifted to instead return an int indicating success and
setting an error in case of an error.
This commit is contained in:
Linus Probert
2023-02-08 20:43:52 +01:00
committed by Sam Lantinga
parent b305d9e3c0
commit 3bd737d44c
13 changed files with 53 additions and 27 deletions

View File

@@ -615,11 +615,16 @@ SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect)
return SDL_GetRectIntersection(rect, &full_rect, &surface->clip_rect);
}
void SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect)
int SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect)
{
if (surface && rect) {
*rect = surface->clip_rect;
if (!surface) {
return SDL_InvalidParamError("surface");
}
if (!rect) {
return SDL_InvalidParamError("rect");
}
*rect = surface->clip_rect;
return 0;
}
/*