From cbfb5c91aeefbd60007ce6ac4942ae45eb07b37b Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 13 Nov 2014 19:00:19 +0000 Subject: minor fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@10982 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewsAggregator/Src/CheckFeed.cpp | 14 +++++++------- plugins/NewsAggregator/Src/Update.cpp | 4 ++-- plugins/NewsAggregator/Src/Utils.cpp | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'plugins/NewsAggregator/Src') diff --git a/plugins/NewsAggregator/Src/CheckFeed.cpp b/plugins/NewsAggregator/Src/CheckFeed.cpp index 723c380a45..deeb313f48 100644 --- a/plugins/NewsAggregator/Src/CheckFeed.cpp +++ b/plugins/NewsAggregator/Src/CheckFeed.cpp @@ -127,7 +127,7 @@ static void XmlToMsg(MCONTACT hContact, CMString &title, CMString &link, CMStrin bool MesExist = false; ptrA pszTemp(mir_utf8encodeT(message)); - DWORD cbMemoLen = 10000, cbOrigLen = lstrlenA(pszTemp); + DWORD cbMemoLen = 10000, cbOrigLen = (DWORD)strlen(pszTemp); BYTE *pbBuffer = (BYTE*)mir_alloc(cbMemoLen); for (HANDLE hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) { olddbei.cbBlob = db_event_getBlobSize(hDbEvent); @@ -137,7 +137,7 @@ static void XmlToMsg(MCONTACT hContact, CMString &title, CMString &link, CMStrin db_event_get(hDbEvent, &olddbei); // there's no need to look for the elder events - if (olddbei.timestamp < stamp) + if (olddbei.timestamp < (DWORD)stamp) break; if (strlen((char*)olddbei.pBlob) == cbOrigLen && !lstrcmpA((char*)olddbei.pBlob, pszTemp)) { @@ -287,9 +287,9 @@ void CheckCurrentFeed(MCONTACT hContact) TCHAR *lastupdtime = (TCHAR *)xi.getText(child); time_t stamp = DateToUnixTime(lastupdtime, 0); double deltaupd = difftime(time(NULL), stamp); - double deltacheck = difftime(time(NULL), db_get_dw(hContact, MODULE, "LastCheck", 0)); + double deltacheck = difftime(time(NULL), (time_t)db_get_dw(hContact, MODULE, "LastCheck", 0)); if (deltaupd - deltacheck >= 0) { - db_set_dw(hContact, MODULE, "LastCheck", time(NULL)); + db_set_dw(hContact, MODULE, "LastCheck", (DWORD)time(NULL)); xi.destroyNode(hXml); return; } @@ -413,9 +413,9 @@ void CheckCurrentFeed(MCONTACT hContact) TCHAR *lastupdtime = (TCHAR *)szChildText; time_t stamp = DateToUnixTime(lastupdtime, 1); double deltaupd = difftime(time(NULL), stamp); - double deltacheck = difftime(time(NULL), db_get_dw(hContact, MODULE, "LastCheck", 0)); + double deltacheck = difftime(time(NULL), (time_t)db_get_dw(hContact, MODULE, "LastCheck", 0)); if (deltaupd - deltacheck >= 0) { - db_set_dw(hContact, MODULE, "LastCheck", time(NULL)); + db_set_dw(hContact, MODULE, "LastCheck", (DWORD)time(NULL)); xi.destroyNode(hXml); return; } @@ -488,7 +488,7 @@ void CheckCurrentFeed(MCONTACT hContact) xi.destroyNode(hXml); } } - db_set_dw(hContact, MODULE, "LastCheck", time(NULL)); + db_set_dw(hContact, MODULE, "LastCheck", (DWORD)time(NULL)); } void CheckCurrentFeedAvatar(MCONTACT hContact) diff --git a/plugins/NewsAggregator/Src/Update.cpp b/plugins/NewsAggregator/Src/Update.cpp index 36bf7d281f..8578f8209f 100644 --- a/plugins/NewsAggregator/Src/Update.cpp +++ b/plugins/NewsAggregator/Src/Update.cpp @@ -32,7 +32,7 @@ void CALLBACK timerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) BOOL HaveUpdates = FALSE; for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) { if (db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME)) { - double diff = difftime(time(NULL), db_get_dw(hContact, MODULE, "LastCheck", 0)); + double diff = difftime(time(NULL), (time_t)db_get_dw(hContact, MODULE, "LastCheck", 0)); if (db_get_b(NULL, MODULE, "AutoUpdate", 1) != 0 && diff >= db_get_dw(hContact, MODULE, "UpdateTime", DEFAULT_UPDATE_TIME) * 60) { UpdateListAdd(hContact); HaveUpdates = TRUE; @@ -126,7 +126,7 @@ void UpdateThreadProc(void *AvatarCheck) // update news by getting the first station from the queue until the queue is empty while (UpdateListHead != NULL && !Miranda_Terminated()) { - if ((BOOL)AvatarCheck) + if (AvatarCheck != NULL) CheckCurrentFeedAvatar(UpdateGetFirst()); else CheckCurrentFeed(UpdateGetFirst()); diff --git a/plugins/NewsAggregator/Src/Utils.cpp b/plugins/NewsAggregator/Src/Utils.cpp index 68b09039d0..fa2f14fac3 100644 --- a/plugins/NewsAggregator/Src/Utils.cpp +++ b/plugins/NewsAggregator/Src/Utils.cpp @@ -46,7 +46,7 @@ void NetlibUnInit() static void arrayToHex(BYTE *data, size_t datasz, char *res) { char *resptr = res; - for (unsigned i = 0; i < datasz ; i++) { + for (unsigned i = 0; i < datasz; i++) { const BYTE ch = data[i]; const char ch0 = (char)(ch >> 4); -- cgit v1.2.3