On 14 December 2012 20:48, Jimmie Houchin <jlhouchin@gmail.com> wrote:
Hello,
In my app using NB and have a few questions on types.
In one function I have an size_t *arg for an argument. Is NBUInt64 proper for this argument?
No. 'size_t*' is a pointer. A size_t type defined as an unsigned integer type, with range big enough to specify size(s) like array size, or a size of memory to allocate in bytes. On 32-bit systems size_t is unsigned 32-bit integer. And here how you can answer your question by yourself: NBFFICallout new resolveType: 'size_t*'
I also have a DATE which uses OLE Automation date format which is described as:
""" An OLE Automation date is implemented as a floating-point number whose integral component is the number of days before or after midnight, 30 December 1899, and whose fractional component represents the time on that day divided by 24. """
Would NBUInt64 be best or is NBUInt32 a better fit? I haven't seen a method for this particular date epoch, but I can easily write the method to handle conversion.
No. The C double type has a special discipline for returning it from function: - it is returned in FP register, unlike rest which using EAX/EDX registers. So, if you use either NBUInt64 or NBUInt32 you won't be able to get actual values which function returns. So, you should use 'double' type, which is alias for NBFloat64
Thanks for any wisdom and guidance.
Jimmie
-- Best regards, Igor Stasenko.