Changeset 46 in dev for BasicCompiler32/Compile_Func.cpp
- Timestamp:
- Feb 6, 2007, 1:19:17 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler32/Compile_Func.cpp
r28 r46 44 44 } 45 45 46 void Opcode_Func_Fix(c har *Parameter){46 void Opcode_Func_Fix(const char *Parameter){ 47 47 int i; 48 48 … … 161 161 } 162 162 163 void Opcode_Func_CUDbl(c har *Parameter){163 void Opcode_Func_CUDbl(const char *Parameter){ 164 164 int i; 165 165 … … 185 185 op_add_esp(8); 186 186 } 187 void Opcode_Func_Len(c har *Parameter){187 void Opcode_Func_Len(const char *Parameter){ 188 188 int type,TypeSize; 189 189 LONG_PTR lpIndex; … … 192 192 type=GetVarType(Parameter,&lpIndex,0); 193 193 194 c har *tempParm=Parameter;194 const char *tempParm=Parameter; 195 195 char temporary[VN_SIZE]; 196 196 char temp2[32]; … … 241 241 obp+=sizeof(long); 242 242 } 243 void Opcode_Func_AddressOf(c har *name){243 void Opcode_Func_AddressOf(const char *name){ 244 244 extern int cp; 245 245 SUBINFO *psi; … … 353 353 psi->bUse=1; 354 354 } 355 void Opcode_Func_SizeOf(c har *Parameter){355 void Opcode_Func_SizeOf(const char *Parameter){ 356 356 int type,size; 357 357 LONG_PTR lpIndex; … … 370 370 obp+=sizeof(long); 371 371 } 372 void Opcode_Func_VarPtr(char *Parameter){ 373 int type; 372 void Opcode_Func_VarPtr( const char *Parameter, TYPEINFO &ReturnTypeInfo ){ 374 373 RELATIVE_VAR RelativeVar; 375 374 376 375 //変数のアドレスを取得 377 if(!GetVarOffsetReadOnly(Parameter,&type,&RelativeVar,0)) return; 376 if(!GetVarOffsetReadOnly( Parameter, &ReturnTypeInfo.type, &RelativeVar, &ReturnTypeInfo.u.lpIndex )) return; 377 378 PTR_LEVEL_UP( ReturnTypeInfo.type ); 378 379 379 380 SetVarPtrToEax(&RelativeVar); 380 381 } 381 void Opcode_Func_GetPtrData(c har *Parameter,int type){382 void Opcode_Func_GetPtrData(const char *Parameter,const int type){ 382 383 int i2; 383 384 … … 438 439 } 439 440 440 int Opcode_CallFunc(char *Parameter,int FuncNum){441 void Opcode_CallFunc( const char *Parameter, const int FuncNum, TYPEINFO &ReturnTypeInfo ){ 441 442 switch(FuncNum){ 442 443 case FUNC_FIX: 443 444 Opcode_Func_Fix(Parameter); 444 return DEF_LONG; 445 ReturnTypeInfo.type = DEF_LONG; 446 break; 445 447 case FUNC_CUDBL: 446 448 Opcode_Func_CUDbl(Parameter); 447 return DEF_DOUBLE; 449 ReturnTypeInfo.type = DEF_DOUBLE; 450 break; 448 451 case FUNC_LEN: 449 452 Opcode_Func_Len(Parameter); 450 return DEF_LONG; 453 ReturnTypeInfo.type = DEF_LONG; 454 break; 451 455 case FUNC_ADDRESSOF: 452 456 Opcode_Func_AddressOf(Parameter); 453 return DEF_PTR_VOID; 457 ReturnTypeInfo.type = DEF_PTR_VOID; 458 break; 454 459 case FUNC_SIZEOF: 455 460 Opcode_Func_SizeOf(Parameter); 456 return DEF_LONG; 461 ReturnTypeInfo.type = DEF_LONG; 462 break; 457 463 case FUNC_VARPTR: 458 Opcode_Func_VarPtr( Parameter);459 return DEF_PTR_VOID;464 Opcode_Func_VarPtr( Parameter, ReturnTypeInfo ); 465 break; 460 466 461 467 case FUNC_GETDOUBLE: 462 468 Opcode_Func_GetPtrData(Parameter,DEF_DOUBLE); 463 return DEF_DOUBLE; 469 ReturnTypeInfo.type = DEF_DOUBLE; 470 break; 464 471 case FUNC_GETSINGLE: 465 472 Opcode_Func_GetPtrData(Parameter,DEF_SINGLE); 466 return DEF_SINGLE; 473 ReturnTypeInfo.type = DEF_SINGLE; 474 break; 467 475 case FUNC_GETQWORD: 468 476 Opcode_Func_GetPtrData(Parameter,DEF_QWORD); 469 return DEF_QWORD; 477 ReturnTypeInfo.type = DEF_QWORD; 478 break; 470 479 case FUNC_GETDWORD: 471 480 Opcode_Func_GetPtrData(Parameter,DEF_DWORD); 472 return DEF_DWORD; 481 ReturnTypeInfo.type = DEF_DWORD; 482 break; 473 483 case FUNC_GETWORD: 474 484 Opcode_Func_GetPtrData(Parameter,DEF_WORD); 475 return DEF_WORD; 485 ReturnTypeInfo.type = DEF_WORD; 486 break; 476 487 case FUNC_GETBYTE: 477 488 Opcode_Func_GetPtrData(Parameter,DEF_BYTE); 478 returnDEF_BYTE;479 }480 return 0;481 } 489 ReturnTypeInfo.type = DEF_BYTE; 490 break; 491 } 492 }
Note:
See TracChangeset
for help on using the changeset viewer.