From bf77c15232b2dbc93fca01ca95a0fcdf955ce600 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Sat, 2 Dec 2017 21:42:50 -0500 Subject: [PATCH] kernel/vm: Correct virtual function declarations. The base VMCache class changed to the generic_ types with their introduction in in *2011* (435c43f5912b109e7d5cf682865d2061e62fad8c), but these classes were never properly adapted. These functions should not be called here (they panic() -- but the base class only returns B_ERROR, so that is a difference at least.) Found by Clang's -Woverloaded-virtual. --- headers/private/kernel/vm/VMCache.h | 2 +- src/system/kernel/vm/VMAnonymousNoSwapCache.cpp | 8 ++++---- src/system/kernel/vm/VMAnonymousNoSwapCache.h | 12 ++++++------ src/system/kernel/vm/VMDeviceCache.cpp | 8 ++++---- src/system/kernel/vm/VMDeviceCache.h | 12 ++++++------ 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/headers/private/kernel/vm/VMCache.h b/headers/private/kernel/vm/VMCache.h index b373c7fb4b..46bedf8907 100644 --- a/headers/private/kernel/vm/VMCache.h +++ b/headers/private/kernel/vm/VMCache.h @@ -147,7 +147,7 @@ public: virtual bool HasPage(off_t offset); virtual status_t Read(off_t offset, const generic_io_vec *vecs, - size_t count,uint32 flags, + size_t count, uint32 flags, generic_size_t *_numBytes); virtual status_t Write(off_t offset, const generic_io_vec *vecs, size_t count, uint32 flags, diff --git a/src/system/kernel/vm/VMAnonymousNoSwapCache.cpp b/src/system/kernel/vm/VMAnonymousNoSwapCache.cpp index 1de023a26f..cd91d5a5cb 100644 --- a/src/system/kernel/vm/VMAnonymousNoSwapCache.cpp +++ b/src/system/kernel/vm/VMAnonymousNoSwapCache.cpp @@ -100,8 +100,8 @@ VMAnonymousNoSwapCache::HasPage(off_t offset) status_t -VMAnonymousNoSwapCache::Read(off_t offset, const iovec* vecs, size_t count, - uint32 flags, size_t* _numBytes) +VMAnonymousNoSwapCache::Read(off_t offset, const generic_io_vec* vecs, size_t count, + uint32 flags, generic_size_t* _numBytes) { panic("anonymous_store: read called. Invalid!\n"); return B_ERROR; @@ -109,8 +109,8 @@ VMAnonymousNoSwapCache::Read(off_t offset, const iovec* vecs, size_t count, status_t -VMAnonymousNoSwapCache::Write(off_t offset, const iovec* vecs, size_t count, - uint32 flags, size_t* _numBytes) +VMAnonymousNoSwapCache::Write(off_t offset, const generic_io_vec* vecs, size_t count, + uint32 flags, generic_size_t* _numBytes) { // no place to write, this will cause the page daemon to skip this store return B_ERROR; diff --git a/src/system/kernel/vm/VMAnonymousNoSwapCache.h b/src/system/kernel/vm/VMAnonymousNoSwapCache.h index c9250ed6bf..7f51e351ac 100644 --- a/src/system/kernel/vm/VMAnonymousNoSwapCache.h +++ b/src/system/kernel/vm/VMAnonymousNoSwapCache.h @@ -27,12 +27,12 @@ public: virtual int32 GuardSize() { return fGuardedSize; } - virtual status_t Read(off_t offset, const iovec* vecs, - size_t count, uint32 flags, - size_t* _numBytes); - virtual status_t Write(off_t offset, const iovec* vecs, - size_t count, uint32 flags, - size_t* _numBytes); + virtual status_t Read(off_t offset, const generic_io_vec *vecs, + size_t count,uint32 flags, + generic_size_t *_numBytes); + virtual status_t Write(off_t offset, const generic_io_vec *vecs, + size_t count, uint32 flags, + generic_size_t *_numBytes); virtual status_t Fault(struct VMAddressSpace* aspace, off_t offset); diff --git a/src/system/kernel/vm/VMDeviceCache.cpp b/src/system/kernel/vm/VMDeviceCache.cpp index f9aa4c97d4..d94bf72d5c 100644 --- a/src/system/kernel/vm/VMDeviceCache.cpp +++ b/src/system/kernel/vm/VMDeviceCache.cpp @@ -21,8 +21,8 @@ VMDeviceCache::Init(addr_t baseAddress, uint32 allocationFlags) status_t -VMDeviceCache::Read(off_t offset, const iovec* vecs, size_t count, - uint32 flags, size_t* _numBytes) +VMDeviceCache::Read(off_t offset, const generic_io_vec *vecs, size_t count, + uint32 flags, generic_size_t *_numBytes) { panic("device_store: read called. Invalid!\n"); return B_ERROR; @@ -30,8 +30,8 @@ VMDeviceCache::Read(off_t offset, const iovec* vecs, size_t count, status_t -VMDeviceCache::Write(off_t offset, const iovec* vecs, size_t count, - uint32 flags, size_t* _numBytes) +VMDeviceCache::Write(off_t offset, const generic_io_vec* vecs, size_t count, + uint32 flags, generic_size_t* _numBytes) { // no place to write, this will cause the page daemon to skip this store return B_OK; diff --git a/src/system/kernel/vm/VMDeviceCache.h b/src/system/kernel/vm/VMDeviceCache.h index 310024f567..a1998ca45e 100644 --- a/src/system/kernel/vm/VMDeviceCache.h +++ b/src/system/kernel/vm/VMDeviceCache.h @@ -18,12 +18,12 @@ public: status_t Init(addr_t baseAddress, uint32 allocationFlags); - virtual status_t Read(off_t offset, const iovec* vecs, - size_t count, uint32 flags, - size_t* _numBytes); - virtual status_t Write(off_t offset, const iovec* vecs, - size_t count, uint32 flags, - size_t* _numBytes); + virtual status_t Read(off_t offset, const generic_io_vec *vecs, + size_t count, uint32 flags, + generic_size_t *_numBytes); + virtual status_t Write(off_t offset, const generic_io_vec *vecs, + size_t count, uint32 flags, + generic_size_t *_numBytes); protected: virtual void DeleteObject();