[sane-devel] question about SANE_FIX macro

m. allan noah kitno455 at gmail.com
Tue Oct 23 20:50:24 UTC 2007


On 10/23/07, jazz_johnson at verizon.net <jazz_johnson at verizon.net> wrote:

<snip>

>    dev->info.x_range.min   = SANE_FIX(0.0);
>    dev->info.x_range.max   = SANE_FIX(mm);
>    dev->info.x_range.quant = SANE_FIX(0.0);
>
>    DBG(11,"attach: winWidth=%d resBasicX=%d mm/in=%f mm=%lf\n",
>                     dev->info.winWidth, dev->info.resBasicX, MM_PER_INCH, mm);
>    DBG(11,"attach: RANGE x_range.max=%ld, y_range.max=%ld\n",
>                     dev->info.x_range.max, dev->info.y_range.max);
> <...>
> }
>
>
> when I run
> 'SANEI_SCSI_DEBUG=128 SANE_DEBUG_HS2p=999 scanimage -d hs2p:/dev/scanner'
>
> I get the following:
> [hs2p] attach: Window(W/L) = (4692/6803)
> [hs2p] attach: winWidth=4692 resBasicX=400 mm/in=25.400000 mm=297.942000
> [hs2p] attach: RANGE x_range.max=19525926, y_range.max=28310929
> [hs2p] <<< attach:
>

<snip>

problem: "x_range.max=%ld, y_range.max=%ld"

x_range.max is a SANE_FIX value. it has been bit shifted upwards. it
is not a long. try putting the SANE_UNFIX macro around the values when
you want to print them.

allan

-- 
"The truth is an offense, but not a sin"



More information about the sane-devel mailing list