summaryrefslogtreecommitdiff
path: root/camlibs/aox
diff options
context:
space:
mode:
authorTheodore Kilgore <kilgota@auburn.edu>2007-06-24 22:29:54 +0000
committerTheodore Kilgore <kilgota@auburn.edu>2007-06-24 22:29:54 +0000
commitec5e6c0c5221c4d9643cc73e03e18d0d9f017635 (patch)
tree35550326c07b296b8d0c192526c6218e5042c4de /camlibs/aox
parentc7e75d95fd4786e7ea652418df035d80ab50ea85 (diff)
downloadlibgphoto2-ec5e6c0c5221c4d9643cc73e03e18d0d9f017635.tar.gz
fixed signedness compile warnings in camlibs/aox and camlibs/sq905
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10402 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/aox')
-rw-r--r--camlibs/aox/ChangeLog4
-rw-r--r--camlibs/aox/README.aox2
-rw-r--r--camlibs/aox/aox.c12
-rw-r--r--camlibs/aox/library.c14
4 files changed, 20 insertions, 12 deletions
diff --git a/camlibs/aox/ChangeLog b/camlibs/aox/ChangeLog
index 7419a7ade..1cfc3159c 100644
--- a/camlibs/aox/ChangeLog
+++ b/camlibs/aox/ChangeLog
@@ -1,3 +1,7 @@
+2007-06-24 Theodore Kilgore <kilgota@auburn.edu>
+ * library.c: compile warnings about signed variables fixed.
+ * aox.c: ditto
+
2007-06-17 Theodore Kilgore <kilgota@auburn.edu>
* library.c: D-MAX DM3588 camera added, found by
Amauri Magagna <amaurimagagna@gmail.com>.
diff --git a/camlibs/aox/README.aox b/camlibs/aox/README.aox
index becae4cef..8d68eab97 100644
--- a/camlibs/aox/README.aox
+++ b/camlibs/aox/README.aox
@@ -119,4 +119,4 @@ June 17, 2006:
New camera D-MAX DM3588 - 0x03e8:0x2130 found by Amauri Magagna
<amaurimagagna@gmail.com>. The new camera seems to differ only in minor
-details from the previously known cameras, but requires a separate model entry. \ No newline at end of file
+details from the previously known cameras, but requires a separate model entry.
diff --git a/camlibs/aox/aox.c b/camlibs/aox/aox.c
index 62fb80daa..6c8cbbf5e 100644
--- a/camlibs/aox/aox.c
+++ b/camlibs/aox/aox.c
@@ -38,7 +38,7 @@
int aox_init (GPPort *port, Model *model, Info *info)
{
- unsigned char c[4];
+ char c[4];
unsigned char hi[2];
unsigned char lo[2];
memset(c,0,sizeof(c));
@@ -51,7 +51,7 @@ int aox_init (GPPort *port, Model *model, Info *info)
WRITE(port, 8, 1, 0, c, 0x10);
READ(port, 0xff, 0x07, 0xfffc, c, 4); /* Returns version number, apparently */
READ(port, 0x06, 0x0, 0x0, c, 2);
- READ(port, 0x04, 0x1, 0x1, lo, 2);
+ READ(port, 0x04, 0x1, 0x1, (char *)lo, 2);
GP_DEBUG("%02x %02x number of lo-res pics\n", lo[0],lo[1]);
/* We need to keep this information. We presume that
* more than 255 pictures is impossible with this camera.
@@ -60,7 +60,7 @@ int aox_init (GPPort *port, Model *model, Info *info)
READ(port, 0x04, 0x2, 0x1, c, 2);
READ(port, 0x04, 0x3, 0x1, c, 2);
READ(port, 0x04, 0x4, 0x1, c, 2);
- READ(port, 0x04, 0x5, 0x1, hi, 2);
+ READ(port, 0x04, 0x5, 0x1, (char *)hi, 2);
GP_DEBUG("%02i %02i number of hi-res pics\n", hi[0], hi[1]);
/* This information, too. */
memcpy (info +1, &hi[0], 1);
@@ -95,12 +95,12 @@ int aox_get_picture_size (GPPort *port, int lo, int hi, int n, int k)
GP_DEBUG("Running aox_get_picture_size for aox_pic%03i\n", k+1);
if ( ( (lo) && ( n ==k ) && (k ==0)) ) {
- READ(port, 0x04, 0x1, 0x1, c, 2);
+ READ(port, 0x04, 0x1, 0x1, (char *)c, 2);
}
if ( ( (hi) && ( n < k ) && (n == 0)) ) {
- READ(port, 0x04, 0x5, 0x1, c, 2);
+ READ(port, 0x04, 0x5, 0x1, (char *)c, 2);
}
- READ(port, 0x05, n+1, 0x1, c, 4);
+ READ(port, 0x05, n+1, 0x1, (char *)c, 4);
size = (int)c[0] + (int)c[1]*0x100 + (int)c[2]*0x10000;
GP_DEBUG(" size of picture %i is 0x%x\n", k, size);
if ( (size >= 0xfffff ) ) {return GP_ERROR;}
diff --git a/camlibs/aox/library.c b/camlibs/aox/library.c
index 51d844b88..39b90a4e9 100644
--- a/camlibs/aox/library.c
+++ b/camlibs/aox/library.c
@@ -200,7 +200,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename,
data = malloc(len);
if (!data) {
printf("Malloc failed\n"); return 0;}
- aox_read_picture_data (camera->port, data, len, n);
+ aox_read_picture_data (camera->port, (char *)data, len, n);
switch (type) {
case GP_FILE_TYPE_EXIF:
@@ -210,7 +210,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename,
case GP_FILE_TYPE_NORMAL:
if ((w == 320)) {
gp_file_detect_mime_type (file); /* Detected as "raw"*/
- gp_file_set_data_and_size (file, data, len);
+ gp_file_set_data_and_size (file, (char *)data, len);
gp_file_adjust_name_for_mime_type (file);
}
if ((w == 640)){
@@ -256,12 +256,12 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename,
gp_gamma_correct_single (gtable, output, w * h);
gp_file_set_mime_type (file, GP_MIME_PPM);
gp_file_append (file, header, header_len);
- gp_file_append (file, output, 3*w*h);
+ gp_file_append (file, (char *)output, 3*w*h);
}
free (output);
return GP_OK;
case GP_FILE_TYPE_RAW:
- gp_file_set_data_and_size (file, data, len);
+ gp_file_set_data_and_size (file, (char *)data, len);
gp_file_set_mime_type (file, GP_MIME_RAW);
gp_file_adjust_name_for_mime_type(file);
break;
@@ -304,11 +304,15 @@ camera_init(Camera *camera, GPContext *context)
camera->functions->summary = camera_summary;
camera->functions->about = camera_about;
camera->functions->exit = camera_exit;
-
+
GP_DEBUG ("Initializing the camera\n");
ret = gp_port_get_settings(camera->port,&settings);
if (ret < 0) return ret;
+ ret = gp_camera_get_abilities(camera,&abilities);
+ if (ret < 0) return ret;
+ GP_DEBUG("product number is 0x%x\n", abilities.usb_product);
+
switch (camera->port->type) {
case GP_PORT_SERIAL:
return ( GP_ERROR );