summaryrefslogtreecommitdiff
path: root/camlibs/ricoh
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/ricoh
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/ricoh')
-rw-r--r--camlibs/ricoh/g3.c4
-rw-r--r--camlibs/ricoh/ricoh.c18
2 files changed, 11 insertions, 11 deletions
diff --git a/camlibs/ricoh/g3.c b/camlibs/ricoh/g3.c
index 29744bd70..3b7fd7224 100644
--- a/camlibs/ricoh/g3.c
+++ b/camlibs/ricoh/g3.c
@@ -56,7 +56,7 @@ g3_channel_read(GPPort *port, int *channel, char **buffer, int *len)
unsigned char xbuf[0x800];
int tocopy, ret, curlen;
- ret = gp_port_read(port, xbuf, 0x800);
+ ret = gp_port_read(port, (char *)xbuf, 0x800);
if (ret < GP_OK) {
gp_log(GP_LOG_ERROR, "g3", "read error in g3_channel_read\n");
return ret;
@@ -117,7 +117,7 @@ g3_channel_read_bytes(
rest = (rest + 9 + 3) & ~3;
if (rest < 0x800) rest = 0x800;
- ret = gp_port_read(port, xbuf, rest);
+ ret = gp_port_read(port, (char *)xbuf, rest);
if (ret < GP_OK) {
gp_log(GP_LOG_ERROR, "g3", "read error in g3_channel_read\n");
return ret;
diff --git a/camlibs/ricoh/ricoh.c b/camlibs/ricoh/ricoh.c
index 29466a30a..01fd2eac4 100644
--- a/camlibs/ricoh/ricoh.c
+++ b/camlibs/ricoh/ricoh.c
@@ -98,7 +98,7 @@ ricoh_send (Camera *camera, GPContext *context, unsigned char cmd,
/* First, make sure there is no data coming from the camera. */
CR (gp_port_get_timeout (camera->port, &timeout));
CR (gp_port_set_timeout (camera->port, 20));
- while (gp_port_read (camera->port, buf, 1) >= 0);
+ while (gp_port_read (camera->port, (char *)buf, 1) >= 0);
CR (gp_port_set_timeout (camera->port, timeout));
/* Write header */
@@ -106,7 +106,7 @@ ricoh_send (Camera *camera, GPContext *context, unsigned char cmd,
buf[1] = STX;
buf[2] = cmd;
buf[3] = len;
- CR (gp_port_write (camera->port, buf, 4));
+ CR (gp_port_write (camera->port, (char *)buf, 4));
crc = updcrc (cmd, crc);
crc = updcrc (len, crc);
@@ -124,7 +124,7 @@ ricoh_send (Camera *camera, GPContext *context, unsigned char cmd,
break;
}
}
- CR (gp_port_write (camera->port, data + w, i - w));
+ CR (gp_port_write (camera->port, (char *)data + w, i - w));
if (data[i - 1] == 0x10)
CR (gp_port_write (camera->port, "\x10", 1));
w = i;
@@ -137,7 +137,7 @@ ricoh_send (Camera *camera, GPContext *context, unsigned char cmd,
buf[3] = crc >> 8;
buf[4] = len + 2;
buf[5] = number;
- CR (gp_port_write (camera->port, buf, 6));
+ CR (gp_port_write (camera->port, (char *)buf, 6));
return (GP_OK);
}
@@ -172,7 +172,7 @@ ricoh_recv (Camera *camera, GPContext *context, unsigned char *cmd,
* drop that and read on.
*/
for (i = 0, buf[1] = ACK; i < 4; i++) {
- CR (gp_port_read (camera->port, buf, 2));
+ CR (gp_port_read (camera->port, (char *)buf, 2));
if (buf[0] != DLE) {
gp_context_error (context, _("We expected "
"0x%x but received 0x%x. Please "
@@ -195,8 +195,8 @@ ricoh_recv (Camera *camera, GPContext *context, unsigned char *cmd,
return GP_ERROR_CORRUPTED_DATA;
}
- CR (gp_port_read (camera->port, cmd, 1));
- CR (gp_port_read (camera->port, len, 1));
+ CR (gp_port_read (camera->port, (char *)cmd, 1));
+ CR (gp_port_read (camera->port, (char *)len, 1));
crc = updcrc (*cmd, crc);
crc = updcrc (*len, crc);
@@ -207,7 +207,7 @@ ricoh_recv (Camera *camera, GPContext *context, unsigned char *cmd,
r = 0;
last_dle = 0;
while (r < *len) {
- CR (gp_port_read (camera->port, data + r, *len - r));
+ CR (gp_port_read (camera->port, (char *)data + r, *len - r));
if (last_dle) {
r++;
last_dle = 0;
@@ -236,7 +236,7 @@ ricoh_recv (Camera *camera, GPContext *context, unsigned char *cmd,
}
/* Get footer */
- CR (gp_port_read (camera->port, buf, 6));
+ CR (gp_port_read (camera->port, (char *)buf, 6));
if ((buf[0] != DLE) || (buf[1] != ETX && buf[1] != ETB))
return (GP_ERROR_CORRUPTED_DATA);