Changeset 62 in dev for BasicCompiler_Common/Variable.cpp
- Timestamp:
- Feb 22, 2007, 3:57:56 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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{
Note:
See TracChangeset
for help on using the changeset viewer.