Very common errors go here */
| 145 | |
| 146 | /* Very common errors go here */ |
| 147 | int |
| 148 | SDL_Error(SDL_errorcode code) |
| 149 | { |
| 150 | switch (code) { |
| 151 | case SDL_ENOMEM: |
| 152 | return SDL_SetError("Out of memory"); |
| 153 | case SDL_EFREAD: |
| 154 | return SDL_SetError("Error reading from datastream"); |
| 155 | case SDL_EFWRITE: |
| 156 | return SDL_SetError("Error writing to datastream"); |
| 157 | case SDL_EFSEEK: |
| 158 | return SDL_SetError("Error seeking in datastream"); |
| 159 | case SDL_UNSUPPORTED: |
| 160 | return SDL_SetError("That operation is not supported"); |
| 161 | default: |
| 162 | return SDL_SetError("Unknown SDL error"); |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | #ifdef TEST_ERROR |
| 167 | int |