mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-14 05:46:00 +00:00
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:

committed by
Sam Lantinga

parent
b305d9e3c0
commit
3bd737d44c
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user