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/InitializerNode.cc

    r9262fe9 r44adf1b  
    3636                : expr( _expr ), aggregate( aggrp ), designator( des ), kids( nullptr ), maybeConstructed( true ), isDelete( false ) {
    3737        if ( aggrp )
    38                 kids = dynamic_cast< InitializerNode * >( get_next() );
     38                kids = next;
    3939
    4040        if ( kids )
     
    4848
    4949        if ( aggrp )
    50                 kids = dynamic_cast< InitializerNode * >( get_next() );
     50                kids = next;
    5151
    5252        if ( kids )
    53                 set_next( nullptr );
     53                next = nullptr;
    5454} // InitializerNode::InitializerNode
    5555
     
    7373                        while ( curdes != nullptr) {
    7474                                curdes->printOneLine(os);
    75                                 curdes = (ExpressionNode *)(curdes->get_next());
     75                                curdes = curdes->next;
    7676                                if ( curdes ) os << ", ";
    7777                        } // while
     
    8787
    8888        InitializerNode *moreInit;
    89         if ( (moreInit = dynamic_cast< InitializerNode * >( get_next() ) ) ) {
     89        if ( ( moreInit = next ) ) {
    9090                moreInit->printOneLine( os );
    9191        } // if
     
    9898                std::vector<ast::ptr<ast::Designation>> designlist;
    9999                InitializerNode * child = next_init();
    100                 for ( ; child != nullptr ; child = dynamic_cast< InitializerNode * >( child->get_next() ) ) {
     100                for ( ; child != nullptr ; child = child->next ) {
    101101                        std::deque<ast::ptr<ast::Expr>> desList;
    102102                        buildList( child->designator, desList );
Note: See TracChangeset for help on using the changeset viewer.