Interfacing with C functions from XOPs with unsigned long long return values
Fri, 05/04/2018 - 03:13 am
I'm thinking about adding a XOP which uses https://github.com/Cyan4973/xxHash to calculate hash sums. In my tests it is much faster than WaveCRC.
One problem is that the hash function  returns an unsigned long long which is a 64bit integer on Windows 64bit. And I can't return that from an XOP function AFAIK.
The following work arounds spring to mind:
- Return a string with the stringified hash
- Use a 64bit integer wave for transfer
- Return a struct with pass-by-reference with a 64bit integer
But all include additional work and make for an ugly interface.
Any other options I have missed?
I think if I do
int64 val = FancyHash(myWave)
where FancyHash returns a 64bit interger as a double I don't get what I expect as Igor will convert from double to integer.