Changeset 62 in dev for BasicCompiler_Common
- Timestamp:
- Feb 22, 2007, 3:57:56 AM (18 years ago)
- Location:
- BasicCompiler_Common
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Class.cpp
r59 r62 127 127 sprintf(temporary,"%s.%s",pobj_c->name,member->name); 128 128 AddGlobalVariable( 129 false, 129 130 temporary, 130 131 member->SubScripts, -
BasicCompiler_Common/Variable.cpp
r57 r62 1137 1137 1138 1138 1139 void AddGlobalVariable( char *name,int *SubScripts,TYPEINFO *pTypeInfo,int TypeSize,char *InitBuf,char *ConstractParameter,DWORD dwFlag){1139 void AddGlobalVariable(bool isRef, char *name,int *SubScripts,TYPEINFO *pTypeInfo,int TypeSize,char *InitBuf,char *ConstractParameter,DWORD dwFlag){ 1140 1140 ///////////////////////// 1141 1141 // グローバル変数を追加 … … 1159 1159 1160 1160 GlobalVar=(VARIABLE *)HeapReAlloc(hHeap,0,GlobalVar,(MaxGlobalVarNum+1)*sizeof(VARIABLE)); 1161 VARIABLE *pVar = &GlobalVar[MaxGlobalVarNum]; 1162 MaxGlobalVarNum++; 1163 1164 if( isRef ){ 1165 //参照型 1166 pVar->fRef = REF_VARIABLE; 1167 TypeSize = PTR_SIZE; 1168 } 1169 else pVar->fRef=0; 1161 1170 1162 1171 for(i2=1,i3=0;i3<255;i3++){ 1163 1172 //配列要素数 1164 GlobalVar[MaxGlobalVarNum].SubScripts[i3]=SubScripts[i3];1173 pVar->SubScripts[i3]=SubScripts[i3]; 1165 1174 1166 1175 if(SubScripts[i3]==-1) break; … … 1170 1179 if(VarSize%PTR_SIZE) VarSize+=PTR_SIZE-(VarSize%PTR_SIZE); 1171 1180 1172 //新しいオブジェクトポインタを取得1173 VARIABLE *pVar = &GlobalVar[MaxGlobalVarNum];1174 1175 //グローバル変数の個数を増加1176 MaxGlobalVarNum++;1177 1178 1181 lstrcpy(pVar->name,name); 1179 pVar->fRef = 0;1180 1182 if(dwFlag & DIMFLAG_CONST) pVar->bConst = true; 1181 1183 else pVar->bConst = false; … … 1218 1220 //単発式が初期値のオブジェクトの場合 1219 1221 //初期値をコピーコンストラクタに渡す 1222 1223 if( isRef ){ 1224 SetRefVariable( name, InitBuf ); 1225 } 1220 1226 } 1221 1227 else{ -
BasicCompiler_Common/Variable.h
r49 r62 28 28 BOOL GetDimentionFormat(const char *buffer, const bool isRef, char *VarName,int *SubScripts,TYPEINFO *pTypeInfo,char *InitBuf,char *ConstractParameter); 29 29 BOOL GetNowStaticVarFullName(char *VarName,char *FullName); 30 void AddGlobalVariable( char *name,int *SubScripts,TYPEINFO *pTypeInfo,int TypeSize,char *InitBuf,char *ConstractParameter,DWORD dwFlag);30 void AddGlobalVariable(bool isRef, char *name,int *SubScripts,TYPEINFO *pTypeInfo,int TypeSize,char *InitBuf,char *ConstractParameter,DWORD dwFlag); 31 31
Note:
See TracChangeset
for help on using the changeset viewer.