mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
* view.c (view_file_load_data): Removed the requirement for
ds_file_datasize to be a power of two.
This commit is contained in:
parent
0972491418
commit
008c9ef797
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user