Changeset 100 in dev for BasicCompiler_Common/Class.cpp
- Timestamp:
- Apr 24, 2007, 3:17:29 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Class.cpp
r97 r100 118 118 119 119 120 CMethod::CMethod(CMethod *pobj){ 121 //コピーコンストラクタ 122 memset(this,0,sizeof(CMethod)); 123 124 pUserProc=pobj->pUserProc; 125 126 bAbstract=pobj->bAbstract; 127 128 bVirtual=pobj->bVirtual; 129 } 130 CMethod::CMethod(){ 131 memset(this,0,sizeof(CMethod)); 120 //コピーコンストラクタ 121 CMethod::CMethod(CMethod *pMethod) 122 : pUserProc( pMethod->pUserProc ) 123 , dwAccess( pMethod->dwAccess ) 124 , bAbstract( pMethod->bAbstract ) 125 , bVirtual( pMethod->bVirtual ) 126 , isConst( pMethod->isConst ) 127 , isStatic( pMethod->isStatic ) 128 { 129 } 130 131 CMethod::CMethod( UserProc *pUserProc, DWORD dwAccess, BOOL bAbstract, BOOL bVirtual, bool isConst, bool isStatic ) 132 : pUserProc( pUserProc ) 133 , dwAccess( dwAccess ) 134 , bAbstract( bAbstract ) 135 , bVirtual( bVirtual ) 136 , isConst( isConst ) 137 , isStatic( isStatic ) 138 , pobj_InheritsClass( NULL ) 139 { 132 140 } 133 141 CMethod::~CMethod(){ … … 330 338 } 331 339 void CClass::AddMethod( UserProc *pUserProc,DWORD dwAccess, bool isConst, BOOL bAbstract, BOOL bVirtual ){ 332 CMethod *method = new CMethod(); 333 method->pUserProc = pUserProc; 334 method->dwAccess = dwAccess; 335 method->isConst = isConst; 336 method->bAbstract = bAbstract; 337 method->bVirtual = bVirtual; 338 method->pobj_InheritsClass = 0; 340 CMethod *method = new CMethod( pUserProc, dwAccess, bAbstract, bVirtual, isConst, false ); 339 341 340 342 methods.push_back( method ); … … 344 346 } 345 347 void CClass::AddStaticMethod(UserProc *pUserProc,DWORD dwAccess){ 346 CMethod *method = new CMethod(); 347 method->pUserProc=pUserProc; 348 method->dwAccess=dwAccess; 349 method->bAbstract=0; 350 method->bVirtual=0; 351 method->pobj_InheritsClass=0; 348 CMethod *method = new CMethod( pUserProc, dwAccess, FALSE, FALSE, false, true ); 352 349 353 350 staticMethods.push_back( method ); … … 421 418 } 422 419 423 void CClass::EnumStaticMethod( const char *methodName, std::vector<UserProc *> &subs ) const420 void CClass::EnumStaticMethod( const char *methodName, vector<UserProc *> &subs ) const 424 421 { 425 422 foreach( CMethod *method, staticMethods ){ … … 430 427 } 431 428 432 void CClass::EnumMethod( const char *methodName, std::vector<UserProc *> &subs ) const429 void CClass::EnumMethod( const char *methodName, vector<UserProc *> &subs ) const 433 430 { 434 431 //オブジェクトのメンバ関数の場合 … … 441 438 } 442 439 443 void CClass::EnumMethod( const BYTE idOperatorCalc, std::vector<UserProc *> &subs ) const440 void CClass::EnumMethod( const BYTE idOperatorCalc, vector<UserProc *> &subs ) const 444 441 { 445 442 //オブジェクトのメンバ関数の場合 … … 603 600 604 601 UserProc **ppsi; 605 ppsi=(UserProc **)HeapAlloc(hHeap,0,vtbl_num*sizeof( UserProc *));602 ppsi=(UserProc **)HeapAlloc(hHeap,0,vtbl_num*sizeof(GlobalProc *)); 606 603 607 604 //関数テーブルに値をセット … … 642 639 int i; 643 640 for(i=0;i<vtbl_num;i++){ 644 UserProc *pUserProc;645 pUserProc=( UserProc *)pVtbl[i];641 GlobalProc *pUserProc; 642 pUserProc=(GlobalProc *)pVtbl[i]; 646 643 if(!pUserProc) continue; 647 644 pVtbl[i]=pUserProc->beginOpAddress+ImageBase+MemPos_CodeSection; … … 803 800 } 804 801 } 805 return 0;802 return NULL; 806 803 } 807 804 … … 932 929 933 930 //関数ハッシュへ登録 934 UserProc *pUserProc;935 pUserProc=AddSubData( buffer,nowLine,bVirtual,pobj_c, (bStatic!=0) );931 GlobalProc *pUserProc; 932 pUserProc=AddSubData( NamespaceScopes(), buffer,nowLine,bVirtual,pobj_c, (bStatic!=0) ); 936 933 if(!pUserProc) return; 937 934
Note:
See TracChangeset
for help on using the changeset viewer.