Re: IOLockSleepDeadline example in docu is wrong (won't compile)
Re: IOLockSleepDeadline example in docu is wrong (won't compile)
- Subject: Re: IOLockSleepDeadline example in docu is wrong (won't compile)
- From: Terry Lambert <email@hidden>
- Date: Tue, 4 Sep 2007 16:06:04 -0700
On Sep 4, 2007, at 5:22 AM, Markus Hanauska wrote:
I can't cast a number to a struct. Publishing source code that is
supposed to not even compile is not only silly and confusing
programmers, it's outreight useless.
Seeing that the struct is endian safe, I assume I can do the
following:
AbsoluteTime deadlineTime;
memcpy(&deadlineTime, deadline, sizeof(deadline));
correct?
You can do that, or you can explicitly coerce the type at the call
site (you can cast the address of a struct to a number pointer, and
dereferernce it if you are calling the one function, or explicitly
reference it if you're not.
This is basically a wart from the passing of the address of the hi and
lo values into a number of functions in user space case, which means
we could not convert it to a 64 bit type without changing the symbol
decoration used by C++, which would have introduced binary
compatibility issues.
A Google for the following keywords will find you a bunch of examples:
compile errors for AbsoluteTime
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden