RE: fptr / Matt Lewis

new topic     » topic index » view thread      » older message » newer message

Yes, just yesterday I considered that, since I came across that problem.
For now, I use this piece of code to convert:

constant sign_conversion = allocate(4)
global function signed( atom x )
    poke4(sign_conversion,x)
    return peek4s( sign_conversion )
end function

In following the peek4 example, should I name them call_cdecls() and
call_cdeclu()?  Or just add call_cdecl_signed() to be really explicit?

Matt Lewis

> From: Andy Serpa [mailto:ac at onehorseshy.com]

> Hi Matt,
> 
> You ought to add duplicate versions of (or add a parameter to) the 
> call_xxx() functions that return signed values rather than 
> unsigned.  I 
> find most libraries I use return signed error codes from the 
> functions 
> and put the "real" return value in some pre-allocated 
> location that you 
> pass as a parameter....

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu