summaryrefslogtreecommitdiff
path: root/src/core
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 /src/core
parentfd7566b5de6b59bb18ff380cb1fa3f3f1089b70b (diff)
useless field DBEVENTINFO::cbSize removed
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdauth/src/auth.cpp2
-rw-r--r--src/core/stdauth/src/authdialogs.cpp8
-rw-r--r--src/core/stdfile/src/file.cpp6
-rw-r--r--src/core/stdfile/src/filerecvdlg.cpp2
-rw-r--r--src/core/stdfile/src/filexferdlg.cpp1
-rw-r--r--src/core/stdmsg/src/cmdlist.cpp2
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp8
-rw-r--r--src/core/stdmsg/src/msglog.cpp2
-rw-r--r--src/core/stdmsg/src/msgs.cpp4
-rw-r--r--src/core/stduihist/src/history.cpp6
10 files changed, 20 insertions, 21 deletions
diff --git a/src/core/stdauth/src/auth.cpp b/src/core/stdauth/src/auth.cpp
index 51d0006890..44ad9644bb 100644
--- a/src/core/stdauth/src/auth.cpp
+++ b/src/core/stdauth/src/auth.cpp
@@ -47,7 +47,7 @@ static int AuthEventAdded(WPARAM, LPARAM lParam)
wchar_t szTooltip[256];
MEVENT hDbEvent = (MEVENT)lParam;
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
db_event_get(lParam, &dbei);
if (dbei.flags & (DBEF_SENT | DBEF_READ) || (dbei.eventType != EVENTTYPE_AUTHREQUEST && dbei.eventType != EVENTTYPE_ADDED))
return 0;
diff --git a/src/core/stdauth/src/authdialogs.cpp b/src/core/stdauth/src/authdialogs.cpp
index 97845bd930..e05db13492 100644
--- a/src/core/stdauth/src/authdialogs.cpp
+++ b/src/core/stdauth/src/authdialogs.cpp
@@ -38,7 +38,7 @@ INT_PTR CALLBACK DlgProcAdded(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
{
//blob is: uin(DWORD), hcontact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
db_event_get(hDbEvent, &dbei);
@@ -161,7 +161,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
//blob is: uin(DWORD), hcontact(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ)
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
db_event_get(hDbEvent, &dbei);
@@ -243,7 +243,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case IDOK:
{
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
db_event_get(hDbEvent, &dbei);
CallProtoService(dbei.szModule, PS_AUTHALLOW, (WPARAM)hDbEvent, 0);
@@ -260,7 +260,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case IDCANCEL:
{
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
db_event_get(hDbEvent, &dbei);
if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_DENYREASON))) {
diff --git a/src/core/stdfile/src/file.cpp b/src/core/stdfile/src/file.cpp
index 7bb233df4f..aa311ec063 100644
--- a/src/core/stdfile/src/file.cpp
+++ b/src/core/stdfile/src/file.cpp
@@ -122,7 +122,7 @@ static int FileEventAdded(WPARAM wParam, LPARAM lParam)
{
DWORD dwSignature;
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.cbBlob = sizeof(DWORD);
dbei.pBlob = (PBYTE)&dwSignature;
db_event_get(lParam, &dbei);
@@ -274,7 +274,7 @@ static void RemoveUnreadFileEvents(void)
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
MEVENT hDbEvent = db_event_firstUnread(hContact);
while (hDbEvent) {
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && dbei.eventType == EVENTTYPE_FILE)
db_event_markRead(hContact, hDbEvent);
@@ -359,7 +359,7 @@ static INT_PTR Proto_RecvFileT(WPARAM, LPARAM lParam)
if (pre->fileCount == 0)
return 0;
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.szModule = GetContactProto(ccs->hContact);
dbei.timestamp = pre->timestamp;
dbei.eventType = EVENTTYPE_FILE;
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp
index c3a8eeb365..f5eda50d2d 100644
--- a/src/core/stdfile/src/filerecvdlg.cpp
+++ b/src/core/stdfile/src/filerecvdlg.cpp
@@ -222,7 +222,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
db_event_markRead(dat->hContact, dat->hDbEvent);
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.cbBlob = db_event_getBlobSize(dat->hDbEvent);
if (dbei.cbBlob > 4 && dbei.cbBlob <= 8196) {
dbei.pBlob = (PBYTE)alloca(dbei.cbBlob + 1);
diff --git a/src/core/stdfile/src/filexferdlg.cpp b/src/core/stdfile/src/filexferdlg.cpp
index 9427d258b2..9c320a63d3 100644
--- a/src/core/stdfile/src/filexferdlg.cpp
+++ b/src/core/stdfile/src/filexferdlg.cpp
@@ -75,7 +75,6 @@ static void SetOpenFileButtonStyle(HWND hwndButton, int enabled)
void FillSendData(FileDlgData *dat, DBEVENTINFO& dbei)
{
- dbei.cbSize = sizeof(dbei);
dbei.szModule = GetContactProto(dat->hContact);
dbei.eventType = EVENTTYPE_FILE;
dbei.flags = DBEF_SENT;
diff --git a/src/core/stdmsg/src/cmdlist.cpp b/src/core/stdmsg/src/cmdlist.cpp
index e2b1e7544c..d334eb19ef 100644
--- a/src/core/stdmsg/src/cmdlist.cpp
+++ b/src/core/stdmsg/src/cmdlist.cpp
@@ -92,7 +92,7 @@ void msgQueue_processack(MCONTACT hContact, int id, BOOL success, const char *sz
return;
}
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.flags = DBEF_SENT | DBEF_UTF | (p->flags & PREF_RTL ? DBEF_RTL : 0);
dbei.szModule = GetContactProto(hContact);
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 4393ef0d74..75e388a03f 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -506,7 +506,7 @@ void CSrmmWindow::OnInitDialog()
if (hPrevEvent == NULL)
break;
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
m_hDbEventFirst = hPrevEvent;
db_event_get(hPrevEvent, &dbei);
if (!DbEventIsShown(&dbei))
@@ -515,7 +515,7 @@ void CSrmmWindow::OnInitDialog()
break;
case LOADHISTORY_TIME:
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
if (m_hDbEventFirst == NULL)
dbei.timestamp = (DWORD)time(NULL);
else
@@ -544,7 +544,7 @@ void CSrmmWindow::OnInitDialog()
MEVENT hdbEvent = db_event_last(m_hContact);
if (hdbEvent) {
do {
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
db_event_get(hdbEvent, &dbei);
if ((dbei.eventType == EVENTTYPE_MESSAGE) && !(dbei.flags & DBEF_SENT)) {
m_lastMessage = dbei.timestamp;
@@ -1178,7 +1178,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
if (m_hDbEventFirst == NULL)
m_hDbEventFirst = hDbEvent;
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
db_event_get(hDbEvent, &dbei);
bool isMessage = (dbei.eventType == EVENTTYPE_MESSAGE), isSent = ((dbei.flags & DBEF_SENT) != 0);
if (DbEventIsShown(&dbei)) {
diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp
index a49be9f4cb..b4eb69150f 100644
--- a/src/core/stdmsg/src/msglog.cpp
+++ b/src/core/stdmsg/src/msglog.cpp
@@ -201,7 +201,7 @@ int DbEventIsShown(DBEVENTINFO *dbei)
//mir_free() the return value
static bool CreateRTFFromDbEvent(LogStreamData *dat)
{
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.cbBlob = db_event_getBlobSize(dat->hDbEvent);
if (dbei.cbBlob == -1)
return false;
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index 9073c0970f..4bc28191a7 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -54,7 +54,7 @@ static int SRMMStatusToPf2(int status)
static int MessageEventAdded(WPARAM hContact, LPARAM lParam)
{
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
db_event_get(lParam, &dbei);
if (dbei.flags & (DBEF_SENT | DBEF_READ) || !(dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei)))
@@ -237,7 +237,7 @@ static void RestoreUnreadMessageAlerts(void)
for (MEVENT hDbEvent = db_event_firstUnread(hContact); hDbEvent; hDbEvent = db_event_next(hContact, hDbEvent)) {
bool autoPopup = false;
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.cbBlob = 0;
db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && (dbei.eventType == EVENTTYPE_MESSAGE || DbEventIsForMsgWindow(&dbei))) {
diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp
index 0969ec8acd..79ff971c34 100644
--- a/src/core/stduihist/src/history.cpp
+++ b/src/core/stduihist/src/history.cpp
@@ -146,7 +146,7 @@ static void FillHistoryThread(void* param)
int i = db_event_count(hInfo->hContact);
SendDlgItemMessage(hInfo->hwnd, IDC_LIST, LB_INITSTORAGE, i, i * 40);
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
int oldBlobSize = 0;
MEVENT hDbEvent = db_event_last(hInfo->hContact);
@@ -273,7 +273,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP
EnableWindow(GetDlgItem(hwndDlg, IDC_DELETEHISTORY), TRUE);
MEVENT hDbEvent = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, sel, 0);
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
if ((int)dbei.cbBlob != -1) {
dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
@@ -295,7 +295,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (index == LB_ERR)
break;
- DBEVENTINFO dbei = { sizeof(dbei) };
+ DBEVENTINFO dbei = {};
int oldBlobSize = 0;
MEVENT hDbEventStart = SendDlgItemMessage(hwndDlg, IDC_LIST, LB_GETITEMDATA, index, 0);