Ignore:
Timestamp:
Mar 5, 2024, 9:55:04 AM (3 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
af60383
Parents:
9262fe9
Message:

Removed casts around get_next (also replaced with direct field access) that are no longer needed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypeData.cc

    r9262fe9 r44adf1b  
    494494        for ( auto i = outputList.begin() ;
    495495                        i != outputList.end() ;
    496                         ++i, n = (DeclarationNode*)n->get_next() ) {
     496                        ++i, n = n->next ) {
    497497                // Only the object type class adds additional assertions.
    498498                if ( n->variable.tyClass != ast::TypeDecl::Otype ) {
     
    639639        for ( auto i = outputForall.begin() ;
    640640                        i != outputForall.end() ;
    641                         ++i, n = (DeclarationNode*)n->get_next() ) {
     641                        ++i, n = n->next ) {
    642642                // Only the object type class adds additional assertions.
    643643                if ( n->variable.tyClass != ast::TypeDecl::Otype ) {
     
    12721272        auto members = ret->members.begin();
    12731273        ret->hide = td->enumeration.hiding == EnumHiding::Hide ? ast::EnumDecl::EnumHiding::Hide : ast::EnumDecl::EnumHiding::Visible;
    1274         for ( const DeclarationNode * cur = td->enumeration.constants; cur != nullptr; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ), ++members ) {
     1274        for ( const DeclarationNode * cur = td->enumeration.constants; cur != nullptr; cur = cur->next, ++members ) {
    12751275                if ( cur->enumInLine ) {
    12761276                        // Do Nothing
     
    15001500        assert( ! function.params );
    15011501        // loop over declaration first as it is easier to spot errors
    1502         for ( DeclarationNode * decl = function.oldDeclList; decl != nullptr; decl = dynamic_cast< DeclarationNode * >( decl->get_next() ) ) {
     1502        for ( DeclarationNode * decl = function.oldDeclList; decl != nullptr; decl = decl->next ) {
    15031503                // scan ALL parameter names for each declaration name to check for duplicates
    1504                 for ( DeclarationNode * param = function.idList; param != nullptr; param = dynamic_cast< DeclarationNode * >( param->get_next() ) ) {
     1504                for ( DeclarationNode * param = function.idList; param != nullptr; param = param->next ) {
    15051505                        if ( *decl->name == *param->name ) {
    15061506                                // type set => parameter name already transformed by a declaration names so there is a duplicate
     
    15241524        //    rtb( a, b, c ) const char * b; {} => int rtn( int a, const char * b, int c ) {}
    15251525
    1526         for ( DeclarationNode * param = function.idList; param != nullptr; param = dynamic_cast< DeclarationNode * >( param->get_next() ) ) {
     1526        for ( DeclarationNode * param = function.idList; param != nullptr; param = param->next ) {
    15271527                if ( ! param->type ) {                                                  // generate type int for empty parameter type
    15281528                        param->type = new TypeData( TypeData::Basic );
Note: See TracChangeset for help on using the changeset viewer.