While you can actually write to the error buffer, conceptually it's read-only.
authorSam Lantinga <slouken@libsdl.org>
Sun, 29 Aug 2010 12:00:09 -0700
changeset 4867ba7492f9e2b8
parent 4866 f42e8db53f78
child 4868 d6adaafcfb10
While you can actually write to the error buffer, conceptually it's read-only.
include/SDL_error.h
src/SDL_error.c
     1.1 --- a/include/SDL_error.h	Sat Aug 28 22:56:52 2010 -0700
     1.2 +++ b/include/SDL_error.h	Sun Aug 29 12:00:09 2010 -0700
     1.3 @@ -41,7 +41,7 @@
     1.4  
     1.5  /* Public functions */
     1.6  extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
     1.7 -extern DECLSPEC char *SDLCALL SDL_GetError(void);
     1.8 +extern DECLSPEC const char *SDLCALL SDL_GetError(void);
     1.9  extern DECLSPEC void SDLCALL SDL_ClearError(void);
    1.10  
    1.11  /**
     2.1 --- a/src/SDL_error.c	Sat Aug 28 22:56:52 2010 -0700
     2.2 +++ b/src/SDL_error.c	Sun Aug 29 12:00:09 2010 -0700
     2.3 @@ -198,12 +198,12 @@
     2.4  }
     2.5  
     2.6  /* Available for backwards compatibility */
     2.7 -char *
     2.8 +const char *
     2.9  SDL_GetError(void)
    2.10  {
    2.11      static char errmsg[SDL_ERRBUFIZE];
    2.12  
    2.13 -    return ((char *) SDL_GetErrorMsg(errmsg, SDL_ERRBUFIZE));
    2.14 +    return SDL_GetErrorMsg(errmsg, SDL_ERRBUFIZE);
    2.15  }
    2.16  
    2.17  void