public: make COM_FixSlashes inlined

This commit is contained in:
Alibek Omarov
2024-12-29 09:05:15 +03:00
parent 62f3354f4e
commit 03eac904c1
2 changed files with 13 additions and 16 deletions

View File

@@ -663,21 +663,6 @@ void COM_RemoveLineFeed( char *str, size_t bufsize )
}
}
/*
============
COM_FixSlashes
Changes all '\' characters into '/' characters, in place.
============
*/
void COM_FixSlashes( char *pname )
{
while(( pname = Q_strchr( pname, '\\' )))
{
*pname = '/';
}
}
/*
============
COM_PathSlashFix

View File

@@ -96,7 +96,6 @@ void COM_ExtractFilePath( const char *path, char *dest );
const char *COM_FileWithoutPath( const char *in );
void COM_StripExtension( char *path );
void COM_RemoveLineFeed( char *str, size_t bufsize );
void COM_FixSlashes( char *pname );
void COM_PathSlashFix( char *path );
// return 0 on empty or null string, 1 otherwise
#define COM_CheckString( string ) ( ( !string || !*string ) ? 0 : 1 )
@@ -320,6 +319,19 @@ static inline int Q_splitstr( char *str, int delim, void *userdata,
return ret;
}
/*
============
COM_FixSlashes
Changes all '\' characters into '/' characters, in place.
============
*/
static inline void COM_FixSlashes( char *pname )
{
while(( pname = Q_strchr( pname, '\\' )))
*pname = '/';
}
#ifdef __cplusplus
}
#endif