summaryrefslogtreecommitdiff
path: root/camlibs
diff options
context:
space:
mode:
authorVince Weaver <vince@deater.net>2002-08-22 14:47:41 +0000
committerVince Weaver <vince@deater.net>2002-08-22 14:47:41 +0000
commit0992b65fec3ae89020729d8a7173098e63621c1f (patch)
treead640a85f1470fb0bb9ff043b65e6dc8b33bc9d7 /camlibs
parent29cd81a9053fc15b2b5160456171fa9852d52883 (diff)
downloadlibgphoto2-0992b65fec3ae89020729d8a7173098e63621c1f.tar.gz
Fix unsigned breakage in soundvision driver
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@5107 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs')
-rw-r--r--camlibs/soundvision/agfa_cl18.c6
-rw-r--r--camlibs/soundvision/commands.c43
-rw-r--r--camlibs/soundvision/commands.h6
-rw-r--r--camlibs/soundvision/soundvision.c2
-rw-r--r--camlibs/soundvision/tiger_fastflicks.c4
5 files changed, 31 insertions, 30 deletions
diff --git a/camlibs/soundvision/agfa_cl18.c b/camlibs/soundvision/agfa_cl18.c
index 38fa5db43..6ddb35fd8 100644
--- a/camlibs/soundvision/agfa_cl18.c
+++ b/camlibs/soundvision/agfa_cl18.c
@@ -47,7 +47,7 @@ int agfa_capture(CameraPrivateLibrary *dev, CameraFilePath *path) {
/*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);
- return (GP_OK);
+ return GP_OK;
}
/* Seems to work OK though sometimes camera is left in */
@@ -56,7 +56,7 @@ int agfa_capture(CameraPrivateLibrary *dev, CameraFilePath *path) {
/* to implement this */
int agfa_delete_picture(CameraPrivateLibrary *dev, const char *filename) {
- uint32_t ret,temp,taken;
+ int32_t ret,temp,taken;
uint8_t data[4],*buffer;
uint32_t size=4,buflen;
@@ -152,6 +152,6 @@ int agfa_delete_picture(CameraPrivateLibrary *dev, const char *filename) {
ret = soundvision_read(dev, data, size);
if (ret<0) return ret;
- return 0;
+ return GP_OK;
}
diff --git a/camlibs/soundvision/commands.c b/camlibs/soundvision/commands.c
index 2149067aa..773b30529 100644
--- a/camlibs/soundvision/commands.c
+++ b/camlibs/soundvision/commands.c
@@ -20,11 +20,12 @@
#include <gphoto2-endian.h>
#include "soundvision.h"
+#include "commands.h"
#define GP_MODULE "soundvision"
/* Regular commands always 8 bytes long */
-uint32_t soundvision_send_command(uint32_t command, uint32_t argument,
+int32_t soundvision_send_command(uint32_t command, uint32_t argument,
CameraPrivateLibrary *dev) {
uint8_t cmd[12];
@@ -40,7 +41,7 @@ uint32_t soundvision_send_command(uint32_t command, uint32_t argument,
}
/* Filenames are always 12 bytes long */
-uint32_t soundvision_send_file_command(const char *filename,
+int32_t soundvision_send_file_command(const char *filename,
CameraPrivateLibrary *dev) {
uint8_t file_cmd[16];
@@ -55,7 +56,7 @@ uint32_t soundvision_send_file_command(const char *filename,
}
/* USB-only */
-uint32_t soundvision_read(CameraPrivateLibrary *dev, void *buffer, int len) {
+int32_t soundvision_read(CameraPrivateLibrary *dev, void *buffer, int len) {
return gp_port_read(dev->gpdev, buffer, len);
}
@@ -67,14 +68,14 @@ int soundvision_reset(CameraPrivateLibrary *dev) {
ret=soundvision_send_command(SOUNDVISION_RESET,0,dev);
if (ret<0) return ret;
- return (GP_OK);
+ return GP_OK;
}
int soundvision_get_revision(CameraPrivateLibrary *dev, char *revision) {
int ret;
char version[8];
- uint32_t temp;
+ /* uint32_t temp; */
ret = soundvision_send_command(SOUNDVISION_DONE_TRANSACTION,0,dev);
@@ -89,13 +90,10 @@ int soundvision_get_revision(CameraPrivateLibrary *dev, char *revision) {
ret=soundvision_reset(dev);
if (ret<0) return ret;
-// ret = soundvision_read(dev, &temp, sizeof(temp));
-// if (ret<0) return ret;
-
+/* ret = soundvision_read(dev, &temp, sizeof(temp));
+ if (ret<0) return ret; */
-
-
- return 0;
+ return GP_OK;
}
@@ -104,7 +102,7 @@ int soundvision_get_status(CameraPrivateLibrary *dev, int *taken,
int *available, int *rawcount) {
uint8_t ss[0x60];
- uint32_t ret;
+ int32_t ret;
ret=soundvision_send_command(SOUNDVISION_STATUS, 0, dev);
@@ -122,12 +120,13 @@ int soundvision_get_status(CameraPrivateLibrary *dev, int *taken,
soundvision_reset(dev);
- return (GP_OK);
+ return GP_OK;
}
int soundvision_photos_taken(CameraPrivateLibrary *dev) {
- uint32_t ret,numpics;
+ int32_t ret;
+ uint32_t numpics;
ret=soundvision_send_command(SOUNDVISION_GET_NUM_PICS, 0, dev);
@@ -149,7 +148,7 @@ int soundvision_photos_taken(CameraPrivateLibrary *dev) {
int soundvision_get_file_list(CameraPrivateLibrary *dev) {
char *buffer;
- uint32_t ret, taken, buflen;
+ int32_t ret, taken, buflen;
/* It seems we need to do a "reset" packet before reading names?? */
@@ -207,7 +206,8 @@ int soundvision_get_file_list(CameraPrivateLibrary *dev) {
int soundvision_get_thumb_size(CameraPrivateLibrary *dev, const char *filename) {
- uint32_t ret,temp,size;
+ int32_t ret,temp;
+ uint32_t size;
ret=soundvision_send_command(SOUNDVISION_GET_THUMB_SIZE,0,dev);
if (ret<0) return ret;
@@ -229,7 +229,7 @@ int soundvision_get_thumb_size(CameraPrivateLibrary *dev, const char *filename)
int soundvision_get_thumb(CameraPrivateLibrary *dev, const char *filename,
unsigned char *data,int size) {
- uint32_t ret,temp;
+ int32_t ret,temp;
ret = soundvision_send_command(SOUNDVISION_GET_THUMB,0,dev);
if (ret<0) return ret;
@@ -260,7 +260,8 @@ int soundvision_get_thumb(CameraPrivateLibrary *dev, const char *filename,
int soundvision_get_pic_size(CameraPrivateLibrary *dev, const char *filename) {
- uint32_t ret,temp,size;
+ int32_t ret,temp;
+ uint32_t size;
ret=soundvision_send_command(SOUNDVISION_GET_PIC_SIZE,0,dev);
if (ret<0) return ret;
@@ -282,7 +283,7 @@ int soundvision_get_pic_size(CameraPrivateLibrary *dev, const char *filename) {
int soundvision_get_pic(CameraPrivateLibrary *dev, const char *filename,
unsigned char *data,int size) {
- uint32_t ret,temp;
+ int32_t ret,temp;
ret = soundvision_send_command(SOUNDVISION_GET_PIC,0,dev);
if (ret<0) return ret;
@@ -311,7 +312,7 @@ int soundvision_get_pic(CameraPrivateLibrary *dev, const char *filename,
/* to implement this */
int soundvision_delete_picture(CameraPrivateLibrary *dev, const char *filename) {
- uint32_t ret,temp,taken;
+ int32_t ret,temp,taken;
uint8_t data[4],*buffer;
uint32_t size=4,buflen;
@@ -407,6 +408,6 @@ int soundvision_delete_picture(CameraPrivateLibrary *dev, const char *filename)
ret = soundvision_read(dev, data, size);
if (ret<0) return ret;
- return 0;
+ return GP_OK;
}
diff --git a/camlibs/soundvision/commands.h b/camlibs/soundvision/commands.h
index 0656f927d..f8eb60d40 100644
--- a/camlibs/soundvision/commands.h
+++ b/camlibs/soundvision/commands.h
@@ -2,12 +2,12 @@
#define commands_H
-uint32_t soundvision_send_command(uint32_t command, uint32_t argument,
+int32_t soundvision_send_command(uint32_t command, uint32_t argument,
CameraPrivateLibrary *dev);
-uint32_t soundvision_send_file_command(const char *filename,
+int32_t soundvision_send_file_command(const char *filename,
CameraPrivateLibrary *dev);
-uint32_t soundvision_read(CameraPrivateLibrary *dev, void *buffer, int len);
+int32_t soundvision_read(CameraPrivateLibrary *dev, void *buffer, int len);
#endif
diff --git a/camlibs/soundvision/soundvision.c b/camlibs/soundvision/soundvision.c
index b3cf5e423..93378c6ee 100644
--- a/camlibs/soundvision/soundvision.c
+++ b/camlibs/soundvision/soundvision.c
@@ -242,7 +242,7 @@ static int camera_capture (Camera *camera, CameraCaptureType type,
*/
if (camera->pl->device_type==SOUNDVISION_AGFACL18)
return (agfa_capture(camera->pl,path));
- return 0;
+ return GP_ERROR_NOT_SUPPORTED;
}
diff --git a/camlibs/soundvision/tiger_fastflicks.c b/camlibs/soundvision/tiger_fastflicks.c
index 38a6c2e19..b00f65e78 100644
--- a/camlibs/soundvision/tiger_fastflicks.c
+++ b/camlibs/soundvision/tiger_fastflicks.c
@@ -50,7 +50,7 @@ int tiger_upload_file(CameraPrivateLibrary *dev, const char *filename) {
/* as it is impossible to test w/o the camera */
int tiger_delete_picture(CameraPrivateLibrary *dev, const char *filename) {
- uint32_t ret,temp,taken,ascii_status[2];
+ int32_t ret,temp,taken,ascii_status[2];
ret = soundvision_send_command(SOUNDVISION_START_TRANSACTION,0,dev);
if (ret<0) return ret;
@@ -72,7 +72,7 @@ int tiger_delete_picture(CameraPrivateLibrary *dev, const char *filename) {
taken=soundvision_photos_taken(dev);
- return 0;
+ return GP_OK;
}