[libbluray-devel] Cleanup some conversion and compare warnings.

Andreas Zelend git at videolan.org
Sat Jan 16 12:02:42 CET 2016


libudfread | branch: master | Andreas Zelend <ace20022 at ymail.com> | Wed Jan 13 09:26:06 2016 +0200| [50d41b171c90d299ee3f685bbe6298d15a44eec0] | committer: Petri Hintukainen

Cleanup some conversion and compare warnings.

> http://git.videolan.org/gitweb.cgi/libudfread.git/?a=commit;h=50d41b171c90d299ee3f685bbe6298d15a44eec0
---

 src/default_blockinput.c |    2 +-
 src/udfread.c            |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/default_blockinput.c b/src/default_blockinput.c
index 652318b..34ebdd1 100644
--- a/src/default_blockinput.c
+++ b/src/default_blockinput.c
@@ -63,7 +63,7 @@ static ssize_t pread(int fd, void *buf, size_t count, off_t offset)
     }
 
     memset(&ov, 0, sizeof(ov));
-    ov.Offset     = offset;
+    ov.Offset     = (DWORD)offset;
     ov.OffsetHigh = (offset >> 32);
     if (!ReadFile(handle, buf, count, &got, &ov)) {
         return -1;
diff --git a/src/udfread.c b/src/udfread.c
index ba910aa..7b27410 100644
--- a/src/udfread.c
+++ b/src/udfread.c
@@ -1405,20 +1405,20 @@ uint32_t udfread_read_blocks(UDFFILE *p, void *buf, uint32_t file_block, uint32_
 static ssize_t _read(UDFFILE *p, void *buf, size_t bytes)
 {
     /* start from middle of block ? */
-    int64_t pos_off = p->pos % UDF_BLOCK_SIZE;
+    size_t pos_off = p->pos % UDF_BLOCK_SIZE;
     if (pos_off) {
-        int64_t chunk_size = UDF_BLOCK_SIZE - pos_off;
+        size_t chunk_size = UDF_BLOCK_SIZE - pos_off;
         if (!p->block_valid) {
             if (udfread_read_blocks(p, p->block, p->pos / UDF_BLOCK_SIZE, 1, 0) != 1) {
                 return -1;
             }
             p->block_valid = 1;
         }
-        if (chunk_size > (int64_t)bytes) {
+        if (chunk_size > bytes) {
             chunk_size = bytes;
         }
         memcpy(buf, p->block + pos_off, chunk_size);
-        p->pos += chunk_size;
+        p->pos += (int64_t)chunk_size;
         return chunk_size;
     }
 
@@ -1478,7 +1478,7 @@ ssize_t udfread_file_read(UDFFILE *p, void *buf, size_t bytes)
 
     /* read chunks */
     while (bytes > 0) {
-        int64_t r = _read(p, bufpt, bytes);
+        ssize_t r = _read(p, bufpt, bytes);
         if (r < 0) {
             if (bufpt != buf) {
                 /* got some bytes */



More information about the libbluray-devel mailing list