diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2020-08-31 12:55:07 +0200 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2020-08-31 12:55:07 +0200 |
commit | 4f748ac6ac2431505c7b06e7a4b89e47302e53e9 (patch) | |
tree | 44e318ed1189d5c0c4cb431d7477b0b145d7c9d7 /camlibs/toshiba | |
parent | 0cc73b08ccc5f32c9c5895f82c28e03a3f182459 (diff) | |
download | libgphoto2-4f748ac6ac2431505c7b06e7a4b89e47302e53e9.tar.gz |
reapply casting to remove warnings
Diffstat (limited to 'camlibs/toshiba')
-rw-r--r-- | camlibs/toshiba/pdrm11/pdrm11.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/camlibs/toshiba/pdrm11/pdrm11.c b/camlibs/toshiba/pdrm11/pdrm11.c index 3f93479e5..311b98d5a 100644 --- a/camlibs/toshiba/pdrm11/pdrm11.c +++ b/camlibs/toshiba/pdrm11/pdrm11.c @@ -194,12 +194,10 @@ int pdrm11_get_file(CameraFilesystem *fs, const char *filename, CameraFileType t GP_DEBUG("size: %d 0x%x", size, size); - image = malloc(sizeof(char)*size); + image = malloc(size); if(!image) return(GP_ERROR_NO_MEMORY); - - if(type == GP_FILE_TYPE_PREVIEW) { CHECK_AND_FREE( gp_port_usb_msg_write(port, 0x01, PDRM11_CMD_GET_THUMB, picNum, NULL, 0), image ); } else { @@ -207,10 +205,10 @@ int pdrm11_get_file(CameraFilesystem *fs, const char *filename, CameraFileType t } ret = gp_port_read(port, (char *)image, size); - if(ret < GP_OK || ret != size) { + if(ret < GP_OK || (unsigned int)ret != size) { GP_DEBUG("failed to read from port. Giving it one more try..."); ret = gp_port_read(port, (char *)image, size); - if(ret < GP_OK || ret != size) { + if(ret < GP_OK || (unsigned int)ret != size) { GP_DEBUG("gp_port_read returned %d 0x%x. size: %d 0x%x", ret, ret, size, size); free (image); return(GP_ERROR_IO_READ); |