Changeset 53 in dev for BasicCompiler_Common/Class.cpp
- Timestamp:
- Feb 11, 2007, 12:30:12 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Class.cpp
r51 r53 125 125 pobj_c=pobj_DBClass->Iterator_GetNext(); 126 126 127 int i; 128 char temporary[VN_SIZE]; 129 for(i=0;i<pobj_c->iStaticMemberNum;i++){ 130 sprintf(temporary,"%s.%s",pobj_c->name,pobj_c->ppobj_StaticMember[i]->name); 127 foreach( CMember *member, pobj_c->staticMembers ){ 128 char temporary[VN_SIZE]; 129 sprintf(temporary,"%s.%s",pobj_c->name,member->name); 131 130 AddGlobalVariable( 132 131 temporary, 133 pobj_c->ppobj_StaticMember[i]->SubScripts,134 & pobj_c->ppobj_StaticMember[i]->TypeInfo,135 GetTypeSize( pobj_c->ppobj_StaticMember[i]->TypeInfo.type,pobj_c->ppobj_StaticMember[i]->TypeInfo.u.lpIndex),136 pobj_c->ppobj_StaticMember[i]->InitBuf,137 pobj_c->ppobj_StaticMember[i]->ConstractParameter,132 member->SubScripts, 133 &member->TypeInfo, 134 GetTypeSize(member->TypeInfo.type,member->TypeInfo.u.lpIndex), 135 member->InitBuf, 136 member->ConstractParameter, 138 137 0); 139 138 140 if( pobj_c->ppobj_StaticMember[i]->TypeInfo.type==DEF_OBJECT){139 if(member->TypeInfo.type==DEF_OBJECT){ 141 140 //エラー用 142 cp= pobj_c->ppobj_StaticMember[i]->source_code_address;141 cp=member->source_code_address; 143 142 144 143 CallConstructor(temporary, 145 pobj_c->ppobj_StaticMember[i]->SubScripts,146 pobj_c->ppobj_StaticMember[i]->TypeInfo,147 pobj_c->ppobj_StaticMember[i]->ConstractParameter);144 member->SubScripts, 145 member->TypeInfo, 146 member->ConstractParameter); 148 147 } 149 148 … … 207 206 } 208 207 209 if(ppobj_StaticMember){ 210 //静的メンバ 211 for(i=0;i<iStaticMemberNum;i++){ 212 delete ppobj_StaticMember[i]; 213 } 214 HeapDefaultFree(ppobj_StaticMember); 215 ppobj_StaticMember=0; 208 //静的メンバ 209 foreach( CMember *member, staticMembers ){ 210 delete member; 216 211 } 217 212 … … 277 272 } 278 273 void CClass::AddStaticMember( DWORD dwAccess, bool isConst, bool isRef, char *buffer, int NowLine ){ 279 ppobj_StaticMember=(CMember **)HeapReAlloc(hHeap,0,ppobj_StaticMember,(iStaticMemberNum+1)*sizeof(CMember *)); 280 ppobj_StaticMember[iStaticMemberNum]=new CMember( this, dwAccess, isConst, isRef, buffer, NowLine ); 281 iStaticMemberNum++; 274 CMember *member = new CMember( this, dwAccess, isConst, isRef, buffer, NowLine ); 275 staticMembers.push_back( member ); 282 276 } 283 277 void CClass::AddMethod( SUBINFO *psi,DWORD dwAccess, bool isConst, BOOL bAbstract, BOOL bVirtual ){ … … 320 314 //重複チェック 321 315 322 int i;323 324 316 //メンバ 325 for( i=0;i<iMemberNum;i++){317 for( int i=0;i<iMemberNum;i++){ 326 318 if(lstrcmp(name,ppobj_Member[i]->name)==0){ 327 319 return 1; … … 330 322 331 323 //静的メンバ 332 for (i=0;i<iStaticMemberNum;i++){333 if( lstrcmp(name,ppobj_StaticMember[i]->name)==0){324 foreach( CMember *member, staticMembers ){ 325 if( lstrcmp( name, member->name ) == 0 ){ 334 326 return 1; 335 327 } … … 911 903 pobj_c->ppobj_Member=(CMember **)HeapAlloc(hHeap,0,1); 912 904 pobj_c->iMemberNum=0; 913 pobj_c->ppobj_StaticMember=(CMember **)HeapAlloc(hHeap,0,1);914 pobj_c->iStaticMemberNum=0;915 905 916 906 pobj_c->ConstructorMemberSubIndex=-1; … … 1069 1059 pobj_c->ppobj_Member=(CMember **)HeapAlloc(hHeap,0,1); 1070 1060 pobj_c->iMemberNum=0; 1071 pobj_c->ppobj_StaticMember=(CMember **)HeapAlloc(hHeap,0,1);1072 pobj_c->iStaticMemberNum=0;1073 1061 1074 1062 pobj_c->ConstructorMemberSubIndex=-1;
Note:
See TracChangeset
for help on using the changeset viewer.