Ignore:
Timestamp:
Mar 19, 2012, 1:59:48 AM (12 years ago)
Author:
イグトランス (egtra)
Message:

egtraブランチの内容をマージ。

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/ab5.0/abdev

    • Property svn:ignore set to
      *.opensdf
      *.sdf
      *.suo
      *.user
      int
      ipch
      out
  • trunk/ab5.0/abdev/BasicCompiler_Common/VarList.cpp

    r763 r828  
    11#include "stdafx.h"
    22
     3#include <boost/range/algorithm.hpp>
    34#include <Compiler.h>
    45
     
    411412    if(pobj_dti->lplpSpBase[i2]==0) return;
    412413
    413     UserProc *pUserProc = NULL;
    414     compiler.GetObjectModule().meta.GetUserProcs().Iterator_Reset();
    415     while( compiler.GetObjectModule().meta.GetUserProcs().Iterator_HasNext() )
     414    auto const& t = compiler.GetObjectModule().meta.GetUserProcs();
     415    auto it = boost::find_if<boost::return_found>(t, [&](UserProc *pUserProc) -> bool {
     416        return rva_to_real(pUserProc->GetBeginOpAddress()) <= pobj_dti->lplpObp[i2] &&
     417            pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->GetEndOpAddress());
     418    });
     419    if (it == boost::end(t))
    416420    {
    417         pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Iterator_GetNext();
    418         if(rva_to_real(pUserProc->GetBeginOpAddress()) <= pobj_dti->lplpObp[i2]  &&
    419             pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->GetEndOpAddress())){
    420             break;
    421         }
    422     }
    423     if(!pUserProc) return;
     421        return;
     422    }
     423    UserProc *pUserProc = *it;
    424424
    425425    foreach( Variable *pVar, pUserProc->GetLocalVars() ){
     
    696696    //プロシージャ コンボボックス
    697697    SendMessage(hProcCombo,CB_RESETCONTENT,0,0);
    698     for(i2=pobj_dti->iProcLevel;i2>=0;i2--){
    699 
     698    for(i2=pobj_dti->iProcLevel;i2>=0;i2--)
     699    {
     700        auto const& t = compiler.GetObjectModule().meta.GetUserProcs();
     701        auto it = boost::find_if<boost::return_found>(t, [&](UserProc* p) {
     702            return rva_to_real(p->GetBeginOpAddress()) <= pobj_dti->lplpObp[i2] &&
     703                pobj_dti->lplpObp[i2] < rva_to_real(p->GetEndOpAddress());
     704        });
    700705        UserProc *pUserProc = NULL;
    701         compiler.GetObjectModule().meta.GetUserProcs().Iterator_Reset();
    702         while( compiler.GetObjectModule().meta.GetUserProcs().Iterator_HasNext() )
     706        if (it != boost::end(t))
    703707        {
    704             pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Iterator_GetNext();
    705 
    706             if(rva_to_real(pUserProc->GetBeginOpAddress()) <= pobj_dti->lplpObp[i2]  &&
    707                 pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->GetEndOpAddress()))
    708             {
    709                 lstrcpy(temporary,pUserProc->GetName().c_str());
    710                 break;
    711             }
     708            pUserProc = *it;
     709            lstrcpy(temporary, pUserProc->GetName().c_str());
    712710        }
    713711        if(!pUserProc){
     
    811809    i2=pobj_dti->iProcLevel-i2;
    812810
    813     if(pobj_dti->lplpSpBase[i2]){
    814 
    815         UserProc *pUserProc = NULL;
    816         compiler.GetObjectModule().meta.GetUserProcs().Iterator_Reset();
    817         while( compiler.GetObjectModule().meta.GetUserProcs().Iterator_HasNext() )
     811    if(pobj_dti->lplpSpBase[i2])
     812    {
     813        auto const& t = compiler.GetObjectModule().meta.GetUserProcs();
     814        auto it = boost::find_if<boost::return_found>(t, [&](UserProc* p) {
     815            return rva_to_real(p->GetBeginOpAddress()) <= pobj_dti->lplpObp[i2] &&
     816                pobj_dti->lplpObp[i2] < rva_to_real(p->GetEndOpAddress());
     817        });
     818
     819        if (it != boost::end(t))
    818820        {
    819             pUserProc = compiler.GetObjectModule().meta.GetUserProcs().Iterator_GetNext();
    820 
    821             if(rva_to_real(pUserProc->GetBeginOpAddress()) <= pobj_dti->lplpObp[i2]  &&
    822                 pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->GetEndOpAddress())){
    823                 break;
    824             }
    825         }
    826 
    827         if(pUserProc){
    828             compiler.StartProcedureCompile( pUserProc );
     821            compiler.StartProcedureCompile(*it);
    829822        }
    830823    }
Note: See TracChangeset for help on using the changeset viewer.