Changeset 803 in dev for branches/egtra/ab5.0/abdev/BasicCompiler_Common/VarList.cpp
- Timestamp:
- Feb 11, 2011, 10:05:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/egtra/ab5.0/abdev/BasicCompiler_Common/VarList.cpp
r763 r803 1 1 #include "stdafx.h" 2 2 3 #include <boost/range/algorithm.hpp> 3 4 #include <Compiler.h> 4 5 … … 411 412 if(pobj_dti->lplpSpBase[i2]==0) return; 412 413 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)) 416 420 { 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; 424 424 425 425 foreach( Variable *pVar, pUserProc->GetLocalVars() ){ … … 696 696 //プロシージャ コンボボックス 697 697 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 }); 700 705 UserProc *pUserProc = NULL; 701 compiler.GetObjectModule().meta.GetUserProcs().Iterator_Reset(); 702 while( compiler.GetObjectModule().meta.GetUserProcs().Iterator_HasNext() ) 706 if (it != boost::end(t)) 703 707 { 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()); 712 710 } 713 711 if(!pUserProc){ … … 811 809 i2=pobj_dti->iProcLevel-i2; 812 810 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)) 818 820 { 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); 829 822 } 830 823 }
Note:
See TracChangeset
for help on using the changeset viewer.