mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 06:58:30 +00:00
Removed mostly unused SDL_errorcode
This commit is contained in:
@@ -59,7 +59,6 @@ int SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Available for backwards compatibility */
|
||||
const char *SDL_GetError(void)
|
||||
{
|
||||
const SDL_error *error = SDL_GetErrBuf(SDL_FALSE);
|
||||
@@ -88,22 +87,13 @@ int SDL_ClearError(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Very common errors go here */
|
||||
int SDL_Error(SDL_errorcode code)
|
||||
int SDL_OutOfMemory(void)
|
||||
{
|
||||
switch (code) {
|
||||
case SDL_ENOMEM:
|
||||
SDL_GetErrBuf(SDL_TRUE)->error = SDL_ErrorCodeOutOfMemory;
|
||||
return -1;
|
||||
case SDL_EFREAD:
|
||||
return SDL_SetError("Error reading from datastream");
|
||||
case SDL_EFWRITE:
|
||||
return SDL_SetError("Error writing to datastream");
|
||||
case SDL_EFSEEK:
|
||||
return SDL_SetError("Error seeking in datastream");
|
||||
case SDL_UNSUPPORTED:
|
||||
return SDL_SetError("That operation is not supported");
|
||||
default:
|
||||
return SDL_SetError("Unknown SDL error");
|
||||
SDL_error *error = SDL_GetErrBuf(SDL_TRUE);
|
||||
|
||||
if (error) {
|
||||
error->error = SDL_ErrorCodeOutOfMemory;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user