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

72 wiersze
3.2 KiB
HTML

<!-- received="Sun Feb 28 13:10:12 1999 PST" -->
<!-- sent="Sun, 28 Feb 1999 13:10:01 -0800" -->
<!-- name="David Mosberger-Tang" -->
<!-- email="David.Mosberger@acm.org" -->
<!-- subject="Re: Porting SANE backends" -->
<!-- id="199902282110.NAA07574@panda.mostang.com" -->
<!-- inreplyto="yam7725.1772.138696360@vip.cybercity.dk" -->
<title>sane-devel: Re: Porting SANE backends</title>
<h1>Re: Porting SANE backends</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:10:01 -0800</i>
<p>
<ul>
<li> <b>Messages sorted by:</b> <a href="date.html#227">[ date ]</a><a href="index.html#227">[ thread ]</a><a href="subject.html#227">[ subject ]</a><a href="author.html#227">[ author ]</a>
<!-- next="start" -->
<li> <b>Next message:</b> <a href="0228.html">Zygo Blaxell: "Re: UMAX Astra 1200S lamp question"</a>
<li> <b>Previous message:</b> <a href="0226.html">David Mosberger-Tang: "Re: resolution option unknown"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>
<!-- body="start" -->
<i>&gt;&gt;&gt;&gt;&gt; On Thu, 25 Feb 1999 20:34:35 +0100, Svend Daugaard Pedersen &lt;<a href="mailto:sdp@vip.cybercity.dk">sdp@vip.cybercity.dk</a>&gt; said:</i><br>
<p>
Svend&gt; - don't use 'alloca()' this routine is not an ANSI routine<br>
Svend&gt; and it is difficult (in many cases impossible) to implement<br>
Svend&gt; in a C system not having it.<br>
<p>
No, alloca() is a sensible and well-defined operation. Shoot ANSI for<br>
not making it standard. GNU C supports it on all platforms. And if<br>
you don't use GNU C, you can use the portable implementation that<br>
comes, e.g., with Emacs (look for alloca.c).<br>
<p>
Svend&gt; - don't use '#pragma' pragmas are completely implementation<br>
Svend&gt; dependant.<br>
<p>
Agreed. I don't think there are any #pragma's in the SANE sources,<br>
though.<br>
<p>
Svend&gt; - don't make any asumptions about the way variables are<br>
Svend&gt; stored in memory a special problem here is that INTEL<br>
Svend&gt; processors and M680xx processors stores words and long words<br>
Svend&gt; in a different way (use only arrays of SANE_Byte to transfer<br>
Svend&gt; data to or from the scanner). If you do not follow this<br>
Svend&gt; advice your code can't even be ported between Intel and 68K<br>
Svend&gt; Linux.<br>
<p>
True, all SANE code should be byte-order independent.<br>
<p>
Svend&gt; - don't use special/unusual parameter values a call like<br>
Svend&gt; 'malloc(0)' is unlikely to be handled in the same way by all<br>
Svend&gt; compilers.<br>
<p>
It's really the run-time system, but yes, there are differences even<br>
between different UNIX versions.<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="0228.html">Zygo Blaxell: "Re: UMAX Astra 1200S lamp question"</a>
<li> <b>Previous message:</b> <a href="0226.html">David Mosberger-Tang: "Re: resolution option unknown"</a>
<!-- nextthread="start" -->
<!-- reply="end" -->
</ul>