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

View File

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