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 <marek.olsak@amd.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
This commit is contained in:
+1
-23
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user