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/toshiba | |
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/toshiba')
-rw-r--r-- | camlibs/toshiba/pdrm11/pdrm11.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/camlibs/toshiba/pdrm11/pdrm11.c b/camlibs/toshiba/pdrm11/pdrm11.c index 29fd2c706..94f000b8d 100644 --- a/camlibs/toshiba/pdrm11/pdrm11.c +++ b/camlibs/toshiba/pdrm11/pdrm11.c @@ -41,15 +41,15 @@ int pdrm11_init(GPPort *port) gp_port_set_timeout(port,1000); /* exactly what windows driver does */ - gp_port_usb_msg_read (port, 0x01, PDRM11_CMD_READY, 0, buf, 4); + gp_port_usb_msg_read (port, 0x01, PDRM11_CMD_READY, 0, (char *)buf, 4); gp_port_usb_msg_write(port, 0x01, PDRM11_CMD_PING3, 0, NULL, 0); - gp_port_usb_msg_read (port, 0x01, PDRM11_CMD_READY, 0, buf, 4); + gp_port_usb_msg_read (port, 0x01, PDRM11_CMD_READY, 0, (char *)buf, 4); gp_port_usb_msg_write(port, 0x01, PDRM11_CMD_INIT1, 0, NULL, 0); - gp_port_usb_msg_read (port, 0x01, PDRM11_CMD_READY, 0, buf, 4); + gp_port_usb_msg_read (port, 0x01, PDRM11_CMD_READY, 0, (char *)buf, 4); gp_port_usb_msg_write(port, 0x01, PDRM11_CMD_INIT2, 0, NULL, 0); - gp_port_usb_msg_read (port, 0x01, PDRM11_CMD_READY, 0, buf, 4); + gp_port_usb_msg_read (port, 0x01, PDRM11_CMD_READY, 0, (char *)buf, 4); - gp_port_usb_msg_read (port, 0x01, PDRM11_CMD_ZERO, 0, buf, 2); + gp_port_usb_msg_read (port, 0x01, PDRM11_CMD_ZERO, 0, (char *)buf, 2); if(buf[0] || buf[1]) { /* I haven't seen anything other than 00 00 yet * unless the connection is bad */ @@ -64,7 +64,7 @@ int pdrm11_init(GPPort *port) GP_DEBUG("waiting..."); timeout--; - if( gp_port_usb_msg_read(port, 0x01, PDRM11_CMD_READY, 0, buf, 4) == -ETIMEDOUT ) + if( gp_port_usb_msg_read(port, 0x01, PDRM11_CMD_READY, 0, (char *)buf, 4) == -ETIMEDOUT ) timeout = 0; } while( !((buf[3] == 0x25) && (buf[0] == 1)) && timeout ); @@ -161,10 +161,10 @@ int pdrm11_get_file(CameraFilesystem *fs, const char *filename, CameraFileType t CHECK( pdrm11_select_file(port, picNum) ); if(type == GP_FILE_TYPE_PREVIEW) { - CHECK(gp_port_usb_msg_read(port, 0x01, PDRM11_CMD_GET_INFO, picNum, buf, 8)); + CHECK(gp_port_usb_msg_read(port, 0x01, PDRM11_CMD_GET_INFO, picNum, (char *)buf, 8)); file_type = buf[4]; - CHECK( gp_port_usb_msg_read(port, 0x01, PDRM11_CMD_GET_THUMBSIZE, picNum, buf, 14) ); + CHECK( gp_port_usb_msg_read(port, 0x01, PDRM11_CMD_GET_THUMBSIZE, picNum, (char *)buf, 14) ); thumbsize = le16atoh( &buf[8] ); /* add 1 to file size only for jpeg thumbnails */ @@ -181,7 +181,7 @@ int pdrm11_get_file(CameraFilesystem *fs, const char *filename, CameraFileType t } } else if(type == GP_FILE_TYPE_NORMAL) { - CHECK( gp_port_usb_msg_read(port, 0x01, PDRM11_CMD_GET_FILESIZE, picNum, buf, 26) ); + CHECK( gp_port_usb_msg_read(port, 0x01, PDRM11_CMD_GET_FILESIZE, picNum, (char *)buf, 26) ); size = le32atoh( &buf[18] ); } else { GP_DEBUG("Unsupported file type!"); @@ -202,10 +202,10 @@ int pdrm11_get_file(CameraFilesystem *fs, const char *filename, CameraFileType t CHECK_AND_FREE( gp_port_usb_msg_write(port, 0x01, PDRM11_CMD_GET_PIC, picNum, NULL, 0), image ); } - ret = gp_port_read(port, image, size); + ret = gp_port_read(port, (char *)image, size); if(ret != size) { GP_DEBUG("failed to read from port. Giving it one more try..."); - ret = gp_port_read(port, image, size); + ret = gp_port_read(port, (char *)image, size); if(ret != size) { GP_DEBUG("gp_port_read returned %d 0x%x. size: %d 0x%x", ret, ret, size, size); free (image); @@ -241,7 +241,7 @@ int pdrm11_delete_file(GPPort *port, int picNum) CHECK( pdrm11_select_file(port, picNum) ); /* should always be 00 00 */ - gp_port_usb_msg_read(port, 0x01, PDRM11_CMD_DELETE, picNum, buf, 2); + gp_port_usb_msg_read(port, 0x01, PDRM11_CMD_DELETE, picNum, (char *)buf, 2); if( (buf[0] != 0) || (buf[1] !=0) ) { GP_DEBUG("should have read 00 00. actually read %2x %2x.", buf[0], buf[1]); return(GP_ERROR); |