[haiku-commits] haiku: hrev45398 - src/system/boot/loader/file_systems/bfs

  • From: alex@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 22 Mar 2013 20:42:47 +0100 (CET)

hrev45398 adds 1 changeset to branch 'master'
old head: 5e0c3db2867defa76df0e83fd74a9a39e0dd622b
new head: e6a0c797902de446e4f2366e55f19609a4bc712e
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=e6a0c79+%5E5e0c3db

----------------------------------------------------------------------------

e6a0c79: CID 608055: Fixed unintended sign extension.

                                      [ Alex Smith <alex@xxxxxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev45398
Commit:      e6a0c797902de446e4f2366e55f19609a4bc712e
URL:         http://cgit.haiku-os.org/haiku/commit/?id=e6a0c79
Author:      Alex Smith <alex@xxxxxxxxxxxxxxxx>
Date:        Fri Mar 22 19:41:57 2013 UTC

----------------------------------------------------------------------------

1 file changed, 4 insertions(+), 4 deletions(-)
src/system/boot/loader/file_systems/bfs/Stream.cpp | 8 ++++----

----------------------------------------------------------------------------

diff --git a/src/system/boot/loader/file_systems/bfs/Stream.cpp 
b/src/system/boot/loader/file_systems/bfs/Stream.cpp
index a819c10..9eb25b7 100644
--- a/src/system/boot/loader/file_systems/bfs/Stream.cpp
+++ b/src/system/boot/loader/file_systems/bfs/Stream.cpp
@@ -255,11 +255,11 @@ Stream::FindBlockRun(off_t pos, block_run& run, off_t& 
offset)
                                                break;
 
                                        runBlockEnd
-                                               += indirect[current].Length() 
<< cached.BlockShift();
+                                               += 
(uint32)indirect[current].Length() << cached.BlockShift();
                                        if (runBlockEnd > pos) {
                                                run = indirect[current];
                                                offset = runBlockEnd
-                                                       - (run.Length() << 
cached.BlockShift());
+                                                       - ((uint32)run.Length() 
<< cached.BlockShift());
                                                //printf("reading from indirect 
block: %ld,%d\n",fRun.allocation_group,fRun.start);
                                                //printf("### indirect-run[%ld] 
= (%ld,%d,%d), offset = 
%Ld\n",fCurrent,fRun.allocation_group,fRun.start,fRun.length,fRunFileOffset);
                                                return 
fVolume.ValidateBlockRun(run);
@@ -278,10 +278,10 @@ Stream::FindBlockRun(off_t pos, block_run& run, off_t& 
offset)
                        if (data.direct[current].IsZero())
                                break;
 
-                       runBlockEnd += data.direct[current].Length() << 
fVolume.BlockShift();
+                       runBlockEnd += (uint32)data.direct[current].Length() << 
fVolume.BlockShift();
                        if (runBlockEnd > pos) {
                                run = data.direct[current];
-                               offset = runBlockEnd - (run.Length() << 
fVolume.BlockShift());
+                               offset = runBlockEnd - ((uint32)run.Length() << 
fVolume.BlockShift());
                                //printf("### run[%ld] = (%ld,%d,%d), offset = 
%Ld\n",fCurrent,fRun.allocation_group,fRun.start,fRun.length,fRunFileOffset);
                                return fVolume.ValidateBlockRun(run);
                        }


Other related posts:

  • » [haiku-commits] haiku: hrev45398 - src/system/boot/loader/file_systems/bfs - alex