[sane-devel] (patch) Small fixes for canon630u, coolscan and microtek2
Petter Reinholdtsen
pere at hungry.com
Fri Oct 4 14:45:16 BST 2002
The following small compile fixes should be included.
Index: ChangeLog
===================================================================
RCS file: /cvsroot/external/sane/sane-backends/ChangeLog,v
retrieving revision 1.1200
diff -u -3 -p -u -w -r1.1200 ChangeLog
--- ChangeLog 2002/10/02 19:40:15 1.1200
+++ ChangeLog 2002/10/04 13:43:38
@@ -1,3 +1,16 @@
+2002-10-04 Petter Reinholdtsen <pere at td.org.uit.no>
+
+ * backend/canon630u-common.c: Change type of size parameter from
+ 'unsigned int' to 'size_t' for gl640WriteBulk() and
+ gl640ReadBulk() to avoid crash on platforms where
+ 'sizeof(size_t) > sizeof(int)'.
+
+ * backend/coolscan.c: Remove semicolon at the end of function
+ declarations.
+
+ * backend/microtek2.c (scsi_read_control_bits): Make sure to pass
+ a size_t* to sanei_scsi_cmd().
+
2002-10-02 Henning Meier-Geinitz <henning at meier-geinitz.de>
* TODO: Updated list of backends scheduled for inclusion. Updated
Index: backend/canon630u-common.c
===================================================================
RCS file: /cvsroot/external/sane/sane-backends/backend/canon630u-common.c,v
retrieving revision 1.5
diff -u -3 -p -u -w -r1.5 canon630u-common.c
--- canon630u-common.c 2002/05/16 23:08:34 1.5
+++ canon630u-common.c 2002/10/04 13:43:38
@@ -158,7 +158,7 @@ gl640ReadReq (int fd, GL640_Request req,
fb630u: setup[2] = 0x80
*/
static SANE_Status
-gl640WriteBulk (int fd, byte * setup, byte * data, unsigned int size)
+gl640WriteBulk (int fd, byte * setup, byte * data, size_t size)
{
SANE_Status status;
setup[0] = 1;
@@ -181,7 +181,7 @@ gl640WriteBulk (int fd, byte * setup, by
fb630u: setup[2] = 0x80
*/
static SANE_Status
-gl640ReadBulk (int fd, byte * setup, byte * data, unsigned int size)
+gl640ReadBulk (int fd, byte * setup, byte * data, size_t size)
{
SANE_Status status;
setup[0] = 0;
Index: backend/coolscan.c
===================================================================
RCS file: /cvsroot/external/sane/sane-backends/backend/coolscan.c,v
retrieving revision 1.3
diff -u -3 -p -u -w -r1.3 coolscan.c
--- coolscan.c 2001/06/04 16:14:11 1.3
+++ coolscan.c 2002/10/04 13:43:39
@@ -2333,7 +2333,7 @@ static int RGBIfix(Coolscan_t * scanner,
}
}
return 1;
-};
+}
/* ---------------------------------------------------------------
@@ -2386,7 +2386,7 @@ static int RGBIfix16(Coolscan_t * scanne
(*opi)=(((*pi)&0x00ff)<<8)+(((*pi)&0xff00)>>8);
}
return 1;
-};
+}
/* ---------------------------------------------------------------
@@ -2425,7 +2425,7 @@ static int rgb2g(unsigned char* rgbimat,
(*opg)=(unsigned char)(g>>8);
}
return 1;
-};
+}
/* ---------------------------------------------------------------
@@ -2529,7 +2529,7 @@ static int RGBIfix1(unsigned char* rgbim
(*opi)=(unsigned char)(ii);
}
return 1;
-};
+}
/* This function is executed as a child process. */
Index: backend/microtek2.c
===================================================================
RCS file: /cvsroot/external/sane/sane-backends/backend/microtek2.c,v
retrieving revision 1.10
diff -u -3 -p -u -w -r1.10 microtek2.c
--- microtek2.c 2002/05/24 22:41:34 1.10
+++ microtek2.c 2002/10/04 13:43:40
@@ -4389,6 +4389,8 @@ scsi_read_control_bits(Microtek2_Scanner
int bit;
int count_1s;
+ size_t n_control_bytes;
+
md = ms->dev;
DBG(30, "scsi_read_control_bits: ms=%p, fd=%d\n", ms, ms->sfd);
@@ -4400,6 +4402,8 @@ scsi_read_control_bits(Microtek2_Scanner
if ( md_dump >= 2)
dump_area2(cmd, RCB_CMD_L, "readcontrolbits");
+ /* Avoid problems if sizeof(u_int32_t) != sizeof(size_t) */
+ n_control_bytes = ms->n_control_bytes;
status = sanei_scsi_cmd(ms->sfd,
cmd,
sizeof(cmd),
More information about the sane-devel
mailing list