fix compiler warnings

DEVEL_2_0_BRANCH-1
Oliver Schwartz 2001-10-10 07:30:06 +00:00
rodzic 08f96d7439
commit f36f2c3de6
3 zmienionych plików z 27 dodań i 18 usunięć

Wyświetl plik

@ -1,22 +1,22 @@
/* sane - Scanner Access Now Easy. /* sane - Scanner Access Now Easy.
Copyright (C) 1997, 1998, 2001 Franck Schnefra, Michel Roelofs, Copyright (C) 1997, 1998, 2001 Franck Schnefra, Michel Roelofs,
Emmanuel Blot, Mikko Tyolajarvi, David Mosberger-Tang, Wolfgang Goeller, Emmanuel Blot, Mikko Tyolajarvi, David Mosberger-Tang, Wolfgang Goeller,
Petter Reinholdtsen, Gary Plewa, Sebastien Sable, Mikael Magnusson, Petter Reinholdtsen, Gary Plewa, Sebastien Sable, Mikael Magnusson,
Oliver Schwartz and Kevin Charter Oliver Schwartz and Kevin Charter
This file is part of the SANE package. This file is part of the SANE package.
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version. License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details. General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, Foundation, Inc., 59 Temple Place - Suite 330, Boston,
@ -1071,7 +1071,7 @@ static SANE_Status get_firmware_name(char** firmware_path)
static SANE_Status download_firmware(SnapScan_Scanner * pss) static SANE_Status download_firmware(SnapScan_Scanner * pss)
{ {
char *pFwBuf, *pCDB; unsigned char *pFwBuf, *pCDB;
char* firmware_path = NULL; char* firmware_path = NULL;
FILE *fd; FILE *fd;
size_t bufLength,cdbLength; size_t bufLength,cdbLength;
@ -1081,7 +1081,7 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss)
int readByte; int readByte;
bModelNo =*(pss->buf + INQUIRY_HWMI); bModelNo =*(pss->buf + INQUIRY_HWMI);
zero_buf(cModel, 255); zero_buf((unsigned char *)cModel, 255);
sprintf(cModelName, "%d", bModelNo); sprintf(cModelName, "%d", bModelNo);
DBG(DL_INFO, "Looking up %s\n", cModelName); DBG(DL_INFO, "Looking up %s\n", cModelName);
status = get_firmware_name(&firmware_path); status = get_firmware_name(&firmware_path);
@ -1129,7 +1129,7 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss)
} }
DBG(DL_INFO, "Size of firmware: %d\n", bufLength); DBG(DL_INFO, "Size of firmware: %d\n", bufLength);
pCDB = (char *)malloc(bufLength + cdbLength); pCDB = (unsigned char *)malloc(bufLength + cdbLength);
pFwBuf = pCDB + cdbLength; pFwBuf = pCDB + cdbLength;
zero_buf (pCDB, cdbLength); zero_buf (pCDB, cdbLength);
readByte = fread(pFwBuf,1,bufLength,fd); readByte = fread(pFwBuf,1,bufLength,fd);
@ -1153,8 +1153,11 @@ static SANE_Status download_firmware(SnapScan_Scanner * pss)
/* /*
* $Log$ * $Log$
* Revision 1.5 2001/10/09 09:45:10 oliverschwartz * Revision 1.6 2001/10/10 07:30:04 oliverschwartz
* update snapscan to snapshot 20011008 * fix compiler warnings
*
* Revision 1.18 2001/10/09 22:34:23 oliverschwartz
* fix compiler warnings
* *
* Revision 1.17 2001/10/08 19:26:01 oliverschwartz * Revision 1.17 2001/10/08 19:26:01 oliverschwartz
* - Disable quality calibration for scanners that do not support it * - Disable quality calibration for scanners that do not support it

Wyświetl plik

@ -302,10 +302,10 @@ static SANE_Status usb_cmd(int fd, const void *src, size_t src_size,
/* Since the "Send Diagnostic" command isn't supported by /* Since the "Send Diagnostic" command isn't supported by
all Snapscan USB-scanners it's disabled . all Snapscan USB-scanners it's disabled .
*/ */
if(((char *)src)[0] == SEND_DIAGNOSTIC) if(((const char *)src)[0] == SEND_DIAGNOSTIC)
return(SANE_STATUS_GOOD); return(SANE_STATUS_GOOD);
cmdlen = usb_cmdlen(*((char *)src)); cmdlen = usb_cmdlen(*((const char *)src));
datalen = src_size - cmdlen; datalen = src_size - cmdlen;
DBG(DL_DATA_TRACE, "%s: cmdlen=%d, datalen=%d\n",me,cmdlen,datalen); DBG(DL_DATA_TRACE, "%s: cmdlen=%d, datalen=%d\n",me,cmdlen,datalen);
@ -319,7 +319,7 @@ static SANE_Status usb_cmd(int fd, const void *src, size_t src_size,
/* Send data only if the scanner is expecting it */ /* Send data only if the scanner is expecting it */
if(datalen > 0 && (tstatus == TRANSACTION_WRITE)) { if(datalen > 0 && (tstatus == TRANSACTION_WRITE)) {
/* Send data to scanner */ /* Send data to scanner */
RETURN_ON_FAILURE( usb_write(fd, ((SANE_Byte *) src) + cmdlen, datalen) ); RETURN_ON_FAILURE( usb_write(fd, ((const SANE_Byte *) src) + cmdlen, datalen) );
/* Read status */ /* Read status */
RETURN_ON_FAILURE( usb_read_status(fd, NULL, &tstatus) ); RETURN_ON_FAILURE( usb_read_status(fd, NULL, &tstatus) );
@ -419,8 +419,11 @@ static void dequeue_bq()
} }
/* /*
* $Log$ * $Log$
* Revision 1.2 2001/10/09 09:45:14 oliverschwartz * Revision 1.3 2001/10/10 07:30:06 oliverschwartz
* update snapscan to snapshot 20011008 * fix compiler warnings
*
* Revision 1.13 2001/10/09 22:34:23 oliverschwartz
* fix compiler warnings
* *
* Revision 1.12 2001/09/18 15:01:07 oliverschwartz * Revision 1.12 2001/09/18 15:01:07 oliverschwartz
* - Read scanner id string again after firmware upload * - Read scanner id string again after firmware upload

Wyświetl plik

@ -1305,7 +1305,7 @@ SANE_Status sane_get_devices (const SANE_Device ***device_list,
DBG (DL_CALL_TRACE, DBG (DL_CALL_TRACE,
"%s (%p, %ld)\n", "%s (%p, %ld)\n",
me, me,
(void *) device_list, (const void *) device_list,
(long) local_only); (long) local_only);
/* Waste the last list returned from this function */ /* Waste the last list returned from this function */
@ -3087,8 +3087,11 @@ SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd)
/* /*
* $Log$ * $Log$
* Revision 1.6 2001/10/09 09:45:16 oliverschwartz * Revision 1.7 2001/10/10 07:30:06 oliverschwartz
* update snapscan to snapshot 20011008 * fix compiler warnings
*
* Revision 1.23 2001/10/09 22:34:23 oliverschwartz
* fix compiler warnings
* *
* Revision 1.22 2001/10/08 19:26:01 oliverschwartz * Revision 1.22 2001/10/08 19:26:01 oliverschwartz
* - Disable quality calibration for scanners that do not support it * - Disable quality calibration for scanners that do not support it