1. fptr / Matt Lewis
- Posted by Andy Serpa <ac at onehorseshy.com> Feb 13, 2003
- 458 views
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....
2. Re: fptr / Matt Lewis
- Posted by jbrown1050 at hotpop.com Feb 13, 2003
- 496 views
When I tried to use fptr.e for Winux, I came across 2 imediate problems. The first one, was that I seemed to crash and burn when calling void functions. The second, was that the parameters and return values were all assumed to be ints. What if i had wanted to pass a float, or a double, or a long long? (Or long double? tho currently Eu doesnt support that.) We need a way to specficy both return value and parameter value type conversion when calling functions by pointer. Perhaps a call_cdecl(fptr, param_type, params, ret_type) setup is needed. (We could even use C_INT and friends from dll.e, if wanted, for specifying type conversion.) jbrown On Thu, Feb 13, 2003 at 07:14:54AM -0500, Matthew Lewis wrote: > > 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.... > > > > TOPICA - Start your own email discussion group. FREE! -- /"\ ASCII ribbon | http://www.geocities.com/jbrown1050/ \ / campain against | Linux User:190064 X HTML in e-mail and | Linux Machine:84163 /*\ news, and unneeded MIME |