From 85c0b6a96f366bdf0ca334ee7cb1877fb3f2288c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Jan 2015 17:49:54 +0000 Subject: MEVENT - the strict type for events, they are not HANDLE anymore git-svn-id: http://svn.miranda-ng.org/main/trunk@11866 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- .../UserInfoEx/src/ex_import/classExImContactXML.cpp | 2 +- plugins/UserInfoEx/src/ex_import/classExImContactXML.h | 6 +++--- plugins/UserInfoEx/src/mir_db.cpp | 18 +++++++++--------- plugins/UserInfoEx/src/mir_db.h | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) (limited to 'plugins/UserInfoEx/src') diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp index c33bc8aaf8..0e409bc24a 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.cpp @@ -401,7 +401,7 @@ BYTE CExImContactXML::ExportEvents() DWORD cbEventBuf = 0, dwNumEventsAdded = 0; // read out all events for the current contact - for (HANDLE hDbEvent = db_event_first(_hContact); hDbEvent != NULL; hDbEvent = db_event_next(_hContact, hDbEvent)) { + for (MEVENT hDbEvent = db_event_first(_hContact); hDbEvent != NULL; hDbEvent = db_event_next(_hContact, hDbEvent)) { DBEVENTINFO dbei = { sizeof(DBEVENTINFO) }; if (DB::Event::GetInfoWithData(hDbEvent, &dbei)) continue; diff --git a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h index b88d1b8097..e989484072 100644 --- a/plugins/UserInfoEx/src/ex_import/classExImContactXML.h +++ b/plugins/UserInfoEx/src/ex_import/classExImContactXML.h @@ -47,9 +47,9 @@ enum EError { class CExImContactXML : public CExImContactBase { - CFileXml* _pXmlFile; // the xmlfile - TiXmlElement* _xmlNode; // xmlnode with contact information - HANDLE _hEvent; + CFileXml *_pXmlFile; // the xmlfile + TiXmlElement *_xmlNode; // xmlnode with contact information + MEVENT _hEvent; BYTE IsContactInfo(LPCSTR pszKey); diff --git a/plugins/UserInfoEx/src/mir_db.cpp b/plugins/UserInfoEx/src/mir_db.cpp index c55a2f4a43..972e9790ba 100644 --- a/plugins/UserInfoEx/src/mir_db.cpp +++ b/plugins/UserInfoEx/src/mir_db.cpp @@ -80,7 +80,7 @@ BYTE Delete(MCONTACT hContact) DWORD WhenAdded(DWORD dwUIN, LPCSTR pszProto) { DBEVENTINFO dbei = { sizeof(dbei) }; - for (HANDLE edbe = db_event_first(NULL); edbe != NULL; edbe = db_event_next(NULL, edbe)) { + for (MEVENT edbe = db_event_first(NULL); edbe != NULL; edbe = db_event_next(NULL, edbe)) { // get eventtype and compare if (!DB::Event::GetInfo(edbe, &dbei) && dbei.eventType == EVENTTYPE_ADDED) { if (!DB::Event::GetInfoWithData(edbe, &dbei)) { @@ -553,7 +553,7 @@ namespace Event { * @retval nonezero - failure **/ -bool GetInfo(HANDLE hEvent, DBEVENTINFO *dbei) +bool GetInfo(MEVENT hEvent, DBEVENTINFO *dbei) { dbei->cbSize = sizeof(DBEVENTINFO); dbei->cbBlob = 0; @@ -571,7 +571,7 @@ bool GetInfo(HANDLE hEvent, DBEVENTINFO *dbei) * @retval 1 - failure **/ -bool GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei) +bool GetInfoWithData(MEVENT hEvent, DBEVENTINFO *dbei) { dbei->cbSize = sizeof(DBEVENTINFO); if (!dbei->cbBlob) { @@ -601,7 +601,7 @@ bool GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei) * @retval timestamp **/ -DWORD TimeOf(HANDLE hEvent) +DWORD TimeOf(MEVENT hEvent) { DBEVENTINFO dbei; if (!GetInfo(hEvent, &dbei)) @@ -648,7 +648,7 @@ static FORCEINLINE bool IsEqual(const DBEVENTINFO *d1, const DBEVENTINFO *d2, bo * **/ -bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei) +bool Exists(MCONTACT hContact, MEVENT& hDbExistingEvent, DBEVENTINFO *dbei) { bool result = false; DBEVENTINFO edbei; @@ -670,7 +670,7 @@ bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei) } } } - HANDLE edbe = db_event_last(hContact); + MEVENT edbe = db_event_last(hContact); if (edbe == hDbExistingEvent) return FALSE; @@ -678,8 +678,8 @@ bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei) } } if (hDbExistingEvent) { - HANDLE sdbe = hDbExistingEvent; - for (HANDLE edbe = sdbe; edbe && !GetInfo(edbe, &edbei) && (dbei->timestamp <= edbei.timestamp); edbe = db_event_prev(hContact, edbe)) { + MEVENT sdbe = hDbExistingEvent; + for (MEVENT edbe = sdbe; edbe && !GetInfo(edbe, &edbei) && (dbei->timestamp <= edbei.timestamp); edbe = db_event_prev(hContact, edbe)) { hDbExistingEvent = edbe; //compare without data (faster) if ( result = IsEqual(dbei, &edbei, false)) { @@ -695,7 +695,7 @@ bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei) } /*end for*/ if (!result) { - for (HANDLE edbe = db_event_next(hContact, sdbe); edbe && !GetInfo(edbe, &edbei) && (dbei->timestamp >= edbei.timestamp); edbe = db_event_next(hContact, edbe)) { + for (MEVENT edbe = db_event_next(hContact, sdbe); edbe && !GetInfo(edbe, &edbei) && (dbei->timestamp >= edbei.timestamp); edbe = db_event_next(hContact, edbe)) { hDbExistingEvent = edbe; //compare without data (faster) if (result = IsEqual(dbei, &edbei, false)) { diff --git a/plugins/UserInfoEx/src/mir_db.h b/plugins/UserInfoEx/src/mir_db.h index a11d01dca1..adb8ef8927 100644 --- a/plugins/UserInfoEx/src/mir_db.h +++ b/plugins/UserInfoEx/src/mir_db.h @@ -110,10 +110,10 @@ namespace Variant { namespace Event { HANDLE FindLast(MCONTACT hContact); - bool GetInfo(HANDLE hEvent, DBEVENTINFO *dbei); - bool GetInfoWithData(HANDLE hEvent, DBEVENTINFO *dbei); - DWORD GetTime(HANDLE hEvent); - bool Exists(MCONTACT hContact, HANDLE& hDbExistingEvent, DBEVENTINFO *dbei); + bool GetInfo(MEVENT hEvent, DBEVENTINFO *dbei); + bool GetInfoWithData(MEVENT hEvent, DBEVENTINFO *dbei); + DWORD GetTime(MEVENT hEvent); + bool Exists(MCONTACT hContact, MEVENT& hDbExistingEvent, DBEVENTINFO *dbei); } /* namespace Events */ /** -- cgit v1.2.3