From 7318557c352d818da699bc5328756c233c9c1060 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 11 Apr 2014 20:15:34 +0000 Subject: iFrom: "Daniel P. Berrange" 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 --- camlibs/minolta/dimagev/capture.c | 8 ++++---- camlibs/minolta/dimagev/delete.c | 4 ++-- camlibs/minolta/dimagev/download.c | 22 +++++++++++----------- camlibs/minolta/dimagev/info.c | 8 ++++---- camlibs/minolta/dimagev/packet.c | 10 +++++----- camlibs/minolta/dimagev/status.c | 8 ++++---- camlibs/minolta/dimagev/upload.c | 12 ++++++------ 7 files changed, 36 insertions(+), 36 deletions(-) (limited to 'camlibs/minolta') diff --git a/camlibs/minolta/dimagev/capture.c b/camlibs/minolta/dimagev/capture.c index 53d617f84..e07b0678b 100644 --- a/camlibs/minolta/dimagev/capture.c +++ b/camlibs/minolta/dimagev/capture.c @@ -71,7 +71,7 @@ int dimagev_shutter(dimagev_t *dimagev) { return GP_ERROR_NO_MEMORY; } - if ( gp_port_write(dimagev->dev, p->buffer, p->length) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)p->buffer, p->length) < GP_OK ) { GP_DEBUG( "dimagev_shutter::unable to write packet"); if ( p != NULL ) { @@ -90,7 +90,7 @@ int dimagev_shutter(dimagev_t *dimagev) { GP_DEBUG( "dimagev_shutter::sleep() returned non-zero value"); } - if ( gp_port_read(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_read(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_shutter::no response from camera"); return GP_ERROR_IO; } @@ -144,12 +144,12 @@ int dimagev_shutter(dimagev_t *dimagev) { } char_buffer = DIMAGEV_EOT; - if ( gp_port_write(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_shutter::unable to send EOT"); return GP_ERROR_IO; } - if ( gp_port_read(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_read(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_shutter::no response from camera"); return GP_ERROR_IO; } diff --git a/camlibs/minolta/dimagev/delete.c b/camlibs/minolta/dimagev/delete.c index 43b7b130b..96f5cd7fd 100644 --- a/camlibs/minolta/dimagev/delete.c +++ b/camlibs/minolta/dimagev/delete.c @@ -64,7 +64,7 @@ int dimagev_delete_picture(dimagev_t *dimagev, int file_number) { return GP_ERROR_NO_MEMORY; } - if ( gp_port_write(dimagev->dev, p->buffer, p->length) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)p->buffer, p->length) < GP_OK ) { GP_DEBUG( "dimagev_delete_picture::unable to send set_data packet"); free(p); return GP_ERROR_IO; @@ -174,7 +174,7 @@ int dimagev_delete_all(dimagev_t *dimagev) { return GP_ERROR_IO; } - if ( gp_port_write(dimagev->dev, p->buffer, p->length) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)p->buffer, p->length) < GP_OK ) { GP_DEBUG( "dimagev_delete_all::unable to send set_data packet"); free(p); return GP_ERROR_IO; diff --git a/camlibs/minolta/dimagev/download.c b/camlibs/minolta/dimagev/download.c index db1c1a722..bd1e33520 100644 --- a/camlibs/minolta/dimagev/download.c +++ b/camlibs/minolta/dimagev/download.c @@ -60,11 +60,11 @@ int dimagev_get_picture(dimagev_t *dimagev, int file_number, CameraFile *file) { return GP_ERROR_NO_MEMORY; } - if ( gp_port_write(dimagev->dev, p->buffer, p->length) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)p->buffer, p->length) < GP_OK ) { GP_DEBUG( "dimagev_get_picture::unable to send set_data packet"); free(p); return GP_ERROR_IO; - } else if ( gp_port_read(dimagev->dev, &char_buffer, 1) < GP_OK ) { + } else if ( gp_port_read(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_picture::no response from camera"); free(p); return GP_ERROR_IO; @@ -116,7 +116,7 @@ int dimagev_get_picture(dimagev_t *dimagev, int file_number, CameraFile *file) { for ( i = 0 ; i < ( total_packets -1 ) ; i++ ) { char_buffer=DIMAGEV_ACK; - if ( gp_port_write(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_picture::unable to send ACK"); free(data); return GP_ERROR_IO; @@ -130,7 +130,7 @@ int dimagev_get_picture(dimagev_t *dimagev, int file_number, CameraFile *file) { GP_DEBUG( "dimagev_get_picture::sending NAK to get retry"); char_buffer=DIMAGEV_NAK; - if ( gp_port_write(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_picture::unable to send NAK"); free(data); return GP_ERROR_IO; @@ -161,13 +161,13 @@ int dimagev_get_picture(dimagev_t *dimagev, int file_number, CameraFile *file) { size++; char_buffer=DIMAGEV_EOT; - if ( gp_port_write(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_picture::unable to send ACK"); free(data); return GP_ERROR_IO; } - if ( gp_port_read(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_read(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_picture::no response from camera"); free(data); return GP_ERROR_IO; @@ -234,11 +234,11 @@ int dimagev_get_thumbnail(dimagev_t *dimagev, int file_number, CameraFile *file) return GP_ERROR_NO_MEMORY; } - if ( gp_port_write(dimagev->dev, p->buffer, p->length) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)p->buffer, p->length) < GP_OK ) { GP_DEBUG( "dimagev_get_thumbnail::unable to send set_data packet"); free(p); return GP_ERROR_IO; - } else if ( gp_port_read(dimagev->dev, &char_buffer, 1) < GP_OK ) { + } else if ( gp_port_read(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_thumbnail::no response from camera"); free(p); return GP_ERROR_IO; @@ -291,7 +291,7 @@ int dimagev_get_thumbnail(dimagev_t *dimagev, int file_number, CameraFile *file) while ( size < 9599 ) { char_buffer=DIMAGEV_ACK; - if ( gp_port_write(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_thumbnail::unable to send ACK"); free(ycrcb_data); return GP_ERROR_IO; @@ -323,13 +323,13 @@ int dimagev_get_thumbnail(dimagev_t *dimagev, int file_number, CameraFile *file) size++; char_buffer=DIMAGEV_EOT; - if ( gp_port_write(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_thumbnail::unable to send ACK"); free(ycrcb_data); return GP_ERROR_IO; } - if ( gp_port_read(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_read(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_thumbnail::no response from camera"); free(ycrcb_data); return GP_ERROR_IO; diff --git a/camlibs/minolta/dimagev/info.c b/camlibs/minolta/dimagev/info.c index d229a5ade..425ef0425 100644 --- a/camlibs/minolta/dimagev/info.c +++ b/camlibs/minolta/dimagev/info.c @@ -53,11 +53,11 @@ int dimagev_get_camera_info(dimagev_t *dimagev) { return GP_ERROR_IO; } - if ( gp_port_write(dimagev->dev, p->buffer, p->length) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)p->buffer, p->length) < GP_OK ) { GP_DEBUG( "dimagev_get_camera_info::unable to write packet"); free(p); return GP_ERROR_IO; - } else if ( gp_port_read(dimagev->dev, &char_buffer, 1) < GP_OK ) { + } else if ( gp_port_read(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_camera_info::no response from camera"); free(p); return GP_ERROR_IO; @@ -86,13 +86,13 @@ int dimagev_get_camera_info(dimagev_t *dimagev) { } char_buffer = DIMAGEV_EOT; - if ( gp_port_write(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_camera_info::unable to send EOT"); free(p); return GP_ERROR_IO; } - if ( gp_port_read(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_read(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_camera_info::no response from camera"); free(p); return GP_ERROR_IO; diff --git a/camlibs/minolta/dimagev/packet.c b/camlibs/minolta/dimagev/packet.c index bf45d5442..5b14f129b 100644 --- a/camlibs/minolta/dimagev/packet.c +++ b/camlibs/minolta/dimagev/packet.c @@ -109,13 +109,13 @@ dimagev_packet *dimagev_read_packet(dimagev_t *dimagev) { return NULL; } - if ( gp_port_read(dimagev->dev, p->buffer, 4) < GP_OK ) { + if ( gp_port_read(dimagev->dev, (char *)p->buffer, 4) < GP_OK ) { GP_DEBUG( "dimagev_read_packet::unable to read packet header - will try to send NAK"); free(p); /* Send a NAK */ char_buffer = DIMAGEV_NAK; - if ( gp_port_write(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_read_packet::unable to send NAK"); return NULL; } @@ -127,13 +127,13 @@ dimagev_packet *dimagev_read_packet(dimagev_t *dimagev) { p->length = ( p->buffer[2] * 256 ) + ( p->buffer[3] ); - if ( gp_port_read(dimagev->dev, &(p->buffer[4]), ( p->length - 4)) < GP_OK ) { + if ( gp_port_read(dimagev->dev, (char *)&(p->buffer[4]), ( p->length - 4)) < GP_OK ) { GP_DEBUG( "dimagev_read_packet::unable to read packet body - will try to send NAK"); free(p); /* Send a NAK */ char_buffer = DIMAGEV_NAK; - if ( gp_port_write(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_read_packet::unable to send NAK"); return NULL; } @@ -150,7 +150,7 @@ dimagev_packet *dimagev_read_packet(dimagev_t *dimagev) { /* Send a NAK */ char_buffer = DIMAGEV_NAK; - if ( gp_port_write(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_read_packet::unable to send NAK"); return NULL; } diff --git a/camlibs/minolta/dimagev/status.c b/camlibs/minolta/dimagev/status.c index af5b58eb7..ffa3e1c51 100644 --- a/camlibs/minolta/dimagev/status.c +++ b/camlibs/minolta/dimagev/status.c @@ -47,11 +47,11 @@ int dimagev_get_camera_status(dimagev_t *dimagev) { return GP_ERROR_IO; } - if ( gp_port_write(dimagev->dev, p->buffer, p->length) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)p->buffer, p->length) < GP_OK ) { GP_DEBUG( "dimagev_get_camera_status::unable to write packet"); free(p); return GP_ERROR_IO; - } else if ( gp_port_read(dimagev->dev, &char_buffer, 1) < GP_OK ) { + } else if ( gp_port_read(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_camera_status::no response from camera"); free(p); return GP_ERROR_IO; @@ -80,13 +80,13 @@ int dimagev_get_camera_status(dimagev_t *dimagev) { } char_buffer = DIMAGEV_EOT; - if ( gp_port_write(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_camera_status::unable to send EOT"); free(p); return GP_ERROR_IO; } - if ( gp_port_read(dimagev->dev, &char_buffer, 1) < GP_OK ) { + if ( gp_port_read(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_get_camera_status::no response from camera"); free(p); return GP_ERROR_IO; diff --git a/camlibs/minolta/dimagev/upload.c b/camlibs/minolta/dimagev/upload.c index d74db14ef..6719533fd 100644 --- a/camlibs/minolta/dimagev/upload.c +++ b/camlibs/minolta/dimagev/upload.c @@ -60,11 +60,11 @@ int dimagev_put_file(dimagev_t* dimagev, CameraFile *file) { return GP_ERROR_NO_MEMORY; } - if ( gp_port_write(dimagev->dev, p->buffer, p->length) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)p->buffer, p->length) < GP_OK ) { GP_DEBUG( "dimagev_put_file::unable to send command packet"); free(p); return GP_ERROR_IO; - } else if ( gp_port_read(dimagev->dev, &char_buffer, 1) < GP_OK ) { + } else if ( gp_port_read(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_put_file::no response from camera"); free(p); return GP_ERROR_IO; @@ -109,11 +109,11 @@ int dimagev_put_file(dimagev_t* dimagev, CameraFile *file) { free(packet_buffer); - if ( gp_port_write(dimagev->dev, p->buffer, p->length) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)p->buffer, p->length) < GP_OK ) { GP_DEBUG( "dimagev_put_file::unable to send data packet"); free(p); return GP_ERROR_IO; - } else if ( gp_port_read(dimagev->dev, &char_buffer, 1) < GP_OK ) { + } else if ( gp_port_read(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_put_file::no response from camera"); free(p); return GP_ERROR_IO; @@ -152,11 +152,11 @@ int dimagev_put_file(dimagev_t* dimagev, CameraFile *file) { } } - if ( gp_port_write(dimagev->dev, p->buffer, p->length) < GP_OK ) { + if ( gp_port_write(dimagev->dev, (char *)p->buffer, p->length) < GP_OK ) { GP_DEBUG( "dimagev_put_file::unable to send data packet"); free(p); return GP_ERROR_IO; - } else if ( gp_port_read(dimagev->dev, &char_buffer, 1) < GP_OK ) { + } else if ( gp_port_read(dimagev->dev, (char *)&char_buffer, 1) < GP_OK ) { GP_DEBUG( "dimagev_put_file::no response from camera"); free(p); return GP_ERROR_IO; -- cgit v1.2.1