+ "Nikodemus Siivola" <nikodemus@...>:
| On 8/7/07, Yaroslav Kavenchuk <kavenchuk@...> wrote:
| > SBCL 188.8.131.52, win32
| > alien function define as:
| > (define-alien-routine ("c-name" lisp-name) char
| > (ptr system-area-pointer))
| > but
| > CL-USER> (lisp-name ptr)
| > 36715267
| > CL-USER> (format nil "~X" *)
| > "2303B03"
| > But need 3.
| I'm probably just out of coffee, but I don't understand what you are saying.
I'm not yet out of coffee, so I'll give it a shot.
| "need 3" what? What's the C function you are calling? What is the
| value of the PTR argument? What did you expect to get?
The value of PTR is probably irrelevant. The C function is declared
to return a C char, but he gets 36715267, which is rather difficult to
interpret as a C char. Then he guesses, with or without good reason,
that the value he is after is in the bottom 8 bits of the answer
returned. In any case, the return value seems nonsensical if it is to
be interpreted as a C char. But then I am not precisely an alien
guru. (Hmm, that could be misinterpreted. But it's correct in either
interpretation, so I'll let it stand.)