summaryrefslogtreecommitdiff
path: root/plugins/Dbx_tree/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-24 15:21:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-24 15:21:30 +0000
commit5e01c907bf4cace9542f880bae418f71c0fd0c07 (patch)
tree4e8b60aa99bcc10540be4b0ca09bcb313ff78677 /plugins/Dbx_tree/src
parent4a4b816398add26a704f13af1aa2ff5023df01af (diff)
more warning fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@6608 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_tree/src')
-rw-r--r--plugins/Dbx_tree/src/BTree.h5
-rw-r--r--plugins/Dbx_tree/src/BlockManager.cpp9
-rw-r--r--plugins/Dbx_tree/src/DataBase.cpp12
-rw-r--r--plugins/Dbx_tree/src/EncryptionManager.cpp6
-rw-r--r--plugins/Dbx_tree/src/Entities.cpp3
-rw-r--r--plugins/Dbx_tree/src/Logger.cpp3
-rw-r--r--plugins/Dbx_tree/src/Settings.cpp12
-rw-r--r--plugins/Dbx_tree/src/TLS.h3
8 files changed, 20 insertions, 33 deletions
diff --git a/plugins/Dbx_tree/src/BTree.h b/plugins/Dbx_tree/src/BTree.h
index 277f206b2b..f1d44ccd27 100644
--- a/plugins/Dbx_tree/src/BTree.h
+++ b/plugins/Dbx_tree/src/BTree.h
@@ -186,7 +186,7 @@ CBTree<TKey, SizeParam>::~CBTree()
while (i != m_ManagedIterators.end())
{
i->second->m_Tree = NULL;
- i++;
+ ++i;
}
if (m_DestroyTree)
@@ -910,8 +910,7 @@ void CBTree<TKey, SizeParam>::DestroyTree()
DeleteNode(node);
}
- if (m_Alloc)
- free(m_Alloc);
+ free(m_Alloc);
m_Alloc = NULL;
m_AllocCount = 0;
m_Count = 0;
diff --git a/plugins/Dbx_tree/src/BlockManager.cpp b/plugins/Dbx_tree/src/BlockManager.cpp
index 82fe27e4f2..b6a7d22feb 100644
--- a/plugins/Dbx_tree/src/BlockManager.cpp
+++ b/plugins/Dbx_tree/src/BlockManager.cpp
@@ -252,8 +252,7 @@ inline void CBlockManager::_PendingRemove(TPendingOperation * Pending, bool Free
else
m_PendingTail = Pending->Prev;
- if (Pending->EncryptionBuffer)
- free(Pending->EncryptionBuffer);
+ free(Pending->EncryptionBuffer);
if (m_PendingLast == Pending)
m_PendingLast = Pending->Prev;
@@ -340,8 +339,7 @@ inline void CBlockManager::_PendingFlush(bool FullFlush)
i = m_PendingHead;
while (i)
{
- if (i->EncryptionBuffer)
- free(i->EncryptionBuffer);
+ free(i->EncryptionBuffer);
if (i->CacheEntry)
i->CacheEntry->Pending = NULL;
@@ -430,8 +428,7 @@ inline void CBlockManager::_CacheErase(uint32_t Idx)
}
*l = i->Next;
- if (i->Cache)
- free(i->Cache);
+ free(i->Cache);
free(i);
}
diff --git a/plugins/Dbx_tree/src/DataBase.cpp b/plugins/Dbx_tree/src/DataBase.cpp
index 451ce89a00..683f0b66a8 100644
--- a/plugins/Dbx_tree/src/DataBase.cpp
+++ b/plugins/Dbx_tree/src/DataBase.cpp
@@ -66,9 +66,9 @@ CDataBase::CDataBase(const TCHAR *FileName)
}
CDataBase::~CDataBase()
{
- if (m_Events) delete m_Events;
- if (m_Settings) delete m_Settings;
- if (m_Entities) delete m_Entities;
+ delete m_Events;
+ delete m_Settings;
+ delete m_Entities;
m_Entities = NULL;
m_Settings = NULL;
@@ -76,9 +76,9 @@ CDataBase::~CDataBase()
for (int i = DBFileMax - 1; i >= 0; --i)
{
- if (m_BlockManager[i]) delete m_BlockManager[i];
- if (m_FileAccess[i]) delete m_FileAccess[i];
- if (m_EncryptionManager[i]) delete m_EncryptionManager[i];
+ delete m_BlockManager[i];
+ delete m_FileAccess[i];
+ delete m_EncryptionManager[i];
m_BlockManager[i] = NULL;
m_FileAccess[i] = NULL;
diff --git a/plugins/Dbx_tree/src/EncryptionManager.cpp b/plugins/Dbx_tree/src/EncryptionManager.cpp
index 7274178ee7..ceaff9a015 100644
--- a/plugins/Dbx_tree/src/EncryptionManager.cpp
+++ b/plugins/Dbx_tree/src/EncryptionManager.cpp
@@ -93,11 +93,9 @@ CEncryptionManager::CEncryptionManager()
}
CEncryptionManager::~CEncryptionManager()
{
- if (m_Ciphers[CURRENT].Cipher)
- delete m_Ciphers[CURRENT].Cipher;
+ delete m_Ciphers[CURRENT].Cipher;
m_Ciphers[CURRENT].Cipher = NULL;
- if (m_Ciphers[OLD].Cipher)
- delete m_Ciphers[OLD].Cipher;
+ delete m_Ciphers[OLD].Cipher;
m_Ciphers[OLD].Cipher = NULL;
CipherListRefCount--;
diff --git a/plugins/Dbx_tree/src/Entities.cpp b/plugins/Dbx_tree/src/Entities.cpp
index 74af4d6665..590cf6f85b 100644
--- a/plugins/Dbx_tree/src/Entities.cpp
+++ b/plugins/Dbx_tree/src/Entities.cpp
@@ -736,7 +736,6 @@ TDBTEntityHandle CEntities::IterationNext(TDBTEntityIterationHandle Iteration)
item = iter->q->front();
iter->q->pop_front();
- std::deque<TEntityIterationItem> tmp;
TEntityIterationItem newitem;
// children
@@ -879,7 +878,7 @@ TDBTEntityHandle CEntities::IterationNext(TDBTEntityIterationHandle Iteration)
{
if (acci->Handle == acc)
acc = 0;
- acci++;
+ ++acci;
}
if (acc != 0)
{
diff --git a/plugins/Dbx_tree/src/Logger.cpp b/plugins/Dbx_tree/src/Logger.cpp
index 7b732b6cfd..79b7bedd72 100644
--- a/plugins/Dbx_tree/src/Logger.cpp
+++ b/plugins/Dbx_tree/src/Logger.cpp
@@ -119,7 +119,6 @@ void CLogger::MessageBoxAsync(void * MsgBoxParams)
{
MSGBOXPARAMS* p = reinterpret_cast<MSGBOXPARAMS*>(MsgBoxParams);
MessageBoxIndirect(p);
- if (p->lpszText)
- delete [] p->lpszText;
+ delete [] p->lpszText;
delete p;
} \ No newline at end of file
diff --git a/plugins/Dbx_tree/src/Settings.cpp b/plugins/Dbx_tree/src/Settings.cpp
index c2acd8ddfc..17d8fe635f 100644
--- a/plugins/Dbx_tree/src/Settings.cpp
+++ b/plugins/Dbx_tree/src/Settings.cpp
@@ -48,8 +48,7 @@ TDBTSettingHandle CSettingsTree::_FindSetting(const uint32_t Hash, const char *
}
}
- if (str)
- free(str);
+ free(str);
return res;
}
@@ -119,8 +118,7 @@ CSettings::~CSettings()
TModulesMap::iterator it2 = m_Modules.begin();
while (it2 != m_Modules.end())
{
- if (it2->second)
- delete [] it2->second;
+ delete [] it2->second;
++it2;
}
}
@@ -1419,8 +1417,7 @@ unsigned int CSettings::IterationClose(TDBTSettingIterationHandle Iteration)
delete iter->Heap; // only this needs synchronization
}
- if (iter->Filter.NameStart)
- delete [] iter->Filter.NameStart;
+ delete [] iter->Filter.NameStart;
if (iter->Filter.Descriptor && iter->Filter.Descriptor->pszSettingName)
{
@@ -1444,8 +1441,7 @@ unsigned int CSettings::IterationClose(TDBTSettingIterationHandle Iteration)
while (!iter->Frame->empty())
{
- if (iter->Frame->front().Name)
- free(iter->Frame->front().Name);
+ free(iter->Frame->front().Name);
iter->Frame->pop();
}
diff --git a/plugins/Dbx_tree/src/TLS.h b/plugins/Dbx_tree/src/TLS.h
index d309090a34..bc7e1ed2d0 100644
--- a/plugins/Dbx_tree/src/TLS.h
+++ b/plugins/Dbx_tree/src/TLS.h
@@ -73,8 +73,7 @@ CThreadLocalStorage<TAdministrator, TData>::CThreadLocalStorage()
template <typename TAdministrator, typename TData>
CThreadLocalStorage<TAdministrator, TData>::~CThreadLocalStorage()
{
- if (m_LockfreeList)
- delete m_LockfreeList;
+ delete m_LockfreeList;
}