summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-06-12 10:57:29 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-06-12 10:57:29 +0000
commitb385ab819019ec29cd44e9c9e6ae8be333298ef2 (patch)
tree84752003df7ec122d2e6e50cd651acd05a771ea4
parentf99f0228cbfc908812ebbeec6415818dd5650010 (diff)
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@16950 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Clist_modern/src/modern_aniavatars.cpp8
-rw-r--r--plugins/Sessions/Src/Main.cpp11
-rw-r--r--src/mir_app/src/netlibsock.cpp9
3 files changed, 12 insertions, 16 deletions
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp
index c6d731ae1f..fe7a2fd8e6 100644
--- a/plugins/Clist_modern/src/modern_aniavatars.cpp
+++ b/plugins/Clist_modern/src/modern_aniavatars.cpp
@@ -289,7 +289,7 @@ static void _AniAva_RemoveAniAvaDC()
static void _AniAva_RealRemoveAvatar(DWORD UniqueID)
{
for (int j = 0; j < s_AniAvatarList.getCount(); j++) {
- ANIAVA_INFO *aai = (ANIAVA_INFO *)s_AniAvatarList[j];
+ ANIAVA_INFO *aai = s_AniAvatarList[j];
if (aai->dwAvatarUniqId == UniqueID) {
aai->nRefCount--;
if (aai->nRefCount == 0) {
@@ -300,7 +300,7 @@ static void _AniAva_RealRemoveAvatar(DWORD UniqueID)
_AniAva_ReduceAvatarImages(aai->nStripTop, aai->FrameSize.cx*aai->nFrameCount, FALSE);
for (int k = 0; k < s_AniAvatarList.getCount(); k++) {
if (k != j) {
- ANIAVA_INFO *taai = (ANIAVA_INFO *)s_AniAvatarList[k];
+ ANIAVA_INFO *taai = s_AniAvatarList[k];
if (taai->nStripTop>aai->nStripTop)
taai->nStripTop -= aai->FrameSize.cx*aai->nFrameCount;
}
@@ -311,7 +311,7 @@ static void _AniAva_RealRemoveAvatar(DWORD UniqueID)
int newHeight = 0;
for (int i = 0; i < s_AniAvatarList.getCount(); i++)
if (i != j)
- newHeight = max(newHeight, ((ANIAVA_INFO *)s_AniAvatarList[i])->FrameSize.cy);
+ newHeight = max(newHeight, s_AniAvatarList[i]->FrameSize.cy);
HDC hNewDC = CreateCompatibleDC(NULL);
HBITMAP hNewBmp = ske_CreateDIB32(newWidth, newHeight);
@@ -397,7 +397,7 @@ static int _AniAva_LoadAvatarFromImage(TCHAR * szFileName, int width, int height
GdiFlush();
_AniAva_ResumePainting();
}
- else paai = (ANIAVA_INFO*)s_AniAvatarList[idx];
+ else paai = s_AniAvatarList[idx];
if (paai == NULL)
return 0;
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index fd71716171..f691a86397 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -122,12 +122,10 @@ INT_PTR CALLBACK SaveSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hdlg);
- {
- LoadSessionToCombobox(hdlg, 1, 5, "UserSessionDsc", 0);
+ LoadSessionToCombobox(hdlg, 1, 5, "UserSessionDsc", 0);
- LoadPosition(hdlg, "SaveDlg");
- ShowWindow(hdlg, SW_SHOW);
- }
+ LoadPosition(hdlg, "SaveDlg");
+ ShowWindow(hdlg, SW_SHOW);
break;
case WM_CLOSE:
@@ -397,13 +395,12 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM)
INT_PTR CloseCurrentSession(WPARAM, LPARAM)
{
HWND hWnd;
- int i = 0;
MessageWindowInputData mwid;
MessageWindowData mwd;
while (session_list[0] != 0) {
mwid.cbSize = sizeof(MessageWindowInputData);
- mwid.hContact = session_list[i];
+ mwid.hContact = session_list[0];
mwid.uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
mwd.cbSize = sizeof(MessageWindowData);
diff --git a/src/mir_app/src/netlibsock.cpp b/src/mir_app/src/netlibsock.cpp
index 58a0857d12..9bef238770 100644
--- a/src/mir_app/src/netlibsock.cpp
+++ b/src/mir_app/src/netlibsock.cpp
@@ -112,7 +112,7 @@ static int ConnectionListToSocketList(HANDLE *hConns, fd_set *fd, int& pending)
return 0;
}
FD_SET(nlcCheck->s, fd);
- if (sslApi.pending(nlcCheck->hSsl))
+ if (!nlcCheck->foreBuf.isEmpty() || sslApi.pending(nlcCheck->hSsl))
pending++;
}
return 1;
@@ -126,10 +126,6 @@ INT_PTR NetlibSelect(WPARAM, LPARAM lParam)
return SOCKET_ERROR;
}
- TIMEVAL tv;
- tv.tv_sec = nls->dwTimeout/1000;
- tv.tv_usec = (nls->dwTimeout%1000)*1000;
-
int pending = 0;
fd_set readfd, writefd, exceptfd;
WaitForSingleObject(hConnectionHeaderMutex, INFINITE);
@@ -144,6 +140,9 @@ INT_PTR NetlibSelect(WPARAM, LPARAM lParam)
if (pending)
return 1;
+ TIMEVAL tv;
+ tv.tv_sec = nls->dwTimeout / 1000;
+ tv.tv_usec = (nls->dwTimeout % 1000) * 1000;
return select(0, &readfd, &writefd, &exceptfd, nls->dwTimeout == INFINITE ? NULL : &tv);
}