diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2014-04-11 20:10:32 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2014-04-11 20:10:32 +0000 |
commit | c1ddde0315005e55ef361720b8b758fa163b1731 (patch) | |
tree | ef0d7fdd0ebcc010cd1c50e697eb01ddb86f2421 /camlibs/canon | |
parent | 9e777504d448e26ace9a56f509a13a1f8fbbcf55 (diff) | |
download | libgphoto2-c1ddde0315005e55ef361720b8b758fa163b1731.tar.gz |
From: "Daniel P. Berrange" <berrange@redhat.com>
A great many functions have variables which are set to some
value, but never read thereafter. All these variables can be
removed with no functional impact.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14896 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/canon')
-rw-r--r-- | camlibs/canon/canon.c | 2 | ||||
-rw-r--r-- | camlibs/canon/serial.c | 8 | ||||
-rw-r--r-- | camlibs/canon/usb.c | 72 |
3 files changed, 1 insertions, 81 deletions
diff --git a/camlibs/canon/canon.c b/camlibs/canon/canon.c index cbf890478..92b2fc0d1 100644 --- a/camlibs/canon/canon.c +++ b/camlibs/canon/canon.c @@ -2544,7 +2544,6 @@ int canon_int_set_owner_name (Camera *camera, const char *name, GPContext *context) { unsigned char *msg; - unsigned char payload[4]; unsigned int len; GP_DEBUG ("canon_int_set_owner_name() called, name = '%s'", name); @@ -2561,7 +2560,6 @@ canon_int_set_owner_name (Camera *camera, const char *name, GPContext *context) if ( camera->pl->md->model == CANON_CLASS_6 ) { msg = canon_usb_dialogue (camera, CANON_USB_FUNCTION_CAMERA_CHOWN_2, &len, (unsigned char *)name, strlen (name) + 1); - htole32a ( payload, 0x0f ); } else msg = canon_usb_dialogue (camera, CANON_USB_FUNCTION_CAMERA_CHOWN, diff --git a/camlibs/canon/serial.c b/camlibs/canon/serial.c index 460d16b97..2602fc857 100644 --- a/camlibs/canon/serial.c +++ b/camlibs/canon/serial.c @@ -968,7 +968,6 @@ canon_serial_put_file (Camera *camera, CameraFile *file, const char *name, const GPContext *context) { unsigned char *msg; - char filename[64]; char buf[4096]; int offset = 0; char offset2[4]; @@ -976,17 +975,12 @@ canon_serial_put_file (Camera *camera, CameraFile *file, const char *name, const char block_len2[4]; unsigned int sent = 0; int i, j = 0; - unsigned int len, hdr_len; + unsigned int len; unsigned long int size; const char *data; unsigned int id; camera->pl->uploading = 1; - for (i = 0; name[i]; i++) - filename[i] = toupper (name[i]); - filename[i] = '\0'; - - hdr_len = HDR_FIXED_LEN + strlen (name) + strlen (destpath); gp_file_get_data_and_size (file, &data, &size); diff --git a/camlibs/canon/usb.c b/camlibs/canon/usb.c index 40a0e49f6..a36d29c63 100644 --- a/camlibs/canon/usb.c +++ b/camlibs/canon/usb.c @@ -935,75 +935,6 @@ static int canon_usb_poll_interrupt_pipe ( Camera *camera, unsigned char *buf, u return status; } -/** - * canon_usb_poll_interrupt_multiple: - * @camera: Array of Camera's to work with - * @n_cameras: Length of #camera - * @camera_flags: array of int's corresponding to entries in #camera. - * Non-zero (true) if that camera is to be polled, zero - * (false) if that camera is to be ignored. - * @buf: buffer to receive data read from the pipe. - * @n_tries: number of times to try - * @which: returns index of camera that responded - * - * Polls the interrupt pipes of several cameras either until one - * responds, or for a specified number of tries. - * We will return when: - * 1. a non-zero length is returned, - * 2. an error code is returned, or - * 3. the number of read attempts reaches @n_tries. - * - * Returns: - * length of read, or - * zero if n_tries has been exceeded, or - * gphoto2 error code from read that results in an I/O error. - * - */ -static int -canon_usb_poll_interrupt_multiple ( Camera *camera[], int n_cameras, - int camera_flags[], - unsigned char *buf, int n_tries, - int *which ) -{ - int i = 0, status = 0, timeout; - - memset ( buf, 0x81, 0x40 ); /* Put weird stuff in buffer */ - *which = 0; /* Start with the first camera */ - - /* Read repeatedly until we get either an - error or a non-zero size. */ - while ( status == 0 && i < n_tries ) { - while ( !camera_flags[*which] ) - *which = (*which+1) % n_cameras; - - /* - * Ideally this timeout code should be hoisted above the - * while() loop. But since this entire function is - * dead code, I am loath to put a lot of effort into - * it. We should probably just remove the entire function. - * -pjw - */ - gp_port_get_timeout ( camera[*which]->port, &timeout ); - gp_port_set_timeout ( camera[*which]->port, CANON_FAST_TIMEOUT ); - - status = gp_port_check_int ( camera[*which]->port, - (char *)buf, 0x40 ); - - gp_port_set_timeout ( camera[*which]->port, timeout ); - - } - - - if ( status <= 0 ) - GP_DEBUG ( "canon_usb_poll_interrupt_multiple:" - " interrupt read failed after %i tries, \"%s\"", - i, gp_result_as_string(status) ); - else - GP_DEBUG ( "canon_usb_poll_interrupt_multiple:" - " interrupt packet took %d tries", i+1 ); - - return status; -} int canon_usb_wait_for_event (Camera *camera, int timeout, @@ -1415,7 +1346,6 @@ canon_usb_dialogue_full (Camera *camera, canonCommandIndex canon_funct, unsigned static unsigned char buffer[0x474]; /* used for receiving data from camera */ char *msg; int j, canon_subfunc = 0; - char subcmd = 0, *subfunct_descr = ""; int additional_read_bytes = 0; /* clear this to indicate that no data is there if we abort */ @@ -1465,8 +1395,6 @@ canon_usb_dialogue_full (Camera *camera, canonCommandIndex canon_funct, unsigned j = 0; while (canon_usb_control_cmd[j].num != 0) { if (canon_usb_control_cmd[j].subcmd == canon_subfunc) { - subfunct_descr = canon_usb_control_cmd[j].description; - subcmd = canon_usb_control_cmd[j].subcmd; additional_read_bytes = canon_usb_control_cmd[j].additional_return_length; break; } |