New enterLong() TMF overload with void pointer

Posted By: AndrewAMD

New enterLong() TMF overload with void pointer - 11/09/20 02:33

jcl,

Currently, enterLong() and enterShort() have an overload where you can supply a function pointer and up to eight doubles. But what if I wanted to supply strings or integers or floats or any combination thereof?

Why not let me supply a pointer to raw data, and Zorro can copy sizeof(var * NUM_SKILLS) to TRADE->Skill.

Something like...
Code
enterLong(function, void* data)
or for a memcpy length cap...
Code
enterLong(function, void* data, size_t size)
Posted By: AndrewAMD

Re: New enterLong() TMF overload with void pointer - 11/09/20 22:40

In retrospect, it looks like I confused TRADE->fArgs with TRADE->fSkill. Hmm...
Posted By: jcl

Re: New enterLong() TMF overload with void pointer - 11/10/20 09:10

I think you can do that already, like this:

ThisTrade = enterLong(TMF);
if(ThisTrade) memcpy(ThisTrade->Skill,Data,NUM_SKILLS*sizeof(var));
Posted By: AndrewAMD

Re: New enterLong() TMF overload with void pointer - 11/10/20 12:03

Yes, that should work just fine. Thanks.
© 2024 lite-C Forums