@@ -533,6 +533,7 @@ process_aggregate (FILE *file, Type t) {
533533 char * lower_str = EXPRto_string (lower );
534534 Expression upper = AGGR_TYPEget_upper_limit (t );
535535 char * upper_str = NULL ;
536+ Type base_type ;
536537 if (upper == LITERAL_INFINITY ) {
537538 upper_str = "None" ;
538539 }
@@ -557,7 +558,7 @@ process_aggregate (FILE *file, Type t) {
557558 }
558559 fprintf (file ,"(%s,%s," ,lower_str ,upper_str );
559560 //write base type
560- Type base_type = TYPEget_base_type (t );
561+ base_type = TYPEget_base_type (t );
561562 if (TYPEis_aggregate (base_type )) {
562563 process_aggregate (file ,base_type );
563564 fprintf (file ,")" ); //close parenthesis
@@ -567,7 +568,6 @@ process_aggregate (FILE *file, Type t) {
567568 //fprintf(file,"%s)",array_base_type);
568569 fprintf (file ,"'%s')" ,array_base_type );
569570 }
570-
571571}
572572
573573void
@@ -578,6 +578,11 @@ LIBdescribe_entity( Entity entity, FILE * file, Schema schema ) {
578578 bool generate_constructor = true; //by default, generates a python constructor
579579 bool inheritance = false;
580580 Type t ;
581+ Linked_List list ;
582+ int num_parent = 0 ;
583+ int num_derived_inverse_attr = 0 ;
584+ int index_attribute = 0 ;
585+
581586 /* class name
582587 need to use new-style classes for properties to work correctly
583588 so class must inherit from object */
@@ -587,9 +592,8 @@ LIBdescribe_entity( Entity entity, FILE * file, Schema schema ) {
587592 /*
588593 * Look for inheritance and super classes
589594 */
590- Linked_List list ;
591595 list = ENTITYget_supertypes ( entity );
592- int num_parent = 0 ;
596+ num_parent = 0 ;
593597 if ( ! LISTempty ( list ) ) {
594598 inheritance = true;
595599 LISTdo ( list , e , Entity )
@@ -632,7 +636,7 @@ LIBdescribe_entity( Entity entity, FILE * file, Schema schema ) {
632636 * other wise just a 'pass' statement is enough
633637 */
634638 attr_count_tmp = 0 ;
635- int num_derived_inverse_attr = 0 ;
639+ num_derived_inverse_attr = 0 ;
636640 LISTdo (ENTITYget_attributes ( entity ), v , Variable )
637641 if (VARis_derived (v ) || VARget_inverse (v )) {
638642 num_derived_inverse_attr ++ ;
@@ -656,7 +660,8 @@ LIBdescribe_entity( Entity entity, FILE * file, Schema schema ) {
656660 }
657661 // if inheritance, first write the inherited parameters
658662 list = ENTITYget_supertypes ( entity );
659- int num_parent = 0 , index_attribute = 0 ;
663+ num_parent = 0 ;
664+ index_attribute = 0 ;
660665 if ( ! LISTempty ( list ) ) {
661666 LISTdo ( list , e , Entity )
662667 /* search attribute names for superclass */
0 commit comments