summaryrefslogtreecommitdiff
path: root/camlibs/stv0680/library.c
diff options
context:
space:
mode:
authorLutz Mueller <lutz@users.sourceforge.net>2000-12-28 10:43:59 +0000
committerLutz Mueller <lutz@users.sourceforge.net>2000-12-28 10:43:59 +0000
commit41f620d8ce64ca792b8984cd33c2ba254f780a25 (patch)
tree4c949c6d39437903f4a8b4991393e753f02bdfa0 /camlibs/stv0680/library.c
parentcbc3b7a0d25383d92351cf6a16da0397f5318629 (diff)
downloadlibgphoto2-41f620d8ce64ca792b8984cd33c2ba254f780a25.tar.gz
Fix some compilation warnings by "#include <stdlib.h>".
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@1439 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/stv0680/library.c')
-rw-r--r--camlibs/stv0680/library.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/camlibs/stv0680/library.c b/camlibs/stv0680/library.c
index 18c848498..6a9916b6b 100644
--- a/camlibs/stv0680/library.c
+++ b/camlibs/stv0680/library.c
@@ -17,6 +17,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <stdlib.h>
+#include <stdio.h>
#include <gphoto2.h>
#include <gpio.h>
@@ -151,10 +153,13 @@ printf("STV: pinging camera\n");
switch(ret) {
case CMD_IO_ERROR:
printf("ping failed\n");
- return GP_ERROR;
+ return GP_ERROR_IO;
case CMD_OK:
printf("ping ok\n");
return GP_OK;
+ default:
+ //Should not be reached.
+ return GP_ERROR;
}
}
@@ -169,12 +174,15 @@ printf("STV: getting file count\n");
switch(ret) {
case CMD_IO_ERROR:
- printf("IO error!\n", response[1]);
- return GP_ERROR;
+ printf("IO error!\n");
+ return GP_ERROR_IO;
case CMD_OK:
printf("GFI OK, count = %d\n", response[1]);
*count = response[1];
return GP_OK;
+ default:
+ //Should not be reached.
+ return GP_ERROR;
}
}
@@ -183,14 +191,14 @@ int stv0680_get_image(struct stv0680_s *device, int image_no,
{
unsigned char response[CMD_GET_IMAGE_RLEN], header[64];
unsigned char *raw;
- int h,w,i;
+ int h,w;
int ret;
ret = stv0680_try_cmd(device, CMD_GET_IMAGE, 0x00, image_no, 0x00,
response, sizeof(response), CMD_RETRIES);
if(ret == CMD_IO_ERROR)
- return GP_ERROR;
+ return GP_ERROR_IO;
w = response[4] << 8 | response[5];
h = response[6] << 8 | response[7];
@@ -234,14 +242,14 @@ int stv0680_get_image_preview(struct stv0680_s *device, int image_no,
{
unsigned char response[CMD_GET_IMAGE_RLEN], header[64];
unsigned char *raw;
- int h,w,i;
+ int h,w;
int ret;
ret = stv0680_try_cmd(device, CMD_GET_PREVIEW, 0x00, image_no, 0x00,
response, sizeof(response), CMD_RETRIES);
if(ret == CMD_IO_ERROR)
- return GP_ERROR;
+ return GP_ERROR_IO;
w = response[4] << 8 | response[5];
h = response[6] << 8 | response[7];