summaryrefslogtreecommitdiff
path: root/libgphoto2
diff options
context:
space:
mode:
authorSiim Meerits <sh0@yutani.ee>2020-08-02 22:25:27 +0300
committerMarcus Meissner <marcus@jet.franken.de>2020-08-03 08:48:43 +0200
commit2c0e3171c2de230503b8a86cf2c3c33f8635a960 (patch)
tree9cb758a0c5c348d59283ff0a131bb4700c795391 /libgphoto2
parent2cbfd58eb6bf6271211d8ae31fdc57bc76410bc5 (diff)
downloadlibgphoto2-2c0e3171c2de230503b8a86cf2c3c33f8635a960.tar.gz
Fix libgphoto2 compilation warnings.
Resolves number of signed-unsigned comparison issues.
Diffstat (limited to 'libgphoto2')
-rw-r--r--libgphoto2/gphoto2-file.c10
-rw-r--r--libgphoto2/gphoto2-filesys.c4
2 files changed, 7 insertions, 7 deletions
diff --git a/libgphoto2/gphoto2-file.c b/libgphoto2/gphoto2-file.c
index cdd671f3d..b51957497 100644
--- a/libgphoto2/gphoto2-file.c
+++ b/libgphoto2/gphoto2-file.c
@@ -409,7 +409,7 @@ gp_file_get_data_and_size (CameraFile *file, const char **data,
break;
case GP_FILE_ACCESSTYPE_FD: {
off_t offset;
- unsigned long int curread = 0;
+ off_t curread = 0;
if (-1 == lseek (file->fd, 0, SEEK_END)) {
if (errno == EBADF) return GP_ERROR_IO;
@@ -504,7 +504,7 @@ gp_file_save (CameraFile *file, const char *filename)
break;
case GP_FILE_ACCESSTYPE_FD: {
char *data;
- unsigned long int curread = 0;
+ off_t curread = 0;
off_t offset;
if (-1 == lseek (file->fd, 0, SEEK_END))
@@ -537,7 +537,7 @@ gp_file_save (CameraFile *file, const char *filename)
unlink (filename);
return GP_ERROR_IO_READ;
}
- if (fwrite (data, 1, res, fp) != res) {
+ if ((int)fwrite (data, 1, res, fp) != res) {
GP_LOG_E ("Not enough space on device in order to save '%s'.", filename);
free (data);
fclose (fp);
@@ -750,7 +750,7 @@ gp_file_copy (CameraFile *destination, CameraFile *source)
(source->accesstype == GP_FILE_ACCESSTYPE_FD)
) {
off_t offset;
- unsigned long int curread = 0;
+ off_t curread = 0;
free (destination->data);
destination->data = NULL;
@@ -799,7 +799,7 @@ gp_file_copy (CameraFile *destination, CameraFile *source)
lseek (source->fd, 0, SEEK_SET);
C_MEM (data = malloc (65536));
while (1) {
- unsigned long curwritten = 0;
+ ssize_t curwritten = 0;
ssize_t res;
res = read (source->fd, data, 65536);
diff --git a/libgphoto2/gphoto2-filesys.c b/libgphoto2/gphoto2-filesys.c
index 7f4314093..a5abb7e1f 100644
--- a/libgphoto2/gphoto2-filesys.c
+++ b/libgphoto2/gphoto2-filesys.c
@@ -411,7 +411,7 @@ lookup_folder (
while (f) {
if (s) {
if (!strncmp(f->name,curpt, (s-curpt)) &&
- (strlen(f->name) == (s-curpt))
+ ((ssize_t)strlen(f->name) == (s-curpt))
) {
folder = f;
curpt = s;
@@ -553,7 +553,7 @@ append_to_folder (CameraFilesystemFolder *folder,
while (f) {
if (s) {
if (!strncmp(f->name,foldername, (s-foldername)) &&
- (strlen(f->name) == (s-foldername))
+ ((ssize_t)strlen(f->name) == (s-foldername))
)
return append_to_folder (f, s+1, newfolder);
} else {