mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
public: minor refactoring, mark some more functions as returns_nonnull
This commit is contained in:
@@ -175,27 +175,27 @@ typedef int qboolean;
|
|||||||
#endif // !defined( PFN_RETURNS_NONNULL )
|
#endif // !defined( PFN_RETURNS_NONNULL )
|
||||||
|
|
||||||
#if !defined( NORETURN )
|
#if !defined( NORETURN )
|
||||||
#define NORETURN
|
#define NORETURN
|
||||||
#endif // !defined( NORETURN )
|
#endif // !defined( NORETURN )
|
||||||
|
|
||||||
#if !defined( NONNULL )
|
#if !defined( NONNULL )
|
||||||
#define NONNULL
|
#define NONNULL
|
||||||
#endif // !defined( NONNULL )
|
#endif // !defined( NONNULL )
|
||||||
|
|
||||||
#if !defined( FORMAT_CHECK )
|
#if !defined( FORMAT_CHECK )
|
||||||
#define FORMAT_CHECK( x )
|
#define FORMAT_CHECK( x )
|
||||||
#endif // !defined( FORMAT_CHECK )
|
#endif // !defined( FORMAT_CHECK )
|
||||||
|
|
||||||
#if !defined( ALLOC_CHECK )
|
#if !defined( ALLOC_CHECK )
|
||||||
#define ALLOC_CHECK( x )
|
#define ALLOC_CHECK( x )
|
||||||
#endif // !defined( ALLOC_CHECK )
|
#endif // !defined( ALLOC_CHECK )
|
||||||
|
|
||||||
#if !defined( WARN_UNUSED_RESULT )
|
#if !defined( WARN_UNUSED_RESULT )
|
||||||
#define WARN_UNUSED_RESULT
|
#define WARN_UNUSED_RESULT
|
||||||
#endif // !defined( WARN_UNUSED_RESULT )
|
#endif // !defined( WARN_UNUSED_RESULT )
|
||||||
|
|
||||||
#if !defined( RENAME_SYMBOL )
|
#if !defined( RENAME_SYMBOL )
|
||||||
#define RENAME_SYMBOL( x )
|
#define RENAME_SYMBOL( x )
|
||||||
#endif // !defined( RENAME_SYMBOL )
|
#endif // !defined( RENAME_SYMBOL )
|
||||||
|
|
||||||
#if !defined( unlikely ) || !defined( likely )
|
#if !defined( unlikely ) || !defined( likely )
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "crclib.h"
|
|
||||||
#include "crtlib.h"
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include "crclib.h"
|
||||||
|
#include "crtlib.h"
|
||||||
|
|
||||||
#define NUM_BYTES 256
|
#define NUM_BYTES 256
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,6 @@ static inline void MD5Init( MD5Context_t *ctx )
|
|||||||
void MD5Update( MD5Context_t *ctx, const byte *buf, uint len );
|
void MD5Update( MD5Context_t *ctx, const byte *buf, uint len );
|
||||||
void MD5Final( byte digest[16], MD5Context_t *ctx );
|
void MD5Final( byte digest[16], MD5Context_t *ctx );
|
||||||
uint COM_HashKey( const char *string, uint hashSize );
|
uint COM_HashKey( const char *string, uint hashSize );
|
||||||
char *MD5_Print( byte hash[16] );
|
char *MD5_Print( byte hash[16] ) RETURNS_NONNULL;
|
||||||
|
|
||||||
#endif // CRCLIB_H
|
#endif // CRCLIB_H
|
||||||
|
|||||||
@@ -288,7 +288,7 @@ void Q_memor( byte *XASH_RESTRICT dst, const byte *XASH_RESTRICT src, size_t len
|
|||||||
dst[i] |= src[i];
|
dst[i] |= src[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* Q_timestamp( int format )
|
const char *Q_timestamp( int format )
|
||||||
{
|
{
|
||||||
static string timestamp;
|
static string timestamp;
|
||||||
time_t crt_time;
|
time_t crt_time;
|
||||||
|
|||||||
@@ -111,13 +111,13 @@ int Q_snprintf( char *buffer, size_t buffersize, const char *format, ... ) FORMA
|
|||||||
#define Q_strpbrk strpbrk
|
#define Q_strpbrk strpbrk
|
||||||
void COM_StripColors( const char *in, char *out );
|
void COM_StripColors( const char *in, char *out );
|
||||||
#define Q_memprint( val ) Q_pretifymem( val, 2 )
|
#define Q_memprint( val ) Q_pretifymem( val, 2 )
|
||||||
char *Q_pretifymem( float value, int digitsafterdecimal );
|
char *Q_pretifymem( float value, int digitsafterdecimal ) RETURNS_NONNULL;
|
||||||
void COM_FileBase( const char *in, char *out, size_t size );
|
void COM_FileBase( const char *in, char *out, size_t size );
|
||||||
const char *COM_FileExtension( const char *in ) RETURNS_NONNULL;
|
const char *COM_FileExtension( const char *in ) RETURNS_NONNULL;
|
||||||
void COM_DefaultExtension( char *path, const char *extension, size_t size );
|
void COM_DefaultExtension( char *path, const char *extension, size_t size );
|
||||||
void COM_ReplaceExtension( char *path, const char *extension, size_t size );
|
void COM_ReplaceExtension( char *path, const char *extension, size_t size );
|
||||||
void COM_ExtractFilePath( const char *path, char *dest );
|
void COM_ExtractFilePath( const char *path, char *dest );
|
||||||
const char *COM_FileWithoutPath( const char *in );
|
const char *COM_FileWithoutPath( const char *in ) RETURNS_NONNULL;
|
||||||
void COM_StripExtension( char *path );
|
void COM_StripExtension( char *path );
|
||||||
void COM_RemoveLineFeed( char *str, size_t bufsize );
|
void COM_RemoveLineFeed( char *str, size_t bufsize );
|
||||||
void COM_PathSlashFix( char *path );
|
void COM_PathSlashFix( char *path );
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ size_t Q_UTF16ToUTF8( char *dst, size_t dstsize, const uint16_t *src, size_t src
|
|||||||
return dsti;
|
return dsti;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint16_t table_cp1251[64] = {
|
static const uint16_t table_cp1251[64] = {
|
||||||
0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021,
|
0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021,
|
||||||
0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F,
|
0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F,
|
||||||
0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
|
0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
|
||||||
|
|||||||
Reference in New Issue
Block a user