diff --git a/camlibs/casio/ycctoppm.c b/camlibs/casio/ycctoppm.c index 569d24e6b..2b4745c89 100644 --- a/camlibs/casio/ycctoppm.c +++ b/camlibs/casio/ycctoppm.c @@ -18,6 +18,8 @@ * Boston, MA 02111-1307, USA. */ +#define _BSD_SOURCE + #include "config.h" #include diff --git a/camlibs/digigr8/library.c b/camlibs/digigr8/library.c index ab1dfc537..a4e6bfeea 100644 --- a/camlibs/digigr8/library.c +++ b/camlibs/digigr8/library.c @@ -18,6 +18,8 @@ * Boston, MA 02111-1307, USA. */ +#define _BSD_SOURCE + #include #include diff --git a/camlibs/digita/digita.c b/camlibs/digita/digita.c index 61dd06e52..40e4e239a 100644 --- a/camlibs/digita/digita.c +++ b/camlibs/digita/digita.c @@ -19,6 +19,8 @@ * Boston, MA 02111-1307, USA. */ +#define _BSD_SOURCE + #include "config.h" #include diff --git a/camlibs/digita/serial.c b/camlibs/digita/serial.c index fef845e46..61be074e7 100644 --- a/camlibs/digita/serial.c +++ b/camlibs/digita/serial.c @@ -21,6 +21,8 @@ * Boston, MA 02111-1307, USA. */ +#define _BSD_SOURCE + #include "config.h" #include diff --git a/camlibs/dimera/dimera3500.c b/camlibs/dimera/dimera3500.c index a9ba1be3e..3700cfd51 100644 --- a/camlibs/dimera/dimera3500.c +++ b/camlibs/dimera/dimera3500.c @@ -19,6 +19,8 @@ * */ +#define _BSD_SOURCE + #include "config.h" #include "mesalib.h" diff --git a/camlibs/directory/directory.c b/camlibs/directory/directory.c index af02f01fe..faab381dc 100644 --- a/camlibs/directory/directory.c +++ b/camlibs/directory/directory.c @@ -19,6 +19,9 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ + +#define _BSD_SOURCE + #include "config.h" #include diff --git a/camlibs/fuji/library.c b/camlibs/fuji/library.c index 1981aae18..0983381be 100644 --- a/camlibs/fuji/library.c +++ b/camlibs/fuji/library.c @@ -18,6 +18,8 @@ * Boston, MA 02111-1307, USA. */ +#define _BSD_SOURCE + #include "config.h" #include diff --git a/camlibs/kodak/dc120/dc120.c b/camlibs/kodak/dc120/dc120.c index d00ec01fb..354b118ab 100644 --- a/camlibs/kodak/dc120/dc120.c +++ b/camlibs/kodak/dc120/dc120.c @@ -1,3 +1,6 @@ +#define _BSD_SOURCE +#define _POSIX_C_SOURCE 199309L + #include "config.h" #include @@ -301,15 +304,12 @@ static int camera_capture (Camera *camera, CameraCaptureType type, CameraFilePat gp_list_get_name (list, count - 1, &name); gp_list_free(list); - /* Set the filename */ - snprintf(path->folder, sizeof(path->folder), "/"); - + strcpy(path->folder, "/"); CHECK_RESULT (gp_filesystem_append (camera->fs, path->folder, path->name, context)); - return (GP_OK); } diff --git a/camlibs/kodak/dc120/library.c b/camlibs/kodak/dc120/library.c index 4f7167b2c..919f2d710 100644 --- a/camlibs/kodak/dc120/library.c +++ b/camlibs/kodak/dc120/library.c @@ -1,8 +1,11 @@ +#define _BSD_SOURCE +#define _POSIX_C_SOURCE 199309L #include "config.h" #include #include #include +#include #include #include "dc120.h" diff --git a/camlibs/kodak/dc210/dc210.c b/camlibs/kodak/dc210/dc210.c index 913dbe0a1..65bacc672 100644 --- a/camlibs/kodak/dc210/dc210.c +++ b/camlibs/kodak/dc210/dc210.c @@ -1,3 +1,4 @@ +#define _BSD_SOURCE #include "config.h" #include diff --git a/camlibs/kodak/dc210/library.c b/camlibs/kodak/dc210/library.c index ba131b628..3d99d3e0a 100644 --- a/camlibs/kodak/dc210/library.c +++ b/camlibs/kodak/dc210/library.c @@ -1,3 +1,4 @@ +#define _POSIX_C_SOURCE 199309L #include "config.h" #include diff --git a/camlibs/kodak/dc240/library.c b/camlibs/kodak/dc240/library.c index a21b4b46a..0b3f22134 100644 --- a/camlibs/kodak/dc240/library.c +++ b/camlibs/kodak/dc240/library.c @@ -4,6 +4,8 @@ Hubert Figuiere */ +#define _POSIX_C_SOURCE 199309L + #include "config.h" #include diff --git a/camlibs/konica/library.c b/camlibs/konica/library.c index aac30c3f5..e97d98949 100644 --- a/camlibs/konica/library.c +++ b/camlibs/konica/library.c @@ -18,6 +18,8 @@ * Boston, MA 02111-1307, USA. */ +#define _BSD_SOURCE + #include "config.h" #include diff --git a/camlibs/konica/qm150.c b/camlibs/konica/qm150.c index 3aa035e6e..ae39ad31c 100644 --- a/camlibs/konica/qm150.c +++ b/camlibs/konica/qm150.c @@ -33,6 +33,8 @@ * information header and use this number with all functions !! */ +#define _BSD_SOURCE + #include "config.h" #include diff --git a/camlibs/largan/lmini/largan.c b/camlibs/largan/lmini/largan.c index ab65d6098..4b5cb6095 100644 --- a/camlibs/largan/lmini/largan.c +++ b/camlibs/largan/lmini/largan.c @@ -24,6 +24,8 @@ * Currently only largan lmini is supported */ +#define _BSD_SOURCE + #include "config.h" #include diff --git a/camlibs/mars/mars.c b/camlibs/mars/mars.c index 0e439a47d..af8b02fb7 100644 --- a/camlibs/mars/mars.c +++ b/camlibs/mars/mars.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include diff --git a/camlibs/minolta/dimagev/dimagev.c b/camlibs/minolta/dimagev/dimagev.c index 17c6bb767..01be3a297 100644 --- a/camlibs/minolta/dimagev/dimagev.c +++ b/camlibs/minolta/dimagev/dimagev.c @@ -19,6 +19,8 @@ * * **********************************************************************/ +#define _BSD_SOURCE + #include "config.h" #ifdef ENABLE_NLS diff --git a/camlibs/panasonic/coolshot/library.c b/camlibs/panasonic/coolshot/library.c index 2b65627c3..0a9ab6018 100644 --- a/camlibs/panasonic/coolshot/library.c +++ b/camlibs/panasonic/coolshot/library.c @@ -23,6 +23,10 @@ /* Free Software Foundation, Inc., 59 Temple Place - Suite 330, */ /* Boston, MA 02111-1307, USA. */ /****************************************************************/ + +#define _POSIX_C_SOURCE 199309L +#define _BSD_SOURCE + #include "config.h" #include diff --git a/camlibs/pentax/library.c b/camlibs/pentax/library.c index 758da6551..d552d63ee 100644 --- a/camlibs/pentax/library.c +++ b/camlibs/pentax/library.c @@ -16,6 +16,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#define _BSD_SOURCE + #include "config.h" #define GP_MODULE "pentax" diff --git a/camlibs/pentax/pslr.c b/camlibs/pentax/pslr.c index 2a0aa0f46..8d2d36c0f 100644 --- a/camlibs/pentax/pslr.c +++ b/camlibs/pentax/pslr.c @@ -17,6 +17,8 @@ along with this program. If not, see . */ +#define _BSD_SOURCE + #include #include #include @@ -121,7 +123,7 @@ static int ipslr_download(ipslr_handle_t *p, uint32_t addr, uint32_t length, uin static int ipslr_identify(ipslr_handle_t *p); static int ipslr_write_args(ipslr_handle_t *p, int n, ...); -//static int ipslr_cmd_00_04(ipslr_handle_t *p, uint32_t mode); +/*static int ipslr_cmd_00_04(ipslr_handle_t *p, uint32_t mode);*/ static int command(ipslr_handle_t *, int a, int b, int c); static int get_status(ipslr_handle_t *); @@ -619,8 +621,8 @@ uint32_t pslr_buffer_read(pslr_handle_t h, uint8_t *buf, uint32_t size) if (blksz > BLKSZ) blksz = BLKSZ; - //printf("File offset %d segment: %d offset %d address 0x%x read size %d\n", p->offset, - // i, seg_offs, addr, blksz); + /*printf("File offset %d segment: %d offset %d address 0x%x read size %d\n", p->offset, + * i, seg_offs, addr, blksz); */ ret = ipslr_download(p, addr, blksz, buf); if (ret != PSLR_OK) @@ -833,49 +835,50 @@ static int ipslr_status_full(ipslr_handle_t *p, pslr_status *status) #endif memset(status, 0, sizeof(*status)); status->bufmask = buf[0x16] << 8 | buf[0x17]; - status->current_iso = get_uint32(&buf[0x130]); //d - status->current_shutter_speed.nom = get_uint32(&buf[0x108]); //d - status->current_shutter_speed.denom = get_uint32(&buf[0x10C]); //d - status->current_aperture.nom = get_uint32(&buf[0x110]); //d - status->current_aperture.denom = get_uint32(&buf[0x114]); //d - status->lens_min_aperture.nom = get_uint32(&buf[0x140]); //d - status->lens_min_aperture.denom = get_uint32(&buf[0x144]); //d - status->lens_max_aperture.nom = get_uint32(&buf[0x148]); //d - status->lens_max_aperture.denom = get_uint32(&buf[0x14B]); //d - status->current_zoom.nom = get_uint32(&buf[0x180]); //d - status->current_zoom.denom = get_uint32(&buf[0x184]); //d - status->set_aperture.nom = get_uint32(&buf[0x34]); //d - status->set_aperture.denom = get_uint32(&buf[0x38]); //d - status->set_shutter_speed.nom = get_uint32(&buf[0x2c]); //d - status->set_shutter_speed.denom = get_uint32(&buf[0x30]); //d - status->set_iso = get_uint32(&buf[0x60]); //d - status->jpeg_resolution = get_uint32(&buf[0x7c]); //d - status->jpeg_contrast = get_uint32(&buf[0x94]); // commands do now work for it? - status->jpeg_sharpness = get_uint32(&buf[0x90]); // commands do now work for it? - status->jpeg_saturation = get_uint32(&buf[0x8c]); // commands do now work for it? - status->jpeg_quality = get_uint32(&buf[0x80]); //d - status->jpeg_image_mode = get_uint32(&buf[0x88]); //d - status->zoom.nom = get_uint32(&buf[0x180]); //d - status->zoom.denom = get_uint32(&buf[0x184]); //d - status->focus = get_uint32(&buf[0x188]); //d current focus ring position? - status->raw_format = get_uint32(&buf[0x84]); //d - status->image_format = get_uint32(&buf[0x78]); //d - status->light_meter_flags = get_uint32(&buf[0x138]); //d - status->ec.nom = get_uint32(&buf[0x3c]); //d - status->ec.denom = get_uint32(&buf[0x40]); //d + status->current_iso = get_uint32(&buf[0x130]); /*d*/ + status->current_shutter_speed.nom = get_uint32(&buf[0x108]); /*d*/ + status->current_shutter_speed.denom = get_uint32(&buf[0x10C]); /*d*/ + status->current_aperture.nom = get_uint32(&buf[0x110]); /*d*/ + status->current_aperture.denom = get_uint32(&buf[0x114]); /*d*/ + status->lens_min_aperture.nom = get_uint32(&buf[0x140]); /*d*/ + status->lens_min_aperture.denom = get_uint32(&buf[0x144]); /*d*/ + status->lens_max_aperture.nom = get_uint32(&buf[0x148]); /*d*/ + status->lens_max_aperture.denom = get_uint32(&buf[0x14B]); /*d*/ + status->current_zoom.nom = get_uint32(&buf[0x180]); /*d*/ + status->current_zoom.denom = get_uint32(&buf[0x184]); /*d*/ + status->set_aperture.nom = get_uint32(&buf[0x34]); /*d*/ + status->set_aperture.denom = get_uint32(&buf[0x38]); /*d*/ + status->set_shutter_speed.nom = get_uint32(&buf[0x2c]); /*d*/ + status->set_shutter_speed.denom = get_uint32(&buf[0x30]); /*d*/ + status->set_iso = get_uint32(&buf[0x60]); /*d*/ + status->jpeg_resolution = get_uint32(&buf[0x7c]); /*d*/ + status->jpeg_contrast = get_uint32(&buf[0x94]); /* commands do now work for it?*/ + status->jpeg_sharpness = get_uint32(&buf[0x90]); /* commands do now work for it?*/ + status->jpeg_saturation = get_uint32(&buf[0x8c]); /* commands do now work for it?*/ + status->jpeg_quality = get_uint32(&buf[0x80]); /*d*/ + status->jpeg_image_mode = get_uint32(&buf[0x88]); /*d*/ + status->zoom.nom = get_uint32(&buf[0x180]); /*d*/ + status->zoom.denom = get_uint32(&buf[0x184]); /*d*/ + status->focus = get_uint32(&buf[0x188]); /*d current focus ring position?*/ + status->raw_format = get_uint32(&buf[0x84]); /*d*/ + status->image_format = get_uint32(&buf[0x78]); /*d*/ + status->light_meter_flags = get_uint32(&buf[0x138]); /*d*/ + status->ec.nom = get_uint32(&buf[0x3c]); /*d*/ + status->ec.denom = get_uint32(&buf[0x40]); /*d*/ status->custom_ev_steps = get_uint32(&buf[0x9c]); status->custom_sensitivity_steps = get_uint32(&buf[0xa0]); - status->exposure_mode = get_uint32(&buf[0xe0]); //d - status->user_mode_flag = get_uint32(&buf[0x1c]); //d - status->af_point_select = get_uint32(&buf[0xbc]); // not sure - status->selected_af_point = get_uint32(&buf[0xc0]); //d - status->focused_af_point = get_uint32(&buf[0x160]); //d, unsure about it, a lot is changing when the camera focuses - // 0x158 current ev? - // 0xB8 0 - MF, 1 - AF.S, 2 - AF.C - // 0xB4, 0xC4 - metering mode, 0 - matrix, 1 - center weighted, 2 - spot - // 0x160 and 0x164 change when AF - // 0xC0 changes when selecting focus point manually or from GUI - // 0xBC focus point selection 0 - auto, 1 - manual, 2 - center + status->exposure_mode = get_uint32(&buf[0xe0]); /*d*/ + status->user_mode_flag = get_uint32(&buf[0x1c]); /*d*/ + status->af_point_select = get_uint32(&buf[0xbc]); /* not sure*/ + status->selected_af_point = get_uint32(&buf[0xc0]); /*d*/ + status->focused_af_point = get_uint32(&buf[0x160]); /*d, unsure about it, a lot is changing when the camera focuses*/ + /* 0x158 current ev? + / 0xB8 0 - MF, 1 - AF.S, 2 - AF.C + / 0xB4, 0xC4 - metering mode, 0 - matrix, 1 - center weighted, 2 - spot + / 0x160 and 0x164 change when AF + / 0xC0 changes when selecting focus point manually or from GUI + / 0xBC focus point selection 0 - auto, 1 - manual, 2 - center + */ return PSLR_OK; } @@ -1028,7 +1031,7 @@ static int ipslr_next_segment(ipslr_handle_t *p) int r; CHECK(ipslr_write_args(p, 1, 0)); CHECK(command(p, 0x04, 0x01, 0x04)); - usleep(100000); // needed !! 100 too short, 1000 not short enough for PEF + usleep(100000); /* needed !! 100 too short, 1000 not short enough for PEF */ r = get_status(p); if (r == 0) return PSLR_OK; @@ -1068,7 +1071,7 @@ static int ipslr_download(ipslr_handle_t *p, uint32_t addr, uint32_t length, uin else block = length; - //DPRINT("Get 0x%x bytes from 0x%x\n", block, addr); + /*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); @@ -1193,14 +1196,14 @@ static int get_status(ipslr_handle_t *p) { uint8_t statusbuf[8]; while (1) { - //usleep(POLL_INTERVAL); + /*usleep(POLL_INTERVAL); */ CHECK(read_status(p, statusbuf)); - //DPRINT("get_status->\n"); - //hexdump(statusbuf, 8); + /*DPRINT("get_status->\n"); */ + /*hexdump(statusbuf, 8); */ if ((statusbuf[7] & 0x01) == 0) break; - //DPRINT("Waiting for ready - "); - //hexdump(statusbuf, 8); + /*DPRINT("Waiting for ready - "); */ + /*hexdump(statusbuf, 8); */ usleep(POLL_INTERVAL); } if ((statusbuf[7] & 0xff) != 0) { @@ -1213,13 +1216,13 @@ static int get_result(ipslr_handle_t *p) { uint8_t statusbuf[8]; while (1) { - //DPRINT("read out status\n"); + /*DPRINT("read out status\n");*/ CHECK(read_status(p, statusbuf)); - //hexdump(statusbuf, 8); + /*hexdump(statusbuf, 8);*/ if (statusbuf[6] == 0x01) break; - //DPRINT("Waiting for result\n"); - //hexdump(statusbuf, 8); + /*DPRINT("Waiting for result\n");*/ + /*hexdump(statusbuf, 8);*/ usleep(POLL_INTERVAL); } if ((statusbuf[7] & 0xff) != 0) { diff --git a/camlibs/pentax/pslr.h b/camlibs/pentax/pslr.h index a5b29260a..800bf0e4a 100644 --- a/camlibs/pentax/pslr.h +++ b/camlibs/pentax/pslr.h @@ -71,7 +71,7 @@ typedef enum { } pslr_buffer_type; typedef enum { - PSLR_JPEG_QUALITY_4, // K20D only + PSLR_JPEG_QUALITY_4, /* K20D only */ PSLR_JPEG_QUALITY_3, PSLR_JPEG_QUALITY_2, PSLR_JPEG_QUALITY_1, @@ -79,7 +79,7 @@ typedef enum { } pslr_jpeg_quality_t; typedef enum { - PSLR_JPEG_RESOLUTION_14M, // K20D only + PSLR_JPEG_RESOLUTION_14M, /* K20D only */ PSLR_JPEG_RESOLUTION_10M, PSLR_JPEG_RESOLUTION_6M, PSLR_JPEG_RESOLUTION_2M, diff --git a/camlibs/ptp2/ptp-pack.c b/camlibs/ptp2/ptp-pack.c index 5bf90e095..dcad0ce2b 100644 --- a/camlibs/ptp2/ptp-pack.c +++ b/camlibs/ptp2/ptp-pack.c @@ -1377,7 +1377,7 @@ ptp_unpack_EOS_CustomFuncEx (PTPParams* params, unsigned char** data ) { uint32_t s = dtoh32a( *data ); uint32_t n = s/4, i; - char* str = (char*)malloc( s ); // n is size in uint32, average len(itoa(i)) < 4 -> alloc n chars + char* str = (char*)malloc( s ); /* n is size in uint32, average len(itoa(i)) < 4 -> alloc n chars */ if (!str) return str; char* p = str; @@ -1400,7 +1400,7 @@ ptp_pack_EOS_CustomFuncEx (PTPParams* params, unsigned char* data, char* str) for (i=0; i