From b93e076795f7998aef8a63f7602998cdc6632a80 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 11 Feb 2013 12:15:06 +0000 Subject: core: copyright update to year 2013 git-svn-id: http://svn.miranda-ng.org/main/trunk@3549 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/addcontact/addcontact.cpp | 7 +- src/modules/button/button.cpp | 9 +- src/modules/clist/Docking.cpp | 39 ++++---- src/modules/clist/clc.cpp | 15 +-- src/modules/clist/clc.h | 2 +- src/modules/clist/clcfiledrop.cpp | 11 ++- src/modules/clist/clcidents.cpp | 13 +-- src/modules/clist/clcitems.cpp | 13 +-- src/modules/clist/clcmsgs.cpp | 5 +- src/modules/clist/clcutils.cpp | 9 +- src/modules/clist/clistcore.cpp | 2 +- src/modules/clist/clistevents.cpp | 25 ++--- src/modules/clist/clistmenus.cpp | 5 +- src/modules/clist/clistmod.cpp | 19 ++-- src/modules/clist/clistsettings.cpp | 19 ++-- src/modules/clist/clisttray.cpp | 31 ++++--- src/modules/clist/clui.cpp | 35 +++---- src/modules/clist/cluiservices.cpp | 5 +- src/modules/clist/contact.cpp | 27 +++--- src/modules/clist/contacts.cpp | 25 +++-- src/modules/clist/genmenu.cpp | 11 ++- src/modules/clist/genmenu.h | 3 +- src/modules/clist/genmenuopt.cpp | 7 +- src/modules/clist/groups.cpp | 15 +-- src/modules/clist/keyboard.cpp | 5 +- src/modules/clist/movetogroup.cpp | 11 ++- src/modules/clist/protocolorder.cpp | 8 +- src/modules/crypt/encrypt.cpp | 2 +- src/modules/database/database.cpp | 15 +-- src/modules/database/database.h | 2 +- src/modules/database/dbini.cpp | 2 +- src/modules/database/dbintf.cpp | 2 +- src/modules/database/dblists.cpp | 2 +- src/modules/database/dblists.h | 2 +- src/modules/database/dbutils.cpp | 2 +- src/modules/database/mdatabasecache.cpp | 4 +- src/modules/database/profilemanager.cpp | 2 +- src/modules/database/profilemanager.h | 2 +- src/modules/extraicons/BaseExtraIcon.cpp | 36 ++++---- src/modules/extraicons/CallbackExtraIcon.cpp | 36 ++++---- src/modules/extraicons/DefaultExtraIcons.cpp | 34 +++---- src/modules/extraicons/ExtraIcon.cpp | 36 ++++---- src/modules/extraicons/ExtraIcon.h | 36 ++++---- src/modules/extraicons/ExtraIconGroup.cpp | 36 ++++---- src/modules/extraicons/IcolibExtraIcon.cpp | 36 ++++---- src/modules/extraicons/extraicons.cpp | 36 ++++---- src/modules/extraicons/extraicons.h | 36 ++++---- src/modules/extraicons/options_ei.cpp | 36 ++++---- src/modules/extraicons/usedIcons.cpp | 36 ++++---- src/modules/extraicons/usedIcons.h | 36 ++++---- src/modules/findadd/findadd.cpp | 15 +-- src/modules/findadd/findadd.h | 16 ++-- src/modules/findadd/searchresults.cpp | 3 +- src/modules/fonts/FontOptions.cpp | 2 +- src/modules/fonts/FontService.cpp | 2 +- src/modules/fonts/FontService.h | 2 +- src/modules/fonts/services.cpp | 2 +- src/modules/icolib/IcoLib.h | 2 +- src/modules/icolib/extracticon.cpp | 13 +-- src/modules/icolib/skin2icons.cpp | 2 +- src/modules/icolib/skin2opts.cpp | 2 +- src/modules/ignore/ignore.cpp | 3 +- src/modules/json/JSONChildren.cpp | 2 +- src/modules/json/JSONDebug.cpp | 2 +- src/modules/json/JSONIterators.cpp | 2 +- src/modules/json/JSONMemory.cpp | 2 +- src/modules/json/JSONNode.cpp | 2 +- src/modules/json/JSONNode_Mutex.cpp | 2 +- src/modules/json/JSONWorker.cpp | 2 +- src/modules/json/JSONWriter.cpp | 2 +- src/modules/json/JSON_Base64.cpp | 2 +- src/modules/json/internalJSONNode.cpp | 2 +- src/modules/json/json.cpp | 2 +- src/modules/json/libJSON.cpp | 2 +- src/modules/langpack/lpservices.cpp | 3 +- src/modules/netlib/netlib.cpp | 13 +-- src/modules/netlib/netlib.h | 17 ++-- src/modules/netlib/netlibautoproxy.cpp | 42 +++++---- src/modules/netlib/netlibbind.cpp | 11 ++- src/modules/netlib/netlibhttp.cpp | 89 +++++++++--------- src/modules/netlib/netlibhttpproxy.cpp | 27 +++--- src/modules/netlib/netliblog.cpp | 2 +- src/modules/netlib/netlibopenconn.cpp | 41 +++++---- src/modules/netlib/netlibopts.cpp | 53 +++++------ src/modules/netlib/netlibpktrecver.cpp | 5 +- src/modules/netlib/netlibsecurity.cpp | 51 +++++----- src/modules/netlib/netlibsock.cpp | 25 ++--- src/modules/netlib/netlibssl.cpp | 2 +- src/modules/netlib/netlibupnp.cpp | 57 ++++++------ src/modules/options/descbutton.cpp | 21 ++--- src/modules/options/filter.cpp | 2 +- src/modules/options/filter.h | 2 +- src/modules/options/headerbar.cpp | 3 +- src/modules/options/iconheader.cpp | 3 +- src/modules/options/options.cpp | 133 ++++++++++++++------------- src/modules/plugins/dll_sniffer.cpp | 11 ++- src/modules/plugins/newplugins.cpp | 21 +++-- src/modules/plugins/pluginopts.cpp | 13 +-- src/modules/protocols/protoaccs.cpp | 2 +- src/modules/protocols/protochains.cpp | 2 +- src/modules/protocols/protocols.cpp | 3 +- src/modules/protocols/protodir.cpp | 2 +- src/modules/protocols/protoint.cpp | 2 +- src/modules/protocols/protoopts.cpp | 2 +- src/modules/skin/hotkey_opts.cpp | 2 +- src/modules/skin/hotkeys.cpp | 2 +- src/modules/skin/skin.h | 2 +- src/modules/skin/skinicons.cpp | 2 +- src/modules/skin/sounds.cpp | 2 +- src/modules/utils/bmpfilter.cpp | 7 +- src/modules/utils/colourpicker.cpp | 7 +- src/modules/utils/hyperlink.cpp | 15 +-- src/modules/utils/imgconv.cpp | 7 +- src/modules/utils/openurl.cpp | 7 +- src/modules/utils/path.cpp | 19 ++-- src/modules/utils/resizer.cpp | 7 +- src/modules/utils/timeutils.cpp | 24 ++--- src/modules/utils/timezones.cpp | 10 +- src/modules/utils/utils.cpp | 15 +-- src/modules/utils/windowlist.cpp | 5 +- src/modules/visibility/visibility.cpp | 9 +- src/modules/xml/xmlApi.cpp | 2 +- 122 files changed, 909 insertions(+), 826 deletions(-) (limited to 'src/modules') diff --git a/src/modules/addcontact/addcontact.cpp b/src/modules/addcontact/addcontact.cpp index 5516611297..89d0b2d15a 100644 --- a/src/modules/addcontact/addcontact.cpp +++ b/src/modules/addcontact/addcontact.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) @@ -69,7 +70,7 @@ INT_PTR CALLBACK AddContactDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lp } } if ( !isSet) { - szName = (acs->handleType == HANDLE_EVENT) ? (tmpStr = mir_a2t(szUin)) : + szName = (acs->handleType == HANDLE_EVENT) ? (tmpStr = mir_a2t(szUin)) : (acs->psr->id ? acs->psr->id : acs->psr->nick); } } diff --git a/src/modules/button/button.cpp b/src/modules/button/button.cpp index d1fec36365..577f4c5e4f 100644 --- a/src/modules/button/button.cpp +++ b/src/modules/button/button.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include @@ -66,7 +67,7 @@ static void LoadTheme(MButtonCtrl *ctl) } } -static void SetHwndPropInt(MButtonCtrl* bct, DWORD idObject, DWORD idChild, MSAAPROPID idProp, int val) +static void SetHwndPropInt(MButtonCtrl* bct, DWORD idObject, DWORD idChild, MSAAPROPID idProp, int val) { if (bct->pAccPropServices == NULL) return; VARIANT var; @@ -496,7 +497,7 @@ static LRESULT CALLBACK MButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR ti.lpszText = Langpack_PcharToTchar((char*)wParam); if (bct->pAccPropServices) { wchar_t *tmpstr = mir_t2u(ti.lpszText); - bct->pAccPropServices->SetHwndPropStr(bct->hwnd, OBJID_CLIENT, + bct->pAccPropServices->SetHwndPropStr(bct->hwnd, OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_DESCRIPTION, tmpstr); mir_free(tmpstr); } diff --git a/src/modules/clist/Docking.cpp b/src/modules/clist/Docking.cpp index d2695ef6b6..40e147ee1a 100644 --- a/src/modules/clist/Docking.cpp +++ b/src/modules/clist/Docking.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" @@ -35,13 +36,13 @@ static POINT dockPos; static void Docking_GetMonitorRectFromPoint(LPPOINT pt, LPRECT rc) { - if (MyMonitorFromPoint) + if (MyMonitorFromPoint) { MONITORINFO monitorInfo; HMONITOR hMonitor = MyMonitorFromPoint(*pt, MONITOR_DEFAULTTONEAREST); // always returns a valid value monitorInfo.cbSize = sizeof(monitorInfo); - if (MyGetMonitorInfo(hMonitor, &monitorInfo)) + if (MyGetMonitorInfo(hMonitor, &monitorInfo)) { *rc = monitorInfo.rcMonitor; return; @@ -57,9 +58,9 @@ static void Docking_GetMonitorRectFromPoint(LPPOINT pt, LPRECT rc) static void Docking_RectToDock(LPRECT rc) { - rc->right += dockPos.x - rc->left; + rc->right += dockPos.x - rc->left; rc->left = dockPos.x; - rc->bottom += dockPos.y - rc->top; + rc->bottom += dockPos.y - rc->top; rc->top = dockPos.y; } @@ -91,7 +92,7 @@ static void Docking_AdjustPosition(HWND hwnd, LPRECT rcDisplay, LPRECT rc, bool rc->top = rcDisplay->top; rc->bottom = rcDisplay->bottom; - if (docked == DOCKED_LEFT) + if (docked == DOCKED_LEFT) { rc->right = rcDisplay->left + (rc->right - rc->left); rc->left = rcDisplay->left; @@ -108,7 +109,7 @@ static void Docking_AdjustPosition(HWND hwnd, LPRECT rcDisplay, LPRECT rc, bool else rc->left = rc->right - cx; - if ( !query) + if ( !query) { Docking_PosCommand(hwnd, rc, false); dockPos = *(LPPOINT)rc; @@ -116,7 +117,7 @@ static void Docking_AdjustPosition(HWND hwnd, LPRECT rcDisplay, LPRECT rc, bool if (move) { - MoveWindow(hwnd, rc->left, rc->top, rc->right - rc->left, + MoveWindow(hwnd, rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, TRUE); } } @@ -145,7 +146,7 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) static int draggingTitle; MSG *msg = (MSG *) wParam; - if (msg->message == WM_DESTROY) + if (msg->message == WM_DESTROY) { if (docked) { @@ -168,7 +169,7 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) { case WM_CREATE: draggingTitle = 0; - docked = db_get_b(NULL, "CLUI", "DockToSides", 1) ? + docked = db_get_b(NULL, "CLUI", "DockToSides", 1) ? (char) db_get_b(NULL, "CList", "Docked", 0) : 0; dockPos.x = (int)db_get_dw(NULL, "CList", "DockX", 0); dockPos.y = (int)db_get_dw(NULL, "CList", "DockY", 0); @@ -282,7 +283,7 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) ptCursor.y = GET_Y_LPARAM(pos); Docking_GetMonitorRectFromPoint(&ptCursor, &rcMonitor); - if (((ptCursor.x < rcMonitor.left + EDGESENSITIVITY) || + if (((ptCursor.x < rcMonitor.left + EDGESENSITIVITY) || (ptCursor.x >= rcMonitor.right - EDGESENSITIVITY)) && db_get_b(NULL, "CLUI", "DockToSides", 1)) { @@ -340,18 +341,18 @@ int fnDocking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) RECT rc; POINT pt; GetClientRect(msg->hwnd, &rc); - if ((docked == DOCKED_LEFT && (short) LOWORD(msg->lParam) > rc.right) || - (docked == DOCKED_RIGHT && (short) LOWORD(msg->lParam) < 0)) + if ((docked == DOCKED_LEFT && (short) LOWORD(msg->lParam) > rc.right) || + (docked == DOCKED_RIGHT && (short) LOWORD(msg->lParam) < 0)) { ReleaseCapture(); draggingTitle = 0; docked = 0; GetCursorPos(&pt); PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y)); - SetWindowPos(msg->hwnd, 0, pt.x - rc.right / 2, - pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, - db_get_dw(NULL, "CList", "Width", 0), - db_get_dw(NULL, "CList", "Height", 0), + SetWindowPos(msg->hwnd, 0, pt.x - rc.right / 2, + pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, + db_get_dw(NULL, "CList", "Width", 0), + db_get_dw(NULL, "CList", "Height", 0), SWP_NOZORDER); Docking_Command(msg->hwnd, ABM_REMOVE); } diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp index b3af146add..f914547fda 100644 --- a/src/modules/clist/clc.cpp +++ b/src/modules/clist/clc.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" @@ -245,7 +246,7 @@ void UnloadClcModule() FreeDisplayNameCache(); UninitCustomMenus(); - UnitGenMenu(); + UnitGenMenu(); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -520,7 +521,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, // this means an offline msg is flashing, so the contact should be shown DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE); shouldShow = (style & CLS_SHOWHIDDEN || !db_get_b((HANDLE)wParam, "CList", "Hidden", 0)) - && ( !cli.pfnIsHiddenMode(dat, status) || CallService(MS_CLIST_GETCONTACTICON, wParam, 0) != lParam); + && ( !cli.pfnIsHiddenMode(dat, status) || CallService(MS_CLIST_GETCONTACTICON, wParam, 0) != lParam); contact = NULL; group = NULL; @@ -589,7 +590,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, case INTM_NOTONLISTCHANGED: if ( !cli.pfnFindItem(hwnd, dat, (HANDLE)wParam, &contact, NULL, NULL)) break; - + if (contact->type == CLCIT_CONTACT) { DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING *) lParam; if (dbcws->value.type == DBVT_DELETED || dbcws->value.bVal == 0) @@ -661,7 +662,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, { PAINTSTRUCT ps; HDC hdc = BeginPaint(hwnd, &ps); - /* we get so many cli.pfnInvalidateRect()'s that there is no point painting, + /* we get so many cli.pfnInvalidateRect()'s that there is no point painting, Windows in theory shouldn't queue up WM_PAINTs in this case but it does so we'll just ignore them */ if (IsWindowVisible(hwnd)) @@ -1303,7 +1304,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, case POPUP_GROUPHIDEOFFLINE: if (contact->type != CLCIT_GROUP) break; - CallService(MS_CLIST_GROUPSETFLAGS, contact->groupId, + CallService(MS_CLIST_GROUPSETFLAGS, contact->groupId, MAKELPARAM(contact->group->hideOffline ? 0 : GROUPF_HIDEOFFLINE, GROUPF_HIDEOFFLINE)); break; } diff --git a/src/modules/clist/clc.h b/src/modules/clist/clc.h index 3604775adb..1e259be92d 100644 --- a/src/modules/clist/clc.h +++ b/src/modules/clist/clc.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/clist/clcfiledrop.cpp b/src/modules/clist/clcfiledrop.cpp index c33bc23334..05ef5b36a7 100644 --- a/src/modules/clist/clcfiledrop.cpp +++ b/src/modules/clist/clcfiledrop.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" #include @@ -29,7 +30,7 @@ struct CDropTarget : IDropTarget LONG refCount; IDropTargetHelper *pDropTargetHelper; - ULONG STDMETHODCALLTYPE AddRef(void); + ULONG STDMETHODCALLTYPE AddRef(void); ULONG STDMETHODCALLTYPE Release(void); HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void ** ppvObject); @@ -253,7 +254,7 @@ static VOID CALLBACK CreateDropTargetHelperTimerProc(HWND hwnd, UINT, UINT_PTR i { KillTimer(hwnd, idEvent); //This is a ludicrously slow function (~200ms) so we delay load it a bit. - if (S_OK != CoCreateInstance(CLSID_DragDropHelper, NULL, CLSCTX_INPROC_SERVER, + if (S_OK != CoCreateInstance(CLSID_DragDropHelper, NULL, CLSCTX_INPROC_SERVER, IID_IDropTargetHelper, (LPVOID*)&dropTarget.pDropTargetHelper)) dropTarget.pDropTargetHelper = NULL; } diff --git a/src/modules/clist/clcidents.cpp b/src/modules/clist/clcidents.cpp index 390c704325..a65e3a6d6f 100644 --- a/src/modules/clist/clcidents.cpp +++ b/src/modules/clist/clcidents.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" @@ -98,7 +99,7 @@ int fnFindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contac && ((unsigned) hItem & ~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) || (IsHContactContact(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->hContact == hItem) || (IsHContactInfo(hItem) - && group->cl.items[group->scanIndex]->type == CLCIT_INFO + && group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->hContact == (HANDLE) ((UINT_PTR)hItem & ~HCONTACT_ISINFO))) { if (isVisible) { @@ -144,9 +145,9 @@ int fnGetRowByIndex(struct ClcData *dat, int testindex, ClcContact **contact, Cl int index = 0; ClcGroup *group = &dat->list; - if (testindex<0) + if (testindex<0) return (-1); - + group->scanIndex = 0; for (;;) { if (group->scanIndex == group->cl.count) { diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp index 4619ba6c4b..d4b8e83a4e 100644 --- a/src/modules/clist/clcitems.cpp +++ b/src/modules/clist/clcitems.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" @@ -332,7 +333,7 @@ void fnDeleteItemFromTree(HWND hwnd, HANDLE hItem) break; if (group->cl.items[i]->type == CLCIT_GROUP) { int len = lstrlen(group->cl.items[i]->szText); - if ( !_tcsncmp(group->cl.items[i]->szText, dbv.ptszVal + nameOffset, len) && + if ( !_tcsncmp(group->cl.items[i]->szText, dbv.ptszVal + nameOffset, len) && (dbv.ptszVal[nameOffset + len] == '\\' || dbv.ptszVal[nameOffset + len] == '\0')) { group->totalMembers--; if (dbv.ptszVal[nameOffset + len] == '\0') @@ -383,12 +384,12 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat) if (group != NULL) { group->totalMembers++; - + if (dat->filterSearch && dat->szQuickSearch[0] != '\0') { TCHAR *name = cli.pfnGetContactDisplayName(hContact, GCDNF_TCHAR); TCHAR *lowered_name = CharLowerW(NEWTSTR_ALLOCA(name)); TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch)); - + if (_tcsstr(lowered_name, lowered_search)) cli.pfnAddContactToGroup(dat, group, hContact); } else if ( !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) { diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp index b772f3bad0..ccde719557 100644 --- a/src/modules/clist/clcmsgs.cpp +++ b/src/modules/clist/clcmsgs.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index f5ef96f917..fb5053bd00 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" @@ -85,7 +86,7 @@ int fnHitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact * POINT pt1 = pt; ScreenToClient(hwndParent, &pt1); - HWND h = ChildWindowFromPointEx(hwndParent ? hwndParent : GetDesktopWindow(), + HWND h = ChildWindowFromPointEx(hwndParent ? hwndParent : GetDesktopWindow(), pt1, CWP_SKIPINVISIBLE | CWP_SKIPTRANSPARENT); if (h != hwndTemp) { @@ -416,7 +417,7 @@ void fnEndRename(HWND, struct ClcData *dat, int save) if (contact->type == CLCIT_GROUP) { if (contact->group->parent && contact->group->parent->parent) { TCHAR szFullName[256]; - mir_sntprintf(szFullName, SIZEOF(szFullName), _T("%s\\%s"), + mir_sntprintf(szFullName, SIZEOF(szFullName), _T("%s\\%s"), cli.pfnGetGroupName(contact->group->parent->groupId, NULL), text); cli.pfnRenameGroup(contact->groupId, szFullName); } diff --git a/src/modules/clist/clistcore.cpp b/src/modules/clist/clistcore.cpp index 19fb928247..d69a1a77db 100644 --- a/src/modules/clist/clistcore.cpp +++ b/src/modules/clist/clistcore.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp index 253381b4a9..c7a58737a1 100644 --- a/src/modules/clist/clistevents.cpp +++ b/src/modules/clist/clistevents.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" @@ -90,14 +91,14 @@ static void ShowEventsInTray() char ** pTrayProtos; char nTrayProtoCnt; int nTrayCnt = cli.trayIconCount; - if ( !cli.events.count || !nTrayCnt) return; - if (cli.events.count == 1 || nTrayCnt == 1) + if ( !cli.events.count || !nTrayCnt) return; + if (cli.events.count == 1 || nTrayCnt == 1) { ShowOneEventInTray(0); //for only one icon in tray show topmost event return; } - // in case if we have several icons in tray and several events with different protocols + // in case if we have several icons in tray and several events with different protocols // lets use several icon to show events from protocols in different icons cli.pfnLockTray(); pTrayProtos = (char**)_alloca(sizeof(char*)*cli.trayIconCount); @@ -215,8 +216,8 @@ int fnRemoveEvent(HANDLE hContact, HANDLE dbEvent) // Update contact's icon szProto = GetContactProto(hContact); - cli.pfnChangeContactIcon(cli.events.items[i]->cle.hContact, - CallService(MS_CLIST_GETCONTACTICON, (WPARAM)cli.events.items[i]->cle.hContact, 1), + cli.pfnChangeContactIcon(cli.events.items[i]->cle.hContact, + CallService(MS_CLIST_GETCONTACTICON, (WPARAM)cli.events.items[i]->cle.hContact, 1), 0); // Free any memory allocated to the event @@ -229,9 +230,9 @@ int fnRemoveEvent(HANDLE hContact, HANDLE dbEvent) { if (cli.events.items[i]->cle.hContact) szEventProto = GetContactProto((cli.events.items[i]->cle.hContact)); - else if (cli.events.items[i]->cle.flags&CLEF_PROTOCOLGLOBAL) + else if (cli.events.items[i]->cle.flags&CLEF_PROTOCOLGLOBAL) szEventProto = (char *) cli.events.items[i]->cle.lpszProtocol; - else + else szEventProto = NULL; if (szEventProto && szProto && !lstrcmpA(szEventProto, szProto)) nSameProto++; @@ -303,7 +304,7 @@ int fnEventsProcessTrayDoubleClick(int index) if (szProto) { for (i=0; icle.hContact) + if (cli.events.items[i]->cle.hContact) eventProto = GetContactProto(cli.events.items[i]->cle.hContact); if ( !eventProto) eventProto = cli.events.items[i]->cle.lpszProtocol; @@ -320,7 +321,7 @@ int fnEventsProcessTrayDoubleClick(int index) if (click_in_first_icon) for (i=0; icle.hContact) + if (cli.events.items[i]->cle.hContact) eventProto = GetContactProto(cli.events.items[i]->cle.hContact); if ( !eventProto) eventProto = cli.events.items[i]->cle.lpszProtocol; @@ -335,7 +336,7 @@ int fnEventsProcessTrayDoubleClick(int index) } } } - if (i == cli.events.count) { //not found + if (i == cli.events.count) { //not found cli.pfnUnlockTray(); return 1; //continue processing to show contact list } diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index 013d13ee96..7e3521eee9 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #pragma hdrstop @@ -1095,7 +1096,7 @@ static int MenuProtoAck(WPARAM, LPARAM lParam) } else { int pos = statustopos(cli.currentStatusMenuItem); - if (pos == -1) + if (pos == -1) pos = 0; if (pos >= 0 && pos < hStatusMainMenuHandlesCnt) { diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp index 3c7f6ddc49..79fb3a7fe8 100644 --- a/src/modules/clist/clistmod.cpp +++ b/src/modules/clist/clistmod.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" @@ -140,7 +141,7 @@ static int ProtocolAck(WPARAM, LPARAM lParam) ACKDATA *ack = (ACKDATA *) lParam; if (ack->type != ACKTYPE_STATUS) return 0; - + CallService(MS_CLUI_PROTOCOLSTATUSCHANGED, ack->lParam, (LPARAM) ack->szModule); if ((int)ack->hProcess < ID_STATUS_ONLINE && ack->lParam >= ID_STATUS_ONLINE) { @@ -190,7 +191,7 @@ static INT_PTR GetContactIcon(WPARAM wParam, LPARAM) char *szProto = GetContactProto((HANDLE)wParam); HANDLE hContact = (HANDLE)wParam; - return cli.pfnIconFromStatusMode(szProto, + return cli.pfnIconFromStatusMode(szProto, szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact); } @@ -208,7 +209,7 @@ static void AddProtoIconIndex(PROTOACCOUNT* pa) static void RemoveProtoIconIndex(PROTOACCOUNT* pa) { - for (int i=0; i < protoIconIndex.getCount(); i++) + for (int i=0; i < protoIconIndex.getCount(); i++) if (strcmp(protoIconIndex[i].szProto, pa->szModuleName) == 0) { protoIconIndex.remove(i); break; @@ -237,7 +238,7 @@ static int ContactListModulesLoaded(WPARAM, LPARAM) static int ContactListAccountsChanged(WPARAM eventCode, LPARAM lParam) { - switch (eventCode) { + switch (eventCode) { case PRAC_ADDED: AddProtoIconIndex((PROTOACCOUNT*)lParam); break; @@ -364,7 +365,7 @@ int fnGetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) if (iNotCoveredDots == 0) //They're all covered! return GWVS_COVERED; - + //There are dots which are visible, but they are not as many as the ones we counted: it's partially covered. return GWVS_PARTIALLY_COVERED; } @@ -407,12 +408,12 @@ int fnShowHide(WPARAM, LPARAM) //this forces the window onto the visible screen GetWindowRect(cli.hwndContactList, &rcWindow); if (Utils_AssertInsideScreen(&rcWindow) == 1) { - MoveWindow(cli.hwndContactList, rcWindow.left, rcWindow.top, + MoveWindow(cli.hwndContactList, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, TRUE); } } else { //It needs to be hidden - if (db_get_b(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) || + if (db_get_b(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) || db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) { ShowWindow(cli.hwndContactList, SW_HIDE); db_set_b(NULL, "CList", "State", SETTING_STATE_HIDDEN); diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp index b3d1edb897..8a2188ce69 100644 --- a/src/modules/clist/clistsettings.cpp +++ b/src/modules/clist/clistsettings.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" @@ -45,7 +46,7 @@ void FreeDisplayNameCache(void) mir_free(clistCache->items[i]); } - List_Destroy(clistCache); + List_Destroy(clistCache); mir_free(clistCache); clistCache = NULL; } @@ -89,7 +90,7 @@ ClcCacheEntry* fnGetCacheEntry(HANDLE hContact) { ClcCacheEntry *p; int idx; - if ( !List_GetIndex(clistCache, &hContact, &idx)) { + if ( !List_GetIndex(clistCache, &hContact, &idx)) { if ((p = cli.pfnCreateCacheItem(hContact)) != NULL) { List_Insert(clistCache, p, idx); cli.pfnInvalidateDisplayNameCacheEntry(p); @@ -195,7 +196,7 @@ INT_PTR GetContactDisplayName(WPARAM wParam, LPARAM lParam) _ltoa(ci.dVal, retVal, 10); if (cacheEntry == NULL) return (INT_PTR)mir_strdup(retVal); - + cacheEntry->tszName = mir_a2u(retVal); return (INT_PTR)retVal; } @@ -286,9 +287,9 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) szProto = NULL; else szProto = cws->value.pszVal; - cli.pfnChangeContactIcon(hContact, - cli.pfnIconFromStatusMode(szProto, - szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", + cli.pfnChangeContactIcon(hContact, + cli.pfnIconFromStatusMode(szProto, + szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact), 0); } } diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp index 8ce5b8b861..071e667e2e 100644 --- a/src/modules/clist/clisttray.cpp +++ b/src/modules/clist/clisttray.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" @@ -288,9 +289,9 @@ int fnTrayIconInit(HWND hwnd) PROTOACCOUNT* pa = accounts[j]; if (cli.pfnGetProtocolVisibility(pa->szModuleName)) cli.pfnTrayIconAdd(hwnd, pa->szModuleName, NULL, CallProtoServiceInt(NULL,pa->szModuleName, PS_GETSTATUS, 0, 0)); - } + } } - } + } else { cli.pfnTrayIconAdd(hwnd, NULL, NULL, averageMode); @@ -303,7 +304,7 @@ int fnTrayIconInit(HWND hwnd) cli.pfnTrayIconAdd(hwnd, NULL, NULL, CallService(MS_CLIST_GETSTATUSMODE, 0, 0)); } - ulock; + ulock; return 0; } @@ -330,7 +331,7 @@ int fnTrayIconDestroy(HWND hwnd) cli.trayIcon = NULL; cli.trayIconCount = 0; - ulock; + ulock; return 0; } @@ -346,7 +347,7 @@ static VOID CALLBACK RefreshTimerProc(HWND, UINT, UINT_PTR, DWORD) { int i; if (RefreshTimerId) { - KillTimer(NULL, RefreshTimerId); + KillTimer(NULL, RefreshTimerId); RefreshTimerId = 0; } for (i=0; i < accounts.getCount(); i++) { @@ -483,7 +484,7 @@ VOID CALLBACK fnTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD) if (i) { DestroyIcon(cli.trayIcon[0].hBaseIcon); - cli.trayIcon[0].hBaseIcon = cli.pfnGetIconFromStatusMode(NULL, accounts[cycleStep]->szModuleName, + cli.trayIcon[0].hBaseIcon = cli.pfnGetIconFromStatusMode(NULL, accounts[cycleStep]->szModuleName, CallProtoServiceInt(NULL,accounts[cycleStep]->szModuleName, PS_GETSTATUS, 0, 0)); if (cli.trayIcon[0].isBase) cli.pfnTrayIconUpdate(cli.trayIcon[0].hBaseIcon, NULL, NULL, 1); @@ -539,8 +540,8 @@ void fnTrayIconUpdateBase(const char *szChangedProto) szProto = NULL; else szProto = dbv.pszVal; - changed = cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(NULL, szProto, szProto ? - CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0) : + changed = cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(NULL, szProto, szProto ? + CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0)), szProto); db_free(&dbv); } @@ -548,9 +549,9 @@ void fnTrayIconUpdateBase(const char *szChangedProto) case SETTING_TRAYICON_CYCLE: cli.cycleTimerId = SetTimer(NULL, 0, db_get_w(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cli.pfnTrayCycleTimerProc); - changed = + changed = cli.pfnTrayIconSetBaseInfo(ImageList_GetIcon - (hCListImages, cli.pfnIconFromStatusMode(szChangedProto, CallProtoServiceInt(NULL,szChangedProto, PS_GETSTATUS, 0, 0), NULL), + (hCListImages, cli.pfnIconFromStatusMode(szChangedProto, CallProtoServiceInt(NULL,szChangedProto, PS_GETSTATUS, 0, 0), NULL), ILD_NORMAL), NULL); break; @@ -741,7 +742,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) for (int j = 0; j < accounts.getCount(); j++) { int k = cli.pfnGetAccountIndexByPos(j); - if (k >= 0) + if (k >= 0) { if ( !strcmp(cli.trayIcon[i].szProto, accounts[k]->szModuleName)) { @@ -752,7 +753,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) if (cli.pfnGetProtocolVisibility(accounts[k]->szModuleName)) ++ind; - } + } } break; } @@ -821,7 +822,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam) *((LRESULT *) lParam) = 0; return TRUE; } - else if (msg->message == WM_TASKBARBUTTONCREATED) { + else if (msg->message == WM_TASKBARBUTTONCREATED) { SetTaskBarIcon(lastTaskBarIcon, NULL); *((LRESULT *) lParam) = 0; return TRUE; diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp index 8fcc0a3120..307cc0b914 100644 --- a/src/modules/clist/clui.cpp +++ b/src/modules/clist/clui.cpp @@ -1,25 +1,26 @@ /* - Miranda IM: the free IM client for Microsoft* Windows* +Miranda IM: the free IM client for Microsoft* Windows* - Copyright 2000-2010 Miranda ICQ/IM project, - all portions of this codebase are copyrighted to the people - listed in contributors.txt. +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "../database/profilemanager.h" #include "clc.h" @@ -627,7 +628,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM { LRESULT result; result = DefWindowProc(hwnd, WM_NCHITTEST, wParam, lParam); - if (result == HTSIZE || result == HTTOP || result == HTTOPLEFT || result == HTTOPRIGHT || + if (result == HTSIZE || result == HTTOP || result == HTTOPLEFT || result == HTTOPRIGHT || result == HTBOTTOM || result == HTBOTTOMRIGHT || result == HTBOTTOMLEFT) if (db_get_b(NULL, "CLUI", "AutoSize", 0)) return HTCLIENT; @@ -718,7 +719,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case SC_MINIMIZE: case SC_CLOSE: - if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) || + if ((GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) || db_get_b(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT)) { ShowWindow(hwnd, SW_HIDE); diff --git a/src/modules/clist/cluiservices.cpp b/src/modules/clist/cluiservices.cpp index 6fe9fb8b6f..ef9885de72 100644 --- a/src/modules/clist/cluiservices.cpp +++ b/src/modules/clist/cluiservices.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp index 9ecc273604..01e60c94fc 100644 --- a/src/modules/clist/contact.cpp +++ b/src/modules/clist/contact.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" @@ -32,15 +33,15 @@ int sortByProto; static const struct { int status, order; } statusModeOrder[] = { - {ID_STATUS_OFFLINE, 500}, - {ID_STATUS_ONLINE, 10}, - {ID_STATUS_AWAY, 200}, - {ID_STATUS_DND, 110}, - {ID_STATUS_NA, 450}, - {ID_STATUS_OCCUPIED, 100}, - {ID_STATUS_FREECHAT, 0}, - {ID_STATUS_INVISIBLE, 20}, - {ID_STATUS_ONTHEPHONE, 150}, + {ID_STATUS_OFFLINE, 500}, + {ID_STATUS_ONLINE, 10}, + {ID_STATUS_AWAY, 200}, + {ID_STATUS_DND, 110}, + {ID_STATUS_NA, 450}, + {ID_STATUS_OCCUPIED, 100}, + {ID_STATUS_FREECHAT, 0}, + {ID_STATUS_INVISIBLE, 20}, + {ID_STATUS_ONTHEPHONE, 150}, {ID_STATUS_OUTTOLUNCH, 425}}; static int GetContactStatus(HANDLE hContact) @@ -167,7 +168,7 @@ INT_PTR ContactChangeGroup(WPARAM wParam, LPARAM lParam) grpChg.pszNewName = cli.pfnGetGroupName(lParam, NULL); db_set_ts((HANDLE)wParam, "CList", "Group", grpChg.pszNewName); } - CallService(MS_CLUI_CONTACTADDED, wParam, + CallService(MS_CLUI_CONTACTADDED, wParam, cli.pfnIconFromStatusMode(GetContactProto((HANDLE)wParam), GetContactStatus((HANDLE)wParam), (HANDLE)wParam)); NotifyEventHooks(hGroupChangeEvent, wParam, (LPARAM)&grpChg); diff --git a/src/modules/clist/contacts.cpp b/src/modules/clist/contacts.cpp index 3382681afc..bcc2b6091a 100644 --- a/src/modules/clist/contacts.cpp +++ b/src/modules/clist/contacts.cpp @@ -1,12 +1,17 @@ /* -Miranda IM + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,15 +24,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "..\..\core\commonheaders.h" #define NAMEORDERCOUNT 8 -static TCHAR* nameOrderDescr[ NAMEORDERCOUNT ] = +static TCHAR* nameOrderDescr[ NAMEORDERCOUNT ] = { - LPGENT("My custom name (not moveable)"), - LPGENT("Nick"), - LPGENT("FirstName"), - LPGENT("E-mail"), - LPGENT("LastName"), - LPGENT("Username"), - LPGENT("FirstName LastName"), + LPGENT("My custom name (not moveable)"), + LPGENT("Nick"), + LPGENT("FirstName"), + LPGENT("E-mail"), + LPGENT("LastName"), + LPGENT("Username"), + LPGENT("FirstName LastName"), LPGENT("'(Unknown Contact)' (not moveable)") }; diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index 8f6944f837..3211ce5581 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "genmenu.h" @@ -349,7 +350,7 @@ int MO_ModifyMenuItem(PMO_IntMenuItem menuHandle, PMO_MenuItem pmi) } //wparam MenuItemHandle -//return ownerdata useful to free ownerdata before delete menu item, +//return ownerdata useful to free ownerdata before delete menu item, //NULL on error. INT_PTR MO_MenuItemGetOwnerData(WPARAM wParam, LPARAM) { @@ -510,7 +511,7 @@ INT_PTR MO_CreateNewMenuObject(WPARAM, LPARAM lParam) p->Name = mir_strdup(pmp->name); p->CheckService = mir_strdup(pmp->CheckService); p->ExecService = mir_strdup(pmp->ExecService); - p->m_hMenuIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), + p->m_hMenuIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16) | ILC_MASK, 15, 100); g_menus.insert(p); return p->id; @@ -1054,7 +1055,7 @@ int OnIconLibChanges(WPARAM, LPARAM) static int MO_RegisterIcon(PMO_IntMenuItem pmi, void*) { - TCHAR *uname = (pmi->UniqName) ? mir_a2t(pmi->UniqName) : mir_tstrdup(pmi->CustomName), + TCHAR *uname = (pmi->UniqName) ? mir_a2t(pmi->UniqName) : mir_tstrdup(pmi->CustomName), *descr = GetMenuItemText(pmi); if ( !uname && !descr) diff --git a/src/modules/clist/genmenu.h b/src/modules/clist/genmenu.h index 06bb467d40..c3d14b0bbd 100644 --- a/src/modules/clist/genmenu.h +++ b/src/modules/clist/genmenu.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #ifndef GENMENU_H #define GENMENU_H //general menu object module diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index 515f5f9702..6dd96a921b 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "genmenu.h" @@ -442,7 +443,7 @@ static INT_PTR CALLBACK GenMenuOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MENUITEMS), GWLP_WNDPROC, (LONG_PTR)&LBTNDOWNProc); { HIMAGELIST himlCheckBoxes; - himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), + himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16) | ILC_MASK, 2, 2); ImageList_AddIcon_IconLibLoaded(himlCheckBoxes, SKINICON_OTHER_NOTICK); diff --git a/src/modules/clist/groups.cpp b/src/modules/clist/groups.cpp index e3a6424c48..7a289603c2 100644 --- a/src/modules/clist/groups.cpp +++ b/src/modules/clist/groups.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" @@ -183,14 +184,14 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) CLISTGROUPCHANGE grpChg = { sizeof(CLISTGROUPCHANGE), NULL, NULL }; - for (hContact = db_find_first(); - hContact; + for (hContact = db_find_first(); + hContact; hContact = db_find_next(hContact)) { if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv)) continue; - if (_tcscmp(dbv.ptszVal, name)) + if (_tcscmp(dbv.ptszVal, name)) { db_free(&dbv); continue; @@ -208,7 +209,7 @@ static INT_PTR DeleteGroup(WPARAM wParam, LPARAM) grpChg.pszNewName = NULL; } NotifyEventHooks(hGroupChangeEvent, (WPARAM)hContact, (LPARAM)&grpChg); - } + } //shuffle list of groups up to fill gap for (i = wParam - 1;; i++) { _itoa(i + 1, str, 10); @@ -540,7 +541,7 @@ static INT_PTR BuildGroupMenu(WPARAM, LPARAM) int InitGroupServices(void) { - for (int i=0;; i++) + for (int i=0;; i++) { char str[32]; _itoa(i, str, 10); diff --git a/src/modules/clist/keyboard.cpp b/src/modules/clist/keyboard.cpp index 01cea3c4ff..2ac34532c1 100644 --- a/src/modules/clist/keyboard.cpp +++ b/src/modules/clist/keyboard.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "clc.h" #include diff --git a/src/modules/clist/movetogroup.cpp b/src/modules/clist/movetogroup.cpp index 0e5bfd5420..1c95688b0a 100644 --- a/src/modules/clist/movetogroup.cpp +++ b/src/modules/clist/movetogroup.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" HANDLE hOnCntMenuBuild; @@ -84,7 +85,7 @@ static void AddGroupItem(HGENMENU hRoot, TCHAR* name, int pos, WPARAM param, boo static int OnContactMenuBuild(WPARAM wParam, LPARAM) { int i; - OBJLIST groups(10, GroupItemSort::compare); + OBJLIST groups(10, GroupItemSort::compare); if ( !hMoveToGroupItem) { CLISTMENUITEM mi = { sizeof(mi) }; @@ -108,7 +109,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) pos += 100000; // Separator - for (i=0; ; i++) + for (i=0; ; i++) { char intname[20]; _itoa(i, intname, 10); @@ -125,7 +126,7 @@ static int OnContactMenuBuild(WPARAM wParam, LPARAM) for (i=0; i < groups.getCount(); i++) { - bool checked = szContactGroup && !_tcscmp(szContactGroup, groups[i].name); + bool checked = szContactGroup && !_tcscmp(szContactGroup, groups[i].name); AddGroupItem(hMoveToGroupItem, groups[i].name, ++pos, groups[i].position, checked); } diff --git a/src/modules/clist/protocolorder.cpp b/src/modules/clist/protocolorder.cpp index b74ef1105d..23b88d57e8 100644 --- a/src/modules/clist/protocolorder.cpp +++ b/src/modules/clist/protocolorder.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -21,10 +21,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// options dialog for protocol order and visibility -// written by daniel vijge -// gpl license ect... - #include "..\..\core\commonheaders.h" #include "clc.h" diff --git a/src/modules/crypt/encrypt.cpp b/src/modules/crypt/encrypt.cpp index dbb2ee3374..659e75cc53 100644 --- a/src/modules/crypt/encrypt.cpp +++ b/src/modules/crypt/encrypt.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2003 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp index f786d853c0..e584e8d187 100644 --- a/src/modules/database/database.cpp +++ b/src/modules/database/database.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "profilemanager.h" @@ -146,7 +147,7 @@ static void loadProfileByShortName(const TCHAR* src, TCHAR *szProfile, size_t cc _tcscat(profileName, _T(".dat")); _tcscpy(profileName, p); - p = _tcsrchr(profileName, '.'); if (p) *p = 0; + p = _tcsrchr(profileName, '.'); if (p) *p = 0; mir_sntprintf(newProfileDir, cch, _T("%s\\%s\\"), profiledir, profileName); PathToAbsoluteT(buf, szProfile, newProfileDir); @@ -297,8 +298,8 @@ static int getProfile(TCHAR *szProfile, size_t cch) getProfileCmdLine(szProfile, cch, g_profileDir); getProfileDefault(szProfile, cch, g_profileDir); if (IsInsideRootDir(g_profileDir, true)) { - MessageBox(NULL, - TranslateT("Profile cannot be placed into Miranda root folder.\nPlease move Miranda profile to some other location."), + MessageBox(NULL, + TranslateT("Profile cannot be placed into Miranda root folder.\nPlease move Miranda profile to some other location."), LPGENT("Miranda NG"), MB_ICONERROR | MB_OK); return 0; } @@ -492,7 +493,7 @@ int LoadDatabaseModule(void) MessageBox(0, buf, TranslateT("No profile support installed!"), MB_OK | MB_ICONERROR); } - // find a driver to support the given profile + // find a driver to support the given profile bool retry; int rc; do { @@ -525,6 +526,6 @@ int LoadDatabaseModule(void) InitIni(); return 0; } - + return rc; } diff --git a/src/modules/database/database.h b/src/modules/database/database.h index b0b5717e0b..eefdd3217c 100644 --- a/src/modules/database/database.h +++ b/src/modules/database/database.h @@ -2,7 +2,7 @@ Miranda NG: the free IM client for Microsoft* Windows* -Copyright 2012 Miranda NG project, +Copyright 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp index f6731cc20d..8a15b3eb08 100644 --- a/src/modules/database/dbini.cpp +++ b/src/modules/database/dbini.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/database/dbintf.cpp b/src/modules/database/dbintf.cpp index e3065d471b..70d033c50c 100644 --- a/src/modules/database/dbintf.cpp +++ b/src/modules/database/dbintf.cpp @@ -2,7 +2,7 @@ Miranda NG: the free IM client for Microsoft* Windows* -Copyright 2012 Miranda NG project, +Copyright (C) 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/database/dblists.cpp b/src/modules/database/dblists.cpp index 91b657eab3..f1d493e362 100644 --- a/src/modules/database/dblists.cpp +++ b/src/modules/database/dblists.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/database/dblists.h b/src/modules/database/dblists.h index 8975f37275..eda544541a 100644 --- a/src/modules/database/dblists.h +++ b/src/modules/database/dblists.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp index 93a9a23eb8..9f70e1abec 100644 --- a/src/modules/database/dbutils.cpp +++ b/src/modules/database/dbutils.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/database/mdatabasecache.cpp b/src/modules/database/mdatabasecache.cpp index fca9670f27..24dda4f9ee 100644 --- a/src/modules/database/mdatabasecache.cpp +++ b/src/modules/database/mdatabasecache.cpp @@ -1,8 +1,8 @@ /* -Miranda IM: the free IM client for Microsoft* Windows* +Miranda NG: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, +Copyright (C) 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp index e3e07f74c4..19f219a463 100644 --- a/src/modules/database/profilemanager.cpp +++ b/src/modules/database/profilemanager.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/database/profilemanager.h b/src/modules/database/profilemanager.h index 848d2797d9..ae68e20388 100644 --- a/src/modules/database/profilemanager.h +++ b/src/modules/database/profilemanager.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/extraicons/BaseExtraIcon.cpp b/src/modules/extraicons/BaseExtraIcon.cpp index ec27c21994..6810d0d832 100644 --- a/src/modules/extraicons/BaseExtraIcon.cpp +++ b/src/modules/extraicons/BaseExtraIcon.cpp @@ -1,21 +1,23 @@ /* - Copyright (C) 2009 Ricardo Pescuma Domenecci - - This is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this file; see the file license.txt. If - not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ + +Copyright (C) 2009 Ricardo Pescuma Domenecci +Copyright (C) 2012-13 Miranda NG Project + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ #include "..\..\core\commonheaders.h" diff --git a/src/modules/extraicons/CallbackExtraIcon.cpp b/src/modules/extraicons/CallbackExtraIcon.cpp index 654d34134b..e82a037f31 100644 --- a/src/modules/extraicons/CallbackExtraIcon.cpp +++ b/src/modules/extraicons/CallbackExtraIcon.cpp @@ -1,21 +1,23 @@ /* - Copyright (C) 2009 Ricardo Pescuma Domenecci - - This is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this file; see the file license.txt. If - not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ + +Copyright (C) 2009 Ricardo Pescuma Domenecci +Copyright (C) 2012-13 Miranda NG Project + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ #include "..\..\core\commonheaders.h" diff --git a/src/modules/extraicons/DefaultExtraIcons.cpp b/src/modules/extraicons/DefaultExtraIcons.cpp index fdc6a79219..d428be1c74 100644 --- a/src/modules/extraicons/DefaultExtraIcons.cpp +++ b/src/modules/extraicons/DefaultExtraIcons.cpp @@ -1,21 +1,23 @@ /* - Copyright (C) 2009 Ricardo Pescuma Domenecci - This is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. +Copyright (C) 2009 Ricardo Pescuma Domenecci +Copyright (C) 2012-13 Miranda NG Project - This is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. - You should have received a copy of the GNU Library General Public - License along with this file; see the file license.txt. If - not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ #include "..\..\core\commonheaders.h" @@ -111,12 +113,12 @@ struct Info const char *db[8]; void (*SetIcon)(HANDLE hContact, Info *info, const char *text); void (*OnClick)(Info *info, const char *text); - + HANDLE hIcolib, hExtraIcon; } static infos[] = { - { "homepage", "Homepage", SKINICON_EVENT_URL, + { "homepage", "Homepage", SKINICON_EVENT_URL, { NULL, "Homepage", "UserInfo", "Homepage" }, DefaultSetIcon, &HomepageOnClick }, { "sms", "Phone/SMS", SKINICON_OTHER_SMS, diff --git a/src/modules/extraicons/ExtraIcon.cpp b/src/modules/extraicons/ExtraIcon.cpp index c042596f70..f59a7310fa 100644 --- a/src/modules/extraicons/ExtraIcon.cpp +++ b/src/modules/extraicons/ExtraIcon.cpp @@ -1,21 +1,23 @@ /* - Copyright (C) 2009 Ricardo Pescuma Domenecci - - This is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this file; see the file license.txt. If - not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ + +Copyright (C) 2009 Ricardo Pescuma Domenecci +Copyright (C) 2012-13 Miranda NG Project + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ #include "..\..\core\commonheaders.h" diff --git a/src/modules/extraicons/ExtraIcon.h b/src/modules/extraicons/ExtraIcon.h index a4623b454f..ca92cd659c 100644 --- a/src/modules/extraicons/ExtraIcon.h +++ b/src/modules/extraicons/ExtraIcon.h @@ -1,21 +1,23 @@ /* - Copyright (C) 2009 Ricardo Pescuma Domenecci - - This is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this file; see the file license.txt. If - not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ + +Copyright (C) 2009 Ricardo Pescuma Domenecci +Copyright (C) 2012-13 Miranda NG Project + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ #ifndef __EXTRAICON_H__ #define __EXTRAICON_H__ diff --git a/src/modules/extraicons/ExtraIconGroup.cpp b/src/modules/extraicons/ExtraIconGroup.cpp index 81a627cab6..2c95e2820b 100644 --- a/src/modules/extraicons/ExtraIconGroup.cpp +++ b/src/modules/extraicons/ExtraIconGroup.cpp @@ -1,21 +1,23 @@ /* - Copyright (C) 2009 Ricardo Pescuma Domenecci - - This is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this file; see the file license.txt. If - not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ + +Copyright (C) 2009 Ricardo Pescuma Domenecci +Copyright (C) 2012-13 Miranda NG Project + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ #include "..\..\core\commonheaders.h" diff --git a/src/modules/extraicons/IcolibExtraIcon.cpp b/src/modules/extraicons/IcolibExtraIcon.cpp index aa00b0efdc..d361e2074b 100644 --- a/src/modules/extraicons/IcolibExtraIcon.cpp +++ b/src/modules/extraicons/IcolibExtraIcon.cpp @@ -1,21 +1,23 @@ /* - Copyright (C) 2009 Ricardo Pescuma Domenecci - - This is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this file; see the file license.txt. If - not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ + +Copyright (C) 2009 Ricardo Pescuma Domenecci +Copyright (C) 2012-13 Miranda NG Project + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ #include "..\..\core\commonheaders.h" diff --git a/src/modules/extraicons/extraicons.cpp b/src/modules/extraicons/extraicons.cpp index f7b5493f6f..5974e7fcc3 100644 --- a/src/modules/extraicons/extraicons.cpp +++ b/src/modules/extraicons/extraicons.cpp @@ -1,21 +1,23 @@ /* - Copyright (C) 2009 Ricardo Pescuma Domenecci - - This is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this file; see the file license.txt. If - not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ + +Copyright (C) 2009 Ricardo Pescuma Domenecci +Copyright (C) 2012-13 Miranda NG Project + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ #include "..\..\core\commonheaders.h" diff --git a/src/modules/extraicons/extraicons.h b/src/modules/extraicons/extraicons.h index f4aa7ae770..ed2bdd20d4 100644 --- a/src/modules/extraicons/extraicons.h +++ b/src/modules/extraicons/extraicons.h @@ -1,21 +1,23 @@ /* - Copyright (C) 2009 Ricardo Pescuma Domenecci - - This is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this file; see the file license.txt. If - not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ + +Copyright (C) 2009 Ricardo Pescuma Domenecci +Copyright (C) 2012-13 Miranda NG Project + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ #ifndef __COMMONS_H__ # define __COMMONS_H__ diff --git a/src/modules/extraicons/options_ei.cpp b/src/modules/extraicons/options_ei.cpp index 90eb263395..fc76ce5835 100644 --- a/src/modules/extraicons/options_ei.cpp +++ b/src/modules/extraicons/options_ei.cpp @@ -1,21 +1,23 @@ /* - Copyright (C) 2009 Ricardo Pescuma Domenecci - - This is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this file; see the file license.txt. If - not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ + +Copyright (C) 2009 Ricardo Pescuma Domenecci +Copyright (C) 2012-13 Miranda NG Project + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ #include "..\..\core\commonheaders.h" diff --git a/src/modules/extraicons/usedIcons.cpp b/src/modules/extraicons/usedIcons.cpp index 6b54ac127e..00f4e3f3c1 100644 --- a/src/modules/extraicons/usedIcons.cpp +++ b/src/modules/extraicons/usedIcons.cpp @@ -1,21 +1,23 @@ /* - Copyright (C) 2009 Ricardo Pescuma Domenecci - - This is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this file; see the file license.txt. If - not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ + +Copyright (C) 2009 Ricardo Pescuma Domenecci +Copyright (C) 2012-13 Miranda NG Project + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ #include "..\..\core\commonheaders.h" diff --git a/src/modules/extraicons/usedIcons.h b/src/modules/extraicons/usedIcons.h index b8aeee226c..aaf97de1b5 100644 --- a/src/modules/extraicons/usedIcons.h +++ b/src/modules/extraicons/usedIcons.h @@ -1,21 +1,23 @@ /* - Copyright (C) 2009 Ricardo Pescuma Domenecci - - This is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this file; see the file license.txt. If - not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. - */ + +Copyright (C) 2009 Ricardo Pescuma Domenecci +Copyright (C) 2012-13 Miranda NG Project + +This is free software; you can redistribute it and/or +modify it under the terms of the GNU Library General Public +License as published by the Free Software Foundation; either +version 2 of the License, or (at your option) any later version. + +This is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Library General Public License for more details. + +You should have received a copy of the GNU Library General Public +License along with this file; see the file license.txt. If +not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. +*/ #ifndef __USEDICONS_H__ #define __USEDICONS_H__ diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp index 8364c33bab..8c47bb8862 100644 --- a/src/modules/findadd/findadd.cpp +++ b/src/modules/findadd/findadd.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "findadd.h" @@ -515,10 +516,10 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP en(ADVANCEDGROUP, Advanced); en(BYADVANCED, Advanced); en(ADVANCED, Advanced); en(BYCUSTOM, Tiny); en(TINYEXTENDEDGROUP, Tiny); #undef en - int checkmarkVisible = (dat->showAdvanced && IsDlgButtonChecked(hwndDlg, IDC_BYADVANCED)) || - (dat->showEmail && IsDlgButtonChecked(hwndDlg, IDC_BYEMAIL)) || - (dat->showTiny && IsDlgButtonChecked(hwndDlg, IDC_BYCUSTOM)) || - (dat->showName && IsDlgButtonChecked(hwndDlg, IDC_BYNAME)) || + int checkmarkVisible = (dat->showAdvanced && IsDlgButtonChecked(hwndDlg, IDC_BYADVANCED)) || + (dat->showEmail && IsDlgButtonChecked(hwndDlg, IDC_BYEMAIL)) || + (dat->showTiny && IsDlgButtonChecked(hwndDlg, IDC_BYCUSTOM)) || + (dat->showName && IsDlgButtonChecked(hwndDlg, IDC_BYNAME)) || (dat->showProtoId && IsDlgButtonChecked(hwndDlg, IDC_BYPROTOID)); if ( !checkmarkVisible) { if (dat->showProtoId) CheckSearchTypeRadioButton(hwndDlg, IDC_BYPROTOID); @@ -763,7 +764,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP psr.id = str; acs.psr = &psr; - acs.szProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, + acs.szProto = (char*)SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CB_GETCURSEL, 0, 0), 0); } diff --git a/src/modules/findadd/findadd.h b/src/modules/findadd/findadd.h index edd0c46bb9..2334b746f1 100644 --- a/src/modules/findadd/findadd.h +++ b/src/modules/findadd/findadd.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,17 +20,21 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -struct ListSearchResult { + +struct ListSearchResult +{ const char *szProto; PROTOSEARCHRESULT psr; }; -struct ProtoSearchInfo { +struct ProtoSearchInfo +{ const char *szProto; HANDLE hProcess; }; -struct FindAddDlgData { +struct FindAddDlgData +{ HANDLE hResultHook; int bSortAscending; int iLastColumnSortIndex; diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp index 597ae8a2e2..e93d4d9048 100644 --- a/src/modules/findadd/searchresults.cpp +++ b/src/modules/findadd/searchresults.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "findadd.h" diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp index 21b786db0b..6270dd4613 100644 --- a/src/modules/fonts/FontOptions.cpp +++ b/src/modules/fonts/FontOptions.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/fonts/FontService.cpp b/src/modules/fonts/FontService.cpp index 26bbcfcfe2..3458c91dfe 100644 --- a/src/modules/fonts/FontService.cpp +++ b/src/modules/fonts/FontService.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/fonts/FontService.h b/src/modules/fonts/FontService.h index 578649f13b..98159fb9c7 100644 --- a/src/modules/fonts/FontService.h +++ b/src/modules/fonts/FontService.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp index 74c8ba9860..d016317f25 100644 --- a/src/modules/fonts/services.cpp +++ b/src/modules/fonts/services.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/icolib/IcoLib.h b/src/modules/icolib/IcoLib.h index ec93d2af62..c8a4f5a556 100644 --- a/src/modules/icolib/IcoLib.h +++ b/src/modules/icolib/IcoLib.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/icolib/extracticon.cpp b/src/modules/icolib/extracticon.cpp index e5906045a1..cd405a3f15 100644 --- a/src/modules/icolib/extracticon.cpp +++ b/src/modules/icolib/extracticon.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #ifdef _ASSERT @@ -73,7 +74,7 @@ void* _GetResourceTable(IMAGE_DOS_HEADER* pDosHeader) if (pPE->FileHeader.SizeOfOptionalHeader < 2) return NULL; - // The DataDirectory is an array of 16 structures. + // The DataDirectory is an array of 16 structures. // Each array entry has a predefined meaning for what it refers to. switch (pPE->OptionalHeader.Magic) @@ -108,7 +109,7 @@ IMAGE_RESOURCE_DIRECTORY_ENTRY* _FindResourceBase(void* prt, int resType, int* p if (i == count) return NULL; - pDir = (IMAGE_RESOURCE_DIRECTORY*)((LPBYTE)prt + + pDir = (IMAGE_RESOURCE_DIRECTORY*)((LPBYTE)prt + (pRes[i].OffsetToData & ~IMAGE_RESOURCE_DATA_IS_DIRECTORY)); count = pDir->NumberOfIdEntries + pDir->NumberOfNamedEntries; @@ -147,7 +148,7 @@ void* _FindResource(IMAGE_DOS_HEADER* pDosHeader, void* prt, int resIndex, int r IMAGE_RESOURCE_DIRECTORY* pDir; pDir = (IMAGE_RESOURCE_DIRECTORY*)((LPBYTE)prt + (pRes[index].OffsetToData & ~IMAGE_RESOURCE_DATA_IS_DIRECTORY)); pRes = (IMAGE_RESOURCE_DIRECTORY_ENTRY*)(pDir+1); - index = 0; + index = 0; } if (pRes[index].OffsetToData & IMAGE_RESOURCE_DATA_IS_DIRECTORY) @@ -268,7 +269,7 @@ UINT _ExtractIconEx(LPCTSTR lpszFile, int iconIndex, int cxIcon, int cyIcon, HIC res = _ExtractFromICO(lpszFile, iconIndex, cxIcon, cyIcon, phicon, flags); break; - case MAGIC_ICON: + case MAGIC_ICON: if ((magic[1] == MAGIC_ICO1 || magic[1] == MAGIC_CUR) && magic[2] >= 1) res = _ExtractFromICO(lpszFile, iconIndex, cxIcon, cyIcon, phicon, flags); diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp index 58137e74d2..9570709115 100644 --- a/src/modules/icolib/skin2icons.cpp +++ b/src/modules/icolib/skin2icons.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/icolib/skin2opts.cpp b/src/modules/icolib/skin2opts.cpp index f6e697aac4..e18382844d 100644 --- a/src/modules/icolib/skin2opts.cpp +++ b/src/modules/icolib/skin2opts.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/ignore/ignore.cpp b/src/modules/ignore/ignore.cpp index 728a33c632..ba049b80c3 100644 --- a/src/modules/ignore/ignore.cpp +++ b/src/modules/ignore/ignore.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #define IGNOREEVENT_MAX 7 diff --git a/src/modules/json/JSONChildren.cpp b/src/modules/json/JSONChildren.cpp index f52b3eb954..9a99ef1680 100644 --- a/src/modules/json/JSONChildren.cpp +++ b/src/modules/json/JSONChildren.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/json/JSONDebug.cpp b/src/modules/json/JSONDebug.cpp index 118ea3a52b..82ec80d5a5 100644 --- a/src/modules/json/JSONDebug.cpp +++ b/src/modules/json/JSONDebug.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/json/JSONIterators.cpp b/src/modules/json/JSONIterators.cpp index 28eb6faf32..5de4ffb9e0 100644 --- a/src/modules/json/JSONIterators.cpp +++ b/src/modules/json/JSONIterators.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/json/JSONMemory.cpp b/src/modules/json/JSONMemory.cpp index 61b2eef567..0fc6d28cde 100644 --- a/src/modules/json/JSONMemory.cpp +++ b/src/modules/json/JSONMemory.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/json/JSONNode.cpp b/src/modules/json/JSONNode.cpp index b53bf2381f..b2364f31aa 100644 --- a/src/modules/json/JSONNode.cpp +++ b/src/modules/json/JSONNode.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/json/JSONNode_Mutex.cpp b/src/modules/json/JSONNode_Mutex.cpp index 77a9e90697..2c52366320 100644 --- a/src/modules/json/JSONNode_Mutex.cpp +++ b/src/modules/json/JSONNode_Mutex.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/json/JSONWorker.cpp b/src/modules/json/JSONWorker.cpp index 83ab246ee1..92d0772e52 100644 --- a/src/modules/json/JSONWorker.cpp +++ b/src/modules/json/JSONWorker.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/json/JSONWriter.cpp b/src/modules/json/JSONWriter.cpp index d141a00a01..b94a0ffb44 100644 --- a/src/modules/json/JSONWriter.cpp +++ b/src/modules/json/JSONWriter.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/json/JSON_Base64.cpp b/src/modules/json/JSON_Base64.cpp index 66f2002b6b..49b24a8a28 100644 --- a/src/modules/json/JSON_Base64.cpp +++ b/src/modules/json/JSON_Base64.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/json/internalJSONNode.cpp b/src/modules/json/internalJSONNode.cpp index 3137c70b85..4dca707526 100644 --- a/src/modules/json/internalJSONNode.cpp +++ b/src/modules/json/internalJSONNode.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/json/json.cpp b/src/modules/json/json.cpp index 4b3e35d926..267775e4eb 100644 --- a/src/modules/json/json.cpp +++ b/src/modules/json/json.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/json/libJSON.cpp b/src/modules/json/libJSON.cpp index a40dde4773..44ccefa616 100644 --- a/src/modules/json/libJSON.cpp +++ b/src/modules/json/libJSON.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/langpack/lpservices.cpp b/src/modules/langpack/lpservices.cpp index 62db2f256e..f99a9211f7 100644 --- a/src/modules/langpack/lpservices.cpp +++ b/src/modules/langpack/lpservices.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/modules/netlib/netlib.cpp b/src/modules/netlib/netlib.cpp index 92d638382d..4245a0e5d6 100644 --- a/src/modules/netlib/netlib.cpp +++ b/src/modules/netlib/netlib.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2012 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "netlib.h" @@ -432,9 +433,9 @@ INT_PTR NetlibHttpUrlEncode(WPARAM, LPARAM lParam) return (INT_PTR)(unsigned char*)NULL; } for (pszOut = szOutput, pszIn = szInput;*pszIn;pszIn++) { - if ((48 <= *pszIn && *pszIn <= 57) || - (65 <= *pszIn && *pszIn <= 90) || - (97 <= *pszIn && *pszIn <= 122) || + if ((48 <= *pszIn && *pszIn <= 57) || + (65 <= *pszIn && *pszIn <= 90) || + (97 <= *pszIn && *pszIn <= 122) || *pszIn == '-' || *pszIn == '_' || *pszIn == '.') *pszOut++=*pszIn; else if (*pszIn == ' ') *pszOut++='+'; else { @@ -600,7 +601,7 @@ int LoadNetlibModule(void) case 0x1c: break; - case 0x02: // Vista Home Basic edition have connection limit of 2 / sec + case 0x02: // Vista Home Basic edition have connection limit of 2 / sec case 0x05: connectionTimeout = 1000; break; diff --git a/src/modules/netlib/netlib.h b/src/modules/netlib/netlib.h index 07316635ac..c7ca929e0c 100644 --- a/src/modules/netlib/netlib.h +++ b/src/modules/netlib/netlib.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2012 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #define GetNetlibHandleType(h) (h?*(int*)h:NLH_INVALID) #define NLH_INVALID 0 #define NLH_USER 'USER' @@ -27,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define NLH_BOUNDPORT 'BIND' #define NLH_PACKETRECVER 'PCKT' -struct NetlibUser +struct NetlibUser { int handleType; NETLIBUSER user; @@ -45,7 +46,7 @@ struct NetlibNestedCriticalSection int lockCount; }; -struct NetlibHTTPProxyPacketQueue +struct NetlibHTTPProxyPacketQueue { struct NetlibHTTPProxyPacketQueue *next; PBYTE dataBuffer; @@ -55,10 +56,10 @@ struct NetlibHTTPProxyPacketQueue typedef union _SOCKADDR_INET_M { SOCKADDR_IN Ipv4; SOCKADDR_IN6 Ipv6; - USHORT si_family; + USHORT si_family; } SOCKADDR_INET_M, *PSOCKADDR_INET_M; -struct NetlibConnection +struct NetlibConnection { int handleType; SOCKET s, s2; @@ -192,7 +193,7 @@ void NetlibGetConnectionInfo(NetlibConnection* nlc, NETLIBCONNINFO *connInfo); NETLIBIPLIST* GetMyIp(unsigned flags); //netlibupnp.c -bool NetlibUPnPAddPortMapping(WORD intport, char *proto, +bool NetlibUPnPAddPortMapping(WORD intport, char *proto, WORD *extport, DWORD *extip, bool search); void NetlibUPnPDeletePortMapping(WORD extport, char* proto); void NetlibUPnPCleanup(void*); @@ -205,7 +206,7 @@ void NetlibSecurityDestroy(void); void NetlibDestroySecurityProvider(HANDLE hSecurity); HANDLE NetlibInitSecurityProvider(const TCHAR* szProvider, const TCHAR* szPrincipal); HANDLE NetlibInitSecurityProvider(const char* szProvider, const char* szPrincipal); -char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, const TCHAR* login, const TCHAR* psw, +char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, const TCHAR* login, const TCHAR* psw, bool http, unsigned& complete); static __inline INT_PTR NLSend(struct NetlibConnection *nlc, const char *buf, int len, int flags) { diff --git a/src/modules/netlib/netlibautoproxy.cpp b/src/modules/netlib/netlibautoproxy.cpp index 33992028dc..3d46a739f8 100644 --- a/src/modules/netlib/netlibautoproxy.cpp +++ b/src/modules/netlib/netlibautoproxy.cpp @@ -1,7 +1,7 @@ /* Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2010-2011 Miranda ICQ/IM project, +Copyright 2010-2011 Miranda IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -10,7 +10,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,18 +19,20 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "netlib.h" #include + /* ///////////////////////////////////////////////////////////////////// // ResolveHostName (a helper function) ///////////////////////////////////////////////////////////////////// -DWORD __stdcall ResolveHostName(LPSTR lpszHostName, +DWORD __stdcall ResolveHostName(LPSTR lpszHostName, LPSTR lpszIPAddress, LPDWORD lpdwIPAddressSize) { - if (*lpdwIPAddressSize < 17 || lpszIPAddress == NULL) + if (*lpdwIPAddressSize < 17 || lpszIPAddress == NULL) { *lpdwIPAddressSize = 17; return ERROR_INSUFFICIENT_BUFFER; @@ -46,7 +48,7 @@ DWORD __stdcall ResolveHostName(LPSTR lpszHostName, else return SOCKET_ERROR; } - mir_snprintf(lpszIPAddress, *lpdwIPAddressSize, "%u.%u.%u.%u", + mir_snprintf(lpszIPAddress, *lpdwIPAddressSize, "%u.%u.%u.%u", ip.s_net, ip.s_host, ip.s_lh, ip.s_impno); return 0; @@ -90,22 +92,22 @@ BOOL __stdcall IsInNet(LPSTR lpszIPAddress, LPSTR lpszDest, LPSTR lpszMask) dwDest = inet_addr(lpszDest); dwMask = inet_addr(lpszMask); - if ((dwDest == INADDR_NONE) || + if ((dwDest == INADDR_NONE) || (dwIpAddr == INADDR_NONE) || ((dwIpAddr & dwMask) != dwDest)) return (FALSE); return (TRUE); } -static const AutoProxyHelperVtbl OurVtbl = +static const AutoProxyHelperVtbl OurVtbl = { - IsResolvable, - GetIPAddress, - ResolveHostName, - IsInNet, - NULL, - NULL, - NULL, + IsResolvable, + GetIPAddress, + ResolveHostName, + IsInNet, + NULL, + NULL, + NULL, NULL }; @@ -162,7 +164,7 @@ bool NetlibGetIeProxyConn(NetlibConnection *nlc, bool forceHttps) bool usingSsl = false; char szUrl[256] = ""; - if ((nlc->nloc.flags & (NLOCF_HTTP | NLOCF_HTTPGATEWAY) && nlc->nloc.flags & NLOCF_SSL) || + if ((nlc->nloc.flags & (NLOCF_HTTP | NLOCF_HTTPGATEWAY) && nlc->nloc.flags & NLOCF_SSL) || nlc->nloc.wPort == 443 || forceHttps) { mir_snprintf(szUrl, sizeof(szUrl), "https://%s", nlc->nloc.szHost); @@ -219,7 +221,7 @@ bool NetlibGetIeProxyConn(NetlibConnection *nlc, bool forceHttps) nlc->wProxyPort = p ? atol(p) : 1080; nlc->szProxyServer = mir_strdup(h); } - else + else return false; return true; @@ -261,7 +263,7 @@ struct IeProxyParam { char *szUrl; char *szHost; - char *szProxy; + char *szProxy; }; static unsigned __stdcall NetlibIeProxyThread(void * arg) @@ -299,7 +301,7 @@ static unsigned __stdcall NetlibIeProxyThread(void * arg) char *proxy = proxyBuffer; DWORD dwProxyLen = sizeof(proxyBuffer); - if (pInternetGetProxyInfo(param->szUrl, (DWORD)strlen(param->szUrl), + if (pInternetGetProxyInfo(param->szUrl, (DWORD)strlen(param->szUrl), param->szHost, (DWORD)strlen(param->szHost), &proxy, &dwProxyLen)) param->szProxy = mir_strdup(lrtrim(proxy)); @@ -337,7 +339,7 @@ char* NetlibGetIeProxy(char *szUrl) int ind = -1; if (strstr(szUrl, "http://")) ind = szProxyHost[0] ? 0 : 2; - else if (strstr(szUrl, "https://")) + else if (strstr(szUrl, "https://")) ind = bOneProxy ? 0 : (szProxyHost[1] ? 1 : 2); else ind = szProxyHost[2] ? 2 : (bOneProxy ? 0 : (szProxyHost[1] ? 1 : 2)); @@ -365,7 +367,7 @@ char* NetlibGetIeProxy(char *szUrl) void NetlibLoadIeProxy(void) { HKEY hSettings; - if (RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", + if (RegOpenKeyExA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", 0, KEY_QUERY_VALUE, &hSettings)) return; diff --git a/src/modules/netlib/netlibbind.cpp b/src/modules/netlib/netlibbind.cpp index 86bbc70b20..01ed2b7413 100644 --- a/src/modules/netlib/netlibbind.cpp +++ b/src/modules/netlib/netlibbind.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2012 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "netlib.h" @@ -77,7 +78,7 @@ bool BindSocketToPort(const char *szPorts, SOCKET s, SOCKET s6, int* portn) if (s == INVALID_SOCKET) continue; if ( !before && portnum <= *portn) continue; - if (before && portnum >= *portn) + if (before && portnum >= *portn) return false; sin.sin_port = htons((WORD)port); @@ -299,10 +300,10 @@ INT_PTR NetlibBindPort(WPARAM wParam, LPARAM lParam) } DWORD extIP; - if (nlu->settings.enableUPnP && + if (nlu->settings.enableUPnP && NetlibUPnPAddPortMapping(nlb->wPort, "TCP", &nlbp->wExPort, &extIP, nlb->cbSize > NETLIBBIND_SIZEOF_V2)) { - NetlibLogf(NULL, "UPnP port mapping succeeded. Internal Port: %u External Port: %u\n", + NetlibLogf(NULL, "UPnP port mapping succeeded. Internal Port: %u External Port: %u\n", nlb->wPort, nlbp->wExPort); if (nlb->cbSize > NETLIBBIND_SIZEOF_V2) { diff --git a/src/modules/netlib/netlibhttp.cpp b/src/modules/netlib/netlibhttp.cpp index a871f6957a..f675ba8c0f 100644 --- a/src/modules/netlib/netlibhttp.cpp +++ b/src/modules/netlib/netlibhttp.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "../plugins/zlib/src/zlib.h" #include "netlib.h" @@ -27,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define HTTPRECVHEADERSTIMEOUT 30000 //in ms #define HTTPRECVDATATIMEOUT 20000 -struct ResizableCharBuffer +struct ResizableCharBuffer { char *sz; int iEnd, cbAlloced; @@ -138,7 +139,7 @@ static int RecvWithTimeoutTime(struct NetlibConnection *nlc, unsigned dwTimeoutT static char* NetlibHttpFindHeader(NETLIBHTTPREQUEST *nlhrReply, const char *hdr) { - for (int i=0; i < nlhrReply->headersCount; i++) + for (int i=0; i < nlhrReply->headersCount; i++) { if (_stricmp(nlhrReply->headers[i].szName, hdr) == 0) { @@ -257,7 +258,7 @@ struct HttpSecurityContext return m_hNtlmSecurity && m_szProvider && _stricmp(m_szProvider, "Basic"); } - char* Execute(NetlibConnection *nlc, char* szHost, const char* szProvider, + char* Execute(NetlibConnection *nlc, char* szHost, const char* szProvider, const char* szChallenge, unsigned& complete) { char* szAuthHdr = NULL; @@ -296,11 +297,11 @@ struct HttpSecurityContext szPassw = mir_a2t(nlc->nlu->settings.szProxyAuthPassword); } - szAuthHdr = NtlmCreateResponseFromChallenge(m_hNtlmSecurity, + szAuthHdr = NtlmCreateResponseFromChallenge(m_hNtlmSecurity, szChallenge, szLogin, szPassw, true, complete); if ( !szAuthHdr) { - NetlibLogf(NULL, "Security login %s failed, user: " TCHAR_STR_PARAM " pssw: " TCHAR_STR_PARAM, + NetlibLogf(NULL, "Security login %s failed, user: " TCHAR_STR_PARAM " pssw: " TCHAR_STR_PARAM, szProvider, szLogin ? szLogin : _T("(no user)"), szPassw ? _T("(exist)") : _T("(no psw)")); } else if (justCreated) @@ -315,8 +316,8 @@ struct HttpSecurityContext } }; -static int HttpPeekFirstResponseLine(NetlibConnection *nlc, DWORD dwTimeoutTime, - DWORD recvFlags, int *resultCode, +static int HttpPeekFirstResponseLine(NetlibConnection *nlc, DWORD dwTimeoutTime, + DWORD recvFlags, int *resultCode, char **ppszResultDescr, int *length) { int bytesPeeked; @@ -325,7 +326,7 @@ static int HttpPeekFirstResponseLine(NetlibConnection *nlc, DWORD dwTimeoutTime, for (;;) { - bytesPeeked = RecvWithTimeoutTime(nlc, dwTimeoutTime, buffer, SIZEOF(buffer) - 1, + bytesPeeked = RecvWithTimeoutTime(nlc, dwTimeoutTime, buffer, SIZEOF(buffer) - 1, MSG_PEEK | recvFlags); if (bytesPeeked == 0) @@ -374,7 +375,7 @@ static int HttpPeekFirstResponseLine(NetlibConnection *nlc, DWORD dwTimeoutTime, size_t off = strcspn(buffer, " \t"); if (off >= (unsigned)bytesPeeked) return 0; - + char* pResultCode = buffer + off; *(pResultCode++) = 0; @@ -397,16 +398,16 @@ static int SendHttpRequestAndData(struct NetlibConnection *nlc, struct Resizable else AppendToCharBuffer(httpRequest, "\r\n"); - DWORD hflags = (nlhr->flags & NLHRF_DUMPASTEXT ? MSG_DUMPASTEXT : 0) | - (nlhr->flags & (NLHRF_NODUMP | NLHRF_NODUMPSEND | NLHRF_NODUMPHEADERS) ? + DWORD hflags = (nlhr->flags & NLHRF_DUMPASTEXT ? MSG_DUMPASTEXT : 0) | + (nlhr->flags & (NLHRF_NODUMP | NLHRF_NODUMPSEND | NLHRF_NODUMPHEADERS) ? MSG_NODUMP : (nlhr->flags & NLHRF_DUMPPROXY ? MSG_DUMPPROXY : 0)) | (nlhr->flags & NLHRF_NOPROXY ? MSG_RAW : 0); int bytesSent = NLSend(nlc, httpRequest->sz, httpRequest->iEnd, hflags); if (bytesSent != SOCKET_ERROR && sendData && nlhr->dataLength) { - DWORD sflags = (nlhr->flags & NLHRF_DUMPASTEXT ? MSG_DUMPASTEXT : 0) | - (nlhr->flags & (NLHRF_NODUMP | NLHRF_NODUMPSEND) ? + DWORD sflags = (nlhr->flags & NLHRF_DUMPASTEXT ? MSG_DUMPASTEXT : 0) | + (nlhr->flags & (NLHRF_NODUMP | NLHRF_NODUMPSEND) ? MSG_NODUMP : (nlhr->flags & NLHRF_DUMPPROXY ? MSG_DUMPPROXY : 0)) | (nlhr->flags & NLHRF_NOPROXY ? MSG_RAW : 0); @@ -520,18 +521,18 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) mir_snprintf(szHost, 64, "%s%s", inet_ntoa(*(PIN_ADDR)&ip), cln ? cln : ""); } /* - if (ip && pszUrl[0] != '/') + if (ip && pszUrl[0] != '/') { mir_free(szNewUrl); szNewUrl = (char*)mir_alloc(strlen(pszUrl) + 60); szNewUrl[0] = 0; - + phost = strstr(pszUrl, "://"); if (phost) { phost += 3; size_t len = phost - pszUrl; - memcpy(szNewUrl, pszUrl, len); + memcpy(szNewUrl, pszUrl, len); szNewUrl[len] = 0; } strcat(szNewUrl, inet_ntoa(*(PIN_ADDR)&ip)); @@ -603,11 +604,11 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) { NetlibLogf(nlc->nlu, "%s %d: %s Failed (%u %u)", __FILE__, __LINE__, "HttpPeekFirstResponseLine", GetLastError(), count); DWORD err = GetLastError(); - if (err == ERROR_TIMEOUT || err == ERROR_BAD_FORMAT || err == ERROR_BUFFER_OVERFLOW || + if (err == ERROR_TIMEOUT || err == ERROR_BAD_FORMAT || err == ERROR_BUFFER_OVERFLOW || lastFirstLineFail || nlc->termRequested || nlhr->requestType == REQUEST_CONNECT) { bytesSent = SOCKET_ERROR; - break; + break; } else { @@ -617,11 +618,11 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) } lastFirstLineFail = false; - DWORD hflags = (nlhr->flags & (NLHRF_NODUMP|NLHRF_NODUMPHEADERS|NLHRF_NODUMPSEND) ? + DWORD hflags = (nlhr->flags & (NLHRF_NODUMP|NLHRF_NODUMPHEADERS|NLHRF_NODUMPSEND) ? MSG_NODUMP : (nlhr->flags & NLHRF_DUMPPROXY ? MSG_DUMPPROXY : 0)) | (nlhr->flags & NLHRF_NOPROXY ? MSG_RAW : 0); - DWORD dflags = (nlhr->flags & (NLHRF_NODUMP | NLHRF_NODUMPSEND) ? + DWORD dflags = (nlhr->flags & (NLHRF_NODUMP | NLHRF_NODUMPSEND) ? MSG_NODUMP : MSG_DUMPASTEXT | MSG_DUMPPROXY) | (nlhr->flags & NLHRF_NOPROXY ? MSG_RAW : 0) | MSG_NODUMP; @@ -651,7 +652,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) phost = strstr(pszFullUrl, "://"); phost = phost ? phost + 3 : pszFullUrl; ppath = strchr(phost, '/'); - rlen = ppath ? ppath - pszFullUrl : strlen(pszFullUrl); + rlen = ppath ? ppath - pszFullUrl : strlen(pszFullUrl); } nlc->szNewUrl = (char*)mir_realloc(nlc->szNewUrl, rlen + strlen(tmpUrl) * 3 + 1); @@ -694,7 +695,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) char *szAuthStr = NULL; if ( !complete) { - szAuthStr = NetlibHttpFindAuthHeader(nlhrReply, "WWW-Authenticate", + szAuthStr = NetlibHttpFindAuthHeader(nlhrReply, "WWW-Authenticate", httpSecurity.m_szProvider); if (szAuthStr) { @@ -704,7 +705,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) } if (complete && httpSecurity.m_hNtlmSecurity) { - szAuthStr = httpSecurity.TryBasic() ? + szAuthStr = httpSecurity.TryBasic() ? NetlibHttpFindAuthHeader(nlhrReply, "WWW-Authenticate", "Basic") : NULL; } @@ -737,7 +738,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) char *szAuthStr = NULL; if ( !complete) { - szAuthStr = NetlibHttpFindAuthHeader(nlhrReply, "Proxy-Authenticate", + szAuthStr = NetlibHttpFindAuthHeader(nlhrReply, "Proxy-Authenticate", httpSecurity.m_szProvider); if (szAuthStr) { @@ -747,7 +748,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) } if (complete && httpSecurity.m_hNtlmSecurity) { - szAuthStr = httpSecurity.TryBasic() ? + szAuthStr = httpSecurity.TryBasic() ? NetlibHttpFindAuthHeader(nlhrReply, "Proxy-Authenticate", "Basic") : NULL; } @@ -849,7 +850,7 @@ INT_PTR NetlibHttpRecvHeaders(WPARAM wParam, LPARAM lParam) nlhr->nlc = nlc; // Needed to id connection in the protocol HTTP gateway wrapper functions nlhr->requestType = REQUEST_RESPONSE; - if ( !HttpPeekFirstResponseLine(nlc, dwRequestTimeoutTime, lParam | MSG_PEEK, + if ( !HttpPeekFirstResponseLine(nlc, dwRequestTimeoutTime, lParam | MSG_PEEK, &nlhr->resultCode, &nlhr->szResultDescr, &firstLineLength)) { NetlibLeaveNestedCS(&nlc->ncsRecv); @@ -884,7 +885,7 @@ INT_PTR NetlibHttpRecvHeaders(WPARAM wParam, LPARAM lParam) buffer = (char*)mir_alloc(bufferSize + 1); } - bytesPeeked = RecvWithTimeoutTime(nlc, dwRequestTimeoutTime, buffer, bufferSize, + bytesPeeked = RecvWithTimeoutTime(nlc, dwRequestTimeoutTime, buffer, bufferSize, MSG_PEEK | MSG_NODUMP | lParam); if (bytesPeeked == 0) break; @@ -923,7 +924,7 @@ INT_PTR NetlibHttpRecvHeaders(WPARAM wParam, LPARAM lParam) nlhr->headersCount = headersCount; nlhr->headers = (NETLIBHTTPHEADER*)mir_calloc(sizeof(NETLIBHTTPHEADER) * headersCount); - for (pbuffer = buffer, headersCount = 0;; pbuffer = peol + 1, ++headersCount) + for (pbuffer = buffer, headersCount = 0;; pbuffer = peol + 1, ++headersCount) { peol = strchr(pbuffer, '\n'); if (peol == NULL || peol == pbuffer || (peol == (pbuffer + 1) && *pbuffer == '\r')) break; @@ -953,8 +954,8 @@ INT_PTR NetlibHttpTransaction(WPARAM wParam, LPARAM lParam) NETLIBHTTPREQUEST *nlhr = (NETLIBHTTPREQUEST*)lParam, *nlhrReply; DWORD dflags, hflags; - if (GetNetlibHandleType(nlu) != NLH_USER || !(nlu->user.flags & NUF_OUTGOING) || - nlhr == NULL || nlhr->cbSize < NETLIBHTTPREQUEST_V1_SIZE || + if (GetNetlibHandleType(nlu) != NLH_USER || !(nlu->user.flags & NUF_OUTGOING) || + nlhr == NULL || nlhr->cbSize < NETLIBHTTPREQUEST_V1_SIZE || nlhr->szUrl == NULL || nlhr->szUrl[0] == 0) { SetLastError(ERROR_INVALID_PARAMETER); @@ -1016,7 +1017,7 @@ INT_PTR NetlibHttpTransaction(WPARAM wParam, LPARAM lParam) (nlhr->flags & NLHRF_NODUMP ? MSG_NODUMP : (nlhr->flags & NLHRF_DUMPPROXY ? MSG_DUMPPROXY : 0)) | (nlhr->flags & NLHRF_NOPROXY ? MSG_RAW : 0); - hflags = + hflags = (nlhr->flags & NLHRF_NODUMP ? MSG_NODUMP : (nlhr->flags & NLHRF_DUMPPROXY ? MSG_DUMPPROXY : 0)) | (nlhr->flags & NLHRF_NOPROXY ? MSG_RAW : 0); @@ -1044,7 +1045,7 @@ INT_PTR NetlibHttpTransaction(WPARAM wParam, LPARAM lParam) void NetlibHttpSetLastErrorUsingHttpResult(int result) { - if (result >= 200 && result < 300) + if (result >= 200 && result < 300) { SetLastError(ERROR_SUCCESS); return; @@ -1150,7 +1151,7 @@ NETLIBHTTPREQUEST* NetlibHttpRecv(NetlibConnection* nlc, DWORD hflags, DWORD dfl next: NETLIBHTTPREQUEST *nlhrReply = (NETLIBHTTPREQUEST*)NetlibHttpRecvHeaders((WPARAM)nlc, hflags); - if (nlhrReply == NULL) + if (nlhrReply == NULL) return NULL; if (nlhrReply->resultCode == 100) @@ -1176,7 +1177,7 @@ next: if ( !lstrcmpiA(nlhrReply->headers[i].szName, "Connection")) close = !lstrcmpiA(nlhrReply->headers[i].szValue, "close"); - if ( !lstrcmpiA(nlhrReply->headers[i].szName, "Transfer-Encoding") && + if ( !lstrcmpiA(nlhrReply->headers[i].szName, "Transfer-Encoding") && !lstrcmpiA(nlhrReply->headers[i].szValue, "chunked")) { chunked = true; @@ -1193,7 +1194,7 @@ next: if (chunked) { chunksz = NetlibHttpRecvChunkHeader(nlc, true, dflags); - if (chunksz == SOCKET_ERROR) + if (chunksz == SOCKET_ERROR) { NetlibHttpFreeRequestStruct(0, (LPARAM)nlhrReply); return NULL; @@ -1207,9 +1208,9 @@ next: { for (;;) { - recvResult = RecvWithTimeoutTime(nlc, GetTickCount() + HTTPRECVDATATIMEOUT, - nlhrReply->pData + nlhrReply->dataLength, - dataBufferAlloced - nlhrReply->dataLength - 1, + recvResult = RecvWithTimeoutTime(nlc, GetTickCount() + HTTPRECVDATATIMEOUT, + nlhrReply->pData + nlhrReply->dataLength, + dataBufferAlloced - nlhrReply->dataLength - 1, dflags | (cenctype ? MSG_NODUMP : 0)); if (recvResult == 0) break; @@ -1260,7 +1261,7 @@ next: nlhrReply->pData[nlhrReply->dataLength] = '\0'; } - + if (chunked) { nlhrReply->headers[chunkhdr].szName = (char*)mir_realloc(nlhrReply->headers[chunkhdr].szName, 16); @@ -1306,12 +1307,12 @@ next: { mir_free(nlhrReply->pData); nlhrReply->pData = NULL; - nlhrReply->dataLength = 0; + nlhrReply->dataLength = 0; } } - if (close && - (nlc->proxyType != PROXYTYPE_HTTP || nlc->nloc.flags & NLOCF_SSL) && + if (close && + (nlc->proxyType != PROXYTYPE_HTTP || nlc->nloc.flags & NLOCF_SSL) && ( !isConnect || nlhrReply->resultCode != 200)) NetlibDoClose(nlc); diff --git a/src/modules/netlib/netlibhttpproxy.cpp b/src/modules/netlib/netlibhttpproxy.cpp index 78e3d31491..efdb0a5ab4 100644 --- a/src/modules/netlib/netlibhttpproxy.cpp +++ b/src/modules/netlib/netlibhttpproxy.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2012 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,16 +20,17 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "netlib.h" typedef enum { - reqHelloGet, - reqOldGet, - reqOldPost, - reqNewPost, -} + reqHelloGet, + reqOldGet, + reqOldPost, + reqNewPost, +} RequestType; static int HttpGatewayReadSetResult(NetlibConnection *nlc, char *buf, int num, int peek) @@ -143,7 +144,7 @@ static bool NetlibHttpGatewaySend(struct NetlibConnection *nlc, RequestType reqT // nlhrSend.headers[3].szName = "Accept-Encoding"; // nlhrSend.headers[3].szValue = "deflate, gzip"; - return NetlibHttpSendRequest((WPARAM)nlc, (LPARAM)&nlhrSend) != SOCKET_ERROR; + return NetlibHttpSendRequest((WPARAM)nlc, (LPARAM)&nlhrSend) != SOCKET_ERROR; } static bool NetlibHttpGatewayStdPost(NetlibConnection *nlc, int& numPackets) @@ -327,7 +328,7 @@ int NetlibHttpGatewayRecv(struct NetlibConnection *nlc, char *buf, int len, int if (nlc->nlu->user.pfnHttpGatewayUnwrapRecv && !(flags & MSG_NOHTTPGATEWAYWRAP)) { - nlhrReply->pData = (char*)nlc->nlu->user.pfnHttpGatewayUnwrapRecv(nlhrReply, + nlhrReply->pData = (char*)nlc->nlu->user.pfnHttpGatewayUnwrapRecv(nlhrReply, (PBYTE)nlhrReply->pData, nlhrReply->dataLength, &nlhrReply->dataLength, mir_realloc); } @@ -365,7 +366,7 @@ int NetlibHttpGatewayRecv(struct NetlibConnection *nlc, char *buf, int len, int nlc->dataBufferLen = rbytes; NetlibHttpFreeRequestStruct(0, (LPARAM)nlhrReply); - + return HttpGatewayReadSetResult(nlc, buf, len, peek); } else @@ -450,9 +451,9 @@ INT_PTR NetlibHttpGatewaySetInfo(WPARAM wParam, LPARAM lParam) NETLIBHTTPPROXYINFO *nlhpi = (NETLIBHTTPPROXYINFO*)lParam; struct NetlibConnection *nlc = (struct NetlibConnection*)wParam; - if (GetNetlibHandleType(nlc) != NLH_CONNECTION || nlhpi == NULL || - nlhpi->cbSize < (sizeof(NETLIBHTTPPROXYINFO) - sizeof(int)) || - nlhpi->szHttpPostUrl == NULL) + if (GetNetlibHandleType(nlc) != NLH_CONNECTION || nlhpi == NULL || + nlhpi->cbSize < (sizeof(NETLIBHTTPPROXYINFO) - sizeof(int)) || + nlhpi->szHttpPostUrl == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return 0; diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp index 05b4e899dd..085c9e27d5 100644 --- a/src/modules/netlib/netliblog.cpp +++ b/src/modules/netlib/netliblog.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/netlib/netlibopenconn.cpp b/src/modules/netlib/netlibopenconn.cpp index 8d2a5e74fc..4b4a5ea4d8 100644 --- a/src/modules/netlib/netlibopenconn.cpp +++ b/src/modules/netlib/netlibopenconn.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2012 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "netlib.h" @@ -39,7 +40,7 @@ DWORD DnsLookup(struct NetlibUser *nlu, const char *szHost) if (ip != INADDR_NONE) return ip; - __try + __try { host = gethostbyname(szHost); if (host) @@ -96,7 +97,7 @@ bool RecvUntilTimeout(struct NetlibConnection *nlc, char *buf, int len, int flag DWORD dwTimeNow, dwCompleteTime = GetTickCount() + dwTimeout; while ((dwTimeNow = GetTickCount()) < dwCompleteTime) { - if (WaitUntilReadable(nlc->s, dwCompleteTime - dwTimeNow) <= 0) return false; + if (WaitUntilReadable(nlc->s, dwCompleteTime - dwTimeNow) <= 0) return false; nReceived = NLRecv(nlc, buf, len, flags); if (nReceived <= 0) return false; @@ -125,9 +126,9 @@ static int NetlibInitSocks4Connection(NetlibConnection *nlc, NetlibUser *nlu, NE if (nUserLen <= 1) pInit[8] = 0; else memcpy(&pInit[8], nlu->settings.szProxyAuthUser, nUserLen); - //if cannot resolve host, try resolving through proxy (requires SOCKS4a) + //if cannot resolve host, try resolving through proxy (requires SOCKS4a) DWORD ip = DnsLookup(nlu, nloc->szHost); - *(PDWORD)&pInit[4] = ip ? ip : 0x01000000; + *(PDWORD)&pInit[4] = ip ? ip : 0x01000000; if ( !ip) { memcpy(&pInit[len], nloc->szHost, nHostLen); len += nHostLen; @@ -252,7 +253,7 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc, struct Netli } if (buf[0] != 5 || buf[1]) { - const char* err = "Unknown response"; + const char* err = "Unknown response"; if (buf[0] != 5) SetLastError(ERROR_BAD_FORMAT); else { @@ -290,7 +291,7 @@ static int NetlibInitSocks5Connection(struct NetlibConnection *nlc, struct Netli if ( !RecvUntilTimeout(nlc, (char*)buf, nRecvSize, MSG_DUMPPROXY, RECV_DEFAULT_TIMEOUT)) { NetlibLogf(nlu, "%s %d: %s() failed (%u)", __FILE__, __LINE__, "RecvUntilTimeout", GetLastError()); return 0; - } + } //connected return 1; @@ -305,7 +306,7 @@ static bool NetlibInitHttpsConnection(struct NetlibConnection *nlc, struct Netli nlhrSend.cbSize = sizeof(nlhrSend); nlhrSend.requestType = REQUEST_CONNECT; nlhrSend.flags = NLHRF_GENERATEHOST | NLHRF_DUMPPROXY | NLHRF_SMARTAUTHHEADER | NLHRF_HTTP11 | NLHRF_NOPROXY | NLHRF_REDIRECT; - if (nlc->dnsThroughProxy) + if (nlc->dnsThroughProxy) mir_snprintf(szUrl, SIZEOF(szUrl), "%s:%u", nloc->szHost, nloc->wPort); else { DWORD ip = DnsLookup(nlu, nloc->szHost); @@ -363,8 +364,8 @@ static void FreePartiallyInitedConnection(struct NetlibConnection *nlc) static bool my_connectIPv4(NetlibConnection *nlc, NETLIBOPENCONNECTION * nloc) { int rc = 0, retrycnt = 0; - u_long notblocking = 1; - DWORD lasterr = 0; + u_long notblocking = 1; + DWORD lasterr = 0; static const TIMEVAL tv = { 1, 0 }; unsigned int dwTimeout = (nloc->cbSize == sizeof(NETLIBOPENCONNECTION) && nloc->flags & NLOCF_V2) ? nloc->timeout : 0; @@ -425,7 +426,7 @@ retry: if (nlc->nlu->settings.specifyOutgoingPorts && nlc->nlu->settings.szOutgoingPorts && nlc->nlu->settings.szOutgoingPorts[0]) { if ( !BindSocketToPort(nlc->nlu->settings.szOutgoingPorts, nlc->s, INVALID_SOCKET, &nlc->nlu->inportnum)) NetlibLogf(nlc->nlu, "Netlib connect: Not enough ports for outgoing connections specified"); - } + } // try a connect if (connect(nlc->s, (LPSOCKADDR)&sin, sizeof(sin)) == 0) { @@ -447,7 +448,7 @@ retry: FD_SET(nlc->s, &r); FD_SET(nlc->s, &w); FD_SET(nlc->s, &e); - if ((rc = select(0, &r, &w, &e, &tv)) == SOCKET_ERROR) + if ((rc = select(0, &r, &w, &e, &tv)) == SOCKET_ERROR) break; if (rc > 0) { @@ -471,12 +472,12 @@ retry: } } break; - } + } else if (Miranda_Terminated()) { rc = SOCKET_ERROR; lasterr = ERROR_TIMEOUT; break; - } + } else if (nloc->cbSize == sizeof(NETLIBOPENCONNECTION) && nloc->flags & NLOCF_V2 && nloc->waitcallback != NULL && nloc->waitcallback(&dwTimeout) == 0) { rc = SOCKET_ERROR; lasterr = ERROR_TIMEOUT; @@ -504,8 +505,8 @@ retry: static bool my_connectIPv6(NetlibConnection *nlc, NETLIBOPENCONNECTION * nloc) { int rc = SOCKET_ERROR, retrycnt = 0; - u_long notblocking = 1; - DWORD lasterr = 0; + u_long notblocking = 1; + DWORD lasterr = 0; static const TIMEVAL tv = { 1, 0 }; unsigned int dwTimeout = (nloc->cbSize == sizeof(NETLIBOPENCONNECTION) && nloc->flags & NLOCF_V2) ? nloc->timeout : 0; @@ -601,7 +602,7 @@ retry: continue; } - while (true) { // timeout loop + while (true) { // timeout loop fd_set r, w, e; FD_ZERO(&r); FD_ZERO(&w); FD_ZERO(&e); FD_SET(nlc->s, &r); @@ -788,7 +789,7 @@ bool NetlibDoConnect(NetlibConnection *nlc) bool NetlibReconnect(NetlibConnection *nlc) { char buf[4]; - bool opened = nlc->s != INVALID_SOCKET; + bool opened = nlc->s != INVALID_SOCKET; if (opened) { switch (WaitUntilReadable(nlc->s, 0, true)) { case SOCKET_ERROR: diff --git a/src/modules/netlib/netlibopts.cpp b/src/modules/netlib/netlibopts.cpp index 1a28e62df4..49be304e5b 100644 --- a/src/modules/netlib/netlibopts.cpp +++ b/src/modules/netlib/netlibopts.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,10 +20,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "netlib.h" -struct NetlibTempSettings +struct NetlibTempSettings { DWORD flags; char *szSettingsModule; @@ -32,37 +33,37 @@ struct NetlibTempSettings static LIST tempSettings(5); -static const UINT outgoingConnectionsControls[] = +static const UINT outgoingConnectionsControls[] = { - IDC_STATIC12, - IDC_USEPROXY, - IDC_STATIC21, IDC_PROXYTYPE, - IDC_STATIC22, IDC_PROXYHOST, IDC_STATIC23, IDC_PROXYPORT, IDC_STOFTENPORT, - IDC_PROXYAUTH, - IDC_STATIC31, IDC_PROXYUSER, IDC_STATIC32, IDC_PROXYPASS, - IDC_PROXYDNS, - IDC_SPECIFYPORTSO, - IDC_PORTSRANGEO, - IDC_STATIC54, + IDC_STATIC12, + IDC_USEPROXY, + IDC_STATIC21, IDC_PROXYTYPE, + IDC_STATIC22, IDC_PROXYHOST, IDC_STATIC23, IDC_PROXYPORT, IDC_STOFTENPORT, + IDC_PROXYAUTH, + IDC_STATIC31, IDC_PROXYUSER, IDC_STATIC32, IDC_PROXYPASS, + IDC_PROXYDNS, + IDC_SPECIFYPORTSO, + IDC_PORTSRANGEO, + IDC_STATIC54, IDC_VALIDATESSL}; static const UINT useProxyControls[] = { - IDC_STATIC21, IDC_PROXYTYPE, - IDC_STATIC22, IDC_PROXYHOST, IDC_STATIC23, IDC_PROXYPORT, IDC_STOFTENPORT, - IDC_PROXYAUTH, - IDC_STATIC31, IDC_PROXYUSER, IDC_STATIC32, IDC_PROXYPASS, + IDC_STATIC21, IDC_PROXYTYPE, + IDC_STATIC22, IDC_PROXYHOST, IDC_STATIC23, IDC_PROXYPORT, IDC_STOFTENPORT, + IDC_PROXYAUTH, + IDC_STATIC31, IDC_PROXYUSER, IDC_STATIC32, IDC_PROXYPASS, IDC_PROXYDNS}; static const UINT specifyOPortsControls[] = { - IDC_PORTSRANGEO, + IDC_PORTSRANGEO, IDC_STATIC54 }; static const UINT incomingConnectionsControls[] = { - IDC_STATIC43, - IDC_SPECIFYPORTS, - IDC_PORTSRANGE, - IDC_STATIC52, + IDC_STATIC43, + IDC_SPECIFYPORTS, + IDC_PORTSRANGE, + IDC_STATIC52, IDC_ENABLEUPNP}; static const UINT specifyPortsControls[] = { - IDC_PORTSRANGE, + IDC_PORTSRANGE, IDC_STATIC52}; static const TCHAR* szProxyTypes[] = {_T(""), _T("SOCKS4"), _T("SOCKS5"), _T("HTTP"), _T("HTTPS"), _T("Internet Explorer")}; @@ -345,7 +346,7 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, EnableMultipleControls(hwndDlg, useProxyControls, SIZEOF(useProxyControls), TRUE); if (selectedProxyType == 0) { for (int i=0; i < tempSettings.getCount(); i++) { - if ( !tempSettings[i]->settings.useProxy || + if ( !tempSettings[i]->settings.useProxy || tempSettings[i]->flags & NUF_NOOPTIONS || !(tempSettings[i]->flags & NUF_OUTGOING)) continue; @@ -478,7 +479,7 @@ static INT_PTR CALLBACK DlgProcNetlibOpts(HWND hwndDlg, UINT msg, WPARAM wParam, switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: for (iUser = 0; iUser < tempSettings.getCount(); iUser++) - NetlibSaveUserSettingsStruct(tempSettings[iUser]->szSettingsModule, + NetlibSaveUserSettingsStruct(tempSettings[iUser]->szSettingsModule, &tempSettings[iUser]->settings); return TRUE; } diff --git a/src/modules/netlib/netlibpktrecver.cpp b/src/modules/netlib/netlibpktrecver.cpp index 4e887b1177..45e39344c5 100644 --- a/src/modules/netlib/netlibpktrecver.cpp +++ b/src/modules/netlib/netlibpktrecver.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "netlib.h" diff --git a/src/modules/netlib/netlibsecurity.cpp b/src/modules/netlib/netlibsecurity.cpp index 05ee106aa7..33656dc868 100644 --- a/src/modules/netlib/netlibsecurity.cpp +++ b/src/modules/netlib/netlibsecurity.cpp @@ -1,7 +1,8 @@ /* + Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -10,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -67,7 +68,7 @@ static HANDLE hSecMutex; static void ReportSecError(SECURITY_STATUS scRet, int line) { char szMsgBuf[256]; - FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, scRet, LANG_USER_DEFAULT, szMsgBuf, SIZEOF(szMsgBuf), NULL); char *p = strchr(szMsgBuf, 13); if (p) *p = 0; @@ -123,7 +124,7 @@ HANDLE NetlibInitSecurityProvider(const TCHAR* szProvider, const TCHAR* szPrinci WaitForSingleObject(hSecMutex, INFINITE); - if (secCnt == 0) + if (secCnt == 0) { LoadSecurityLibrary(); secCnt += g_hSecurity != NULL; @@ -193,17 +194,17 @@ char* CompleteGssapi(HANDLE hSecurity, unsigned char *szChallenge, unsigned chls NtlmHandleType* hNtlm = (NtlmHandleType*)hSecurity; unsigned char inDataBuffer[1024]; - SecBuffer inBuffers[2] = + SecBuffer inBuffers[2] = { - { sizeof(inDataBuffer), SECBUFFER_DATA, inDataBuffer }, - { chlsz, SECBUFFER_STREAM, szChallenge }, + { sizeof(inDataBuffer), SECBUFFER_DATA, inDataBuffer }, + { chlsz, SECBUFFER_STREAM, szChallenge }, }; SecBufferDesc inBuffersDesc = { SECBUFFER_VERSION, 2, inBuffers }; unsigned long qop = 0; SECURITY_STATUS sc = g_pSSPI->DecryptMessage(&hNtlm->hClientContext, &inBuffersDesc, 0, &qop); - if (sc != SEC_E_OK) + if (sc != SEC_E_OK) { ReportSecError(sc, __LINE__); return NULL; @@ -225,10 +226,10 @@ char* CompleteGssapi(HANDLE hSecurity, unsigned char *szChallenge, unsigned chls unsigned char outDataBuffer[4] = { 1, 0, 16, 0 }; - SecBuffer outBuffers[3] = + SecBuffer outBuffers[3] = { - { sizes.cbSecurityTrailer, SECBUFFER_TOKEN, tokenBuffer }, - { sizeof(outDataBuffer), SECBUFFER_DATA, outDataBuffer }, + { sizes.cbSecurityTrailer, SECBUFFER_TOKEN, tokenBuffer }, + { sizeof(outDataBuffer), SECBUFFER_DATA, outDataBuffer }, { sizes.cbBlockSize, SECBUFFER_PADDING, paddingBuffer } }; SecBufferDesc outBuffersDesc = { SECBUFFER_VERSION, 3, outBuffers }; @@ -245,7 +246,7 @@ char* CompleteGssapi(HANDLE hSecurity, unsigned char *szChallenge, unsigned chls ressz += outBuffersDesc.pBuffers[i].cbBuffer; unsigned char *response = (unsigned char*)alloca(ressz), *p = response; - for (i=0; i < outBuffersDesc.cBuffers; i++) + for (i=0; i < outBuffersDesc.cBuffers; i++) { memcpy(p, outBuffersDesc.pBuffers[i].pvBuffer, outBuffersDesc.pBuffers[i].cbBuffer); p += outBuffersDesc.pBuffers[i].cbBuffer; @@ -259,7 +260,7 @@ char* CompleteGssapi(HANDLE hSecurity, unsigned char *szChallenge, unsigned chls if ( !NetlibBase64Encode(0, (LPARAM)&nlb64)) return NULL; return mir_strdup(nlb64.pszEncoded); -} +} char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, const TCHAR* login, const TCHAR* psw, bool http, unsigned& complete) { @@ -333,14 +334,14 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, } } } - else + else { if (SecIsValidHandle(&hNtlm->hClientContext)) g_pSSPI->DeleteSecurityContext(&hNtlm->hClientContext); if (SecIsValidHandle(&hNtlm->hClientCredential)) g_pSSPI->FreeCredentialsHandle(&hNtlm->hClientCredential); SEC_WINNT_AUTH_IDENTITY auth; - if (login != NULL && login[0] != '\0') + if (login != NULL && login[0] != '\0') { memset(&auth, 0, sizeof(auth)); @@ -357,7 +358,7 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, domainLen = domainName - login; domainName = login; } - else if ((domainName = _tcschr(login, '@')) != NULL) + else if ((domainName = _tcschr(login, '@')) != NULL) { loginName = login; loginLen = domainName - login; @@ -375,8 +376,8 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, hNtlm->hasDomain = domainLen != 0; } - sc = g_pSSPI->AcquireCredentialsHandle(NULL, szProvider, - SECPKG_CRED_OUTBOUND, NULL, hNtlm->hasDomain ? &auth : NULL, NULL, NULL, + sc = g_pSSPI->AcquireCredentialsHandle(NULL, szProvider, + SECPKG_CRED_OUTBOUND, NULL, hNtlm->hasDomain ? &auth : NULL, NULL, NULL, &hNtlm->hClientCredential, &tokenExpiration); if (sc != SEC_E_OK) { @@ -392,10 +393,10 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, outputSecurityToken.cbBuffer = hNtlm->cbMaxToken; outputSecurityToken.pvBuffer = alloca(outputSecurityToken.cbBuffer); - sc = g_pSSPI->InitializeSecurityContext(&hNtlm->hClientCredential, - hasChallenge ? &hNtlm->hClientContext : NULL, - hNtlm->szPrincipal, isGSSAPI ? ISC_REQ_MUTUAL_AUTH | ISC_REQ_STREAM : 0, 0, SECURITY_NATIVE_DREP, - hasChallenge ? &inputBufferDescriptor : NULL, 0, &hNtlm->hClientContext, + sc = g_pSSPI->InitializeSecurityContext(&hNtlm->hClientCredential, + hasChallenge ? &hNtlm->hClientContext : NULL, + hNtlm->szPrincipal, isGSSAPI ? ISC_REQ_MUTUAL_AUTH | ISC_REQ_STREAM : 0, 0, SECURITY_NATIVE_DREP, + hasChallenge ? &inputBufferDescriptor : NULL, 0, &hNtlm->hClientContext, &outputBufferDescriptor, &contextAttributes, &tokenExpiration); complete = (sc != SEC_I_COMPLETE_AND_CONTINUE && sc != SEC_I_CONTINUE_NEEDED); @@ -486,7 +487,7 @@ static INT_PTR NtlmCreateResponseService(WPARAM wParam, LPARAM lParam) NETLIBNTLMREQUEST* req = (NETLIBNTLMREQUEST*)lParam; unsigned complete; - char* response = NtlmCreateResponseFromChallenge((HANDLE)wParam, req->szChallenge, + char* response = NtlmCreateResponseFromChallenge((HANDLE)wParam, req->szChallenge, StrConvT(req->userName), StrConvT(req->password), false, complete); return (INT_PTR)response; @@ -501,14 +502,14 @@ static INT_PTR NtlmCreateResponseService2(WPARAM wParam, LPARAM lParam) if (req->flags & NNR_UNICODE) { - response = NtlmCreateResponseFromChallenge((HANDLE)wParam, req->szChallenge, + response = NtlmCreateResponseFromChallenge((HANDLE)wParam, req->szChallenge, req->szUserName, req->szPassword, false, req->complete); } else { TCHAR *szLogin = mir_a2t((char*)req->szUserName); TCHAR *szPassw = mir_a2t((char*)req->szPassword); - response = NtlmCreateResponseFromChallenge((HANDLE)wParam, req->szChallenge, + response = NtlmCreateResponseFromChallenge((HANDLE)wParam, req->szChallenge, szLogin, szPassw, false, req->complete); mir_free(szLogin); mir_free(szPassw); diff --git a/src/modules/netlib/netlibsock.cpp b/src/modules/netlib/netlibsock.cpp index 5918263110..03138ef389 100644 --- a/src/modules/netlib/netlibsock.cpp +++ b/src/modules/netlib/netlibsock.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2012 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "netlib.h" @@ -88,7 +89,7 @@ INT_PTR NetlibRecv(WPARAM wParam, LPARAM lParam) recvResult = recv(nlc->s, nlb->buf, nlb->len, nlb->flags & 0xFFFF); } NetlibLeaveNestedCS(&nlc->ncsRecv); - if (recvResult <= 0) + if (recvResult <= 0) return recvResult; NetlibDumpData(nlc, (PBYTE)nlb->buf, recvResult, 0, nlb->flags); @@ -184,7 +185,7 @@ INT_PTR NetlibSelectEx(WPARAM, LPARAM lParam) This happens for read/write/except */ NetlibConnection *conn = NULL; int j; - for (j = 0; j < FD_SETSIZE; j++) + for (j = 0; j < FD_SETSIZE; j++) { conn = (NetlibConnection*)nls->hReadConns[j]; if (conn == NULL || conn == INVALID_HANDLE_VALUE) break; @@ -228,7 +229,7 @@ bool NetlibStringToAddress(const char* str, SOCKADDR_INET_M* addr) addr->Ipv4.sin_addr.s_addr = iaddr; addr->Ipv4.sin_family = AF_INET; - return true; + return true; } } @@ -250,7 +251,7 @@ char* NetlibAddressToString(SOCKADDR_INET_M* addr) mir_snprintf(saddr, sizeof(saddr), "%s:%d", szIp, htons(addr->Ipv4.sin_port)); return mir_strdup(saddr); } - else + else return mir_strdup(szIp); } return NULL; @@ -284,7 +285,7 @@ inline bool IsAddrGlobal(const IN6_ADDR *a) static NETLIBIPLIST* GetMyIpv6(unsigned flags) { addrinfo *air = NULL, *ai, hints = {0}; - const char *szMyHost = ""; + const char *szMyHost = ""; hints.ai_family = AF_UNSPEC; hints.ai_flags = AI_PASSIVE; @@ -296,8 +297,8 @@ static NETLIBIPLIST* GetMyIpv6(unsigned flags) for (ai = air; ai; ai = ai->ai_next) { SOCKADDR_INET_M* iaddr = (SOCKADDR_INET_M*)ai->ai_addr; - if (ai->ai_family == AF_INET || - (ai->ai_family == AF_INET6 && + if (ai->ai_family == AF_INET || + (ai->ai_family == AF_INET6 && ( !(flags & 1) || IsAddrGlobal(&iaddr->Ipv6.sin6_addr)))) ++n; } @@ -309,8 +310,8 @@ static NETLIBIPLIST* GetMyIpv6(unsigned flags) for (ai = air; ai; ai = ai->ai_next) { SOCKADDR_INET_M* iaddr = (SOCKADDR_INET_M*)ai->ai_addr; - if (ai->ai_family == AF_INET || - (ai->ai_family == AF_INET6 && + if (ai->ai_family == AF_INET || + (ai->ai_family == AF_INET6 && ( !(flags & 1) || IsAddrGlobal(&iaddr->Ipv6.sin6_addr)))) { @@ -336,7 +337,7 @@ static NETLIBIPLIST* GetMyIpv4(void) NETLIBIPLIST *addr = (NETLIBIPLIST*)mir_calloc(n * 64 + 4); addr->cbNum = n; - for (unsigned i=0; i < n; i++) + for (unsigned i=0; i < n; i++) strcpy(addr->szIp[i], inet_ntoa(*(PIN_ADDR)he->h_addr_list[i])); return addr; diff --git a/src/modules/netlib/netlibssl.cpp b/src/modules/netlib/netlibssl.cpp index 6327edb459..0a989ff9b7 100644 --- a/src/modules/netlib/netlibssl.cpp +++ b/src/modules/netlib/netlibssl.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp index 50f6e421f9..564d7093a7 100644 --- a/src/modules/netlib/netlibupnp.cpp +++ b/src/modules/netlib/netlibupnp.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2012 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,10 +20,11 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "netlib.h" -static const char search_request_msg[] = +static const char search_request_msg[] = "M-SEARCH * HTTP/1.1\r\n" "HOST: 239.255.255.250:1900\r\n" "MAN: \"ssdp:discover\"\r\n" @@ -31,12 +32,12 @@ static const char search_request_msg[] = "ST: urn:schemas-upnp-org:service:%s\r\n" "\r\n"; -static const char xml_get_hdr[] = +static const char xml_get_hdr[] = "GET %s HTTP/1.1\r\n" "HOST: %s:%u\r\n" "ACCEPT-LANGUAGE: *\r\n\r\n"; -static const char soap_post_hdr[] = +static const char soap_post_hdr[] = "POST %s HTTP/1.1\r\n" "HOST: %s:%u\r\n" "CONTENT-LENGTH: %u\r\n" @@ -44,7 +45,7 @@ static const char soap_post_hdr[] = "SOAPACTION: \"%s#%s\"\r\n\r\n" "%s"; -static const char soap_post_hdr_m[] = +static const char soap_post_hdr_m[] = "M-POST %s URL HTTP/1.1\r\n" "HOST: %s:%u\r\n" "CONTENT-LENGTH: %u\r\n" @@ -53,10 +54,10 @@ static const char soap_post_hdr_m[] = "01-SOAPACTION: \"%s#%s\"\r\n\r\n" "%s"; -static const char search_device[] = +static const char search_device[] = "%s"; -static const char soap_action[] = +static const char soap_action[] = "\r\n" "\r\n"; -static const char soap_query[] = +static const char soap_query[] = "\r\n" + " xmlns:s = \"http://schemas.xmlsoap.org/soap/envelope/\"\r\n" + " s:encodingStyle = \"http://schemas.xmlsoap.org/soap/encoding/\">\r\n" " \r\n" " \r\n" " %s\r\n" @@ -79,7 +80,7 @@ static const char soap_query[] = " \r\n" "\r\n"; -static const char add_port_mapping[] = +static const char add_port_mapping[] = " \r\n" " %i\r\n" " %s\r\n" @@ -89,12 +90,12 @@ static const char add_port_mapping[] = " Miranda\r\n" " 0\r\n"; -static const char delete_port_mapping[] = +static const char delete_port_mapping[] = " \r\n" " %i\r\n" " %s\r\n"; -static const char get_port_mapping[] = +static const char get_port_mapping[] = " %i\r\n"; static bool gatewayFound; @@ -115,12 +116,12 @@ static char szCtlUrl[256], szDev[256]; typedef enum { - DeviceGetReq, - ControlAction, + DeviceGetReq, + ControlAction, ControlQuery } ReqType; -static bool txtParseParam(char* szData, char* presearch, +static bool txtParseParam(char* szData, char* presearch, char* start, char* finish, char* param, size_t size) { char *cp, *cp1; @@ -271,11 +272,11 @@ static int httpTransact(char* szUrl, char* szResult, int resSize, char* szAction char szData1[1024]; szReq = mir_strdup(szResult); - sz = mir_snprintf (szData1, sizeof(szData1), + sz = mir_snprintf (szData1, sizeof(szData1), soap_action, szActionName, szDev, szReq, szActionName); - sz = mir_snprintf (szData, 4096, - szPostHdr, szPath, szHost, sPort, + sz = mir_snprintf (szData, 4096, + szPostHdr, szPath, szHost, sPort, sz, szDev, szActionName, szData1); } break; @@ -284,11 +285,11 @@ static int httpTransact(char* szUrl, char* szResult, int resSize, char* szAction { char szData1[1024]; - sz = mir_snprintf (szData1, sizeof(szData1), + sz = mir_snprintf (szData1, sizeof(szData1), soap_query, szActionName); - sz = mir_snprintf (szData, 4096, - szPostHdr, szPath, szHost, sPort, + sz = mir_snprintf (szData, 4096, + szPostHdr, szPath, szHost, sPort, sz, "urn:schemas-upnp-org:control-1-0", "QueryStateVariable", szData1); } break; @@ -438,7 +439,7 @@ retrycon: if (hdrend != NULL) { // Get packet size if provided - if (txtParseParam(szResult, NULL, "Content-Length:", "\n", szRes, sizeof(szRes)) || + if (txtParseParam(szResult, NULL, "Content-Length:", "\n", szRes, sizeof(szRes)) || txtParseParam(szResult, NULL, "CONTENT-LENGTH:", "\n", szRes, sizeof(szRes))) { // Add size of HTTP header to the packet size to compute full transmission size @@ -659,7 +660,7 @@ static void discoverUPnP(void) buf[buflen] = 0; LongLog(buf); - if (txtParseParam(buf, NULL, "LOCATION:", "\n", szUrl, sizeof(szUrl)) || + if (txtParseParam(buf, NULL, "LOCATION:", "\n", szUrl, sizeof(szUrl)) || txtParseParam(buf, NULL, "Location:", "\n", szUrl, sizeof(szUrl))) { char age[30]; @@ -739,7 +740,7 @@ bool NetlibUPnPAddPortMapping(WORD intport, char *proto, WORD *extport, DWORD *e do { ++*extport; - mir_snprintf(szData, 4096, add_port_mapping, + mir_snprintf(szData, 4096, add_port_mapping, *extport, proto, intport, inet_ntoa(locIP.sin_addr)); res = httpTransact(szCtlUrl, szData, 4096, "AddPortMapping", ControlAction); txtParseParam(szData, NULL, "", "", szExtIP, sizeof(szExtIP)); @@ -752,7 +753,7 @@ bool NetlibUPnPAddPortMapping(WORD intport, char *proto, WORD *extport, DWORD *e if (res == 200) { unsigned ip = getExtIP(); - if (ip) *extip = ip; + if (ip) *extip = ip; if (numports >= numportsAlloc) mir_realloc(portList, sizeof(WORD)*(numportsAlloc += 10)); @@ -845,7 +846,7 @@ void NetlibUPnPCleanup(void*) { WORD mport = (WORD)atol(buf); - if (j >= SIZEOF(ports)) + if (j >= SIZEOF(ports)) break; for (k = 0; k= y;) { COLORREF color = RGB( - ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height, - ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height, + ((height-i-1)*rgb0->rgbRed + i*rgb1->rgbRed) / height, + ((height-i-1)*rgb0->rgbGreen + i*rgb1->rgbGreen) / height, ((height-i-1)*rgb0->rgbBlue + i*rgb1->rgbBlue) / height); rc.top = rc.bottom = i; ++rc.bottom; @@ -161,20 +160,20 @@ static LRESULT MDescButton_OnPaint(HWND hwndDlg, MDescButtonCtrl *dat, UINT msg temprc.left = 0; temprc.right = dat->width; temprc.top = 0; - + //Draw background if (dat->bMouseInside || (GetFocus() == hwndDlg)) { MDescButton_FillRect(tempDC, 0, 0, dat->width, dat->height, dat->clSelBorder); MDescButton_DrawGradient(tempDC, 1, 1, dat->width-2, dat->height-2, &dat->rgbSelTop, &dat->rgbSelBottom); SetTextColor(tempDC, dat->clSelText); - } + } else { MDescButton_FillRect(tempDC, 0, 0, dat->width, dat->height, dat->clBackground); SetTextColor(tempDC, dat->clText); } if (dat->hIcon) - DrawIcon(tempDC, DBC_BORDER_SIZE, DBC_BORDER_SIZE, dat->hIcon); + DrawIcon(tempDC, DBC_BORDER_SIZE, DBC_BORDER_SIZE, dat->hIcon); hfntSave = (HFONT)SelectObject(tempDC, dat->hFont); SetBkMode(tempDC, TRANSPARENT); @@ -309,7 +308,7 @@ static LRESULT CALLBACK MDescButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wPara if (wParam & MDBCF_SHAREDICON) { dat->bSharedIcon = TRUE; dat->hIcon = (HICON)lParam; - } + } else { dat->bSharedIcon = FALSE; dat->hIcon = CopyIcon((HICON)lParam); @@ -326,7 +325,7 @@ static LRESULT CALLBACK MDescButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wPara DestroyIcon(dat->hIcon); mir_free(dat); return TRUE; - } + } return DefWindowProc(hwndDlg, msg, wParam, lParam); } diff --git a/src/modules/options/filter.cpp b/src/modules/options/filter.cpp index c4cad5a70f..5b9d53a707 100644 --- a/src/modules/options/filter.cpp +++ b/src/modules/options/filter.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/options/filter.h b/src/modules/options/filter.h index c8a62665d3..df81e247ce 100644 --- a/src/modules/options/filter.h +++ b/src/modules/options/filter.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/options/headerbar.cpp b/src/modules/options/headerbar.cpp index 3eddace9e1..5db6a627fc 100644 --- a/src/modules/options/headerbar.cpp +++ b/src/modules/options/headerbar.cpp @@ -3,8 +3,7 @@ Miranda IM: the free IM client for Microsoft* Windows* Copyright 2007 Artem Shpynov -Copyright 2000-2007 Miranda ICQ/IM project, - +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/options/iconheader.cpp b/src/modules/options/iconheader.cpp index 49fe2e1fe8..0bdbd3209d 100644 --- a/src/modules/options/iconheader.cpp +++ b/src/modules/options/iconheader.cpp @@ -3,8 +3,7 @@ Miranda IM: the free IM client for Microsoft* Windows* Copyright 2007 Artem Shpynov -Copyright 2000-2007 Miranda ICQ/IM project, - +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 0fea7c4a36..285c38dc4e 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "filter.h" @@ -98,7 +99,7 @@ struct OptionsDlgData RECT rcDisplay; RECT rcTab; HFONT hBoldFont; - TCHAR szFilterString[1024]; + TCHAR szFilterString[1024]; HANDLE hPluginLoad, hPluginUnload; OptionsPageData* getCurrent() const @@ -206,9 +207,9 @@ static TCHAR *GetPluginName(HINSTANCE hInstance, TCHAR *buffer, int size) else { dllName++; } - + _tcsncpy(buffer, dllName, size); - + return buffer; } @@ -229,15 +230,15 @@ static void FindFilterStrings(int enableKeywordFiltering, int current, HWND hWnd hWnd = CreateDialogIndirectParamA(page->hInst, page->pTemplate, hWndParent, page->dlgProc, page->dwInitParam); //create the options dialog page so we can parse it ShowWindow(hWnd, SW_HIDE); //make sure it's hidden } } - + DWORD key = GetPluginPageHash(page); //get the plugin page hash - + TCHAR *PluginFullName = NULL; char * temp = GetPluginNameByInstance(page->hInst); if (temp) PluginFullName = mir_a2t(temp); GetDialogStrings(enableKeywordFiltering, key, GetPluginName(page->hInst, pluginName, SIZEOF(pluginName)), hWnd, page->ptszGroup, page->ptszTitle, page->ptszTab, PluginFullName); if (PluginFullName) mir_free(PluginFullName); - + if (enableKeywordFiltering && !current) DestroyWindow(hWnd); //destroy the page, we're done with it } @@ -245,7 +246,7 @@ static void FindFilterStrings(int enableKeywordFiltering, int current, HWND hWnd static int MatchesFilter(const OptionsPageData *page, TCHAR *szFilterString) { DWORD key = GetPluginPageHash(page); - + return ContainsFilterString(key, szFilterString); } @@ -256,7 +257,7 @@ static LRESULT CALLBACK OptionsFilterSubclassProc(HWND hWnd, UINT message, WPARA if (message != WM_PAINT && message != WM_PRINT) return CallWindowProc(OptionsFilterDefaultProc, hWnd, message, wParam, lParam); - if (GetFocus() == hWnd || GetWindowTextLength(hWnd)) + if (GetFocus() == hWnd || GetWindowTextLength(hWnd)) return CallWindowProc(OptionsFilterDefaultProc, hWnd, message, wParam, lParam); RECT rc; @@ -276,7 +277,7 @@ static LRESULT CALLBACK OptionsFilterSubclassProc(HWND hWnd, UINT message, WPARA mir_sntprintf(buf, SIZEOF(buf), TranslateT("Search")); BOOL bDrawnByTheme = FALSE; - + int oldMode = SetBkMode(hdc, TRANSPARENT); if (openThemeData) { @@ -436,12 +437,12 @@ static void CALLBACK FilterSearchTimerFunc(HWND hwnd, UINT, UINT_PTR, DWORD) OptionsDlgData* dat = (OptionsDlgData*)GetWindowLongPtr(hwnd, GWLP_USERDATA); if ( !dat) return; - + if (hFilterSearchWnd == NULL) hFilterSearchWnd = CreateWindowA("STATIC", "Test", WS_OVERLAPPED|WS_DISABLED, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, GetModuleHandle(NULL), 0); // Fake window to keep option page focused if (FilterPage < dat->arOpd.getCount()) - FindFilterStrings(TRUE, dat->currentPage == FilterPage, hFilterSearchWnd, dat->arOpd[FilterPage]); + FindFilterStrings(TRUE, dat->currentPage == FilterPage, hFilterSearchWnd, dat->arOpd[FilterPage]); FilterPage++; FilterLoadProgress = FilterPage*100/((dat->arOpd.getCount()) ? dat->arOpd.getCount() : FilterPage); @@ -474,9 +475,9 @@ static void FillFilterCombo(HWND hDlg, OptionsDlgData* dat) index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT) CB_ADDSTRING, 0, (LPARAM)TranslateTS(CORE_MODULES_FILTER)); SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT) CB_SETITEMDATA, (WPARAM)index, (LPARAM)hInst); TCHAR *tszModuleName = (TCHAR*)alloca(MAX_PATH*sizeof(TCHAR)); - for (int i=0; i < dat->arOpd.getCount(); i++) { + for (int i=0; i < dat->arOpd.getCount(); i++) { FindFilterStrings(FALSE, FALSE, hDlg, dat->arOpd[i]); // only modules name (fast enougth) - + HINSTANCE inst = dat->arOpd[i]->hInst; if (inst == hInst) continue; @@ -496,17 +497,17 @@ static void FillFilterCombo(HWND hDlg, OptionsDlgData* dat) { char *name = GetPluginNameByInstance(inst); if (name) - dllName = mir_a2t(name); + dllName = mir_a2t(name); } if ( !dllName) dllName = mir_tstrdup(_tcsrchr(tszModuleName, _T('\\'))); if ( !dllName) dllName = mir_tstrdup(tszModuleName); - + if (dllName) { index = SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT) CB_ADDSTRING, 0, (LPARAM)dllName); SendDlgItemMessage(hDlg, IDC_KEYWORD_FILTER, (UINT) CB_SETITEMDATA, (WPARAM)index, (LPARAM)inst); mir_free(dllName); - } + } } FilterLoadProgress = 100; @@ -534,7 +535,7 @@ static bool LoadOptionsPage(OPTIONSDIALOGPAGE *src, OptionsPageData *dst) HRSRC hrsrc = FindResourceA(src->hInstance, src->pszTemplate, MAKEINTRESOURCEA(5)); if (hrsrc == NULL) return false; - + HGLOBAL hglb = LoadResource(src->hInstance, hrsrc); if (hglb == NULL) return false; @@ -567,7 +568,7 @@ static bool LoadOptionsPage(OPTIONSDIALOGPAGE *src, OptionsPageData *dst) dst->ptszTitle = NULL; else if (src->flags & ODPF_UNICODE) dst->ptszTitle = mir_tstrdup(src->ptszTitle); - else + else dst->ptszTitle = mir_a2t(src->pszTitle); if (src->pszGroup == NULL) @@ -583,7 +584,7 @@ static bool LoadOptionsPage(OPTIONSDIALOGPAGE *src, OptionsPageData *dst) dst->ptszTab = mir_tstrdup(src->ptszTab); else dst->ptszTab = mir_a2t(src->pszTab); - + return true; } @@ -647,14 +648,14 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L if ( !ServiceExists(MS_MODERNOPT_SHOW)) ShowWindow( GetDlgItem(hdlg, IDC_MODERN), FALSE); - { + { PROPSHEETHEADER *psh = (PROPSHEETHEADER*)lParam; OPENOPTIONSDIALOG *ood = (OPENOPTIONSDIALOG*)psh->pStartPage; TCHAR *lastPage = NULL, *lastGroup = NULL, *lastTab = NULL; DBVARIANT dbv; typedef BOOL (STDAPICALLTYPE *pfnGetComboBoxInfo)(HWND, PCOMBOBOXINFO); - pfnGetComboBoxInfo getComboBoxInfo = (pfnGetComboBoxInfo)GetProcAddress(GetModuleHandleA("user32"), "GetComboBoxInfo"); + pfnGetComboBoxInfo getComboBoxInfo = (pfnGetComboBoxInfo)GetProcAddress(GetModuleHandleA("user32"), "GetComboBoxInfo"); if (getComboBoxInfo) { COMBOBOXINFO cbi; cbi.cbSize = sizeof(COMBOBOXINFO); @@ -675,13 +676,13 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L dat = new OptionsDlgData; SetWindowLongPtr(hdlg, GWLP_USERDATA, (LONG_PTR)dat); SetWindowText(hdlg, psh->pszCaption); - + LOGFONT lf; dat->hBoldFont = (HFONT)SendDlgItemMessage(hdlg, IDC_APPLY, WM_GETFONT, 0, 0); GetObject(dat->hBoldFont, sizeof(lf), &lf); lf.lfWeight = FW_BOLD; dat->hBoldFont = CreateFontIndirect(&lf); - + dat->hPluginLoad = HookEventMessage(ME_SYSTEM_MODULELOAD, hdlg, HM_MODULELOAD); dat->hPluginUnload = HookEventMessage(ME_SYSTEM_MODULEUNLOAD, hdlg, HM_MODULEUNLOAD); @@ -750,18 +751,18 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L return TRUE; case DM_REBUILDPAGETREE: - { + { BOOL bRemoveFocusFromFilter = FALSE; HINSTANCE FilterInst = NULL; LPARAM oldSel = SendDlgItemMessage(hdlg, IDC_KEYWORD_FILTER, CB_GETEDITSEL, 0, 0); GetDlgItemText(hdlg, IDC_KEYWORD_FILTER, dat->szFilterString, SIZEOF(dat->szFilterString)); - + //if filter string is set to all modules then make the filter string empty (this will return all modules) if (_tcscmp(dat->szFilterString, TranslateTS(ALL_MODULES_FILTER)) == 0) { - dat->szFilterString[0] = 0; + dat->szFilterString[0] = 0; bRemoveFocusFromFilter = TRUE; - } + } //if filter string is set to core modules replace it with the name of the executable (this will return all core modules) else if (_tcscmp(dat->szFilterString, TranslateTS(CORE_MODULES_FILTER)) == 0) { //replace string with process name - that will show core settings @@ -772,7 +773,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L pos++; else pos = szFileName; - + _tcsncpy(dat->szFilterString, pos, SIZEOF(dat->szFilterString)); } else { @@ -786,26 +787,26 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L else pos = szFileName; _tcsncpy(dat->szFilterString, pos, SIZEOF(dat->szFilterString)); } } - + _tcslwr_locale(dat->szFilterString); //all strings are stored as lowercase ... make sure filter string is lowercase too SendMessage(hwndTree, WM_SETREDRAW, FALSE, 0); - + HWND oldWnd = NULL; HWND oldTab = NULL; - + opd = dat->getCurrent(); - if (opd != NULL) { + if (opd != NULL) { oldWnd = opd->hwnd; if (opd->insideTab) - oldTab = GetDlgItem(hdlg, IDC_TAB); - } + oldTab = GetDlgItem(hdlg, IDC_TAB); + } dat->hCurrentPage = NULL; TreeView_SelectItem(hwndTree, NULL); TreeView_DeleteAllItems(hwndTree); - + TVINSERTSTRUCT tvis; tvis.hParent = NULL; tvis.hInsertAfter = TVI_SORT; @@ -828,8 +829,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L if (sz) sz+=3; sz += ptszTitle ? _tcslen(ptszTitle)+1 : 0; fullTitle = (TCHAR*)mir_alloc(sz*sizeof(TCHAR)); - mir_sntprintf(fullTitle, sz, (ptszGroup && ptszTitle)?_T("%s - %s"):_T("%s%s"), - ptszGroup ? ptszGroup : _T(""), + mir_sntprintf(fullTitle, sz, (ptszGroup && ptszTitle)?_T("%s - %s"):_T("%s%s"), + ptszGroup ? ptszGroup : _T(""), ptszTitle ? ptszTitle : _T("")); } TCHAR *useTitle = fullTitle ? fullTitle : ptszTitle; @@ -877,12 +878,12 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L tvis.item.lParam = i; opd->hTreeItem = TreeView_InsertItem(hwndTree, &tvis); if (i == dat->currentPage) - dat->hCurrentPage = opd->hTreeItem; + dat->hCurrentPage = opd->hTreeItem; if (fullTitle) mir_free(fullTitle); fullTitle = NULL; } - + char str[128]; TVITEMA tvi; tvi.mask = TVIF_TEXT | TVIF_STATE; @@ -904,14 +905,14 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L dat->currentPage = -1; } TreeView_SelectItem(hwndTree, dat->hCurrentPage); - + if (oldWnd) { opd = dat->getCurrent(); if (opd && oldWnd != opd->hwnd) { ShowWindow(oldWnd, SW_HIDE); if (oldTab && (opd == NULL || !opd->insideTab)) - ShowWindow(oldTab, SW_HIDE); - } + ShowWindow(oldTab, SW_HIDE); + } } if (dat->szFilterString[0] == 0) // Clear the keyword combo box @@ -920,7 +921,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L SetFocus( GetDlgItem(hdlg, IDC_KEYWORD_FILTER)); //set the focus back to the combo box SendDlgItemMessage(hdlg, IDC_KEYWORD_FILTER, CB_SETEDITSEL, 0, oldSel); //but don't select any of the text - + SendMessage(hwndTree, WM_SETREDRAW, TRUE, 0); } break; @@ -935,11 +936,11 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L case PSM_CHANGED: EnableWindow( GetDlgItem(hdlg, IDC_APPLY), TRUE); - + opd = dat->getCurrent(); if (opd) opd->changed = 1; - + return TRUE; case PSM_GETBOLDFONT: @@ -974,11 +975,11 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L case TCN_SELCHANGE: case TVN_SELCHANGED: ShowWindow( GetDlgItem(hdlg, IDC_STNOPAGE), SW_HIDE); - + opd = dat->getCurrent(); if (opd && opd->hwnd != NULL) ShowWindow(opd->hwnd, SW_HIDE); - + if (wParam != IDC_TAB) { TVITEM tvi; tvi.hItem = dat->hCurrentPage = TreeView_GetSelection(hwndTree); @@ -986,12 +987,12 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L ShowWindow( GetDlgItem(hdlg, IDC_TAB), SW_HIDE); break; } - + tvi.mask = TVIF_HANDLE | TVIF_PARAM; TreeView_GetItem(hwndTree, &tvi); dat->currentPage = tvi.lParam; ShowWindow( GetDlgItem(hdlg, IDC_TAB), SW_HIDE); - } + } else { TCITEM tie; tie.mask = TCIF_PARAM; @@ -1067,9 +1068,9 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L ShowWindow(hwndTab, opd->insideTab ? SW_SHOW : SW_HIDE); } - if (opd->insideTab) + if (opd->insideTab) ThemeDialogBackground(opd->hwnd, TRUE); - else + else ThemeDialogBackground(opd->hwnd, FALSE); } @@ -1086,7 +1087,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L if (dat->currentPage != -1) SetFocus(dat->arOpd[dat->currentPage]->hwnd); break; - + case WM_TIMER: if (wParam == FILTER_TIMEOUT_TIMER) { SaveOptionsTreeState(hdlg); @@ -1094,8 +1095,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L KillTimer(hdlg, FILTER_TIMEOUT_TIMER); } - break; - + break; + case WM_COMMAND: switch(LOWORD(wParam)) { case IDC_KEYWORD_FILTER: @@ -1113,7 +1114,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L break; case IDCANCEL: - { + { PSHNOTIFY pshn; pshn.hdr.idFrom = 0; pshn.lParam = 0; @@ -1133,7 +1134,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L { if (LOWORD(wParam) == IDOK && GetParent(GetFocus()) == GetDlgItem(hdlg, IDC_KEYWORD_FILTER)) return TRUE; - + PSHNOTIFY pshn; EnableWindow( GetDlgItem(hdlg, IDC_APPLY), FALSE); SetFocus(hwndTree); @@ -1182,7 +1183,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L SaveOptionsTreeState(hdlg); Window_FreeIcon_IcoLib(hdlg); - + opd = dat->getCurrent(); if (opd) { if (opd->ptszTab) @@ -1200,7 +1201,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L DBDeleteContactSetting(NULL, "Options", "LastGroup"); DBDeleteContactSetting(NULL, "Options", "LastPage"); } - + Utils_SaveWindowPosition(hdlg, NULL, "Options", ""); { for (int i=0; i < dat->arOpd.getCount(); i++) @@ -1211,7 +1212,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L delete dat; hwndOptions = NULL; - CallService(MS_MODERNOPT_RESTORE, 0, 0); + CallService(MS_MODERNOPT_RESTORE, 0, 0); break; } return FALSE; @@ -1264,7 +1265,7 @@ static void OpenOptionsNow(int hLangpack, const char *pszGroup, const char *pszP if (hItem != NULL) TreeView_SelectItem( GetDlgItem(hwndOptions, IDC_PAGETREE), hItem); - } + } } else { OptionsPageInit opi = { 0 }; @@ -1284,8 +1285,8 @@ static void OpenOptionsNow(int hLangpack, const char *pszGroup, const char *pszP psh.pszCaption = TranslateT("Miranda NG Options"); psh.ppsp = (PROPSHEETPAGE*)opi.odp; //blatent misuse of the structure, but what the hell - hwndOptions = CreateDialogParam(hInst, - MAKEINTRESOURCE(bSinglePage ? IDD_OPTIONSPAGE : IDD_OPTIONS), + hwndOptions = CreateDialogParam(hInst, + MAKEINTRESOURCE(bSinglePage ? IDD_OPTIONSPAGE : IDD_OPTIONS), NULL, OptionsDlgProc, (LPARAM)&psh); FreeOptionsData(&opi); @@ -1354,7 +1355,7 @@ static INT_PTR AddOptionsPage(WPARAM wParam, LPARAM lParam) else { dst->ptszTitle = mir_a2u(odp->pszTitle); dst->flags |= ODPF_UNICODE; - } + } } if (odp->ptszGroup != NULL) { @@ -1363,7 +1364,7 @@ static INT_PTR AddOptionsPage(WPARAM wParam, LPARAM lParam) else { dst->ptszGroup = mir_a2t(odp->pszGroup); dst->flags |= ODPF_UNICODE; - } + } } if (odp->ptszTab != NULL) { diff --git a/src/modules/plugins/dll_sniffer.cpp b/src/modules/plugins/dll_sniffer.cpp index 299fb9cd3a..7092b8dc4d 100644 --- a/src/modules/plugins/dll_sniffer.cpp +++ b/src/modules/plugins/dll_sniffer.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "plugins.h" @@ -30,7 +31,7 @@ static IMAGE_SECTION_HEADER *getSectionByRVA(IMAGE_SECTION_HEADER *pISH, int nSe return pISH; return NULL; -} +} MUUID* GetPluginInterfaces(const TCHAR* ptszFileName, bool& bIsPlugin) { @@ -78,14 +79,14 @@ MUUID* GetPluginInterfaces(const TCHAR* ptszFileName, bool& bIsPlugin) INT_PTR base; PIMAGE_DATA_DIRECTORY pIDD; - if ( pINTH->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 && + if ( pINTH->FileHeader.Machine == IMAGE_FILE_MACHINE_I386 && pINTH->FileHeader.SizeOfOptionalHeader >= sizeof(IMAGE_OPTIONAL_HEADER32) && pINTH->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR32_MAGIC) { pIDD = (PIMAGE_DATA_DIRECTORY)( (PBYTE)pINTH + offsetof( IMAGE_NT_HEADERS32, OptionalHeader.DataDirectory )); base = *(DWORD*)((PBYTE)pINTH + offsetof(IMAGE_NT_HEADERS32, OptionalHeader.ImageBase)); - } - else if ( pINTH->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64 && + } + else if ( pINTH->FileHeader.Machine == IMAGE_FILE_MACHINE_AMD64 && pINTH->FileHeader.SizeOfOptionalHeader >= sizeof(IMAGE_OPTIONAL_HEADER64) && pINTH->OptionalHeader.Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) { diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp index c80db5c948..7b3ef4b408 100644 --- a/src/modules/plugins/newplugins.cpp +++ b/src/modules/plugins/newplugins.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "plugins.h" @@ -86,7 +87,7 @@ bool hasMuuid(const BASIC_PLUGIN_INFO& bpi, const MUUID& uuid) ///////////////////////////////////////////////////////////////////////////////////////// // banned plugins -static const MUUID pluginBannedList[] = +static const MUUID pluginBannedList[] = { {0x9d6c3213, 0x02b4, 0x4fe1, { 0x92, 0xe6, 0x52, 0x6d, 0xe2, 0x4f, 0x8d, 0x65 }}, // old chat {0x240a91dc, 0x9464, 0x457a, { 0x97, 0x87, 0xff, 0x1e, 0xa8, 0x8e, 0x77, 0xe3 }}, // old clist @@ -106,7 +107,7 @@ static bool isPluginBanned(const MUUID& u1) ///////////////////////////////////////////////////////////////////////////////////////// // default plugins -static MuuidReplacement pluginDefault[] = +static MuuidReplacement pluginDefault[] = { { MIID_UIUSERINFO, _T("stduserinfo"), NULL }, // 0 { MIID_SRURL, _T("stdurl"), NULL }, // 1 @@ -158,7 +159,7 @@ int LoadStdPlugins() char* GetPluginNameByInstance(HINSTANCE hInstance) { - if (pluginList.getCount() == 0) + if (pluginList.getCount() == 0) return NULL; for (int i=0; i < pluginList.getCount(); i++) { @@ -171,7 +172,7 @@ char* GetPluginNameByInstance(HINSTANCE hInstance) int GetPluginLangByInstance(HINSTANCE hInstance) { - if (pluginList.getCount() == 0) + if (pluginList.getCount() == 0) return NULL; for (int i=0; i < pluginList.getCount(); i++) { @@ -192,7 +193,7 @@ int GetPluginFakeId(const MUUID &uuid, int hLangpack) if ( equalUUID(p->bpi.pluginInfo->uuid, uuid)) return p->hLangpack = (hLangpack) ? hLangpack : --sttFakeID; } - + return 0; } @@ -220,14 +221,14 @@ static bool validInterfaceList(MUUID *piface) * storage */ -static const TCHAR* modulesToSkip[] = +static const TCHAR* modulesToSkip[] = { _T("autoloadavatars.dll"), _T("multiwindow.dll"), _T("fontservice.dll"), _T("icolib.dll"), _T("historyeditor.dll") }; // The following plugins will be checked for a valid MUUID or they will not be loaded -static const TCHAR* expiredModulesToSkip[] = +static const TCHAR* expiredModulesToSkip[] = { _T("scriver.dll"), _T("nconvers.dll"), _T("tabsrmm.dll"), _T("nhistory.dll"), _T("historypp.dll"), _T("help.dll"), _T("loadavatars.dll"), _T("tabsrmm_unicode.dll"), @@ -453,7 +454,7 @@ pluginEntry* OpenPlugin(TCHAR *tszFileName, TCHAR *dir, TCHAR *path) clistPlugins.insert(p); p->pclass |= PCLASS_CLIST; } - // plugin declared that it's a service mode plugin. + // plugin declared that it's a service mode plugin. // load it for a profile manager's window else if ( hasMuuid(pIds, miid_servicemode)) { BASIC_PLUGIN_INFO bpi; @@ -518,7 +519,7 @@ bool TryLoadPlugin(pluginEntry *p, bool bDynamic) p->pclass |= PCLASS_FAILED; return false; } - + p->bpi = bpi; p->pclass |= PCLASS_OK | PCLASS_BASICAPI; } diff --git a/src/modules/plugins/pluginopts.cpp b/src/modules/plugins/pluginopts.cpp index e8c946b510..5c9feb5b38 100644 --- a/src/modules/plugins/pluginopts.cpp +++ b/src/modules/plugins/pluginopts.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2010 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include @@ -133,7 +134,7 @@ static int uuidToString(const MUUID uuid, char *szStr, int cbLen) if (cbLen < 1 || !szStr) return 0; - mir_snprintf(szStr, cbLen, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", + mir_snprintf(szStr, cbLen, "{%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}", uuid.a, uuid.b, uuid.c, uuid.d[0], uuid.d[1], uuid.d[2], uuid.d[3], uuid.d[4], uuid.d[5], uuid.d[6], uuid.d[7]); return 1; } @@ -226,7 +227,7 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP static int CALLBACK SortPlugins(WPARAM i1, LPARAM i2, LPARAM lParamSort) { - PluginListItemData *p1 = (PluginListItemData*)i1, *p2 = (PluginListItemData*)i2; + PluginListItemData *p1 = (PluginListItemData*)i1, *p2 = (PluginListItemData*)i2; return _tcscmp(p1->fileName, p2->fileName); } @@ -363,7 +364,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar mir_ptr tszEmail( latin2t(sel ? dat->authorEmail : NULL)); SetWindowText( GetDlgItem(hwndDlg, IDC_PLUGINEMAIL), tszEmail); - + mir_ptr p( Langpack_PcharToTchar(dat->description)); SetWindowText( GetDlgItem(hwndDlg, IDC_PLUGINLONGINFO), sel ? (TCHAR*)p : _T("")); @@ -386,7 +387,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar TCHAR bufRestart[1024]; int bufLen = mir_sntprintf(bufRestart, SIZEOF(bufRestart), _T("%s\n"), TranslateT("Miranda NG must be restarted to apply changes for these plugins:")); - HWND hwndList = GetDlgItem(hwndDlg, IDC_PLUGLIST); + HWND hwndList = GetDlgItem(hwndDlg, IDC_PLUGLIST); TCHAR buf[1024]; for (int iRow = 0; iRow != -1;) { ListView_GetItemText(hwndList, iRow, 2, buf, SIZEOF(buf)); @@ -428,7 +429,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar } } } - + iRow = ListView_GetNextItem(hwndList, iRow, LVNI_ALL); } ShowWindow( GetDlgItem(hwndDlg, IDC_RESTART), needRestart); diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index b643a960e8..69946b91a6 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/protocols/protochains.cpp b/src/modules/protocols/protochains.cpp index 176711ce34..f614fd50e2 100644 --- a/src/modules/protocols/protochains.cpp +++ b/src/modules/protocols/protochains.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp index 0b471da68a..090428cc45 100644 --- a/src/modules/protocols/protocols.cpp +++ b/src/modules/protocols/protocols.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" int LoadProtoChains(void); diff --git a/src/modules/protocols/protodir.cpp b/src/modules/protocols/protodir.cpp index 2311e1a1e2..1edcd3fc2d 100644 --- a/src/modules/protocols/protodir.cpp +++ b/src/modules/protocols/protodir.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2005 Miranda ICQ/IM project, +Copyright 2000-2005 Miranda IM project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/protocols/protoint.cpp b/src/modules/protocols/protoint.cpp index 041132c1f5..ecc93265df 100644 --- a/src/modules/protocols/protoint.cpp +++ b/src/modules/protocols/protoint.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp index af8621bc73..e0cc9e6afc 100644 --- a/src/modules/protocols/protoopts.cpp +++ b/src/modules/protocols/protoopts.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/skin/hotkey_opts.cpp b/src/modules/skin/hotkey_opts.cpp index 03aa7bbd7b..b2159e5032 100644 --- a/src/modules/skin/hotkey_opts.cpp +++ b/src/modules/skin/hotkey_opts.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp index 81b24e2e42..d7635de2d5 100644 --- a/src/modules/skin/hotkeys.cpp +++ b/src/modules/skin/hotkeys.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/skin/skin.h b/src/modules/skin/skin.h index bd8783e17d..3dbbb3a7c5 100644 --- a/src/modules/skin/skin.h +++ b/src/modules/skin/skin.h @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp index 3940011d19..493a14016e 100644 --- a/src/modules/skin/skinicons.cpp +++ b/src/modules/skin/skinicons.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp index ebf2be6f80..fc9443cf4d 100644 --- a/src/modules/skin/sounds.cpp +++ b/src/modules/skin/sounds.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. diff --git a/src/modules/utils/bmpfilter.cpp b/src/modules/utils/bmpfilter.cpp index 442c75996a..2f111f8ae6 100644 --- a/src/modules/utils/bmpfilter.cpp +++ b/src/modules/utils/bmpfilter.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include diff --git a/src/modules/utils/colourpicker.cpp b/src/modules/utils/colourpicker.cpp index fccd240660..1b5c4ca55e 100644 --- a/src/modules/utils/colourpicker.cpp +++ b/src/modules/utils/colourpicker.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" static LRESULT CALLBACK ColourPickerWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) diff --git a/src/modules/utils/hyperlink.cpp b/src/modules/utils/hyperlink.cpp index dceff9dd11..ebb24b7c14 100644 --- a/src/modules/utils/hyperlink.cpp +++ b/src/modules/utils/hyperlink.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" struct HyperlinkWndData { @@ -35,7 +36,7 @@ struct HyperlinkWndData { /* internal messages */ #define HLK_MEASURETEXT (WM_USER+1) -#define HLK_INVALIDATE (WM_USER+2) +#define HLK_INVALIDATE (WM_USER+2) static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { @@ -216,7 +217,7 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA COLORREF textColor; PAINTSTRUCT ps; HDC hdc; - + hdc = BeginPaint(hwnd, &ps); if (hdc != NULL) { if (IsWindowEnabled(hwnd)) { @@ -246,9 +247,9 @@ static LRESULT CALLBACK HyperlinkWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA } return 0; } - case WM_NCDESTROY: + case WM_NCDESTROY: if (dat->hEnableFont != NULL) DeleteObject(dat->hEnableFont); - mir_free(dat); + mir_free(dat); break; } return DefWindowProc(hwnd, msg, wParam, lParam); diff --git a/src/modules/utils/imgconv.cpp b/src/modules/utils/imgconv.cpp index 03c39eef1d..5267162025 100644 --- a/src/modules/utils/imgconv.cpp +++ b/src/modules/utils/imgconv.cpp @@ -1,8 +1,8 @@ /* Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2010 Miranda IM project, -all portions of this codebase are copyrighted to the people +Copyright 2010-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -10,7 +10,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,6 +19,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" typedef DWORD ARGB; diff --git a/src/modules/utils/openurl.cpp b/src/modules/utils/openurl.cpp index ebf462cca4..764169f268 100644 --- a/src/modules/utils/openurl.cpp +++ b/src/modules/utils/openurl.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp index 184dd876f7..8c9cfbc6fe 100644 --- a/src/modules/utils/path.cpp +++ b/src/modules/utils/path.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #include "../database/profilemanager.h" @@ -32,7 +33,7 @@ static INT_PTR pathToRelative(WPARAM wParam, LPARAM lParam) return PathToRelative((char*)wParam, (char*)lParam); } -static INT_PTR pathToAbsolute(WPARAM wParam, LPARAM lParam) +static INT_PTR pathToAbsolute(WPARAM wParam, LPARAM lParam) { return PathToAbsolute((char*)wParam, (char*)lParam, NULL); } @@ -171,10 +172,10 @@ static __forceinline char *GetPathVarX(char *, int code) switch(code) { case 1: mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\%s\\AvatarCache"), g_profileDir, szProfileName); - break; + break; case 2: mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\%s\\Logs"), g_profileDir, szProfileName); - break; + break; case 3: mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\%s"), g_profileDir, szProfileName); break; @@ -252,10 +253,10 @@ static __forceinline TCHAR *GetPathVarX(TCHAR *, int code) switch(code) { case 1: mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\%s\\AvatarCache"), g_profileDir, szProfileName); - break; + break; case 2: mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\%s\\Logs"), g_profileDir, szProfileName); - break; + break; case 3: mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\%s"), g_profileDir, szProfileName); break; @@ -276,7 +277,7 @@ XCHAR *GetInternalVariable(XCHAR *key, size_t keyLength, HANDLE hContact) theValue = GetContactNickX(key, hContact); else if ( !_xcscmp(theKey, XSTR(key, "proto"))) theValue = mir_a2x(key, GetContactProto(hContact)); - else if ( !_xcscmp(theKey, XSTR(key, "userid"))) + else if ( !_xcscmp(theKey, XSTR(key, "userid"))) theValue = GetContactIDX(key, hContact); } diff --git a/src/modules/utils/resizer.cpp b/src/modules/utils/resizer.cpp index 0f9b0b418f..4834e1ec89 100644 --- a/src/modules/utils/resizer.cpp +++ b/src/modules/utils/resizer.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" typedef struct { diff --git a/src/modules/utils/timeutils.cpp b/src/modules/utils/timeutils.cpp index 8df679d359..a27a65ee52 100644 --- a/src/modules/utils/timeutils.cpp +++ b/src/modules/utils/timeutils.cpp @@ -1,7 +1,7 @@ /* Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2010 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -10,7 +10,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -47,11 +47,11 @@ void FormatTime(const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, int TCHAR *pDest = szDest; int destCharsLeft = cbDest - 1; - for (const TCHAR* pFormat = szFormat; *pFormat; ++pFormat) + for (const TCHAR* pFormat = szFormat; *pFormat; ++pFormat) { DWORD fmt; bool date, iso = false; - switch (*pFormat) + switch (*pFormat) { case 't': fmt = TIME_NOSECONDS; @@ -83,26 +83,26 @@ void FormatTime(const SYSTEMTIME *st, const TCHAR *szFormat, TCHAR *szDest, int break; default: - if (destCharsLeft--) + if (destCharsLeft--) *pDest++=*pFormat; continue; } - + TCHAR dateTimeStr[64]; int dateTimeStrLen; if (iso) { - dateTimeStrLen = mir_sntprintf(dateTimeStr, SIZEOF(dateTimeStr), - _T("%d-%02d-%02dT%02d:%02d:%02dZ"), - st->wYear, st->wMonth, st->wDay, + dateTimeStrLen = mir_sntprintf(dateTimeStr, SIZEOF(dateTimeStr), + _T("%d-%02d-%02dT%02d:%02d:%02dZ"), + st->wYear, st->wMonth, st->wDay, st->wHour, st->wMinute, st->wSecond) + 1; } - else if (date) - dateTimeStrLen = GetDateFormat(LOCALE_USER_DEFAULT, fmt, st, NULL, + else if (date) + dateTimeStrLen = GetDateFormat(LOCALE_USER_DEFAULT, fmt, st, NULL, dateTimeStr, SIZEOF(dateTimeStr)); else - dateTimeStrLen = GetTimeFormat(LOCALE_USER_DEFAULT, fmt, st, NULL, + dateTimeStrLen = GetTimeFormat(LOCALE_USER_DEFAULT, fmt, st, NULL, dateTimeStr, SIZEOF(dateTimeStr)); if (dateTimeStrLen) --dateTimeStrLen; diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp index 1f2a4f1306..a22dd4ef26 100644 --- a/src/modules/utils/timezones.cpp +++ b/src/modules/utils/timezones.cpp @@ -1,7 +1,7 @@ /* Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2010 Miranda ICQ/IM project, +Copyright 2010-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -10,7 +10,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -353,10 +353,10 @@ typedef struct UINT addStr, getSel, setSel, getData, setData; } ListMessages; -static const ListMessages lbMessages = +static const ListMessages lbMessages = { LB_ADDSTRING, LB_GETCURSEL, LB_SETCURSEL, LB_GETITEMDATA, LB_SETITEMDATA }; -static const ListMessages cbMessages = +static const ListMessages cbMessages = { CB_ADDSTRING, CB_GETCURSEL, CB_SETCURSEL, CB_GETITEMDATA, CB_SETITEMDATA }; static const ListMessages *GetListMessages(HWND hWnd, DWORD dwFlags) @@ -557,7 +557,7 @@ extern "C" __declspec(dllexport) void RecalculateTime(void) if ( !found) { - if ( !wcscmp(tz.tzi.StandardName, myInfo.myTZ.tzi.StandardName) || + if ( !wcscmp(tz.tzi.StandardName, myInfo.myTZ.tzi.StandardName) || !wcscmp(tz.tzi.DaylightName, myInfo.myTZ.tzi.DaylightName)) { _tcscpy(myInfo.myTZ.tszName, tz.tszName); diff --git a/src/modules/utils/utils.cpp b/src/modules/utils/utils.cpp index 4f165bbd6c..8739273094 100644 --- a/src/modules/utils/utils.cpp +++ b/src/modules/utils/utils.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" #define MS_SYSTEM_GET_MD5I "Miranda/System/GetMD5I" @@ -41,9 +42,9 @@ int InitCrypt(void); static BOOL bModuleInitialized = FALSE; static CountryListEntry countries[] = { - {0, "Unspecified", ""}, - {9999, "Other", ""}, - {0xFFFF, "Unknown", ""}, + {0, "Unspecified", ""}, + {9999, "Other", ""}, + {0xFFFF, "Unknown", ""}, {93, "Afghanistan", "AF"}, {358, "Aland Islands", "AX"}, {355, "Albania", "AL"}, @@ -351,7 +352,7 @@ static INT_PTR AssertInsideScreen(WPARAM wParam, LPARAM lParam) RECT rcScreen; SystemParametersInfo(SPI_GETWORKAREA, 0, &rcScreen, FALSE); - if (MyMonitorFromWindow) + if (MyMonitorFromWindow) { if (MyMonitorFromRect(rc, MONITOR_DEFAULTTONULL)) return 0; @@ -362,7 +363,7 @@ static INT_PTR AssertInsideScreen(WPARAM wParam, LPARAM lParam) if (MyGetMonitorInfo(hMonitor, &mi)) rcScreen = mi.rcWork; } - else + else { RECT rcDest; if (IntersectRect(&rcDest, &rcScreen, rc)) diff --git a/src/modules/utils/windowlist.cpp b/src/modules/utils/windowlist.cpp index 7230ab4a23..4453048f36 100644 --- a/src/modules/utils/windowlist.cpp +++ b/src/modules/utils/windowlist.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" static WINDOWLISTENTRY *windowList = NULL; diff --git a/src/modules/visibility/visibility.cpp b/src/modules/visibility/visibility.cpp index c6d02a148e..b8b21b2838 100644 --- a/src/modules/visibility/visibility.cpp +++ b/src/modules/visibility/visibility.cpp @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, +all portions of this codebase are copyrighted to the people listed in contributors.txt. This program is free software; you can redistribute it and/or @@ -11,7 +11,7 @@ modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. -This program is distributed in the hope that it will be useful, +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -20,6 +20,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + #include "..\..\core\commonheaders.h" static void SetListGroupIcons(HWND hwndList, HANDLE hFirstItem, HANDLE hParentItem, int *groupChildCount) @@ -197,7 +198,7 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP DWORD hitFlags; HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y)); if (hItem == NULL) - break; + break; // It was not a visbility icon if ( !(hitFlags & CLCHT_ONITEMEXTRA)) diff --git a/src/modules/xml/xmlApi.cpp b/src/modules/xml/xmlApi.cpp index 6d2a09390f..2335b7c6d7 100644 --- a/src/modules/xml/xmlApi.cpp +++ b/src/modules/xml/xmlApi.cpp @@ -2,7 +2,7 @@ Miranda IM: the free IM client for Microsoft* Windows* -Copyright 2000-2009 Miranda ICQ/IM project, +Copyright 2000-12 Miranda IM, 2012-13 Miranda NG project, all portions of this codebase are copyrighted to the people listed in contributors.txt. -- cgit v1.2.3