diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2014-04-11 20:15:34 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2014-04-11 20:15:34 +0000 |
commit | 7318557c352d818da699bc5328756c233c9c1060 (patch) | |
tree | cf2f2b41b0eceb2b1c56679c259871b976003ab5 /camlibs/polaroid | |
parent | 73861f12036b5dfb912ca0214e6f574a0161c023 (diff) | |
download | libgphoto2-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/polaroid')
-rw-r--r-- | camlibs/polaroid/pdc320.c | 22 | ||||
-rw-r--r-- | camlibs/polaroid/pdc700.c | 6 |
2 files changed, 14 insertions, 14 deletions
diff --git a/camlibs/polaroid/pdc320.c b/camlibs/polaroid/pdc320.c index cd699469d..88fff44cc 100644 --- a/camlibs/polaroid/pdc320.c +++ b/camlibs/polaroid/pdc320.c @@ -163,7 +163,7 @@ pdc320_command( memset (newcmd, 0xe6, 4); off = 4; off += pdc320_escape (cmd, cmdlen, newcmd + off); off += pdc320_escape (csum, 2, newcmd + off); - ret = gp_port_write (port, newcmd, off); + ret = gp_port_write (port, (char *)newcmd, off); free(newcmd); return ret; } @@ -180,15 +180,15 @@ pdc320_simple_reply (GPPort *port, const unsigned char expcode, unsigned char csum[2]; int calccsum; - CR (gp_port_read (port, reply, 1)); + CR (gp_port_read (port, (char *)reply, 1)); if (reply[0] != expcode) { GP_DEBUG("*** reply got 0x%02x, expected 0x%02x\n", reply[0], expcode ); return GP_ERROR; } - CR (gp_port_read (port, reply+1, replysize-1)); - CR (gp_port_read (port, csum, 2)); + CR (gp_port_read (port, (char *)reply+1, replysize-1)); + CR (gp_port_read (port, (char *)csum, 2)); calccsum = pdc320_calc_checksum (reply, replysize); if (calccsum != ((csum[1] << 8) | csum[0])) { GP_DEBUG("csum %x vs %x\n",calccsum,((csum[0]<<8)|csum[1])); @@ -218,7 +218,7 @@ pdc320_init (GPPort *port) /* The initial command is prefixed by 4 raw E6. */ memset(e6,0xe6,sizeof(e6)); - CR (gp_port_write (port, e6, sizeof (e6) )); + CR (gp_port_write (port, (char *)e6, sizeof (e6) )); GP_DEBUG ("*** PDC320_INIT ***"); CR (pdc320_simple_command_reply (port, PDC320_INIT, 5, 1, buf)); @@ -285,16 +285,16 @@ pdc320_0c (Camera *camera, int n) /* Write the command */ GP_DEBUG ("*** PDC320_0c ***"); CR (pdc320_command (camera->port, cmd, sizeof (cmd))); - CR (gp_port_read (camera->port, buf, 3)); + CR (gp_port_read (camera->port, (char *)buf, 3)); if (buf[0] != 7) return GP_ERROR; size = (buf[1] << 8) | buf[2]; xbuf = malloc (size); - CR (gp_port_read (camera->port, xbuf, size)); + CR (gp_port_read (camera->port, (char *)xbuf, size)); for (i=0; i<size; i++) { GP_DEBUG ("buf[%d]=0x%02x", i, xbuf[i]); } - CR (gp_port_read (camera->port, buf, 2)); + CR (gp_port_read (camera->port, (char *)buf, 2)); /* checksum is calculated from both, but i am not clear how. */ return GP_OK; } @@ -336,7 +336,7 @@ pdc320_pic (Camera *camera, int n, unsigned char **data, int *size) /* Read the frame number */ usleep (10000); - CR_FREE (gp_port_read (camera->port, buf, 5), *data); + CR_FREE (gp_port_read (camera->port, (char *)buf, 5), *data); f1 = (buf[1] << 8) + buf[2]; f2 = (buf[3] << 8) + buf[4]; GP_DEBUG ("Reading frame %d " @@ -344,10 +344,10 @@ pdc320_pic (Camera *camera, int n, unsigned char **data, int *size) /* Read the actual data */ usleep(1000); - CR_FREE (gp_port_read (camera->port, *data + i, len), *data); + CR_FREE (gp_port_read (camera->port, (char *)*data + i, len), *data); /* Read the checksum */ - CR_FREE (gp_port_read (camera->port, buf, 2), *data); + CR_FREE (gp_port_read (camera->port, (char *)buf, 2), *data); } return (GP_OK); diff --git a/camlibs/polaroid/pdc700.c b/camlibs/polaroid/pdc700.c index 3395d824e..41670048a 100644 --- a/camlibs/polaroid/pdc700.c +++ b/camlibs/polaroid/pdc700.c @@ -208,7 +208,7 @@ pdc700_send (Camera *camera, unsigned char *cmd, unsigned int cmd_len) cmd[1] = (cmd_len - 3) >> 8; cmd[2] = (cmd_len - 3) & 0xff; cmd[cmd_len - 1] = calc_checksum (cmd + 3, cmd_len - 1 - 3); - CR (gp_port_write (camera->port, cmd, cmd_len)); + CR (gp_port_write (camera->port, (char *)cmd, cmd_len)); return (GP_OK); } @@ -226,7 +226,7 @@ pdc700_read (Camera *camera, unsigned char *cmd, * Read the header (0x40 plus 2 bytes indicating how many bytes * will follow) */ - CR (gp_port_read (camera->port, header, 3)); + CR (gp_port_read (camera->port, (char *)header, 3)); if (header[0] != 0x40) { gp_context_error (context, _("Received unexpected " "header (%i)"), header[0]); @@ -235,7 +235,7 @@ pdc700_read (Camera *camera, unsigned char *cmd, *b_len = (header[2] << 8) | header [1]; /* Read the remaining bytes */ - CR (gp_port_read (camera->port, b, *b_len)); + CR (gp_port_read (camera->port, (char *)b, *b_len)); /* * The first byte indicates if this the response for our command. |