summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-17 17:19:19 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-17 17:19:19 +0300
commitb327ed7872ca83c3a4249039ba1a3d8dd3ece630 (patch)
tree5a4ae83dafab23f7832186b5dd0736611998f43c /protocols/JabberG/src
parentfd7566b5de6b59bb18ff380cb1fa3f3f1089b70b (diff)
useless field DBEVENTINFO::cbSize removed
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r--protocols/JabberG/src/jabber_archive.cpp9
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp4
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp6
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp4
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp4
5 files changed, 11 insertions, 16 deletions
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp
index 32d5db407f..53165e64a1 100644
--- a/protocols/JabberG/src/jabber_archive.cpp
+++ b/protocols/JabberG/src/jabber_archive.cpp
@@ -94,7 +94,7 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei)
if (!hExistingDbEvent)
return FALSE;
- DBEVENTINFO dbeiExisting = { sizeof(dbeiExisting) };
+ DBEVENTINFO dbeiExisting = {};
db_event_get(hExistingDbEvent, &dbeiExisting);
DWORD dwEventTimeStamp = dbeiExisting.timestamp;
@@ -117,7 +117,6 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei)
return FALSE;
memset(&dbeiExisting, 0, sizeof(dbeiExisting));
- dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
dwEventTimeStamp = dbeiExisting.timestamp;
@@ -135,7 +134,6 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei)
// check for equal timestamps
if (dbei.timestamp == dwPreviousTimeStamp) {
memset(&dbeiExisting, 0, sizeof(dbeiExisting));
- dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hPreviousDbEvent, &dbeiExisting);
if (dbei == dbeiExisting)
@@ -145,7 +143,6 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei)
hExistingDbEvent = db_event_next(hContact, hPreviousDbEvent);
while (hExistingDbEvent != NULL) {
memset(&dbeiExisting, 0, sizeof(dbeiExisting));
- dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
if (dbeiExisting.timestamp != dwPreviousTimeStamp) {
@@ -166,7 +163,6 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei)
// look back
while (hExistingDbEvent != NULL) {
memset(&dbeiExisting, 0, sizeof(dbeiExisting));
- dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
if (dbei.timestamp > dbeiExisting.timestamp) {
@@ -192,7 +188,6 @@ BOOL IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO& dbei)
// look forward
while (hExistingDbEvent != NULL) {
memset(&dbeiExisting, 0, sizeof(dbeiExisting));
- dbeiExisting.cbSize = sizeof(dbeiExisting);
db_event_get(hExistingDbEvent, &dbeiExisting);
if (dbei.timestamp < dbeiExisting.timestamp) {
@@ -267,7 +262,7 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
T2Utf szEventText(tszBody);
- DBEVENTINFO dbei = { sizeof(DBEVENTINFO) };
+ DBEVENTINFO dbei = {};
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.szModule = m_szModuleName;
dbei.cbBlob = (DWORD)mir_strlen(szEventText)+1;
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index ed0320d301..ee64e3c348 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -50,7 +50,7 @@ void CJabberProto::DBAddAuthRequest(const wchar_t *jid, const wchar_t *nick)
DB_AUTH_BLOB blob(hContact, T2Utf(nick), NULL, NULL, T2Utf(jid), NULL);
- DBEVENTINFO dbei = { sizeof(DBEVENTINFO) };
+ DBEVENTINFO dbei = {};
dbei.szModule = m_szModuleName;
dbei.timestamp = (DWORD)time(NULL);
dbei.flags = DBEF_UTF;
@@ -118,7 +118,7 @@ BOOL CJabberProto::AddDbPresenceEvent(MCONTACT hContact, BYTE btEventType)
break;
}
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.pBlob = &btEventType;
dbei.cbBlob = sizeof(btEventType);
dbei.eventType = EVENTTYPE_JABBER_PRESENCE;
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 075f2defea..be0bbb6e50 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -331,7 +331,7 @@ MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, MEV
{
debugLogA("AddToListByEvent");
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
return NULL;
if ((dbei.pBlob = (PBYTE)alloca(dbei.cbBlob)) == NULL)
@@ -355,7 +355,7 @@ int CJabberProto::Authorize(MEVENT hDbEvent)
if (!m_bJabberOnline)
return 1;
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
return 1;
if ((dbei.pBlob = (PBYTE)alloca(dbei.cbBlob)) == NULL)
@@ -401,7 +401,7 @@ int CJabberProto::AuthDeny(MEVENT hDbEvent, const wchar_t*)
debugLogA("Entering AuthDeny");
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
return 1;
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index af4f79f711..c37e85bc31 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -469,7 +469,7 @@ int CJabberProto::RcGetUnreadEventsCount()
if (jid == NULL) continue;
for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
if (dbei.cbBlob == -1)
continue;
@@ -556,7 +556,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
continue;
for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
if (dbei.cbBlob == -1)
continue;
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 778a2b72e8..0b28ee9157 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -987,7 +987,7 @@ DWORD JabberGetLastContactMessageTime(MCONTACT hContact)
DWORD dwTime = 0;
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
if (dbei.cbBlob != -1) {
dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob + 1);
@@ -1146,7 +1146,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
// chatstates gone event
if (hContact && XmlGetChildByTag(node, "gone", "xmlns", JABBER_FEAT_CHATSTATES) && m_options.LogChatstates) {
BYTE bEventType = JABBER_DB_EVENT_CHATSTATES_GONE; // gone event
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.pBlob = &bEventType;
dbei.cbBlob = 1;
dbei.eventType = EVENTTYPE_JABBER_CHATSTATES;