Ignore:
Timestamp:
Oct 21, 2007, 3:37:31 PM (17 years ago)
Author:
dai_9181
Message:

インターフェイス実装周りの仕様整備

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abdev/BasicCompiler_Common/ParamImpl.cpp

    r319 r353  
    204204
    205205const UserProc *ParamImpl::_OverloadSolution( const char *name, std::vector<const UserProc *> &subs, bool isEnabledReturnType ){
    206     int sw=0;
    207     const UserProc *pUserProc;
    208     pUserProc=0;
     206    const UserProc *pUserProc = NULL;
    209207
    210208    for( int level=OVERLOAD_MIN_LEVEL; level<=OVERLOAD_MAX_LEVEL; level++ ){
     
    213211
    214212            if(EvaluateOverloadScore( level, pTempUserProc->Params(), isEnabledReturnType?pTempUserProc->ReturnType():Type() )){
    215                 trace_for_overload( "レベル" << level <<   " ○適合..." << pTempUserProc->_paramStr );
    216 
    217                 if(sw){
     213                trace_for_overload( "レベル" << level << " ○適合..." << pTempUserProc->_paramStr );
     214
     215                if( pUserProc ){
    218216                    if( isEnabledReturnType ){
    219217                        SetError(52,name,cp);
    220 
    221                         return 0;
    222218                    }
    223219                    else{
     
    229225                    }
    230226                }
    231                 sw=1;
    232227
    233228                pUserProc = pTempUserProc;
     
    235230            else
    236231            {
    237                 trace_for_overload( "レベル" << level <<   " ×不適合..." << pTempUserProc->_paramStr );
    238             }
    239         }
    240 
    241         if( sw ) break;
    242     }
    243 
    244     if(!sw){
     232                trace_for_overload( "レベル" << level << " ×不適合..." << pTempUserProc->_paramStr );
     233            }
     234        }
     235
     236        if( pUserProc ) break;
     237    }
     238
     239    if( !pUserProc ){
    245240        BOOST_FOREACH( const UserProc *pTempUserProc, subs ){
    246241
    247242            //エラーチェック
    248243            if(pTempUserProc->Params().size()==this->ParmsNum){
    249                 if(sw){
    250                     sw=0;
    251                     break;
    252                 }
    253                 sw=1;
     244                if( pUserProc ){
     245                    SetError(52,name,cp);
     246                }
    254247
    255248                pUserProc=pTempUserProc;
     
    258251    }
    259252
    260     if(!sw){
    261         SetError(52,name,cp);
    262 
    263         return 0;
    264     }
    265 
     253    if( !pUserProc )
     254    {
     255        SetError();
     256    }
    266257
    267258    return pUserProc;
Note: See TracChangeset for help on using the changeset viewer.