diff options
author | Dylan Baker <[email protected]> | 2019-12-09 10:54:16 -0800 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2020-04-21 11:09:03 -0700 |
commit | bf188f3494b85f550a39dddbf059669c2a9ee324 (patch) | |
tree | ced53e90730a93cef0200b2b974d25ba09a604b5 /src/util | |
parent | c495c3af26b73cb1d444fdd67cc6c1f0226bd168 (diff) |
mesa|mapi: replace _mesa_[v]snprintf with [v]snprintf
MSVC 2015 and newer has perfectly valid snprintf and vsnprintf
implementations, let's just use those.
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Kristian H. Kristensen <[email protected]>
Reviewed-by: Matt Turner <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/imports.c | 24 | ||||
-rw-r--r-- | src/util/imports.h | 24 |
2 files changed, 1 insertions, 47 deletions
diff --git a/src/util/imports.c b/src/util/imports.c index 2744ee988d3..776e86efb7a 100644 --- a/src/util/imports.c +++ b/src/util/imports.c @@ -1,7 +1,7 @@ /** * \file imports.c * Standard C library function wrappers. - * + * * Imports are services which the device driver or window system or * operating system provides to the core renderer. The core renderer (Mesa) * will call these functions in order to do memory allocation, simple I/O, @@ -60,25 +60,3 @@ #elif defined(__IBMC__) || defined(__IBMCPP__) extern int vsnprintf(char *str, size_t count, const char *fmt, va_list arg); #endif - - -/** Needed due to #ifdef's, above. */ -int -_mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list args) -{ - return vsnprintf( str, size, fmt, args); -} - -/** Wrapper around vsnprintf() */ -int -_mesa_snprintf( char *str, size_t size, const char *fmt, ... ) -{ - int r; - va_list args; - va_start( args, fmt ); - r = vsnprintf( str, size, fmt, args ); - va_end( args ); - return r; -} - - diff --git a/src/util/imports.h b/src/util/imports.h index 4d7405dbf55..345e9114aa3 100644 --- a/src/util/imports.h +++ b/src/util/imports.h @@ -47,15 +47,6 @@ extern "C" { #endif -/* - * For GL_ARB_vertex_buffer_object we need to treat vertex array pointers - * as offsets into buffer stores. Since the vertex array pointer and - * buffer store pointer are both pointers and we need to add them, we use - * this macro. - * Both pointers/offsets are expressed in bytes. - */ -#define ADD_POINTERS(A, B) ( (uint8_t *) (A) + (uintptr_t) (B) ) - /** * Sometimes we treat floats as ints. On x86 systems, moving a float @@ -68,21 +59,6 @@ extern "C" { typedef union { float f; int i; unsigned u; } fi_type; - -/*@}*/ - - -/********************************************************************** - * Functions - */ - -extern int -_mesa_snprintf( char *str, size_t size, const char *fmt, ... ) PRINTFLIKE(3, 4); - -extern int -_mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list arg); - - #ifdef __cplusplus } #endif |