Skip to content

Commit fd77902

Browse files
committed
drop macro streq
1 parent 1732897 commit fd77902

File tree

7 files changed

+16
-19
lines changed

7 files changed

+16
-19
lines changed

include/express/basic.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ typedef void * Generic;
9595
typedef char * Generic;
9696
#endif /* */
9797

98-
/* other handy macros */
99-
#define streq(x,y) (!strcmp((x),(y)))
100-
10198

10299
/**************************/
103100
/* function pointer types */

src/exp2cxx/classes_entity.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ static void collectAttributes( Linked_List curList, const Entity curEntity, enum
10141014
static bool listContainsVar( Linked_List l, Variable v ) {
10151015
const char * vName = VARget_simple_name( v );
10161016
LISTdo( l, curr, Variable ) {
1017-
if( streq( vName, VARget_simple_name( curr ) ) ) {
1017+
if( !strcmp( vName, VARget_simple_name( curr ) ) ) {
10181018
return true;
10191019
}
10201020
}

src/exppp/pretty_schema.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ char * SCHEMAout( Schema s ) {
7777
if( 0 != ( p = strchr( buf, '\n' ) ) ) {
7878
*p = '\0';
7979
}
80-
if( ( !result ) || ( streq( buf, expheader[0] ) ) ) {
80+
if( ( !result ) || ( !strcmp( buf, expheader[0] ) ) ) {
8181
unlink( exppp_filename_buffer );
8282
} else {
8383
fprintf( stderr, "%s: %s already exists and appears to be hand-written\n",

src/express/entity.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static Entity ENTITY_find_inherited_entity( Entity entity, char * name, int down
146146
entity->search_id = __SCOPE_search_id;
147147

148148
LISTdo( entity->u.entity->supertypes, super, Entity )
149-
if( streq( super->symbol.name, name ) ) {
149+
if( !strcmp( super->symbol.name, name ) ) {
150150
return super;
151151
}
152152
LISTod
@@ -160,7 +160,7 @@ static Entity ENTITY_find_inherited_entity( Entity entity, char * name, int down
160160

161161
if( down ) {
162162
LISTdo( entity->u.entity->subtypes, sub, Entity )
163-
if( streq( sub->symbol.name, name ) ) {
163+
if( !strcmp( sub->symbol.name, name ) ) {
164164
return sub;
165165
}
166166
LISTod;
@@ -177,7 +177,7 @@ static Entity ENTITY_find_inherited_entity( Entity entity, char * name, int down
177177
}
178178

179179
struct Scope_ * ENTITYfind_inherited_entity( struct Scope_ *entity, char * name, int down ) {
180-
if( streq( name, entity->symbol.name ) ) {
180+
if( !strcmp( name, entity->symbol.name ) ) {
181181
return( entity );
182182
}
183183

@@ -437,7 +437,7 @@ Variable ENTITYget_named_attribute( Entity entity, char * name ) {
437437
Variable attribute;
438438

439439
LISTdo( entity->u.entity->attributes, attr, Variable )
440-
if( streq( VARget_simple_name( attr ), name ) ) {
440+
if( !strcmp( VARget_simple_name( attr ), name ) ) {
441441
return attr;
442442
}
443443
LISTod;
@@ -495,7 +495,7 @@ int ENTITYget_named_attribute_offset( Entity entity, char * name ) {
495495
int value;
496496

497497
LISTdo( entity->u.entity->attributes, attr, Variable )
498-
if( streq( VARget_simple_name( attr ), name ) )
498+
if( !strcmp( VARget_simple_name( attr ), name ) )
499499
return entity->u.entity->inheritance +
500500
VARget_offset( ENTITY_find_inherited_attribute( entity, name, 0, 0 ) );
501501
LISTod;

src/express/error.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ void ERRORcreate_warning( char * name, Error error ) {
199199

200200
/* first check if we know about this type of error */
201201
LISTdo( ERRORwarnings, opt, Error_Warning ) {
202-
if( streq( name, opt->name ) ) {
202+
if( !strcmp( name, opt->name ) ) {
203203
LISTadd_last( opt->errors, ( Generic )error );
204204
return;
205205
}
@@ -215,14 +215,14 @@ void ERRORcreate_warning( char * name, Error error ) {
215215

216216
void ERRORset_warning( char * name, int set ) {
217217

218-
if( streq( name, "all" ) ) {
218+
if( !strcmp( name, "all" ) ) {
219219
ERRORset_all_warnings( set );
220-
} else if( streq( name, "none" ) ) {
220+
} else if( !strcmp( name, "none" ) ) {
221221
ERRORset_all_warnings( !set );
222222
} else {
223223
bool found = false;
224224
LISTdo( ERRORwarnings, opt, Error_Warning ) {
225-
if( streq( opt->name, name ) ) {
225+
if( !strcmp( opt->name, name ) ) {
226226
found = true;
227227
LISTdo_n( opt->errors, err, Error, b ) {
228228
err->enabled = set;

src/express/express.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static void EXPRESS_PATHinit() {
222222

223223
/* if it's just ".", make it as if it was */
224224
/* just "" to make error messages cleaner */
225-
if( streq( ".", start ) ) {
225+
if( !strcmp( ".", start ) ) {
226226
dir->leaf = dir->full;
227227
LISTadd_last( EXPRESS_path, ( Generic )dir );
228228
*( p - 1 ) = save; /* put char back where */
@@ -446,7 +446,7 @@ void EXPRESSparse( Express model, FILE * fp, char * filename ) {
446446
int length = strlen( start );
447447

448448
/* drop .exp suffix if present */
449-
if( dot && streq( dot, ".exp" ) ) {
449+
if( dot && !strcmp( dot, ".exp" ) ) {
450450
length -= 4;
451451
}
452452

@@ -552,7 +552,7 @@ static Generic SCOPEfind_for_rename( Scope schema, char * name ) {
552552
}
553553

554554
LISTdo( schema->u.schema->uselist, r, Rename * )
555-
if( streq( ( r->nnew ? r->nnew : r->old )->name, name ) ) {
555+
if( !strcmp( ( r->nnew ? r->nnew : r->old )->name, name ) ) {
556556
RENAMEresolve( r, schema );
557557
DICT_type = r->type;
558558
return( r->object );

src/express/resolve.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ void ALGresolve_expressions_statements( Scope s, Linked_List statements ) {
957957

958958
static Variable ENTITY_get_local_attribute( Entity e, char * name ) {
959959
LISTdo( e->u.entity->attributes, a, Variable )
960-
if( streq( VARget_simple_name( a ), name ) ) {
960+
if( !strcmp( VARget_simple_name( a ), name ) ) {
961961
return a;
962962
}
963963
LISTod;
@@ -982,7 +982,7 @@ void ENTITYresolve_expressions( Entity e ) {
982982
if( attr->name->type->u.type->body->type == op_ ) {
983983
/* attribute redeclaration */
984984
sname = attr->name->e.op1->e.op2->symbol.name;
985-
if( streq( sname, e->symbol.name ) ||
985+
if( !strcmp( sname, e->symbol.name ) ||
986986
!( sup = ENTITYfind_inherited_entity( e, sname, 0 ) ) ) {
987987
ERRORreport_with_symbol( ERROR_redecl_no_such_supertype,
988988
&attr->name->e.op1->e.op2->symbol,

0 commit comments

Comments
 (0)