sane-project-website/old-archive/1999-02/0231.html

62 wiersze
2.6 KiB
HTML

<!-- received="Sun Feb 28 13:20:07 1999 PST" -->
<!-- sent="Sun, 28 Feb 1999 13:19:55 -0800" -->
<!-- name="David Mosberger-Tang" -->
<!-- email="David.Mosberger@acm.org" -->
<!-- subject="Re: Epson backend" -->
<!-- id="199902282119.NAA07649@panda.mostang.com" -->
<!-- inreplyto="yam7727.2108.141046672@vip.cybercity.dk" -->
<title>sane-devel: Re: Epson backend</title>
<h1>Re: Epson backend</h1>
<b>David Mosberger-Tang</b> (<a href="mailto:David.Mosberger@acm.org"><i>David.Mosberger@acm.org</i></a>)<br>
<i>Sun, 28 Feb 1999 13:19:55 -0800</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#231">[ date ]</a><a href="index.html#231">[ thread ]</a><a href="subject.html#231">[ subject ]</a><a href="author.html#231">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0232.html">Dieter Poesl: "Mustek ScanExpress 12000SP"</a>
<li> <b>Next message:</b> <a href="0232.html">Bob Campbell: "Re: SANE and MicroTek ScanMaker X6"</a>
<li> <b>Previous message:</b> <a href="0230.html">Zygo Blaxell: "Re: UMAX Astra 1200S lamp question"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
<i>&gt;&gt;&gt;&gt;&gt; On Sat, 27 Feb 1999 21:53:42 +0100, Svend Daugaard Pedersen &lt;<a href="mailto:sdp@vip.cybercity.dk">sdp@vip.cybercity.dk</a>&gt; said:</i><br>
<p>
Svend&gt; I have not made the "final" solution to this problem. Since<br>
Svend&gt; my version of the code is to be used on M680x0 I swapped the<br>
Svend&gt; to bytes in the 16 bit word<br>
<p>
Svend&gt; wordSwap(head-&gt;count);<br>
<p>
Svend&gt; by using this macro:<br>
<p>
Svend&gt; #define wordSwap(X) {u_char b;u_char*<br>
Svend&gt; bp=(u_char*)&amp;(X);b=*bp;*( bp++)=*bp;*bp=b;}<br>
<p>
This is just as non-portable as the original code. What you should do<br>
is change the struture declaration to use:<br>
<p>
u_char count[2]<br>
<p>
instead of u_short count. Then you can get the count using the expression:<br>
<p>
(head-&gt;count[0] | (head-&gt;count[1] &lt;&lt; 8))<br>
<p>
--david<br>
<p>
<pre>
--
Source code, list archive, and docs: <a href="http://www.mostang.com/sane/">http://www.mostang.com/sane/</a>
To unsubscribe: echo unsubscribe sane-devel | mail <a href="mailto:majordomo@mostang.com">majordomo@mostang.com</a>
</pre>
<!-- body="end" -->
<p>
<ul>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0232.html">Dieter Poesl: "Mustek ScanExpress 12000SP"</a>
<li> <b>Next message:</b> <a href="0232.html">Bob Campbell: "Re: SANE and MicroTek ScanMaker X6"</a>
<li> <b>Previous message:</b> <a href="0230.html">Zygo Blaxell: "Re: UMAX Astra 1200S lamp question"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>