Changeset 40 in dev for BasicCompiler_Common/Object.cpp
- Timestamp:
- Jan 28, 2007, 3:48:22 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Object.cpp
r34 r40 17 17 18 18 for(i=0;i<pobj_c->iMemberNum;i++){ 19 if(pobj_c->ppobj_Member[i]->TypeInfo.type==DEF_OBJECT){ 19 CMember *pMember = pobj_c->ppobj_Member[i]; 20 21 if(pMember->TypeInfo.type==DEF_OBJECT && pMember->IsRef() == false){ 20 22 //メンバクラスのアラインメントを取得 21 member_size=GetAlignment(p obj_c->ppobj_Member[i]->TypeInfo.u.pobj_Class);23 member_size=GetAlignment(pMember->TypeInfo.u.pobj_Class); 22 24 } 23 25 else{ 24 26 //メンバサイズを取得 25 member_size =GetTypeSize(pobj_c->ppobj_Member[i]->TypeInfo.type,pobj_c->ppobj_Member[i]->TypeInfo.u.lpIndex);27 member_size = pMember->GetSize(); 26 28 } 27 29 … … 49 51 int iMaxAlign=0; 50 52 for(i=0;i<pobj_c->iMemberNum;i++){ 51 //メンバ変数の型サイズを取得52 i2=GetTypeSize(pobj_c->ppobj_Member[i]->TypeInfo.type,pobj_c->ppobj_Member[i]->TypeInfo.u.lpIndex); 53 i f(i2==-1) return -1;53 CMember *pMember = pobj_c->ppobj_Member[i]; 54 55 i2 = pMember->GetSize(); 54 56 55 57 //アラインメントを算出 56 58 int member_size; 57 if(p obj_c->ppobj_Member[i]->TypeInfo.type==DEF_OBJECT){59 if(pMember->TypeInfo.type==DEF_OBJECT){ 58 60 //メンバクラスのアラインメントを取得 59 member_size=GetAlignment(p obj_c->ppobj_Member[i]->TypeInfo.u.pobj_Class);61 member_size=GetAlignment(pMember->TypeInfo.u.pobj_Class); 60 62 } 61 63 else{ … … 83 85 if(pMemberName){ 84 86 //メンバ指定がある場合は、オフセットを返す 85 if(lstrcmp(p obj_c->ppobj_Member[i]->name,pMemberName)==0){87 if(lstrcmp(pMember->name,pMemberName)==0){ 86 88 if(pMemberNum) *pMemberNum=i; 87 89 return offset; … … 90 92 91 93 //配列を考慮したメンバサイズを取得 92 member_size=i2 * JumpSubScripts(p obj_c->ppobj_Member[i]->SubScripts);94 member_size=i2 * JumpSubScripts(pMember->SubScripts); 93 95 94 96 //メンバサイズを加算
Note:
See TracChangeset
for help on using the changeset viewer.