diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-23 20:32:10 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-23 20:32:10 +0000 |
commit | c1075c9ea02e77bcb55fa627623b1ac598abda44 (patch) | |
tree | e140de04b3f1d4cbd517f270d8720baef8cf9353 /plugins/Db3x_mmap/src/dbcache.cpp | |
parent | 35d4044e1958d2cd68553837a0da0829bd3b98f4 (diff) |
slightly changed class hierarchy
git-svn-id: http://svn.miranda-ng.org/main/trunk@1141 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/dbcache.cpp')
-rw-r--r-- | plugins/Db3x_mmap/src/dbcache.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
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);
|