summaryrefslogtreecommitdiff
path: root/camlibs/pccam300/pccam300.c
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2014-04-11 20:15:34 +0000
committerMarcus Meissner <marcus@jet.franken.de>2014-04-11 20:15:34 +0000
commit7318557c352d818da699bc5328756c233c9c1060 (patch)
treecf2f2b41b0eceb2b1c56679c259871b976003ab5 /camlibs/pccam300/pccam300.c
parent73861f12036b5dfb912ca0214e6f574a0161c023 (diff)
downloadlibgphoto2-7318557c352d818da699bc5328756c233c9c1060.tar.gz
iFrom: "Daniel P. Berrange" <dan@berrange.com>
Many calls of gp_port_* functions are passing a 'unsigned char *' rather than the 'char *' they expect. Add explicit casts to silence the compiler. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14899 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/pccam300/pccam300.c')
-rw-r--r--camlibs/pccam300/pccam300.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/camlibs/pccam300/pccam300.c b/camlibs/pccam300/pccam300.c
index 5ea3b58cc..61f825116 100644
--- a/camlibs/pccam300/pccam300.c
+++ b/camlibs/pccam300/pccam300.c
@@ -63,18 +63,18 @@ pccam300_wait_for_status (GPPort *port)
while (status != 0x00 && retries--) {
gp_port_set_timeout (port, 3000);
- CHECK(gp_port_usb_msg_read (port, 0x06, 0x00, 0x00, &status, 1));
+ CHECK(gp_port_usb_msg_read (port, 0x06, 0x00, 0x00, (char *)&status, 1));
if (status == 0 || status == 8)
return GP_OK;
if (status == 0xb0) {
gp_port_set_timeout (port, 200000);
CHECK(gp_port_usb_msg_read (port, 0x06, 0x00, 0x00,
- &status, 1));
+ (char *)&status, 1));
}
if (status == 0x40) {
gp_port_set_timeout (port, 400000);
CHECK(gp_port_usb_msg_read (port, 0x06, 0x00, 0x00,
- &status, 1));
+ (char *)&status, 1));
}
}
return GP_ERROR;
@@ -106,7 +106,8 @@ pccam300_get_filecount (GPPort *port, int *filecount)
uint8_t response;
gp_port_set_timeout (port, 400000);
- CHECK (gp_port_usb_msg_read (port, 0x08, 0x00, 0x00, &response, 0x01));
+ CHECK (gp_port_usb_msg_read (port, 0x08, 0x00, 0x00,
+ (char *)&response, 0x01));
*filecount = response;
return GP_OK;
}
@@ -119,7 +120,8 @@ pccam300_get_filesize (GPPort *port, unsigned int index,
uint16_t i = index;
gp_port_set_timeout (port, 400000);
- CHECK (gp_port_usb_msg_read (port, 0x08, i, 0x0001, response, 0x03));
+ CHECK (gp_port_usb_msg_read (port, 0x08, i, 0x0001,
+ (char *)response, 0x03));
*filesize = (response[0] & 0xff)
+ (response[1] & 0xff) * 0x100 + (response[2] & 0xff) * 0x10000;
@@ -133,10 +135,12 @@ pccam300_get_mem_info (GPPort *port, GPContext *context, int *totalmem,
unsigned char response[4];
gp_port_set_timeout (port, 400000);
- CHECK (gp_port_usb_msg_read (port, 0x60, 0x00, 0x02, response, 0x04));
+ CHECK (gp_port_usb_msg_read (port, 0x60, 0x00, 0x02,
+ (char *)response, 0x04));
*totalmem = response[2] * 65536 + response[1] * 256 + response[0];
CHECK (pccam300_wait_for_status (port));
- CHECK (gp_port_usb_msg_read (port, 0x60, 0x00, 0x03, response, 0x04));
+ CHECK (gp_port_usb_msg_read (port, 0x60, 0x00, 0x03,
+ (char *)response, 0x04));
*freemem = response[2] * 65536 + response[1] * 256 + response[0];
CHECK (pccam300_wait_for_status (port));
return GP_OK;
@@ -166,7 +170,7 @@ pccam300_get_file (GPPort *port, GPContext *context, int index,
/* Read the data into the buffer overlapping the header area by
* 0x200 bytes. */
- r = gp_port_read (port, buf + 623 - 0x200, data_size);
+ r = gp_port_read (port, (char *)buf + 623 - 0x200, data_size);
if (r < GP_OK) {
free (buf);
return r;
@@ -188,7 +192,7 @@ pccam300_get_file (GPPort *port, GPContext *context, int index,
* we need to request the correct header.
*/
CHECK(gp_port_usb_msg_read(port, 0x0b, buf[623 - 0x200 + 8],
- 0x3, buf, 623));
+ 0x3, (char *)buf, 623));
*type = PCCAM300_MIME_JPEG;
}
*data = buf;