[sane-devel] How to set a double value?

Ralph Little skelband at gmail.com
Thu Mar 11 16:54:03 GMT 2021


Hi,

On 2021-03-09 1:25 p.m., Thiago Milczarek Sayão wrote:
> I have a double var that represents a FIXED value as in SANE_TYPE_FIXED.
>
> How do I pass it to sane_control_option() as void * ?
>
> tried:
> (void *) double_var
> (void *) SANE_FIX(double_var)
>
>
I believe that you need to pass a pointer to the value:

e.g.

SANE_Fixed value;
function(&value);

The callee will know what the referenced type is and will make the
appropriate cast.

Cheers,
Ralph




More information about the sane-devel mailing list