| 449 | } |
| 450 | |
| 451 | static asQWORD CallCDeclFunction(const asDWORD* pArgs, const asBYTE *pArgsType, int argSize, asDWORD func, void *retInMemory) |
| 452 | { |
| 453 | int baseArgCount = 0; |
| 454 | if( retInMemory ) |
| 455 | { |
| 456 | // the first argument is the 'return in memory' pointer |
| 457 | ppcArgs[0] = (asDWORD)retInMemory; |
| 458 | ppcArgsType[0] = ppcINTARG; |
| 459 | ppcArgsType[1] = ppcENDARG; |
| 460 | baseArgCount = 1; |
| 461 | } |
| 462 | |
| 463 | // put the arguments in the correct places in the ppcArgs array |
| 464 | int numTotalArgs = baseArgCount; |
| 465 | if( argSize > 0 ) |
| 466 | { |
| 467 | int intArgs = baseArgCount, floatArgs = 0, doubleArgs = 0, longArgs = 0; |
| 468 | stackArgs( pArgs, pArgsType, intArgs, floatArgs, doubleArgs, longArgs ); |
| 469 | numTotalArgs = intArgs + floatArgs + doubleArgs + longArgs; |
| 470 | } |
| 471 | else |
| 472 | { |
| 473 | // no arguments, cap the type list |
| 474 | ppcArgsType[baseArgCount] = ppcENDARG; |
| 475 | } |
| 476 | |
| 477 | // call the function with the arguments |
| 478 | return ppcFunc64( ppcArgs, PPC_STACK_SIZE(numTotalArgs), func ); |
| 479 | } |
| 480 | |
| 481 | // This function is identical to CallCDeclFunction, with the only difference that |
| 482 | // the value in the first parameter is the object (unless we are returning in memory) |
no test coverage detected