sane-project-website/old-archive/2001-01/0233.html

241 wiersze
8.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>sane-devel: canon backend driver fix</TITLE>
<META NAME="Author" CONTENT="doj (doj@cubic.org)">
<META NAME="Subject" CONTENT="canon backend driver fix">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>canon backend driver fix</H1>
<!-- received="Sun Jan 21 13:00:56 2001" -->
<!-- isoreceived="20010121210056" -->
<!-- sent="Sun, 21 Jan 2001 21:57:05 +0100" -->
<!-- isosent="20010121205705" -->
<!-- name="doj" -->
<!-- email="doj@cubic.org" -->
<!-- subject="canon backend driver fix" -->
<!-- id="3A6B4D21.5B84A255@cubic.org" -->
<!-- inreplyto="01012117233700.06857@slowcrap" -->
<STRONG>From:</STRONG> doj (<A HREF="mailto:doj@cubic.org?Subject=Re:%20canon%20backend%20driver%20fix&In-Reply-To=&lt;3A6B4D21.5B84A255@cubic.org&gt;"><EM>doj@cubic.org</EM></A>)<BR>
<STRONG>Date:</STRONG> Sun Jan 21 2001 - 12:57:05 PST
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0234.html">Adam Tauno Williams: "Re: scanning to cd-rom"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0232.html">Peter Kirchgessner: "Re: Setting up HP ScanJet 5P on Solaris 8 SPARC"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0227.html">mh: "ADF scanner question"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0286.html">Mitsuru Okaniwa: "Re: canon backend driver fix"</A>
<LI><STRONG>Next in thread:</STRONG> <A HREF="0238.html">Randolph Bentson: "Re: ADF scanner question"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0286.html">Mitsuru Okaniwa: "Re: canon backend driver fix"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#233">[ date ]</A>
<A HREF="index.html#233">[ thread ]</A>
<A HREF="subject.html#233">[ subject ]</A>
<A HREF="author.html#233">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
Hello Scanner Developers,
<BR>
<P>I am using an CanoScan 300. The 0.99 versions of SANE were working with
<BR>
my scanner, but since v1.0 the driver complained. Now I have worked
<BR>
myself through the sources and found some glitches, which I think result
<BR>
from another bug beeing solved not 100% correct.
<BR>
<P>With the patch I have attached everything is working fine with my system
<BR>
again. I think the patch should work with others as well.
<BR>
<P><PRE>
--
---&gt;
----&gt; doj / cubic
-----&gt; <A HREF="http://www.cubic.org">http://www.cubic.org</A>
-----&gt; <A HREF="http://llg.cubic.org">http://llg.cubic.org</A>
</PRE>
<P>
diff -w -b -B -u -U 5 -r -P sane-backends-1.0.4/backend/canon-sane.c sane-backends-1.0.4.doj/backend/canon-sane.c
--- sane-backends-1.0.4/backend/canon-sane.c Sat Aug 12 17:09:02 2000
+++ sane-backends-1.0.4.doj/backend/canon-sane.c Sun Dec 31 00:36:39 2000
@@ -103,22 +103,22 @@
for (dev = first_dev; dev; dev = dev-&gt;next)
{
if (strcmp (dev-&gt;sane.name, devnam) == 0)
break;
}
+ }
+ else
+ {
+ dev = first_dev;
+ }
if (!dev)
{
status = attach (devnam, &amp;dev);
if (status != SANE_STATUS_GOOD)
return (status);
}
- }
- else
- {
- dev = first_dev;
- }
if (!dev)
return (SANE_STATUS_INVAL);
s = malloc (sizeof (*s));
@@ -1065,11 +1065,11 @@
/* { */
/* DBG (1, &quot;attach: GET SCAN MODE for scan control conditions failed\n&quot;); */
/* sanei_scsi_close (s-&gt;fd); */
/* return (SANE_STATUS_INVAL); */
/* } */
- for (i=0; i&lt;buf_size; i++)
+ for (i=0; i&lt;(int)buf_size; i++)
{
DBG(3, &quot;scan mode control byte[%d] = %d\n&quot;, i, ebuf[i]);
}
DBG (3, &quot;attach: sending GET SCAN MODE for transparency unit\n&quot;);
@@ -1081,11 +1081,11 @@
{
DBG (1, &quot;attach: GET SCAN MODE for transparency unit failed\n&quot;);
sanei_scsi_close (s-&gt;fd);
return (SANE_STATUS_INVAL);
}
- for (i=0; i&lt;buf_size; i++)
+ for (i=0; i&lt;(int)buf_size; i++)
{
DBG(3, &quot;scan mode control byte[%d] = %d\n&quot;, i, ebuf[i]);
}
#endif
@@ -1291,11 +1291,11 @@
{
DBG (1, &quot;sane_start: GET SCAN MODE for scan control conditions failed\n&quot;);
sanei_scsi_close (s-&gt;fd);
return (SANE_STATUS_INVAL);
}
- for (i=0; i&lt;buf_size; i++)
+ for (i=0; i&lt;(int)buf_size; i++)
{
DBG(3, &quot;scan mode byte[%d] = %d\n&quot;, i, ebuf[i]);
}
#endif
diff -w -b -B -u -U 5 -r -P sane-backends-1.0.4/backend/canon-scsi.c sane-backends-1.0.4.doj/backend/canon-scsi.c
--- sane-backends-1.0.4/backend/canon-scsi.c Sat Aug 12 17:09:02 2000
+++ sane-backends-1.0.4.doj/backend/canon-scsi.c Sun Dec 31 00:29:26 2000
@@ -377,11 +377,11 @@
(page == SCAN_CONTROL_CONDITIONS) ? 0x14 : 0x24;
memcpy (cmd + 10, data, (page == TRANSPARENCY_UNIT) ? 8 :
(page == SCAN_CONTROL_CONDITIONS) ? 16 : 24);
- for(i = 0; i &lt; sizeof(cmd); i++)
+ for(i = 0; i &lt;(int) sizeof(cmd); i++)
{
DBG (31, &quot;define scan mode: cmd[%d]='0x%0X'\n&quot;, i, cmd[i]);
}
cmdlen = (page == TRANSPARENCY_UNIT) ? 18 :
(page == SCAN_CONTROL_CONDITIONS) ? 26 : 34;
diff -w -b -B -u -U 5 -r -P sane-backends-1.0.4/backend/canon.c sane-backends-1.0.4.doj/backend/canon.c
--- sane-backends-1.0.4/backend/canon.c Sat Aug 12 17:09:03 2000
+++ sane-backends-1.0.4.doj/backend/canon.c Sun Dec 31 00:27:48 2000
@@ -226,11 +226,11 @@
{
DBG (1, &quot;get scan mode failed: %s\n&quot;, sane_strstatus (status));
return;
}
- for (i=0; i&lt;buf_size; i++)
+ for (i=0; i&lt;(int)buf_size; i++)
{
DBG(3, &quot;scan mode control byte[%d] = %d\n&quot;, i, tbuf[i]);
}
dev-&gt;tpu.Status = ( tbuf[2 + 4 + 5] &gt;&gt; 7 ) ?
TPU_STAT_INACTIVE : TPU_STAT_NONE;
@@ -280,11 +280,11 @@
DBG (1, &quot;get scan mode failed: %s\n&quot;, sane_strstatus (status));
perror(&quot;get scan mode failed&quot;);
return;
}
- for (i=0; i&lt;buf_size; i++)
+ for (i=0; i&lt;(int)buf_size; i++)
{
DBG(3, &quot;scan mode control byte[%d] = %d\n&quot;, i, abuf[i]);
/* printf(&quot;scan mode control byte[%d] = %d\n&quot;, i, abuf[i]); */
}
@@ -594,11 +594,11 @@
{
DBG (1, &quot;attach: GET SCAN MODE for scan control conditions failed\n&quot;);
sanei_scsi_close (fd);
return (SANE_STATUS_INVAL);
}
- for (i=0; i&lt;buf_size; i++)
+ for (i=0; i&lt;(int)buf_size; i++)
{
DBG(3, &quot;scan mode byte[%d] = %d\n&quot;, i, ebuf[i]);
}
DBG (3, &quot;attach: sending (extended) INQUIRY\n&quot;);
@@ -1123,11 +1123,11 @@
/* Build the histograms */
DBG(7, &quot;sizeof(histo)='%lu'\n&quot;, (unsigned long) sizeof(histo));
memset (histo, 0, sizeof(histo));
- for(i=0; i&lt;bread; i+=3)
+ for(i=0; i&lt;(int)bread; i+=3)
{
/* j = (int)adjbuf[i] - 71; */
/* j = (j&lt;0) ? -j : j; */
/* ++histo[RED][j]; */
++histo[RED][(int)adjbuf[i]];
Binary files sane-backends-1.0.4/core and sane-backends-1.0.4.doj/core differ
<P><P><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?Subject=Re:%20canon%20backend%20driver%20fix&In-Reply-To=&lt;3A6B4D21.5B84A255@cubic.org&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0234.html">Adam Tauno Williams: "Re: scanning to cd-rom"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0232.html">Peter Kirchgessner: "Re: Setting up HP ScanJet 5P on Solaris 8 SPARC"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0227.html">mh: "ADF scanner question"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0286.html">Mitsuru Okaniwa: "Re: canon backend driver fix"</A>
<LI><STRONG>Next in thread:</STRONG> <A HREF="0238.html">Randolph Bentson: "Re: ADF scanner question"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0286.html">Mitsuru Okaniwa: "Re: canon backend driver fix"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#233">[ date ]</A>
<A HREF="index.html#233">[ thread ]</A>
<A HREF="subject.html#233">[ subject ]</A>
<A HREF="author.html#233">[ author ]</A>
</UL>
<!-- trailer="footer" -->
<HR NOSHADE>
<P>
<SMALL>
<EM>
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
: <EM>Sun Jan 21 2001 - 13:04:02 PST</EM>
</EM>
</SMALL>
</BODY>
</HTML>