mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-30 08:44:31 +00:00
public: Q_strstr should return pointer to non-const data
This commit is contained in:
parent
5d4f8373c4
commit
fb43a5590f
@ -409,7 +409,7 @@ const char* Q_timestamp( int format )
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if !defined( HAVE_STRCASESTR )
|
#if !defined( HAVE_STRCASESTR )
|
||||||
const char *Q_stristr( const char *string, const char *string2 )
|
char *Q_stristr( const char *string, const char *string2 )
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
size_t len;
|
size_t len;
|
||||||
@ -431,7 +431,7 @@ const char *Q_stristr( const char *string, const char *string2 )
|
|||||||
}
|
}
|
||||||
else return NULL;
|
else return NULL;
|
||||||
}
|
}
|
||||||
return string;
|
return (char *)string;
|
||||||
}
|
}
|
||||||
#endif // !defined( HAVE_STRCASESTR )
|
#endif // !defined( HAVE_STRCASESTR )
|
||||||
|
|
||||||
|
@ -105,9 +105,9 @@ static inline int Q_strncmp( const char *s1, const char *s2, size_t n )
|
|||||||
( unlikely(!s2) ? 1 : strncmp( s1, s2, n ));
|
( unlikely(!s2) ? 1 : strncmp( s1, s2, n ));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline const char *Q_strstr( const char *s1, const char *s2 )
|
static inline char *Q_strstr( const char *s1, const char *s2 )
|
||||||
{
|
{
|
||||||
return unlikely( !s1 || !s2 ) ? NULL : strstr( s1, s2 );
|
return unlikely( !s1 || !s2 ) ? NULL : (char*)strstr( s1, s2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// libc extensions, be careful
|
// libc extensions, be careful
|
||||||
@ -135,12 +135,12 @@ static inline int Q_strnicmp( const char *s1, const char *s2, size_t n )
|
|||||||
#if XASH_WIN32
|
#if XASH_WIN32
|
||||||
#define strcasestr stristr
|
#define strcasestr stristr
|
||||||
#endif
|
#endif
|
||||||
static inline const char *Q_stristr( const char *s1, const char *s2 )
|
static inline char *Q_stristr( const char *s1, const char *s2 )
|
||||||
{
|
{
|
||||||
return unlikely( !s1 || !s2 ) ? NULL : strcasestr( s1, s2 );
|
return unlikely( !s1 || !s2 ) ? NULL : (char *)strcasestr( s1, s2 );
|
||||||
}
|
}
|
||||||
#else // defined( HAVE_STRCASESTR )
|
#else // defined( HAVE_STRCASESTR )
|
||||||
const char *Q_stristr( const char *s1, const char *s2 );
|
char *Q_stristr( const char *s1, const char *s2 );
|
||||||
#endif // defined( HAVE_STRCASESTR )
|
#endif // defined( HAVE_STRCASESTR )
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user