* mmap.cc (class mmap_record): Fix return type of get_offset.

(mmap_record::fixup_page_map): Fix off by one error.
	(list::search_record): Use long as type of "start" argument in both,
	declaration and definition.  Use long as type for local variable "i".
This commit is contained in:
Corinna Vinschen 2004-07-15 09:21:16 +00:00
parent a671e18c42
commit 5ba42c7f4c
2 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2004-07-15 Corinna Vinschen <corinna@vinschen.de>
* mmap.cc (class mmap_record): Fix return type of get_offset.
(mmap_record::fixup_page_map): Fix off by one error.
(list::search_record): Use long as type of "start" argument in both,
declaration and definition. Use long as type for local variable "i".
2004-07-14 Dave Korn <dk@artimi.com>
* fhandler_registry.cc (registry_listing): Correct typo.

View File

@ -82,7 +82,7 @@ class mmap_record
HANDLE get_handle () const { return mapping_handle_; }
device& get_device () { return dev; }
DWORD get_access () const { return access_mode_; }
DWORD get_offset () const { return offset_; }
_off64_t get_offset () const { return offset_; }
DWORD get_size () const { return size_to_map_; }
caddr_t get_address () const { return base_address_; }
@ -273,7 +273,7 @@ mmap_record::fixup_page_map ()
}
for (DWORD off = PAGE_CNT (size_to_map_); off > 0; --off)
VirtualProtect (base_address_ + off * getpagesize (), getpagesize (),
VirtualProtect (base_address_ + (off - 1) * getpagesize (), getpagesize (),
MAP_ISSET (off - 1) ? prot : PAGE_NOACCESS, &old_prot);
}
@ -358,11 +358,11 @@ list::search_record (_off64_t off, DWORD len)
/* Used in munmap() */
long
list::search_record (caddr_t addr, DWORD len, caddr_t &m_addr, DWORD &m_len,
_off_t start)
long start)
{
caddr_t low, high;
for (int i = start + 1; i < nrecs; ++i)
for (long i = start + 1; i < nrecs; ++i)
{
low = (addr >= recs[i].get_address ()) ? addr : recs[i].get_address ();
high = recs[i].get_address ()