stage4/generate_c/generate_c_typedecl.cc
changeset 592 99a284cec1f2
parent 587 1ecf916cc397
child 594 c8092e909886
equal deleted inserted replaced
591:76bad7199896 592:99a284cec1f2
    73       arraysubrange_bd
    73       arraysubrange_bd
    74     } basetypedeclaration_t;
    74     } basetypedeclaration_t;
    75 
    75 
    76     basetypedeclaration_t current_basetypedeclaration;
    76     basetypedeclaration_t current_basetypedeclaration;
    77 
    77 
    78     void print_integer(unsigned int integer) {
    78     void print_integer(unsigned long long int integer) {
    79       char str[10];
    79       char str[24];
    80       sprintf(str, "%d", integer);
    80       sprintf(str, "%llu", integer);
    81       s4o.print(str);
    81       s4o.print(str);
    82     }
    82     }
    83 
    83 
    84     void print_integer_incl(unsigned int integer) {
    84     void print_integer_incl(unsigned long long int integer) {
    85       char str[10];
    85       char str[24];
    86       sprintf(str, "%d", integer);
    86       sprintf(str, "%llu", integer);
    87       s4o_incl.print(str);
    87       s4o_incl.print(str);
    88     }
    88     }
    89 
    89 
    90     void *print_list_incl(list_c *list,
    90     void *print_list_incl(list_c *list,
    91          std::string pre_elem_str = "",
    91          std::string pre_elem_str = "",
   253   int dimension;
   253   int dimension;
   254   switch (current_typedefinition) {
   254   switch (current_typedefinition) {
   255     case array_td:
   255     case array_td:
   256       if (current_basetypedeclaration == arraysubrange_bd) {
   256       if (current_basetypedeclaration == arraysubrange_bd) {
   257         s4o_incl.print("[");
   257         s4o_incl.print("[");
   258         dimension = extract_int64_value(symbol->upper_limit) - extract_int64_value(symbol->lower_limit) + 1;
   258         print_integer_incl(symbol->dimension);
   259         print_integer_incl(dimension);
       
   260         s4o_incl.print("]");
   259         s4o_incl.print("]");
   261       }
   260       }
   262       else
   261       else
   263         symbol->lower_limit->accept(*this);
   262         symbol->lower_limit->accept(*this);
   264       break;
   263       break;