summaryrefslogtreecommitdiff
path: root/camlibs/gsmart300
diff options
context:
space:
mode:
authorSiim Meerits <sh0@yutani.ee>2020-08-03 01:38:42 +0300
committerMarcus Meissner <marcus@jet.franken.de>2020-08-31 12:18:49 +0200
commit6ca7a554709a2449e4bfb55350ac11e56affb0e2 (patch)
tree0f54b0a95d8d0dbe4b2358b424f00a7f1bcbafd0 /camlibs/gsmart300
parent84d0a210d8738937ebcfdb18de2b2ddba57ddd7f (diff)
downloadlibgphoto2-6ca7a554709a2449e4bfb55350ac11e56affb0e2.tar.gz
Fix gsmart300 camlib compilation warnings.
gsmart300.c: * gsmart300_reset(...): sleep(...) function takes integer argument so avoid implicit casting by changing number to integer. * gsmart300_download_data(...): Signed-unsigned comparison issue. Variable 'i' is already treated as unsigned in compares and cannot be negative as the buffer offset would cause segfault. * gsmart300_get_FATs(...): Signed-unsigned comparison issue. The 'index' variable is used in a very simple way and already used as an unsigned integer in compares.
Diffstat (limited to 'camlibs/gsmart300')
-rw-r--r--camlibs/gsmart300/gsmart300.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/camlibs/gsmart300/gsmart300.c b/camlibs/gsmart300/gsmart300.c
index 990f9d925..2e9ae69d4 100644
--- a/camlibs/gsmart300/gsmart300.c
+++ b/camlibs/gsmart300/gsmart300.c
@@ -336,7 +336,7 @@ gsmart300_reset (CameraPrivateLibrary * lib)
GP_DEBUG ("* gsmart300_reset");
CHECK (gp_port_usb_msg_write (lib->gpdev, 0x02, 0x0000, 0x0003,
NULL, 0));
- sleep (1.5);
+ sleep (1);
return GP_OK;
}
@@ -348,7 +348,7 @@ static int gsmart300_download_data (CameraPrivateLibrary * lib, int data_type,
uint16_t index, unsigned int size, uint8_t * buf)
{
uint16_t fat_index = 0x1fff - index;
- int i;
+ unsigned int i;
if (data_type == __GS300_FAT)
CHECK (gp_port_usb_msg_write (lib->gpdev, 0x03,
@@ -376,7 +376,7 @@ static int
gsmart300_get_FATs (CameraPrivateLibrary * lib)
{
uint8_t type;
- unsigned int index = 0;
+ int index = 0;
unsigned int file_index = 0;
uint8_t *p = NULL;
char buf[14];