Index: BasicCompiler32/Compile_Statement.cpp
===================================================================
--- BasicCompiler32/Compile_Statement.cpp	(revision 75)
+++ BasicCompiler32/Compile_Statement.cpp	(revision 76)
@@ -71,8 +71,7 @@
 	}
 
-
 	int idProc;
-	void *pInfo;
-	idProc=GetProc(buffer,&pInfo);
+	void *pProc;
+	idProc=GetProc(buffer,(void **)&pProc);
 
 	int i4;
@@ -92,6 +91,6 @@
 		////////////////
 
-		LONG_PTR lp;
-		i2=CallProc(idProc,pInfo,buffer,temp2,&lp);
+		Type resultType;
+		CallProc(idProc,pProc,buffer,temp2,resultType);
 
 
@@ -100,14 +99,14 @@
 		/////////////////////
 
-		if(i2==DEF_DOUBLE||i2==DEF_SINGLE){
+		if( resultType.IsReal() ){
 			//fstp st(0)
 			OpBuffer[obp++]=(char)0xDD;
 			OpBuffer[obp++]=(char)0xD8;
 		}
-		if(i2==DEF_STRUCT){
+		else if( resultType.IsStruct() ){
 			//mov ebx,eax
 			op_mov_RR(REG_EBX,REG_EAX);
 
-			FreeTempObject(REG_EBX,(CClass *)lp);
+			FreeTempObject(REG_EBX,&resultType.GetClass());
 		}
 		return;
@@ -122,5 +121,6 @@
 
 void OpcodeIf(char *Parameter){
-	int i,i2,i3,i4,type;
+	int i,i2,i3,i4;
+	Type tempType;
 
 	for(i=0;;i++){
@@ -135,11 +135,9 @@
 	}
 
-	type=NumOpe(Parameter,0,0,0);
-
-	if(type==-1){
+	if( !NumOpe(Parameter,Type(),tempType) ){
 		//NumOpe内でエラー
 		i3=-1;	//ダミー
 	}
-	else if(type==DEF_DOUBLE){
+	else if( tempType.IsDouble() ){
 		//fld qword ptr[esp]
 		op_fld_ptr_esp(DEF_DOUBLE);
@@ -175,5 +173,5 @@
 		i3=obp;
 	}
-	else if(type==DEF_SINGLE){
+	else if( tempType.IsSingle() ){
 		//fld dword ptr[esp]
 		op_fld_ptr_esp(DEF_SINGLE);
@@ -209,5 +207,5 @@
 		i3=obp;
 	}
-	else if(type==DEF_INT64||type==DEF_QWORD){
+	else if( tempType.Is64() ){
 		//64ビット型
 
@@ -383,5 +381,5 @@
 void OpcodeWhile(char *Parameter){
 	extern HANDLE hHeap;
-	int i2,i3,type;
+	int i2,i3 = 0;
 
 	//Continueアドレスのバックアップとセット
@@ -392,8 +390,12 @@
 
 	if(!Parameter[0]) SetError(10,"While",cp);
-	type=NumOpe(Parameter,0,0,0);
 
 	int je_schedule;
-	if(type==DEF_DOUBLE){
+	Type tempType;
+	if( !NumOpe(Parameter,Type(),tempType) ){
+		//ダミー
+		i3=-1;
+	}
+	else if( tempType.IsDouble() ){
 		//fld qword ptr[esp]
 		op_fld_ptr_esp(DEF_DOUBLE);
@@ -429,5 +431,5 @@
 		je_schedule=obp;
 	}
-	else if(type==DEF_SINGLE){
+	else if( tempType.IsSingle() ){
 		//fld dword ptr[esp]
 		op_fld_ptr_esp(DEF_SINGLE);
@@ -463,5 +465,5 @@
 		je_schedule=obp;
 	}
-	else if(type==DEF_INT64||type==DEF_QWORD){
+	else if( tempType.Is64() ){
 		//64ビット型
 
@@ -533,4 +535,8 @@
 
 	obj_LexScopes.CallDestructorsOfScopeEnd();
+
+	if( i3 == -1 ){
+		return;
+	}
 
 	//jmp ...
@@ -605,5 +611,5 @@
 	//増加か減少かを区別する
 	sprintf(temporary,"(%s)>=0",StepNum);
-	NumOpe(temporary,0,0,0);
+	NumOpe(temporary,Type(),Type());
 
 	//pop eax
@@ -623,5 +629,5 @@
 	//判定（カウンタ増加の場合）
 	sprintf(temporary,"%s<=(%s)",variable,JudgeNum);
-	NumOpe(temporary,0,0,0);
+	NumOpe(temporary,Type(),Type());
 
 	//pop eax
@@ -637,5 +643,5 @@
 	//判定（カウンタ減少の場合）
 	sprintf(temporary,"%s>=(%s)",variable,JudgeNum);
-	NumOpe(temporary,0,0,0);
+	NumOpe(temporary,Type(),Type());
 
 	//pop eax
@@ -687,5 +693,5 @@
 void OpcodeDo(char *Parameter){
 	extern HANDLE hHeap;
-	int i,i2,i3,i4,type;
+	int i,i2,i3,i4;
 
 	if(Parameter[0]) SetError(10,"Do",cp);
@@ -724,7 +730,8 @@
 			}
 
-			type=NumOpe(temporary,0,0,0);
-
-			if(type==DEF_DOUBLE){
+			Type tempType;
+			NumOpe(temporary,Type(),tempType);
+
+			if( tempType.IsDouble() ){
 				//fld qword ptr[esp]
 				op_fld_ptr_esp(DEF_DOUBLE);
@@ -767,5 +774,5 @@
 				}
 			}
-			else if(type==DEF_SINGLE){
+			else if( tempType.IsSingle() ){
 				//fld dword ptr[esp]
 				op_fld_ptr_esp(DEF_SINGLE);
@@ -808,5 +815,5 @@
 				}
 			}
-			else if(type==DEF_INT64||type==DEF_QWORD){
+			else if( tempType.Is64() ){
 				//64ビット型
 
@@ -933,6 +940,5 @@
 	extern HANDLE hHeap;
 
-	extern BOOL bCompilingGlobal;
-	if(bCompilingGlobal){
+	if( UserProc::IsGlobalAreaCompiling() ){
 		SetError(12,"Exit Sub/Function",cp);
 		return;
@@ -963,5 +969,5 @@
 
 int CaseTypeSize;
-void OpcodeSelect(const char *lpszParams){
+void OpcodeSelect(const char *lpszParms){
 	extern DWORD *pCaseSchedule;
 	extern int CaseScheduleNum;
@@ -970,5 +976,5 @@
 	extern HANDLE hHeap;
 	extern char *basbuf;
-	int i,i2,i3,sw,type1,type2,NowCaseCp;
+	int i,i2,i3,sw,NowCaseCp;
 	char temporary[VN_SIZE];
 
@@ -986,15 +992,12 @@
 	NowCaseSchedule=0;
 
-	LONG_PTR lpIndex;
-	type1=NumOpe(lpszParams,0,0,&lpIndex);
-	if(type1==DEF_INTEGER||
-		type1==DEF_WORD||
-		type1==DEF_SBYTE||
-		type1==DEF_BYTE||
-		type1==DEF_BOOLEAN||
-		type1==DEF_CHAR) CaseTypeSize=sizeof(long);
-	else{
-		CaseTypeSize=GetTypeSize(type1,lpIndex);
-		if(type1==DEF_OBJECT) CaseTypeSize=PTR_SIZE;
+	Type type1;
+	if( !NumOpe(lpszParms,Type(), type1 ) ){
+		return;
+	}
+
+	CaseTypeSize = type1.GetSize();
+	if( CaseTypeSize < sizeof(long) ){
+		CaseTypeSize=sizeof(long);
 	}
 
@@ -1067,15 +1070,14 @@
 				cp=NowCaseCp;
 
-				LONG_PTR lpIndex2;
-				type2=NumOpe(temporary,type1,lpIndex,&lpIndex2);
+				Type type2;
+				if( !NumOpe(temporary,type1,type2) ){
+					return;
+				}
 
 				cp=i2;
 
-				if(type1==DEF_OBJECT){
-					CClass *pobj_c;
-					pobj_c=(CClass *)lpIndex;
-
+				if(type1.IsObject()){
 					std::vector<UserProc *> subs;
-					pobj_c->EnumMethod( CALC_EQUAL, subs );
+					type1.GetClass().EnumMethod( CALC_EQUAL, subs );
 					if( subs.size() == 0 ){
 						return;
@@ -1083,5 +1085,5 @@
 
 					Parameters params;
-					params.push_back( new Parameter( "", Type( type2, lpIndex2 ) ) );
+					params.push_back( new Parameter( "", Type( type2 ) ) );
 
 					//オーバーロードを解決
@@ -1121,6 +1123,6 @@
 					obp+=sizeof(long);
 				}
-				else if(type1==DEF_DOUBLE){
-					ChangeTypeToDouble(type2);
+				else if(type1.IsDouble()){
+					ChangeTypeToDouble(type2.GetBasicType());
 
 					//fld qword ptr[esp]
@@ -1152,6 +1154,6 @@
 					obp+=sizeof(long);
 				}
-				else if(type1==DEF_SINGLE){
-					ChangeTypeToSingle(type2);
+				else if(type1.IsSingle()){
+					ChangeTypeToSingle(type2.GetBasicType());
 
 					//fld dword ptr[esp]
@@ -1314,6 +1316,5 @@
 }
 void OpcodeReturn(char *Parameter){
-	extern BOOL bCompilingGlobal;
-	if(bCompilingGlobal){
+	if( UserProc::IsGlobalAreaCompiling() ){
 		//Gosub～Returnとして扱う
 
@@ -1324,10 +1325,13 @@
 		//戻り値をセット
 		if(Parameter[0]){
-			extern UserProc *pCompilingUserProc;
+			UserProc &proc = UserProc::CompilingUserProc();
+
 			const char *temp = "_System_ReturnValue";
-			if(pCompilingUserProc->GetName()[0]==1&&pCompilingUserProc->GetName()[1]==ESC_OPERATOR)
+			if(proc.GetName()[0]==1&&proc.GetName()[1]==ESC_OPERATOR)
 			{
 			}
-			else temp=pCompilingUserProc->GetName().c_str();
+			else{
+				temp=proc.GetName().c_str();
+			}
 
 			char temporary[VN_SIZE];
@@ -1341,427 +1345,10 @@
 }
 
-void Opcode_Input(const char *Parameter){
-	extern int cp;
-	int i2,i3,i4,i5,type;
-	BOOL bFile;
-	char temporary[VN_SIZE],temp2[VN_SIZE],buffer[VN_SIZE];
-
-	if(Parameter[0]=='#'){
-		bFile=1;
-		for(i2=0,i3=1;;i2++,i3++){
-			buffer[i2]=Parameter[i3];
-			if(Parameter[i3]==','||Parameter[i3]=='\0') break;
-		}
-		buffer[i2+1]=0;
-		i2=i3+1;
-	}
-	else{
-		bFile=0;
-		i2=0;
-		buffer[0]=0;
-
-		//表示用文字列パラメータをセット
-		if(Parameter[0]=='\"'){
-			buffer[0]='\"';
-			for(i2=1;;i2++){
-				if(Parameter[i2]=='\"'){
-					buffer[i2]=0;
-					break;
-				}
-				buffer[i2]=Parameter[i2];
-			}
-			if(Parameter[i2+1]==';') lstrcpy(buffer+i2,"? \"");
-			else if(Parameter[i2+1]==',') lstrcpy(buffer+i2,"\"");
-			else SetError(10,"Input",cp);
-			i2+=2;
-		}
-		else if((Parameter[0]=='e'||Parameter[0]=='E')&&
-			(Parameter[1]=='x'||Parameter[1]=='X')&&
-			Parameter[2]=='\"'){
-			memcpy(buffer,Parameter,3);
-			for(i2=3;;i2++){
-				if(Parameter[i2]=='\"'){
-					buffer[i2]=0;
-					break;
-				}
-				buffer[i2]=Parameter[i2];
-			}
-			if(Parameter[i2+1]==';') lstrcpy(buffer+i2,"? \"");
-			else if(Parameter[i2+1]==',') lstrcpy(buffer+i2,"\"");
-			else SetError(10,"Input",cp);
-			i2+=2;
-		}
-		else{
-			lstrcpy(buffer,"\"? \"");
-			i2=0;
-		}
-	}
-
-	//変数ポインタ、変数のタイプをセット
-	i4=0;
-	while(1){
-		for(i3=0;;i2++,i3++){
-			if(Parameter[i2]=='('){
-				i5=GetStringInPare(temporary+i3,Parameter+i2);
-				i2+=i5-1;
-				i3+=i5-1;
-			}
-			if(Parameter[i2]=='['){
-				i5=GetStringInBracket(temporary+i3,Parameter+i2);
-				i2+=i5-1;
-				i3+=i5-1;
-			}
-			if(Parameter[i2]==','){
-				temporary[i3]=0;
-				i2++;
-				break;
-			}
-			temporary[i3]=Parameter[i2];
-			if(Parameter[i2]=='\0') break;
-		}
-		if(temporary[0]=='\0'){
-			SetError(10,"Input",cp);
-			return;
-		}
-
-		LONG_PTR lpIndex;
-		type = GetVarType(temporary,&lpIndex,1);
-
-		sprintf(temp2,"_System_InputDataPtr[%d]=VarPtr(%s)",i4,temporary);
-		OpcodeCalc(temp2);
-
-		if(type==DEF_LONG) type=DEF_DWORD;
-		else if(type==DEF_INTEGER) type=DEF_WORD;
-		else if(type==DEF_OBJECT){
-			CClass *pobj_Class=(CClass *)lpIndex;
-			if(lstrcmp(pobj_Class->name,"String")==0) type=DEF_STRING;
-		}
-		sprintf(temp2,"_System_InputDataType[%d]=%d",i4,type);
-		OpcodeCalc(temp2);
-
-		i4++;
-		if(Parameter[i2]=='\0') break;
-	}
-	sprintf(temp2,"_System_InputDataPtr[%d]=0",i4);
-	OpcodeCalc(temp2);
-
-	UserProc *pUserProc;
-	if(bFile) pUserProc=GetSubHash("INPUT_FromFile");
-	else pUserProc=GetSubHash("INPUT_FromPrompt");
-	if(!pUserProc){
-		SetError(3,"Input",cp);
-		return;
-	}
-	Opcode_CallProc(buffer,pUserProc,0,"",0);
-}
-void Opcode_PrintUsing(const char *Parameter,char *buffer,BOOL bFile){
-	extern int cp;
-	int i2,i3,i4,i5;
-	char temporary[VN_SIZE],temp2[8192];
-	BOOL bReturnLine;
-
-	char parms[8192];
-	lstrcpy( parms, Parameter );
-
-	i2=lstrlen(parms);
-	if(parms[i2-1]==';'){
-		bReturnLine=0;
-		parms[i2-1]=0;
-	}
-	else bReturnLine=1;
-
-	i3=lstrlen(buffer);
-	for(i2=0;;i2++,i3++){
-		if(parms[i2]==';'){
-			buffer[i3]=0;
-			break;
-		}
-		buffer[i3]=parms[i2];
-		if(parms[i2]=='\0') break;
-	}
-	if(parms[i2]==';') i2++;
-
-	if(bReturnLine) lstrcat(buffer,"+Ex\"\\r\\n\"");
-
-	//データポインタ、データのタイプをセット
-	i4=0;
-	while(1){
-		for(i3=0;;i2++,i3++){
-			if(parms[i2]=='\"'){
-				temporary[i3]=parms[i2];
-				for(i2++,i3++;;i2++,i3++){
-					temporary[i3]=parms[i2];
-					if(parms[i2]=='\"') break;
-				}
-				continue;
-			}
-			if(parms[i2]=='('){
-				i5=GetStringInPare(temporary+i3,parms+i2);
-				i2+=i5-1;
-				i3+=i5-1;
-				continue;
-			}
-			if(parms[i2]=='['){
-				i5=GetStringInBracket(temporary+i3,parms+i2);
-				i2+=i5-1;
-				i3+=i5-1;
-				continue;
-			}
-			if(parms[i2]==','){
-				temporary[i3]=0;
-				i2++;
-				break;
-			}
-			temporary[i3]=parms[i2];
-			if(parms[i2]=='\0') break;
-		}
-		if(temporary[0]=='\0'){
-			SetError(10,"Print",cp);
-			return;
-		}
-
-		int iResult;
-		iResult=IsStrCalculation(temporary);
-
-		if(iResult==1){
-			//文字列
-			sprintf(temp2,"_System_UsingStrData[%d]=%s",i4,temporary);
-			OpcodeCalc(temp2);
-
-			sprintf(temp2,"_System_UsingDataType[%d]=%d",i4,DEF_STRING);
-			OpcodeCalc(temp2);
-		}
-		else if(iResult==0){
-			//数値
-			sprintf(temp2,"_System_UsingDblData[%d]=%s",i4,temporary);
-			OpcodeCalc(temp2);
-
-			sprintf(temp2,"_System_UsingDataType[%d]=%d",i4,DEF_DOUBLE);
-			OpcodeCalc(temp2);
-		}
-		//else if(iResult==-1) エラー
-
-		i4++;
-		if(parms[i2]=='\0') break;
-	}
-	sprintf(temp2,"_System_UsingDataType[%d]=-1",i4);
-	OpcodeCalc(temp2);
-
-	UserProc *pUserProc;
-	if(bFile) pUserProc=GetSubHash("PRINTUSING_ToFile");
-	else pUserProc=GetSubHash("PRINTUSING_ToPrompt");
-	if(!pUserProc){
-		SetError(3,"Print",cp);
-		return;
-	}
-	Opcode_CallProc(buffer,pUserProc,0,"",0);
-}
-void Opcode_Print(const char *Parameter,BOOL bWrite){
-	int i2,i3,i4,sw;
-	char temporary[VN_SIZE],buffer[VN_SIZE];
-	BOOL bFile;
-
-	if(Parameter[0]=='#'){
-		bFile=1;
-		for(i2=0,i3=1;;i2++,i3++){
-			buffer[i2]=Parameter[i3];
-			if(Parameter[i3]==','||Parameter[i3]=='\0') break;
-		}
-		buffer[i2+1]=0;
-		if(Parameter[i3]==',') i3++;
-		i2=i3;
-	}
-	else{
-		bFile=0;
-		i2=0;
-		buffer[0]=0;
-	}
-	if(Parameter[i2]==1&&Parameter[i2+1]==ESC_USING){
-		Opcode_PrintUsing(Parameter+i2+2,buffer,bFile);
-		return;
-	}
-
-	lstrcat(buffer,"_System_DummyStr+");
-
-	sw=1;
-	while(1){
-		for(i3=0;;i2++,i3++){
-			if(Parameter[i2]=='\"'){
-				temporary[i3]=Parameter[i2];
-				for(i2++,i3++;;i2++,i3++){
-					temporary[i3]=Parameter[i2];
-					if(Parameter[i2]=='\"') break;
-				}
-				continue;
-			}
-			if(Parameter[i2]=='('){
-				i4=GetStringInPare(temporary+i3,Parameter+i2);
-				i2+=i4-1;
-				i3+=i4-1;
-				continue;
-			}
-			if(Parameter[i2]=='['){
-				i4=GetStringInBracket(temporary+i3,Parameter+i2);
-				i2+=i4-1;
-				i3+=i4-1;
-				continue;
-			}
-			if(Parameter[i2]==','||Parameter[i2]==';'){
-				temporary[i3]=0;
-				break;
-			}
-			temporary[i3]=Parameter[i2];
-			if(Parameter[i2]=='\0') break;
-		}
-
-		if(temporary[0]=='\0') lstrcat(buffer,"\"\"");
-		else{
-			int iResult;
-			iResult=IsStrCalculation(temporary);
-			if(iResult==-1){
-				//エラー
-				lstrcat(buffer,"\"\"");
-			}
-			else if(iResult){
-				//文字列
-				lstrcat(buffer,temporary);
-			}
-			else{
-				//数値
-				sprintf(buffer+lstrlen(buffer),"Str$(%s)",temporary);
-			}
-		}
-
-		if(Parameter[i2]==','){
-			if(bWrite) lstrcat(buffer,"+\",\"+");
-			else lstrcat(buffer,"+\"\t\"+");
-		}
-		else if(Parameter[i2]==';'){
-			if(Parameter[i2+1]=='\0'){
-				sw=0;
-				break;
-			}
-			if(bWrite) lstrcat(buffer,"+\",\"+");
-			else lstrcat(buffer,"+\" \"+");
-		}
-		else if(Parameter[i2]=='\0') break;
-
-		i2++;
-	}
-
-	if(sw) lstrcat(buffer,"+Ex\"\\r\\n\"");
-
-	UserProc *pUserProc;
-	if(bFile) pUserProc=GetSubHash("PRINT_ToFile");
-	else pUserProc=GetSubHash("PRINT_ToPrompt");
-	if(!pUserProc){
-		SetError(3,"Print",cp);
-		return;
-	}
-	Opcode_CallProc(buffer,pUserProc,0,"",0);
-}
-
-
-
 
 ////////////
 // ポインタ
 
-void OpcodeCallPtr(char *Parameter){
-	extern HANDLE hHeap;
-	int i,i2,i3,num,types[255];
-	BOOL bCdecl;
-	char szFuncPtr[VN_SIZE],temporary[VN_SIZE],*Parms[255];
-
-	//関数ポインタを取得
-	i=GetOneParameter(Parameter,0,szFuncPtr);
-
-	if(lstrcmpi(szFuncPtr,"cdecl")==0){
-		//cdeclが指定された場合は、第2パラメータを関数ポインタとして扱う
-		bCdecl=1;
-
-		i=GetOneParameter(Parameter,i,szFuncPtr);
-	}
-	else bCdecl=0;
-
-	if(Parameter[0]=='\0'){
-		SetError(10,"CallPtr",cp);
-	}
-
-	num=0;
-	while(Parameter[i]){
-		i=GetOneParameter(Parameter,i,temporary);
-
-		types[num]=DEF_LONG;
-
-		for(i2=0;;i2++){
-			if(temporary[i2]=='\0') break;
-			if(temporary[i2]==1&&temporary[i2+1]==ESC_AS){
-				LONG_PTR lp;
-				types[num]=GetTypeFixed(temporary+i2+2,&lp);
-
-				if(types[num]==DEF_OBJECT){
-					SetError(11,temporary+i2+2,cp);
-				}
-
-				temporary[i2]=0;
-				break;
-			}
-		}
-
-		Parms[num]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
-		lstrcpy(Parms[num],temporary);
-
-		num++;
-	}
-
-	int ParmSize=0;
-
-	for(i=num-1;i>=0;i--){
-		//スタックへプッシュ
-		i3=NumOpe(Parms[i],0,0,0);
-
-		switch(types[i]){
-			case DEF_INT64:
-			case DEF_QWORD:
-				ChangeTypeToInt64(i3);
-				break;
-			case DEF_SINGLE:
-				ChangeTypeToSingle(i3);
-				break;
-			case DEF_DOUBLE:
-				ChangeTypeToDouble(i3);
-				break;
-
-			default:
-				ChangeTypeToLong(i3);
-				break;
-		}
-
-		ParmSize+=GetTypeSize(types[i],0);
-
-		HeapDefaultFree(Parms[i]);
-	}
-
-	i3=NumOpe(szFuncPtr,0,0,0);
-	ChangeTypeToLong(i3);
-
-	//pop eax
-	op_pop(REG_EAX);
-
-	//call eax
-	OpBuffer[obp++]=(char)0xFF;
-	OpBuffer[obp++]=(char)0xD0;
-
-	if(bCdecl){
-		//スタックを戻す
-
-		//add esp,ParmSize
-		op_add_esp(ParmSize);
-	}
-}
-
 void OpcodeSetPtrData(char *Parameter,int type){
-	int i,i2;
+	int i;
 	char temporary[VN_SIZE];
 
@@ -1784,6 +1371,14 @@
 	}
 
-	i2=NumOpe(temporary,0,0,0);
-	ChangeTypeToLong(i2);
+	Type resultType;
+	if( !NumOpe(temporary,Type(),resultType) ){
+		return;
+	}
+	if(!resultType.IsWhole()){
+		SetError(11,Parameter,cp);
+		return;
+	}
+
+	ChangeTypeToLong( resultType.GetBasicType() );
 
 	//第２パラメータを取得
@@ -1794,7 +1389,10 @@
 	}
 
-	i2=NumOpe(temporary,0,0,0);
+	if( !NumOpe(temporary,Type(),resultType) ){
+		return;
+	}
+
 	if(type==DEF_DOUBLE){
-		ChangeTypeToDouble_ToFpuReg(i2);
+		ChangeTypeToDouble_ToFpuReg( resultType.GetBasicType() );
 
 		//pop eax
@@ -1806,5 +1404,5 @@
 	}
 	else if(type==DEF_SINGLE){
-		ChangeTypeToSingle(i2);
+		ChangeTypeToSingle( resultType.GetBasicType() );
 
 		//pop ebx
@@ -1819,5 +1417,5 @@
 	}
 	else if(type==DEF_QWORD){
-		ChangeTypeToInt64(i2);
+		ChangeTypeToInt64( resultType.GetBasicType() );
 
 		//pop ecx
@@ -1840,5 +1438,5 @@
 	}
 	else if(type==DEF_DWORD){
-		ChangeTypeToLong(i2);
+		ChangeTypeToLong( resultType.GetBasicType() );
 
 		//pop ebx
@@ -1853,5 +1451,5 @@
 	}
 	else if(type==DEF_WORD){
-		ChangeTypeToLong(i2);
+		ChangeTypeToLong( resultType.GetBasicType() );
 
 		//pop ebx
@@ -1867,5 +1465,5 @@
 	}
 	else if(type==DEF_BYTE){
-		ChangeTypeToLong(i2);
+		ChangeTypeToLong( resultType.GetBasicType() );
 
 		//pop ebx
