Skip to content

Commit 485cfa8

Browse files
committed
cleanup, and use bool in place of int in one place
1 parent f1470bb commit 485cfa8

5 files changed

Lines changed: 23 additions & 16 deletions

File tree

include/express/stmt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ struct Compound_Statement_ {
131131

132132
struct Conditional_ {
133133
Expression test;
134-
Linked_List code; /**< list of statements */
134+
Linked_List code; /**< list of statements */
135135
Linked_List otherwise; /**< list of statements */
136136
};
137137

src/clstepcore/STEPcomplex.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void STEPcomplex::Initialize( const char ** names, const char * schnm ) {
6969
*eptr = ents, *prev = NULL, *enext;
7070
const EntityDescriptor * enDesc;
7171
char nm[BUFSIZ];
72-
int invalid = 0, outOfOrder = 0;
72+
bool invalid = false, outOfOrder = false;
7373

7474
// Splice out the invalid names from our list:
7575
while( eptr ) {
@@ -88,11 +88,11 @@ void STEPcomplex::Initialize( const char ** names, const char * schnm ) {
8888
// support structs only deal with the original names) and have
8989
// ents re-ort eptr properly in the list:
9090
eptr->Name( StrToLower( enDesc->Name(), nm ) );
91-
outOfOrder = 1;
91+
outOfOrder = true;
9292
}
9393
prev = eptr;
9494
} else {
95-
invalid = 1;
95+
invalid = true;
9696
cerr << "ERROR: Invalid entity \"" << eptr->Name()
9797
<< "\" found in complex entity.\n";
9898
if( !prev ) {

src/express/entity.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ Variable ENTITY_find_inherited_attribute( Entity entity, char * name, int * down
227227
return 0;
228228
}
229229

230+
/** find a (possibly inherited) attribute
231+
* \sa ENTITY_find_inherited_attribute
232+
*/
230233
Variable ENTITYfind_inherited_attribute( struct Scope_ *entity, char * name,
231234
struct Symbol_ ** down_sym ) {
232235
extern int __SCOPE_search_id;

src/express/expr.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,12 +396,12 @@ Type EXPresolve_op_dot( Expression expr, Scope scope ) {
396396
resolved_all( expr );
397397
return( op2->return_type );
398398
case enumeration_:
399+
/* enumerations within a select will be handled by `case select_` above,
400+
* which calls EXP_resolve_op_dot_fuzzy(). */
399401
item = ( Expression )DICTlookup( TYPEget_enum_tags( op1type ), op2->symbol.name );
400-
/* item = (Expression )DICTlookup(TYPEget_enum_tags(op1->return_type),op2->symbol.name);*/
401402
if( !item ) {
402403
ERRORreport_with_symbol( ERROR_enum_no_such_item, &op2->symbol,
403404
op1type->symbol.name, op2->symbol.name );
404-
/* ERRORreport_with_symbol(ERROR_enum_no_such_item,&op2->symbol,op1->return_type->symbol.name,op2->symbol.name);*/
405405
resolve_failed( expr );
406406
return( Type_Bad );
407407
}
@@ -784,10 +784,14 @@ Type EXPresolve_op_unary_minus( Expression e, Scope s ) {
784784
return e->e.op1->return_type;
785785
}
786786

787-
/**
787+
/** Initialize one entry in EXPop_table
788+
* This table's function pointers are resolved in \sa EXP_resolve()
789+
* , at approx resolve.c:520
790+
* \sa EXPop_init()
791+
*
792+
* \param token_number operator value, usually in macro form
793+
* \param string human-readable description
788794
* \param resolve_func resolves an expression of this type
789-
* \param type_func returns final type of expression of this type
790-
* avoids resolution if possible
791795
*/
792796
void EXPop_create( int token_number, char * string, Resolve_expr_func * resolve_func ) {
793797
EXPop_table[token_number].token = string;

src/express/resolve.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ void STMTresolve( Statement statement, Scope scope ) {
930930
break;
931931
case STMT_SKIP:
932932
case STMT_ESCAPE:
933-
/* do nothing */
933+
/* do nothing */ //WARNING should we really *not* do anything for these?
934934
;
935935
}
936936
}
@@ -1066,12 +1066,12 @@ void ENTITYcheck_missing_supertypes( Entity ent ) {
10661066
void ENTITYcalculate_inheritance( Entity e ) {
10671067
e->u.entity->inheritance = 0;
10681068

1069-
LISTdo( e->u.entity->supertypes, super, Entity )
1070-
if( super->u.entity->inheritance == ENTITY_INHERITANCE_UNINITIALIZED ) {
1071-
ENTITYcalculate_inheritance( super );
1072-
}
1073-
e->u.entity->inheritance += ENTITYget_size( super );
1074-
LISTod
1069+
LISTdo( e->u.entity->supertypes, super, Entity ) {
1070+
if( super->u.entity->inheritance == ENTITY_INHERITANCE_UNINITIALIZED ) {
1071+
ENTITYcalculate_inheritance( super );
1072+
}
1073+
e->u.entity->inheritance += ENTITYget_size( super );
1074+
} LISTod
10751075
}
10761076

10771077
/** returns 1 if entity is involved in circularity, else 0 */

0 commit comments

Comments
 (0)