summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-01 00:07:01 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-01 00:07:01 +0000
commitb2fad485cd5b41744ef0cc4a02722c021afd926c (patch)
treeaa19403cd699066600e8306be8ad33e4a17fba6f /plugins/Db3x_mmap
parentfc62f1f1e1f8af40a1f7efe0ba3afc358fb66ef3 (diff)
ZeroMemory -> memset, few bugs fised
git-svn-id: http://svn.miranda-ng.org/main/trunk@11184 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap')
-rw-r--r--plugins/Db3x_mmap/src/dbcache.cpp6
-rw-r--r--plugins/Db3x_mmap/src/dbtool/disk.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/plugins/Db3x_mmap/src/dbcache.cpp b/plugins/Db3x_mmap/src/dbcache.cpp
index 3c301b0162..d4ddb83ad3 100644
--- a/plugins/Db3x_mmap/src/dbcache.cpp
+++ b/plugins/Db3x_mmap/src/dbcache.cpp
@@ -79,7 +79,7 @@ void CDb3Mmap::DBMoveChunk(DWORD ofsDest, DWORD ofsSource, int bytes)
log0("buggy move!");
}
if (x > 0)
- ZeroMemory(m_pDbCache + ofsDest + bytes - x, x);
+ memset((m_pDbCache + ofsDest + bytes - x), 0, x);
if (ofsSource < m_dwFileSize)
MoveMemory(m_pDbCache + ofsDest, m_pDbCache + ofsSource, bytes - x);
@@ -116,8 +116,8 @@ void CDb3Mmap::DBWrite(DWORD ofs, PVOID pData, int bytes)
void CDb3Mmap::DBFill(DWORD ofs, int bytes)
{
//log2("zerofill %d@%08x",bytes,ofs);
- if (ofs+bytes <= m_dwFileSize)
- ZeroMemory(m_pDbCache+ofs,bytes);
+ if ((ofs + bytes) <= m_dwFileSize)
+ memset((m_pDbCache + ofs), 0, bytes);
logg();
}
diff --git a/plugins/Db3x_mmap/src/dbtool/disk.cpp b/plugins/Db3x_mmap/src/dbtool/disk.cpp
index 692fdb7fde..109df7b03b 100644
--- a/plugins/Db3x_mmap/src/dbtool/disk.cpp
+++ b/plugins/Db3x_mmap/src/dbtool/disk.cpp
@@ -62,9 +62,9 @@ int CDb3Mmap::ReadSegment(DWORD ofs, PVOID buf, int cbBytes)
if (cb->bAggressive) {
if (ofs + cbBytes > sourceFileSize) {
cb->pfnAddLogMessage(STATUS_WARNING, TranslateT("Can't write to working file, aggressive mode may be too aggressive now"));
- ZeroMemory(m_pDbCache + ofs, sourceFileSize - ofs);
+ memset((m_pDbCache + ofs), 0, (sourceFileSize - ofs));
}
- else ZeroMemory(m_pDbCache + ofs, cbBytes);
+ else memset((m_pDbCache + ofs), 0, cbBytes);
}
cb->spaceProcessed += cbBytes;
return ERROR_SUCCESS;