Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ArgTweak/FunctionFixer.cc

    rf1b1e4c r843054c2  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // FunctionFixer.cc --
     7// FunctionFixer.cc -- 
    88//
    99// Author           : Rodolfo G. Esteves
     
    4242        Expression *FunctionFixer::mutate( UntypedExpr *untypedExpr ) throw ( SemanticError ) {
    4343                assert( untypedExpr != 0 );
     44                NameExpr *function;
    4445
    45                 if ( NameExpr * function = dynamic_cast< NameExpr *>(untypedExpr->get_function() ) ) {
     46                if ( ( function = dynamic_cast< NameExpr *>(untypedExpr->get_function()) ) != 0 ) {
    4647                        std::list < DeclarationWithType * > options;
    4748                        index->lookupId ( function->get_name(), options );
    4849                        for ( std::list < DeclarationWithType * >::iterator i = options.begin(); i != options.end(); i++ ) {
    49                                 if ( FunctionType * f = dynamic_cast< FunctionType * > ( (*i)->get_type() ) )   {
     50                                FunctionType *f;
     51                                if ( ( f = dynamic_cast< FunctionType * > ( (*i)->get_type() ) ) != 0 ) {
    5052                                        std::list < DeclarationWithType * > &pars = f->get_parameters();
     53
    5154                                        bool candidateExists ;
    52                                         for ( std::list < DeclarationWithType * >::iterator p = pars.begin(); p != pars.end(); p++ ) {
     55                                        for ( std::list < DeclarationWithType * >::iterator p = pars.begin(); p != pars.end(); p++ )
    5356                                                if ( ( candidateExists = align( f->get_parameters(), untypedExpr->get_args(), Matcher() ) ) ) break;
    54                                         }
     57
    5558                                        if ( ! candidateExists ) throw SemanticError("Error in function call");
    5659                                } // if
Note: See TracChangeset for help on using the changeset viewer.