From c1075c9ea02e77bcb55fa627623b1ac598abda44 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 23 Jul 2012 20:32:10 +0000 Subject: slightly changed class hierarchy git-svn-id: http://svn.miranda-ng.org/main/trunk@1141 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbcache.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'plugins/Db3x_mmap/src/dbcache.cpp') diff --git a/plugins/Db3x_mmap/src/dbcache.cpp b/plugins/Db3x_mmap/src/dbcache.cpp index 466aa7a00d..4e09335bae 100644 --- a/plugins/Db3x_mmap/src/dbcache.cpp +++ b/plugins/Db3x_mmap/src/dbcache.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "commonheaders.h" -void CDdxMmap::Map() +void CDb3Mmap::Map() { m_hMap = CreateFileMapping(m_hDbFile, NULL, PAGE_READWRITE, 0, m_dwFileSize, NULL); @@ -37,7 +37,7 @@ void CDdxMmap::Map() DatabaseCorruption( _T("%s (CreateFileMapping failed. Code: %d)")); } -void CDdxMmap::ReMap(DWORD needed) +void CDb3Mmap::ReMap(DWORD needed) { KillTimer(NULL,m_flushBuffersTimerId); @@ -64,7 +64,7 @@ void CDdxMmap::ReMap(DWORD needed) Map(); } -void CDdxMmap::DBMoveChunk(DWORD ofsDest,DWORD ofsSource,int bytes) +void CDb3Mmap::DBMoveChunk(DWORD ofsDest,DWORD ofsSource,int bytes) { int x = 0; log3("move %d %08x->%08x",bytes,ofsSource,ofsDest); @@ -72,7 +72,6 @@ void CDdxMmap::DBMoveChunk(DWORD ofsDest,DWORD ofsSource,int bytes) if (ofsSource+bytes > m_dwFileSize) { x = ofsSource+bytes-m_dwFileSize; log0("buggy move!"); - _ASSERT(0); } if (x > 0) ZeroMemory(m_pDbCache+ofsDest+bytes-x, x); @@ -83,7 +82,7 @@ void CDdxMmap::DBMoveChunk(DWORD ofsDest,DWORD ofsSource,int bytes) } //we are assumed to be in a mutex here -PBYTE CDdxMmap::DBRead(DWORD ofs,int bytesRequired,int *bytesAvail) +PBYTE CDb3Mmap::DBRead(DWORD ofs,int bytesRequired,int *bytesAvail) { // buggy read if (ofs>= m_dwFileSize) { @@ -97,7 +96,7 @@ PBYTE CDdxMmap::DBRead(DWORD ofs,int bytesRequired,int *bytesAvail) } //we are assumed to be in a mutex here -void CDdxMmap::DBWrite(DWORD ofs,PVOID pData,int bytes) +void CDb3Mmap::DBWrite(DWORD ofs,PVOID pData,int bytes) { log2("write %d@%08x",bytes,ofs); if (ofs+bytes > m_dwFileSize) ReMap(ofs+bytes-m_dwFileSize); @@ -106,7 +105,7 @@ void CDdxMmap::DBWrite(DWORD ofs,PVOID pData,int bytes) } //we are assumed to be in a mutex here -void CDdxMmap::DBFill(DWORD ofs,int bytes) +void CDb3Mmap::DBFill(DWORD ofs,int bytes) { log2("zerofill %d@%08x",bytes,ofs); if (ofs+bytes <= m_dwFileSize) @@ -117,7 +116,7 @@ void CDdxMmap::DBFill(DWORD ofs,int bytes) static VOID CALLBACK DoBufferFlushTimerProc(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime) { for (int i=0; i < g_Dbs.getCount(); i++) { - CDdxMmap* db = g_Dbs[i]; + CDb3Mmap* db = g_Dbs[i]; if (db->m_flushBuffersTimerId != idEvent) continue; @@ -137,7 +136,7 @@ static VOID CALLBACK DoBufferFlushTimerProc(HWND hwnd, UINT message, UINT_PTR id } } -void CDdxMmap::DBFlush(int setting) +void CDb3Mmap::DBFlush(int setting) { if (!setting) { log0("nflush1"); @@ -158,7 +157,7 @@ void CDdxMmap::DBFlush(int setting) m_flushBuffersTimerId = SetTimer(NULL, m_flushBuffersTimerId, 50, DoBufferFlushTimerProc); } -int CDdxMmap::InitCache(void) +int CDb3Mmap::InitCache(void) { m_dwFileSize = GetFileSize(m_hDbFile, NULL); -- cgit v1.2.3