summaryrefslogtreecommitdiff
path: root/camlibs/toshiba
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2020-08-31 12:55:07 +0200
committerMarcus Meissner <marcus@jet.franken.de>2020-08-31 12:55:07 +0200
commit4f748ac6ac2431505c7b06e7a4b89e47302e53e9 (patch)
tree44e318ed1189d5c0c4cb431d7477b0b145d7c9d7 /camlibs/toshiba
parent0cc73b08ccc5f32c9c5895f82c28e03a3f182459 (diff)
downloadlibgphoto2-4f748ac6ac2431505c7b06e7a4b89e47302e53e9.tar.gz
reapply casting to remove warnings
Diffstat (limited to 'camlibs/toshiba')
-rw-r--r--camlibs/toshiba/pdrm11/pdrm11.c8
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);