(svn r23198) -Codechange: introduce a free that takes const pointers so we don't need to cast to void/non-const before being able to free

This commit is contained in:
rubidium
2011-11-12 13:00:29 +00:00
parent aadbb9ed3f
commit 33d71b45fe
21 changed files with 78 additions and 60 deletions

View File

@@ -437,6 +437,15 @@ void NORETURN CDECL error(const char *str, ...) WARN_FORMAT(1, 2);
#define MAX_PATH 260
#endif
/**
* Version of the standard free that accepts const pointers.
* @param ptr The data to free.
*/
static FORCEINLINE void free(const void *ptr)
{
free(const_cast<void *>(ptr));
}
/**
* The largest value that can be entered in a variable
* @param type the type of the variable