diff options
author | George Hazan <ghazan@miranda.im> | 2018-01-22 22:26:18 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-01-22 22:26:25 +0300 |
commit | 23f676163a595018346050eccb5cc8b2571381e6 (patch) | |
tree | 09107aede495a3bebea5bed64a4483ffb3d148e5 /src/mir_app | |
parent | 36b876e544afe74ce5f7463cdf9502d3b23f3ed6 (diff) |
code cleaning
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/MDatabaseCommon.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/database.h | 4 | ||||
-rw-r--r-- | src/mir_app/src/mdatabasecache.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/proto_chains.cpp | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/mir_app/src/MDatabaseCommon.cpp b/src/mir_app/src/MDatabaseCommon.cpp index b7d2ccaa40..61b32afc13 100644 --- a/src/mir_app/src/MDatabaseCommon.cpp +++ b/src/mir_app/src/MDatabaseCommon.cpp @@ -48,7 +48,7 @@ int MDatabaseCommon::CheckProto(DBCachedContact *cc, const char *proto) if (GetContactSettingStatic(cc->contactID, "Protocol", "p", &dbv) != 0 || (dbv.type != DBVT_ASCIIZ)) return 0; - cc->szProto = m_cache->GetCachedSetting(nullptr, protobuf, 0, (int)mir_strlen(protobuf)); + cc->szProto = m_cache->GetCachedSetting(nullptr, protobuf, 0, mir_strlen(protobuf)); } return !mir_strcmp(cc->szProto, proto); @@ -297,7 +297,7 @@ STDMETHODIMP_(BOOL) MDatabaseCommon::EnumResidentSettings(DBMODULEENUMPROC pFunc STDMETHODIMP_(BOOL) MDatabaseCommon::SetSettingResident(BOOL bIsResident, const char *pszSettingName) { - char *szSetting = m_cache->GetCachedSetting(nullptr, pszSettingName, 0, (int)mir_strlen(pszSettingName)); + char *szSetting = m_cache->GetCachedSetting(nullptr, pszSettingName, 0, mir_strlen(pszSettingName)); szSetting[-1] = (char)bIsResident; mir_cslock lck(m_csDbAccess); diff --git a/src/mir_app/src/database.h b/src/mir_app/src/database.h index f0a4b29105..19e665c127 100644 --- a/src/mir_app/src/database.h +++ b/src/mir_app/src/database.h @@ -46,8 +46,8 @@ protected: STDMETHODIMP_(DBCachedContact*) GetNextContact(MCONTACT contactID);
STDMETHODIMP_(void) FreeCachedContact(MCONTACT contactID);
- STDMETHODIMP_(char*) InsertCachedSetting(const char *szName, int);
- STDMETHODIMP_(char*) GetCachedSetting(const char *szModuleName, const char *szSettingName, int, int);
+ STDMETHODIMP_(char*) InsertCachedSetting(const char *szName, size_t size);
+ STDMETHODIMP_(char*) GetCachedSetting(const char *szModuleName, const char *szSettingName, size_t, size_t);
STDMETHODIMP_(void) SetCachedVariant(DBVARIANT *s, DBVARIANT *d);
STDMETHODIMP_(DBVARIANT*) GetCachedValuePtr(MCONTACT contactID, char *szSetting, int bAllocate);
};
diff --git a/src/mir_app/src/mdatabasecache.cpp b/src/mir_app/src/mdatabasecache.cpp index e27da509ea..a3fa6faa35 100644 --- a/src/mir_app/src/mdatabasecache.cpp +++ b/src/mir_app/src/mdatabasecache.cpp @@ -119,7 +119,7 @@ void MDatabaseCache::FreeCachedContact(MCONTACT contactID) /////////////////////////////////////////////////////////////////////////////////////////
-char* MDatabaseCache::InsertCachedSetting(const char* szName, int cbLen)
+char* MDatabaseCache::InsertCachedSetting(const char* szName, size_t cbLen)
{
char* newValue = (char*)HeapAlloc(m_hCacheHeap, 0, cbLen);
*newValue++ = 0;
@@ -131,7 +131,7 @@ char* MDatabaseCache::InsertCachedSetting(const char* szName, int cbLen) return newValue;
}
-char* MDatabaseCache::GetCachedSetting(const char *szModuleName, const char *szSettingName, int moduleNameLen, int settingNameLen)
+char* MDatabaseCache::GetCachedSetting(const char *szModuleName, const char *szSettingName, size_t moduleNameLen, size_t settingNameLen)
{
char szFullName[512];
const char *szKey;
diff --git a/src/mir_app/src/proto_chains.cpp b/src/mir_app/src/proto_chains.cpp index b34f1e6f76..0855cdc8e3 100644 --- a/src/mir_app/src/proto_chains.cpp +++ b/src/mir_app/src/proto_chains.cpp @@ -48,7 +48,7 @@ static int GetProtocolP(MCONTACT hContact, char *szBuf, int cbLen) if (cc == nullptr)
cc = currDb->m_cache->AddContactToCache(hContact);
- cc->szProto = currDb->m_cache->GetCachedSetting(nullptr, szBuf, 0, (int)mir_strlen(szBuf));
+ cc->szProto = currDb->m_cache->GetCachedSetting(nullptr, szBuf, 0, mir_strlen(szBuf));
}
return res;
}
|