diff options
34 files changed, 44 insertions, 192 deletions
diff --git a/camlibs/ax203/tinyjpeg.c b/camlibs/ax203/tinyjpeg.c index 740f607db..2b48e37ee 100644 --- a/camlibs/ax203/tinyjpeg.c +++ b/camlibs/ax203/tinyjpeg.c @@ -290,7 +290,6 @@ static int build_huffman_table(struct jdec_private *priv, const unsigned char *b unsigned int i, j, code, code_size, val, nbits; unsigned char huffsize[257], *hz; unsigned int huffcode[257], *hc; - int next_free_entry; int slowtable_used[16-HUFFMAN_HASH_NBITS]; /* @@ -329,7 +328,6 @@ static int build_huffman_table(struct jdec_private *priv, const unsigned char *b /* * Build the lookup table, and the slowtable if needed. */ - next_free_entry = -1; for (i=0; huffsize[i]; i++) { val = vals[i]; 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; } diff --git a/camlibs/casio/camtojpeg.c b/camlibs/casio/camtojpeg.c index d7ebdc036..d014ecec8 100644 --- a/camlibs/casio/camtojpeg.c +++ b/camlibs/casio/camtojpeg.c @@ -42,13 +42,11 @@ static unsigned int u32(const unsigned char *buf) int QVcamtojpeg(const unsigned char *cam, long int camSize, unsigned char **jpeg, long int *jpegSize) { - int areaNum; int ysize; int usize; int vsize; unsigned char *dst; - areaNum = u16(cam); /* areaNum == 0x03 */ ysize = u16(cam + 2); usize = u16(cam + 4); vsize = u16(cam + 6); diff --git a/camlibs/digigr8/digi_postprocess.c b/camlibs/digigr8/digi_postprocess.c index 109e21563..427ebc6c2 100644 --- a/camlibs/digigr8/digi_postprocess.c +++ b/camlibs/digigr8/digi_postprocess.c @@ -118,7 +118,7 @@ digi_second_decompress (unsigned char *uncomp, unsigned char *in, { int diff = 0; int tempval = 0; - int i, m, parity; + int i, m; unsigned char delta_left = 0; unsigned char delta_right = 0; int input_counter = 0; @@ -155,7 +155,6 @@ digi_second_decompress (unsigned char *uncomp, unsigned char *in, for (m = 0; m < height / 2; m++) { /* First we do an even-numbered line */ for (i = 0; i < width / 2; i++) { - parity = i&1; delta_right = in[input_counter] & 0x0f; delta_left = (in[input_counter] >> 4) & 0xff; input_counter++; diff --git a/camlibs/directory/directory.c b/camlibs/directory/directory.c index 549468d0a..cd4216c29 100644 --- a/camlibs/directory/directory.c +++ b/camlibs/directory/directory.c @@ -441,7 +441,7 @@ set_info_func (CameraFilesystem *fs, const char *folder, const char *file, CameraFileInfo info, void *data, GPContext *context) { int retval; - char path_old[1024], path_new[1024], path[1024]; + char path[1024]; Camera *camera = (Camera*)data; retval = _get_path (camera->port, folder, file, path, sizeof(path)); diff --git a/camlibs/iclick/library.c b/camlibs/iclick/library.c index 796dbb141..a4e0b9e31 100644 --- a/camlibs/iclick/library.c +++ b/camlibs/iclick/library.c @@ -172,7 +172,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, unsigned char *ppm, *ptr; unsigned char gtable[256]; int start; - int datasize, framesize, hdrsize, ppmsize; + int datasize, hdrsize, ppmsize; int nb_frames=1; unsigned char buf[0x8000]; @@ -239,9 +239,6 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, camera->pl->data_offset = start; } - /* Retrieve frames */ - framesize = datasize; - frame_data = malloc(datasize); if (!frame_data) return GP_ERROR_NO_MEMORY; icl_read_picture_data(camera->port, frame_data, datasize); diff --git a/camlibs/jl2005a/jl2005a.c b/camlibs/jl2005a/jl2005a.c index 8d4c9da8a..43061be7f 100644 --- a/camlibs/jl2005a/jl2005a.c +++ b/camlibs/jl2005a/jl2005a.c @@ -120,13 +120,12 @@ int jl2005a_read_picture_data (Camera *camera, GPPort *port, unsigned char *data, unsigned int size) { - char response; unsigned char *to_read; int maxdl = 0xfa00; to_read=data; - response = (jl2005a_read_info_byte(port, 7) )&0xff; + jl2005a_read_info_byte(port, 7); /* Always 0x80. Purpose unknown */ - response = (jl2005a_read_info_byte(port, 0x0a) )&0xff; + jl2005a_read_info_byte(port, 0x0a); /* Previous byte is 0x11 if what is to be downloaded is the first * frame in a clip, is 0x01 if it is any clip frame after the initial * one, and is zero if what is to be downloaded is a standalone photo. diff --git a/camlibs/kodak/dc3200/library.c b/camlibs/kodak/dc3200/library.c index 91652fd67..e1f6434c8 100644 --- a/camlibs/kodak/dc3200/library.c +++ b/camlibs/kodak/dc3200/library.c @@ -198,7 +198,6 @@ int dc3200_get_data(Camera *camera, unsigned char **data, unsigned long *data_le unsigned char ack[ACK_PACKET_LEN], resp[DEF_PACKET_LEN]; int ack_len = ACK_PACKET_LEN, resp_len = DEF_PACKET_LEN; unsigned long num_left = 0; - unsigned long total = 0; int data_start_pos = 0; unsigned char *ptr_data = NULL; unsigned int pid = 0; @@ -370,7 +369,6 @@ int dc3200_get_data(Camera *camera, unsigned char **data, unsigned long *data_le /* get the total list length from the data header */ *data_len = bytes_to_l(resp[34], resp[35], resp[36], resp[37]); num_left = bytes_to_l(resp[12], resp[13], resp[14], resp[15]); - total = num_left; data_start_pos = 39; *data_len -= 1; diff --git a/camlibs/konica/library.c b/camlibs/konica/library.c index 150244026..820fb4b91 100644 --- a/camlibs/konica/library.c +++ b/camlibs/konica/library.c @@ -1068,8 +1068,6 @@ localization_file_read (Camera *camera, const char *file_name, int f; unsigned char c[] = "\0\0"; unsigned long line_number; - unsigned char checksum; - unsigned long fcs; unsigned int d; char path[1024]; @@ -1157,13 +1155,11 @@ localization_file_read (Camera *camera, const char *file_name, fclose (file); /* Calculate and check checksum. */ - checksum = 0; gp_log (GP_LOG_DEBUG, "konica", "Checksum not implemented!"); /*FIXME: There's a checksum at (*data)[100]. I could not figure out how it is calculated. */ /* Calculate and check frame check sequence. */ - fcs = 0; gp_log (GP_LOG_DEBUG, "konica", "Frame check sequence " "not implemented!"); diff --git a/camlibs/largan/lmini/largan.c b/camlibs/largan/lmini/largan.c index b873bc29d..ce72ace5f 100644 --- a/camlibs/largan/lmini/largan.c +++ b/camlibs/largan/lmini/largan.c @@ -264,7 +264,7 @@ static CameraFilesystemFuncs fsfuncs = { int camera_init (Camera *camera, GPContext *context) { - int ret, selected_speed = 0; + int ret; GPPortSettings settings; /* First, set up all the function pointers */ @@ -286,7 +286,6 @@ camera_init (Camera *camera, GPContext *context) case GP_PORT_SERIAL: /* Remember the selected speed */ - selected_speed = settings.serial.speed; settings.serial.speed = 19200;/* initial speed is 19200 */ settings.serial.bits = 8; diff --git a/camlibs/largan/lmini/lmini.c b/camlibs/largan/lmini/lmini.c index d789f4e98..445d8527a 100644 --- a/camlibs/largan/lmini/lmini.c +++ b/camlibs/largan/lmini/lmini.c @@ -563,12 +563,11 @@ static int wakeup_camera (Camera * camera) { int num_pix; /* int i;*/ - int ret; if (camera->port->type == GP_PORT_SERIAL) { - ret = set_serial_speed (camera, 4800); /*wakes camera best*/ + set_serial_speed (camera, 4800); /*wakes camera best*/ num_pix = largan_get_num_pict (camera); /*this wakes*/ - ret = set_serial_speed (camera, 19200); /*back to normal*/ + set_serial_speed (camera, 19200); /*back to normal*/ sleep (1); num_pix = largan_get_num_pict (camera); /*this wakes*/ if (num_pix >= 0){ diff --git a/camlibs/minolta/dimagev/download.c b/camlibs/minolta/dimagev/download.c index fd2211e66..db1c1a722 100644 --- a/camlibs/minolta/dimagev/download.c +++ b/camlibs/minolta/dimagev/download.c @@ -28,7 +28,7 @@ #define GP_MODULE "dimagev" int dimagev_get_picture(dimagev_t *dimagev, int file_number, CameraFile *file) { - int length, total_packets, i; + int total_packets, i; unsigned long size = 0; dimagev_packet *p, *r; unsigned char char_buffer, command_buffer[3]; @@ -101,7 +101,6 @@ int dimagev_get_picture(dimagev_t *dimagev, int file_number, CameraFile *file) { free(p); total_packets = (int) r->buffer[0]; - length = ( r->length - 1 ); /* Allocate an extra byte just in case. */ if ( ( data = malloc((size_t)((993 * total_packets) + 1)) ) == NULL ) { diff --git a/camlibs/panasonic/coolshot/library.c b/camlibs/panasonic/coolshot/library.c index 4793913a4..ea886711f 100644 --- a/camlibs/panasonic/coolshot/library.c +++ b/camlibs/panasonic/coolshot/library.c @@ -480,12 +480,10 @@ static int coolshot_read_packet (Camera *camera, char *packet) { int r = 0, x = 0, ret, done, length=0; int blocksize, bytes_read; - char buf[4096]; GP_DEBUG ("* coolshot_read_packet"); read_packet_again: - buf[0] = 0; packet[0] = 0; if (r > 0) diff --git a/camlibs/pentax/library.c b/camlibs/pentax/library.c index 571c13a60..6dae6b44d 100644 --- a/camlibs/pentax/library.c +++ b/camlibs/pentax/library.c @@ -152,7 +152,6 @@ save_buffer(pslr_handle_t camhandle, int bufno, CameraFile *file, pslr_status *s { int imagetype; uint8_t buf[65536]; - int length; uint32_t current; if (status->image_format != PSLR_IMAGE_FORMAT_JPEG) { @@ -165,7 +164,6 @@ save_buffer(pslr_handle_t camhandle, int bufno, CameraFile *file, pslr_status *s if ( pslr_buffer_open(camhandle, bufno, imagetype, status->jpeg_resolution) != PSLR_OK) return GP_ERROR; - length = pslr_buffer_get_size(camhandle); current = 0; while (1) { uint32_t bytes; diff --git a/camlibs/pentax/pslr.c b/camlibs/pentax/pslr.c index 730b03d75..177527557 100644 --- a/camlibs/pentax/pslr.c +++ b/camlibs/pentax/pslr.c @@ -986,14 +986,11 @@ static int ipslr_status_full(ipslr_handle_t *p, pslr_status *status) static int ipslr_press_shutter(ipslr_handle_t *p) { - int r; - uint32_t bufmask; CHECK(ipslr_status_full(p, &p->status)); - bufmask = p->status.bufmask; DPRINT("before: mask=0x%x\n", p->status.bufmask); CHECK(ipslr_write_args(p, 1, 2)); CHECK(command(p, 0x10, 0x05, 0x04)); - r = get_status(p); + get_status(p); DPRINT("shutter result code: 0x%x\n", r); return PSLR_OK; } @@ -1084,7 +1081,6 @@ static int ipslr_download(ipslr_handle_t *p, uint32_t addr, uint32_t length, uin uint32_t block; int n; int retry; - int r; uint32_t length_start = length; retry = 0; @@ -1097,10 +1093,10 @@ static int ipslr_download(ipslr_handle_t *p, uint32_t addr, uint32_t length, uin /*DPRINT("Get 0x%x bytes from 0x%x\n", block, addr); */ CHECK(ipslr_write_args(p, 2, addr, block)); CHECK(command(p, 0x06, 0x00, 0x08)); - r = get_status(p); + get_status(p); n = scsi_read(p, downloadCmd, sizeof(downloadCmd), buf, block); - r = get_status(p); + get_status(p); if (n < 0) { if (retry < BLOCK_RETRY) { diff --git a/camlibs/polaroid/pdc320.c b/camlibs/polaroid/pdc320.c index f5657171f..cd699469d 100644 --- a/camlibs/polaroid/pdc320.c +++ b/camlibs/polaroid/pdc320.c @@ -275,7 +275,7 @@ pdc320_size (Camera *camera, int n) static int pdc320_0c (Camera *camera, int n) { - int size, csum, i; + int size, i; unsigned char buf[3], *xbuf; unsigned char cmd[2]; @@ -295,7 +295,6 @@ pdc320_0c (Camera *camera, int n) GP_DEBUG ("buf[%d]=0x%02x", i, xbuf[i]); } CR (gp_port_read (camera->port, buf, 2)); - csum = (buf[0] << 8) | buf[1]; /* checksum is calculated from both, but i am not clear how. */ return GP_OK; } @@ -305,7 +304,7 @@ pdc320_pic (Camera *camera, int n, unsigned char **data, int *size) { unsigned char cmd[2]; unsigned char buf[2048]; - int remaining, f1, f2, i, len, checksum; + int remaining, f1, f2, i, len; int chunksize=2000; /* Get the size of the picture and allocate the memory */ @@ -349,7 +348,6 @@ pdc320_pic (Camera *camera, int n, unsigned char **data, int *size) /* Read the checksum */ CR_FREE (gp_port_read (camera->port, buf, 2), *data); - checksum = (buf[0] << 8) + buf[1]; } return (GP_OK); diff --git a/camlibs/ptp2/config.c b/camlibs/ptp2/config.c index d202115e0..990ee1e3b 100644 --- a/camlibs/ptp2/config.c +++ b/camlibs/ptp2/config.c @@ -5405,7 +5405,6 @@ _put_nikon_list_wifi_profiles (CONFIG_PUT_ARGS) int value; char* endptr; long val; - int deleted = 0; if (camera->pl->params.deviceinfo.VendorExtensionID != PTP_VENDOR_NIKON) return (GP_ERROR_NOT_SUPPORTED); @@ -5422,7 +5421,6 @@ _put_nikon_list_wifi_profiles (CONFIG_PUT_ARGS) if (!*endptr) { ptp_nikon_deletewifiprofile(&(camera->pl->params), val); gp_widget_set_value(child2, 0); - deleted = 1; } } } diff --git a/camlibs/ricoh/ricoh.c b/camlibs/ricoh/ricoh.c index 871d3f9bf..29466a30a 100644 --- a/camlibs/ricoh/ricoh.c +++ b/camlibs/ricoh/ricoh.c @@ -820,7 +820,7 @@ ricoh_put_file (Camera *camera, GPContext *context, const char *name, { RicohMode mode; unsigned char p[16], len, buf[0xff], block[0xff]; - unsigned int pic_num, i, pr; + unsigned int i, pr; CR (ricoh_get_mode (camera, context, &mode)); if (mode != RICOH_MODE_PLAY) @@ -846,7 +846,6 @@ ricoh_put_file (Camera *camera, GPContext *context, const char *name, * We just received the picture number of the new file. We don't * need it. */ - pic_num = buf[0] | (buf[1] << 8); /* Now send the data */ pr = gp_context_progress_start (context, size, _("Uploading...")); diff --git a/camlibs/sierra/sierra-desc.c b/camlibs/sierra/sierra-desc.c index 5df57522e..220ebcc4d 100644 --- a/camlibs/sierra/sierra-desc.c +++ b/camlibs/sierra/sierra-desc.c @@ -360,7 +360,6 @@ camera_cam_desc_set_widget (Camera *camera, CameraRegisterType *reg_p, CameraWidget *window, GPContext *context) { int ind, vind, ret; - int mask; union value_in { char *charp; int val; @@ -373,7 +372,6 @@ camera_cam_desc_set_widget (Camera *camera, CameraRegisterType *reg_p, for (ind = 0; ind < reg_p->reg_desc_cnt; ind++) { reg_desc_p = ®_p->reg_desc[ind]; - mask = reg_desc_p->regs_mask; GP_DEBUG ("window name is %s", reg_desc_p->regs_long_name); if ((gp_widget_get_child_by_label (window, diff --git a/camlibs/sipix/web2.c b/camlibs/sipix/web2.c index 6d1b32332..e7124326d 100644 --- a/camlibs/sipix/web2.c +++ b/camlibs/sipix/web2.c @@ -146,11 +146,9 @@ web2_getthumb(GPPort *port, GPContext *context, CameraFile *file) static int web2_get_file_info(GPPort *port, GPContext *context, char *name, int *filesize) { unsigned char cmdbuf[26]; - int i, hmm, ret; + int i, ret; ret = web2_command(port, 0, WEB2_GET_DIRENTRY, 0, 0, (char*)cmdbuf, 26); - /* 0 usually? */ - hmm = cmdbuf[0] | (cmdbuf[1] << 8); /* flip filename bytes to be in correct order */ for (i=2;i<16;i++) name[i-2] = cmdbuf[i^1]; diff --git a/camlibs/sonix/sonix.c b/camlibs/sonix/sonix.c index 0c6702900..c542702bc 100644 --- a/camlibs/sonix/sonix.c +++ b/camlibs/sonix/sonix.c @@ -67,7 +67,7 @@ SONIX_COMMAND (GPPort *port, char *command) int sonix_init (GPPort *port, CameraPrivateLibrary *priv) { - int i, command_done=1; + int i; char c[6]; char status; unsigned char reading[4]; @@ -94,7 +94,7 @@ int sonix_init (GPPort *port, CameraPrivateLibrary *priv) } } - command_done = SONIX_COMMAND ( port, c); + SONIX_COMMAND ( port, c); while (status !=2) diff --git a/camlibs/sonydscf1/command.c b/camlibs/sonydscf1/command.c index 360d51c70..c0ce0bd72 100644 --- a/camlibs/sonydscf1/command.c +++ b/camlibs/sonydscf1/command.c @@ -115,13 +115,12 @@ static int recvdata(GPPort *port, unsigned char *p, int len) char F1newstatus(GPPort *port, int verbose, char *return_buf) { unsigned char buf[34]; - int i; char status_buf[1000]=""; char tmp_buf[150]=""; buf[0] = 0x03; buf[1] = 0x02; sendcommand(port,buf, 2); - i = recvdata(port, buf, 33); + recvdata(port, buf, 33); #ifdef DEBUG fprintf(stderr,"Status: %02x%02x:%02x(len = %d)\n", buf[0], buf[1], buf[2], i); #endif @@ -172,12 +171,11 @@ int F1status(GPPort *port) { unsigned char buf[34]; - int i; buf[0] = 0x03; buf[1] = 0x02; sendcommand(port,buf, 2); - i = recvdata(port, buf, 33); + recvdata(port, buf, 33); #ifdef DEBUG fprintf(stderr,"Status: %02x%02x:%02x(len = %d)\n", buf[0], buf[1], buf[2], i); #endif diff --git a/camlibs/sonydscf1/sonydscf1.c b/camlibs/sonydscf1/sonydscf1.c index 2bfda6e12..bcc3acd5b 100644 --- a/camlibs/sonydscf1/sonydscf1.c +++ b/camlibs/sonydscf1/sonydscf1.c @@ -148,14 +148,13 @@ get_picture_information(GPPort *port,int *pmx_num, int outit) { unsigned char buforg[PMF_MAXSIZ]; char name[64]; - long len; int i, n; int j, k; char *buf = (char *) &buforg; strcpy(name, "/PIC_CAM/PIC00000/PIC_INF.PMF"); F1ok(port); - len = F1getdata(port, name, buf); + F1getdata(port, name, buf); n = buf[26] * 256 + buf[27]; /* how many files */ *pmx_num = buf[31]; /* ??? */ diff --git a/camlibs/soundvision/agfa_cl18.c b/camlibs/soundvision/agfa_cl18.c index 535f317ef..e7df2ba76 100644 --- a/camlibs/soundvision/agfa_cl18.c +++ b/camlibs/soundvision/agfa_cl18.c @@ -29,8 +29,8 @@ int agfa_capture(CameraPrivateLibrary *dev, CameraFilePath *path) { /*FIXME: Not fully implemented according to the gphoto2 spec.*/ /*Should also save taken picture, and then delete it from the camera*/ /*but when I try to do that it just hangs*/ - - int ret,taken; + + int ret; ret=soundvision_send_command(SOUNDVISION_SETPC1,0,dev); if (ret < 0) return ret; @@ -45,9 +45,9 @@ int agfa_capture(CameraPrivateLibrary *dev, CameraFilePath *path) { /*delay(20); */ sleep(20); /*Again, three times in windows driver*/ - taken = soundvision_photos_taken(dev); - taken = soundvision_photos_taken(dev); - taken = soundvision_photos_taken(dev); + soundvision_photos_taken(dev); + soundvision_photos_taken(dev); + soundvision_photos_taken(dev); /*This seems to do some kind of reset, but does cause the camera to start responding again*/ ret=soundvision_send_command(SOUNDVISION_GET_NAMES, 0, dev); if (ret < 0) return ret; diff --git a/camlibs/spca50x/spca50x-sdram.c b/camlibs/spca50x/spca50x-sdram.c index aec5309d1..c22125c86 100644 --- a/camlibs/spca50x/spca50x-sdram.c +++ b/camlibs/spca50x/spca50x-sdram.c @@ -522,7 +522,7 @@ spca50x_get_avi_thumbnail (CameraPrivateLibrary * lib, uint8_t ** buf, uint32_t start; uint8_t *mybuf; int size, o_size, file_size; - int w, h, ret; + int ret; /* FIXME */ if (lib->bridge == BRIDGE_SPCA500) @@ -539,8 +539,6 @@ spca50x_get_avi_thumbnail (CameraPrivateLibrary * lib, uint8_t ** buf, (p[52] & 0xff) * 0x10000 + (p[51] & 0xff) * 0x100 + (p[50] & 0xff); qIndex = p[7] & 0x0f; - w = (int) ((p[8] & 0xFF) * 16); - h = (int) ((p[9] & 0xFF) * 16); /* align */ if (size % 64 != 0) diff --git a/camlibs/stv0674/library.c b/camlibs/stv0674/library.c index 037fd8d99..676f09df7 100644 --- a/camlibs/stv0674/library.c +++ b/camlibs/stv0674/library.c @@ -100,7 +100,7 @@ static int setval(unsigned char* where,unsigned long val) int stv0674_get_image(GPPort *port, int image_no, CameraFile *file) { unsigned char header[0x200];/*block for header */ - int x,y,size; + int size; int whole,remain; @@ -141,9 +141,6 @@ int stv0674_get_image(GPPort *port, int image_no, CameraFile *file) size=(header[0x47]<<8) | header[0x48]; - x=(header[0x49]<<8) | header[0x4a]; - y=(header[0x4b]<<8) | header[0x4c]; - /*create data block */ data=malloc(size); if (!data) diff --git a/examples/lunkwill-canon-capture.c b/examples/lunkwill-canon-capture.c index b64c2b1fc..b16739d96 100644 --- a/examples/lunkwill-canon-capture.c +++ b/examples/lunkwill-canon-capture.c @@ -129,7 +129,7 @@ main(int argc, char **argv) { int retval; GPContext *canoncontext = sample_create_context(); - gp_log_add_func(GP_LOG_ERROR, errordumper, NULL); + gp_log_add_func(GP_LOG_DEBUG, errordumper, NULL); gp_camera_new(&canon); /* When I set GP_LOG_DEBUG instead of GP_LOG_ERROR above, I noticed that the @@ -146,6 +146,12 @@ main(int argc, char **argv) { canon_enable_capture(canon, TRUE, canoncontext); /*set_capturetarget(canon, canoncontext);*/ capture_to_file(canon, canoncontext, "foo.jpg"); + capture_to_file(canon, canoncontext, "foo1.jpg"); + capture_to_file(canon, canoncontext, "foo2.jpg"); + capture_to_file(canon, canoncontext, "foo3.jpg"); + capture_to_file(canon, canoncontext, "foo4.jpg"); + capture_to_file(canon, canoncontext, "foo5.jpg"); + capture_to_file(canon, canoncontext, "foo6.jpg"); gp_camera_exit(canon, canoncontext); return 0; } diff --git a/examples/preview.c b/examples/preview.c index 8a6cd118a..fb53d0804 100644 --- a/examples/preview.c +++ b/examples/preview.c @@ -24,7 +24,7 @@ static void errordumper(GPLogLevel level, const char *domain, const char *str, void *data) { - printf("%s\n", str); + printf("%s (data %p)\n", str,data); } /* This seems to have no effect on where images go @@ -121,7 +121,7 @@ main(int argc, char **argv) { int i, retval; GPContext *canoncontext = sample_create_context(); - gp_log_add_func(GP_LOG_ERROR, errordumper, NULL); + gp_log_add_func(GP_LOG_ERROR, errordumper, 0x4242424242); gp_camera_new(&canon); /* When I set GP_LOG_DEBUG instead of GP_LOG_ERROR above, I noticed that the diff --git a/examples/sample-trigger-capture.c b/examples/sample-trigger-capture.c index 974f78460..0d8189ae4 100644 --- a/examples/sample-trigger-capture.c +++ b/examples/sample-trigger-capture.c @@ -128,7 +128,6 @@ int main(int argc, char **argv) { Camera *camera; int retval, nrcapture = 0; - time_t lastsec; struct timeval tval; GPContext *context = sample_create_context(); @@ -139,7 +138,6 @@ main(int argc, char **argv) { /*gp_log_add_func(GP_LOG_DATA, errordumper, NULL); */ gp_camera_new(&camera); - lastsec = time(NULL)-3; retval = gp_camera_init(camera, context); if (retval != GP_OK) { printf("gp_camera_init: %d\n", retval); diff --git a/libgphoto2/bayer.c b/libgphoto2/bayer.c index 09fa497ab..8653327ff 100644 --- a/libgphoto2/bayer.c +++ b/libgphoto2/bayer.c @@ -145,26 +145,26 @@ int gp_bayer_interpolate (unsigned char *image, int w, int h, BayerTile tile) { int x, y, bayer; - int p0, p1, p2, p3; + int p0, p1, p2; int value, div ; switch (tile) { default: case BAYER_TILE_RGGB: case BAYER_TILE_RGGB_INTERLACED: - p0 = 0; p1 = 1; p2 = 2; p3 = 3; + p0 = 0; p1 = 1; p2 = 2; break; case BAYER_TILE_GRBG: case BAYER_TILE_GRBG_INTERLACED: - p0 = 1; p1 = 0; p2 = 3; p3 = 2; + p0 = 1; p1 = 0; p2 = 3; break; case BAYER_TILE_BGGR: case BAYER_TILE_BGGR_INTERLACED: - p0 = 3; p1 = 2; p2 = 1; p3 = 0; + p0 = 3; p1 = 2; p2 = 1; break; case BAYER_TILE_GBRG: case BAYER_TILE_GBRG_INTERLACED: - p0 = 2; p1 = 3; p2 = 0; p3 = 1; + p0 = 2; p1 = 3; p2 = 0; break; } diff --git a/libgphoto2_port/serial/unix.c b/libgphoto2_port/serial/unix.c index 03856fc4a..35c3b46dc 100644 --- a/libgphoto2_port/serial/unix.c +++ b/libgphoto2_port/serial/unix.c @@ -300,7 +300,7 @@ gp_port_library_list (GPPortInfoList *list) { GPPortInfo info; char path[1024], prefix[1024]; - int x, fd; + int x; struct stat s; #ifdef OS2 int r, fh, option; @@ -334,25 +334,6 @@ gp_port_library_list (GPPortInfoList *list) if ((stat (path, &s) == -1) && ((errno == ENOENT) || (errno == ENODEV))) continue; -#if 0 - /* First of all, try to lock the device */ - if (gp_port_serial_lock (NULL, path) < 0) - continue; - - /* Device locked. Try to open the device. */ - fd = open (path, O_RDONLY | O_NONBLOCK); - if (fd < 0) { - gp_port_serial_unlock (NULL, path); - continue; - } - - /* - * Device locked and opened. Close it, unlock it, and add - * it to the list. - */ - close (fd); - gp_port_serial_unlock (NULL, path); -#endif gp_port_info_new (&info); gp_port_info_set_type (info, GP_PORT_SERIAL); xname = malloc (strlen("serial:")+strlen(path)+1); diff --git a/packaging/generic/print-camera-list.c b/packaging/generic/print-camera-list.c index 1152df35c..8824942ad 100644 --- a/packaging/generic/print-camera-list.c +++ b/packaging/generic/print-camera-list.c @@ -220,7 +220,6 @@ hotplug_camera_func (const func_params_t *params, { int flags = 0; int class = 0, subclass = 0, proto = 0; - int usb_vendor = 0, usb_product = 0; const char *usermap_script = ((*params->argv)[0] != NULL) ?((*params->argv)[0]) @@ -233,8 +232,6 @@ hotplug_camera_func (const func_params_t *params, proto = 0; flags = (GP_USB_HOTPLUG_MATCH_VENDOR_ID | GP_USB_HOTPLUG_MATCH_PRODUCT_ID); - usb_vendor = a->usb_vendor; - usb_product = a->usb_product; } else if ((a->usb_class) && (a->usb_class != 666)) { class = a->usb_class; subclass = a->usb_subclass; @@ -248,8 +245,6 @@ hotplug_camera_func (const func_params_t *params, flags |= GP_USB_HOTPLUG_MATCH_INT_PROTOCOL; else proto = 0; - usb_vendor = 0; - usb_product = 0; } } else { /* not a USB camera */ @@ -574,7 +569,6 @@ udev_camera_func (const func_params_t *params, { int flags = 0; int class = 0, subclass = 0, proto = 0; - int usb_vendor = 0, usb_product = 0; int has_valid_rule = 0; udev_persistent_data_t *pdata = (udev_persistent_data_t *) data; ASSERT(pdata != NULL); @@ -588,8 +582,6 @@ udev_camera_func (const func_params_t *params, proto = 0; flags = (GP_USB_HOTPLUG_MATCH_VENDOR_ID | GP_USB_HOTPLUG_MATCH_PRODUCT_ID); - usb_vendor = a->usb_vendor; - usb_product = a->usb_product; } else { if (a->usb_class) { class = a->usb_class; @@ -604,8 +596,6 @@ udev_camera_func (const func_params_t *params, flags |= GP_USB_HOTPLUG_MATCH_INT_PROTOCOL; else proto = 0; - usb_vendor = 0; - usb_product = 0; } } |