summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src/dbtool
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Db3x_mmap/src/dbtool')
-rw-r--r--plugins/Db3x_mmap/src/dbtool/disk.cpp8
-rw-r--r--plugins/Db3x_mmap/src/dbtool/eventchain.cpp14
-rw-r--r--plugins/Db3x_mmap/src/dbtool/initialchecks.cpp2
-rw-r--r--plugins/Db3x_mmap/src/dbtool/modulechain.cpp6
4 files changed, 15 insertions, 15 deletions
diff --git a/plugins/Db3x_mmap/src/dbtool/disk.cpp b/plugins/Db3x_mmap/src/dbtool/disk.cpp
index fabff439a2..da18f9a1d6 100644
--- a/plugins/Db3x_mmap/src/dbtool/disk.cpp
+++ b/plugins/Db3x_mmap/src/dbtool/disk.cpp
@@ -78,8 +78,8 @@ DWORD CDb3Mmap::WriteSegment(DWORD ofs, PVOID buf, int cbBytes)
ofs = m_dbHeader.ofsFileEnd;
m_dbHeader.ofsFileEnd += cbBytes;
}
- SetFilePointer(cb->hOutFile, ofs, NULL, FILE_BEGIN);
- WriteFile(cb->hOutFile, buf, cbBytes, &bytesWritten, NULL);
+ SetFilePointer(cb->hOutFile, ofs, nullptr, FILE_BEGIN);
+ WriteFile(cb->hOutFile, buf, cbBytes, &bytesWritten, nullptr);
if ((int)bytesWritten < cbBytes) {
cb->pfnAddLogMessage(STATUS_FATAL, TranslateT("Can't write to output file - disk full? (%u)"), GetLastError());
return WS_ERROR;
@@ -94,8 +94,8 @@ int CDb3Mmap::ReadWrittenSegment(DWORD ofs, PVOID buf, int cbBytes)
if (ofs + cbBytes > m_dbHeader.ofsFileEnd)
return ERROR_SEEK;
- SetFilePointer(cb->hOutFile, ofs, NULL, FILE_BEGIN);
- ReadFile(cb->hOutFile, buf, cbBytes, &bytesRead, NULL);
+ SetFilePointer(cb->hOutFile, ofs, nullptr, FILE_BEGIN);
+ ReadFile(cb->hOutFile, buf, cbBytes, &bytesRead, nullptr);
if ((int)bytesRead < cbBytes)
return ERROR_READ_FAULT;
diff --git a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp
index e03bee1b0d..0225aa685a 100644
--- a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp
+++ b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp
@@ -33,8 +33,8 @@ static DWORD eventCount;
static DWORD lastTimestamp;
static DWORD ofsFirstUnread, tsFirstUnread;
static DWORD memsize = 0;
-static DBEvent* memblock = NULL;
-static DBEvent* dbePrevEvent = NULL;
+static DBEvent* memblock = nullptr;
+static DBEvent* dbePrevEvent = nullptr;
void CDb3Mmap::ConvertOldEvent(DBEvent*& dbei)
{
@@ -56,7 +56,7 @@ void CDb3Mmap::ConvertOldEvent(DBEvent*& dbei)
if (msglenW > 0 && msglenW <= msglen) {
char* utf8str = Utf8EncodeW((WCHAR*)&dbei->blob[msglen]);
- if (utf8str == NULL)
+ if (utf8str == nullptr)
return;
dbei->cbBlob = (DWORD)mir_strlen(utf8str) + 1;
@@ -98,7 +98,7 @@ void CDb3Mmap::FinishUp(DWORD ofsLast, DBContact *dbc)
if (memsize && memblock) {
free(memblock);
memsize = 0;
- memblock = NULL;
+ memblock = nullptr;
}
}
@@ -123,7 +123,7 @@ DWORD CDb3Mmap::WriteEvent(DBEvent *dbe)
DWORD ofs = WriteSegment(WSOFS_END, dbe, offsetof(DBEvent, blob) + dbe->cbBlob);
if (ofs == WS_ERROR) {
free(memblock);
- memblock = NULL;
+ memblock = nullptr;
memsize = 0;
return 0;
}
@@ -135,7 +135,7 @@ int CDb3Mmap::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime)
int isUnread = 0;
if (firstTime) {
- dbePrevEvent = NULL;
+ dbePrevEvent = nullptr;
ofsPrevEvent = 0;
ofsDestPrevEvent = 0;
ofsThisEvent = dbc->ofsFirstEvent;
@@ -219,7 +219,7 @@ int CDb3Mmap::WorkEventChain(DWORD ofsContact, DBContact *dbc, int firstTime)
return ERROR_SUCCESS;
}
- DBEvent *dbePrev = NULL;
+ DBEvent *dbePrev = nullptr;
if (dbePrevEvent && dbeOld.timestamp == lastTimestamp) {
int len = offsetof(DBEvent, blob) + dbePrevEvent->cbBlob;
dbePrev = (DBEvent*)malloc(len);
diff --git a/plugins/Db3x_mmap/src/dbtool/initialchecks.cpp b/plugins/Db3x_mmap/src/dbtool/initialchecks.cpp
index 07505eb2ab..45c8120442 100644
--- a/plugins/Db3x_mmap/src/dbtool/initialchecks.cpp
+++ b/plugins/Db3x_mmap/src/dbtool/initialchecks.cpp
@@ -47,7 +47,7 @@ int CDb3Mmap::WorkInitialCheckHeaders()
int CDb3Mmap::WorkInitialChecks(int)
{
- sourceFileSize = GetFileSize(m_hDbFile, NULL);
+ sourceFileSize = GetFileSize(m_hDbFile, nullptr);
if (sourceFileSize == 0) {
cb->pfnAddLogMessage(STATUS_WARNING, TranslateT("Database is newly created and has no data to process"));
cb->pfnAddLogMessage(STATUS_SUCCESS, TranslateT("Processing completed successfully"));
diff --git a/plugins/Db3x_mmap/src/dbtool/modulechain.cpp b/plugins/Db3x_mmap/src/dbtool/modulechain.cpp
index 16ff76df78..60ae30af7c 100644
--- a/plugins/Db3x_mmap/src/dbtool/modulechain.cpp
+++ b/plugins/Db3x_mmap/src/dbtool/modulechain.cpp
@@ -23,7 +23,7 @@ struct ModChainEntry {
DWORD ofsOld, ofsNew;
int size;
char name[257];
-} static *modChain = NULL;
+} static *modChain = nullptr;
static int modChainCount;
static DWORD ofsCurrent;
static int phase, iCurrentModName;
@@ -132,9 +132,9 @@ DWORD CDb3Mmap::ConvertModuleNameOfs(DWORD ofsOld)
void CDb3Mmap::FreeModuleChain()
{
- if (modChain != NULL) {
+ if (modChain != nullptr) {
free(modChain);
- modChain = NULL;
+ modChain = nullptr;
last_mod = 0;
}
}