* view.c (view_file_load_data): Removed the requirement for

ds_file_datasize to be a power of two.
This commit is contained in:
Roland Illig 2005-04-19 18:36:23 +00:00
parent 0972491418
commit 008c9ef797
2 changed files with 6 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2005-04-19 Roland Illig <roland.illig@gmx.de>
* view.c (view_file_load_data): Removed the requirement for
ds_file_datasize to be a power of two.
2005-04-18 Roland Illig <roland.illig@gmx.de>
* view.c (struct WView): Moved the growing buffer variables

View File

@ -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;