mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-11-22 09:56:22 +01:00
public: move va() function back to engine, it's not recommended to use in shared modules
This commit is contained in:
parent
bcbd1a59c6
commit
fb6e310eab
@ -151,6 +151,30 @@ int GAME_EXPORT COM_RandomLong( int lLow, int lHigh )
|
||||
return lLow + (n % x);
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
va
|
||||
|
||||
does a varargs printf into a temp buffer,
|
||||
so I don't need to have varargs versions
|
||||
of all text functions.
|
||||
============
|
||||
*/
|
||||
char *va( const char *format, ... )
|
||||
{
|
||||
va_list argptr;
|
||||
static char string[16][MAX_VA_STRING], *s;
|
||||
static int stringindex = 0;
|
||||
|
||||
s = string[stringindex];
|
||||
stringindex = (stringindex + 1) & 15;
|
||||
va_start( argptr, format );
|
||||
Q_vsnprintf( s, sizeof( string[0] ), format, argptr );
|
||||
va_end( argptr );
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
|
||||
|
@ -844,6 +844,7 @@ void COM_NormalizeAngles( vec3_t angles );
|
||||
int COM_FileSize( const char *filename );
|
||||
void COM_FreeFile( void *buffer );
|
||||
int COM_CompareFileTime( const char *filename1, const char *filename2, int *iCompare );
|
||||
char *va( const char *format, ... ) _format( 1 );
|
||||
|
||||
// soundlib shared exports
|
||||
qboolean S_Init( void );
|
||||
|
@ -619,30 +619,6 @@ char *Q_pretifymem( float value, int digitsafterdecimal )
|
||||
return out;
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
va
|
||||
|
||||
does a varargs printf into a temp buffer,
|
||||
so I don't need to have varargs versions
|
||||
of all text functions.
|
||||
============
|
||||
*/
|
||||
char *va( const char *format, ... )
|
||||
{
|
||||
va_list argptr;
|
||||
static char string[16][MAX_VA_STRING], *s;
|
||||
static int stringindex = 0;
|
||||
|
||||
s = string[stringindex];
|
||||
stringindex = (stringindex + 1) & 15;
|
||||
va_start( argptr, format );
|
||||
Q_vsnprintf( s, sizeof( string[0] ), format, argptr );
|
||||
va_end( argptr );
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
COM_FileBase
|
||||
|
@ -90,7 +90,6 @@ int Q_sprintf( char *buffer, const char *format, ... ) _format( 2 );
|
||||
void COM_StripColors( const char *in, char *out );
|
||||
#define Q_memprint( val ) Q_pretifymem( val, 2 )
|
||||
char *Q_pretifymem( float value, int digitsafterdecimal );
|
||||
char *va( const char *format, ... ) _format( 1 );
|
||||
void COM_FileBase( const char *in, char *out );
|
||||
const char *COM_FileExtension( const char *in );
|
||||
void COM_DefaultExtension( char *path, const char *extension );
|
||||
|
Loading…
Reference in New Issue
Block a user