See if the following helps. The test function returns a double with opposite byte order.
#include <utility.h>
#include <formatio.h>
#include <ansi_c.h>
double test(double dbl)
{
int intBuffer[sizeof(double)/sizeof(int)],
intBuffer2[sizeof(double)/sizeof(int)];
double result;
memcpy(intBuffer, &dbl, sizeof(intBuffer));
Fmt(&intBuffer2[1], "%i[o3210]<%i", intBuffer[0]);
Fmt(&intBuffer2[0], "%i[o3210]<%i", intBuffer[1]);
memcpy(&result, intBuffer2, sizeof(result));
return result;
}
void main(void)
{
__int64 i64 = 0x0A0B0C0D0E0F0102;
double dbl1, dbl2;
void *p1 = &dbl1, *p2 = &dbl2;
// assign a nice pattern to the double for testing
memcpy(&dbl1, &i64, sizeof(double));
dbl2 = test(dbl1);
// look at p1 and p2 in memory window to check byte order
Breakpoint();
}