change EPAIR_STRCMP semantics

This commit is contained in:
Garux 2020-01-24 02:47:33 +03:00
parent cf98275ee4
commit 3409de2cb0
2 changed files with 6 additions and 6 deletions

View File

@ -574,7 +574,7 @@ bool ParseEntity( void ){
if ( !GetToken( true ) ) {
Error( "ParseEntity: EOF without closing brace" );
}
if ( !EPAIR_STRCMP( token, "}" ) ) {
if ( strEqual( token, "}" ) ) {
break;
}
e = ParseEPair();
@ -757,7 +757,7 @@ void SetKeyValue( entity_t *ent, const char *key, const char *value ){
/* check for existing epair */
for ( ep = ent->epairs; ep != NULL; ep = ep->next )
{
if ( !EPAIR_STRCMP( ep->key, key ) ) {
if ( EPAIR_EQUAL( ep->key, key ) ) {
free( ep->value );
ep->value = copystring( value );
return;
@ -783,7 +783,7 @@ bool KeyExists( const entity_t *ent, const char *key ){
/* walk epair list */
for ( ep = ent->epairs; ep != NULL; ep = ep->next )
{
if ( !EPAIR_STRCMP( ep->key, key ) ) {
if ( EPAIR_EQUAL( ep->key, key ) ) {
return true;
}
}
@ -809,7 +809,7 @@ const char *ValueForKey( const entity_t *ent, const char *key ){
/* walk epair list */
for ( ep = ent->epairs; ep != NULL; ep = ep->next )
{
if ( !EPAIR_STRCMP( ep->key, key ) ) {
if ( EPAIR_EQUAL( ep->key, key ) ) {
return ep->value;
}
}

View File

@ -144,9 +144,9 @@
#define CASE_INSENSITIVE_EPAIRS 1
#if CASE_INSENSITIVE_EPAIRS
#define EPAIR_STRCMP Q_stricmp
#define EPAIR_EQUAL striEqual
#else
#define EPAIR_STRCMP strcmp
#define EPAIR_EQUAL strEqual
#endif