Changeset 63 in dev for BasicCompiler32/Compile_Var.cpp


Ignore:
Timestamp:
Feb 23, 2007, 2:12:26 AM (18 years ago)
Author:
dai_9181
Message:

CClass::GetSize、CClass::GetMemberOffsetを追加

File:
1 edited

Legend:

Unmodified
Added
Removed
  • BasicCompiler32/Compile_Var.cpp

    r62 r63  
    2525        *pType=MAKE_PTR_TYPE(NATURAL_TYPE(*pType),PTR_LEVEL(*pType)-1);
    2626        if((*pType)==DEF_OBJECT){
     27            CClass *pClass = (CClass *)lpIndex;
     28            int objsize = pClass->GetSize();
     29
    2730            //imul ebx,objsize
    2831            OpBuffer[obp++]=(char)0x69;
    2932            OpBuffer[obp++]=(char)0xDB;
    30             *((long *)(OpBuffer+obp))=GetSizeOfClassMember((CClass *)lpIndex,NULL,NULL);
     33            *((long *)(OpBuffer+obp))=objsize;
    3134            obp+=sizeof(long);
    3235        }
     
    158161}
    159162BOOL GetMemberOffset(bool isErrorEnabled, bool isWriteAccess, CClass *pobj_c, char *member, int *pType, RELATIVE_VAR *pRelativeVar, LONG_PTR *plpNestIndex, BOOL bPrivateAccess){
    160     int i,offset;
     163    int i;
    161164
    162165    //クラス、配列の構成要素を解析する
     
    173176    ////////////////////////////
    174177
    175     offset=GetSizeOfClassMember(pobj_c,VarName,&i);
     178    int offset=pobj_c->GetMemberOffset( VarName, &i );
    176179    if(i==pobj_c->iMemberNum){
    177180        if(isErrorEnabled) SetError(103,VarName,cp);
     
    789792                i=GetOneParameter(InitBuf,i,temporary);
    790793
    791                 i3=GetSizeOfClassMember(pobj_c,pobj_c->ppobj_Member[i2]->name,NULL);
     794                i3=pobj_c->GetMemberOffset( pobj_c->ppobj_Member[i2]->name, NULL );
    792795
    793796                if(!SetInitGlobalData(offset+i3,
     
    922925                i=GetOneParameter(InitBuf,i,temporary);
    923926
    924                 i3=GetSizeOfClassMember(pobj_c,pobj_c->ppobj_Member[i2]->name,NULL);
     927                i3 = pobj_c->GetMemberOffset( pobj_c->ppobj_Member[i2]->name, NULL );
    925928
    926929                if(!InitLocalVar(offset+i3,
Note: See TracChangeset for help on using the changeset viewer.