Harmless casts of file positions.

Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/6a7ce0a3
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/6a7ce0a3
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/6a7ce0a3

Branch: refs/heads/master
Commit: 6a7ce0a3d1b321c30c088f1b8d6c748675b21909
Parents: 72fd9af
Author: Marvin Humphrey <[email protected]>
Authored: Thu May 26 19:38:27 2016 -0700
Committer: Marvin Humphrey <[email protected]>
Committed: Thu May 26 19:38:27 2016 -0700

----------------------------------------------------------------------
 core/Lucy/Store/InStream.c      | 2 +-
 core/Lucy/Store/RAMFileHandle.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/6a7ce0a3/core/Lucy/Store/InStream.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/InStream.c b/core/Lucy/Store/InStream.c
index 1317aa9..f35ace9 100644
--- a/core/Lucy/Store/InStream.c
+++ b/core/Lucy/Store/InStream.c
@@ -307,7 +307,7 @@ InStream_Buf_IMP(InStream *self, size_t request) {
      * skip the following refill block. */
     if ((int64_t)request > bytes_in_buf) {
         const int64_t remaining_in_file = ivars->len - SI_tell(self);
-        int64_t amount = request;
+        int64_t amount = (int64_t)request;
 
         // Try to bump up small requests.
         if (amount < IO_STREAM_BUF_SIZE) { amount = IO_STREAM_BUF_SIZE; }

http://git-wip-us.apache.org/repos/asf/lucy/blob/6a7ce0a3/core/Lucy/Store/RAMFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/RAMFileHandle.c b/core/Lucy/Store/RAMFileHandle.c
index 4545d8d..c87c606 100644
--- a/core/Lucy/Store/RAMFileHandle.c
+++ b/core/Lucy/Store/RAMFileHandle.c
@@ -113,7 +113,7 @@ RAMFH_Release_Window_IMP(RAMFileHandle *self, FileWindow 
*window) {
 bool
 RAMFH_Read_IMP(RAMFileHandle *self, char *dest, int64_t offset, size_t len) {
     RAMFileHandleIVARS *const ivars = RAMFH_IVARS(self);
-    int64_t end = offset + len;
+    int64_t end = offset + (int64_t)len;
     if (!(ivars->flags & FH_READ_ONLY)) {
         Err_set_error(Err_new(Str_newf("Can't read from write-only handle")));
         return false;

Reply via email to