From: Richard R. <rr...@ms...> - 2006-01-19 22:53:54
|
I know there is a method to the madness. Thanks Richard On Thu, 19 Jan 2006 er...@on... wrote: > Richard Ray <rr...@ms...> writes: > >>>>>> (alien-funcall (extern-alien "TIFFSetField" >>>>>> (function int system-area-pointer int float)) >>>>>> tf 282 200.0) >> >> But this works >> >> (alien-funcall (extern-alien "TIFFSetField" >> (function int system-area-pointer int double)) >> tf 282 200.0d0) >> >> But the parameter is defined as a float. > > This is because float is promoted to double in the variable-length > part of variable-length argument lists. See the comp.lang.C FAQ at > http://c-faq.com/varargs/float.html > > Similarly char and short are promoted to int. > >> Also the parameter must be read with TIFFGetField using a (* float). >> Using a (* double) does not cause an error but the returned value is >> wrong. > > In this case the argument is a pointer type and the default argument > promotions does not apply. > > -Erik > -- > /d{def}def/m{mul}d/a{add}d/q{repeat}d/y 1 d 300{/x 1 d 600{/c x 600 div 4 m 2 > sub d/z y 300 div 2 m 1 sub d/r 0 d/i 0 d/t 0 d{t 1 le{/n r r m i i m sub c a > d/b 2 r m i m z a d/r n d/i b d r r m i i m a 16 gt{exit}if} {exit}ifelse/t t > .01 a d}loop t setgray x y moveto 1 1 rlineto stroke/x x 1 a d}q /y y 1 a d}q > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 > _______________________________________________ > Sbcl-help mailing list > Sbc...@li... > https://lists.sourceforge.net/lists/listinfo/sbcl-help > |