From 008c9ef797f89fcfea2405fc4b99d76c22430425 Mon Sep 17 00:00:00 2001 From: Roland Illig Date: Tue, 19 Apr 2005 18:36:23 +0000 Subject: [PATCH] * view.c (view_file_load_data): Removed the requirement for ds_file_datasize to be a power of two. --- src/ChangeLog | 5 +++++ src/view.c | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9b83c2f89..0d5411606 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-04-19 Roland Illig + + * view.c (view_file_load_data): Removed the requirement for + ds_file_datasize to be a power of two. + 2005-04-18 Roland Illig * view.c (struct WView): Moved the growing buffer variables diff --git a/src/view.c b/src/view.c index b099d9c0d..8f562d01d 100644 --- a/src/view.c +++ b/src/view.c @@ -2896,10 +2896,7 @@ view_file_load_data (WView *view, offset_type byte_index) if (already_loaded (view->ds_file_offset, byte_index, view->ds_file_datalen)) return; - /* ds_file_datasize must be a power of two. */ - assert ((view->ds_file_datasize & (view->ds_file_datasize - 1)) == 0); - blockoffset = byte_index &- (view->ds_file_datasize); - + blockoffset = byte_index - byte_index % view->ds_file_datasize; if (mc_lseek (view->ds_file_fd, blockoffset, SEEK_SET) == -1) goto error;