summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Import/src/import.cpp38
-rw-r--r--plugins/Import/src/main.cpp10
-rw-r--r--plugins/Import/src/miranda.cpp13
-rw-r--r--plugins/Import/src/stdafx.h2
-rw-r--r--plugins/Import/src/wizard.cpp4
-rw-r--r--src/mir_app/src/pluginopts.cpp27
6 files changed, 35 insertions, 59 deletions
diff --git a/plugins/Import/src/import.cpp b/plugins/Import/src/import.cpp
index 5127e56e0d..a382dcf0af 100644
--- a/plugins/Import/src/import.cpp
+++ b/plugins/Import/src/import.cpp
@@ -151,27 +151,6 @@ static MCONTACT HContactFromID(char *pszProtoName, char *pszSetting, TCHAR *pwsz
return INVALID_CONTACT_ID;
}
-static MCONTACT HistoryImportFindContact(HWND hdlgProgress, char *szModuleName, DWORD uin, int addUnknown)
-{
- MCONTACT hContact = HContactFromNumericID(szModuleName, "UIN", uin);
- if (hContact == NULL) {
- AddMessage(LPGENT("Ignored event from/to self"));
- return INVALID_CONTACT_ID;
- }
-
- if (hContact != INVALID_CONTACT_ID)
- return hContact;
-
- if (!addUnknown)
- return INVALID_CONTACT_ID;
-
- hContact = CallService(MS_DB_CONTACT_ADD, 0, 0);
- Proto_AddToContact(hContact, szModuleName);
- db_set_dw(hContact, szModuleName, "UIN", uin);
- AddMessage(LPGENT("Added contact %u (found in history)"), uin);
- return hContact;
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
static int CopySettingsEnum(const char *szSetting, LPARAM lParam)
@@ -264,7 +243,7 @@ static LRESULT CALLBACK ListWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
SendMessage(hwndCombo, WM_KILLFOCUS, 0, (LPARAM)hwndCombo);
hwndCombo = CreateWindowEx(WS_EX_CLIENTEDGE, WC_COMBOBOX, _T(""), WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST,
- r.left+3, r.top, r.right - r.left - 3, r.bottom - r.top, hwnd, 0, hInst, NULL);
+ r.left + 3, r.top, r.right - r.left - 3, r.bottom - r.top, hwnd, 0, hInst, NULL);
// copy a font from listview
HFONT hFont = (HFONT)SendMessage(hwnd, WM_GETFONT, 0, 0);
@@ -545,7 +524,7 @@ static MCONTACT MapContact(MCONTACT hSrc)
return (pDestContact == NULL) ? INVALID_CONTACT_ID : pDestContact->dstID;
}
-static MCONTACT AddContact(HWND hdlgProgress, char* szProto, char* pszUniqueSetting, DBVARIANT* id, const TCHAR* pszUserID, TCHAR *nick, TCHAR *group)
+static MCONTACT AddContact(char *szProto, char *pszUniqueSetting, DBVARIANT *id, const TCHAR *pszUserID, TCHAR *nick, TCHAR *group)
{
MCONTACT hContact = CallService(MS_DB_CONTACT_ADD, 0, 0);
if (Proto_AddToContact(hContact, szProto) != 0) {
@@ -631,7 +610,7 @@ static int ImportGroup(const char* szSettingName, LPARAM lParam)
{
int *pnGroups = (int*)lParam;
- TCHAR* tszGroup = myGetWs(NULL, "CListGroups", szSettingName);
+ TCHAR *tszGroup = myGetWs(NULL, "CListGroups", szSettingName);
if (tszGroup != NULL) {
if (CreateGroup(tszGroup + 1, NULL))
pnGroups[0]++;
@@ -848,7 +827,7 @@ static MCONTACT ImportContact(MCONTACT hSrc)
if (tszNick == NULL)
tszNick = myGetWs(hSrc, cc->szProto, "Nick");
- hDst = AddContact(hdlgProgress, pda->pa->szModuleName, pszUniqueSetting, &dbv, pszUniqueID, tszNick, tszGroup);
+ hDst = AddContact(pda->pa->szModuleName, pszUniqueSetting, &dbv, pszUniqueID, tszNick, tszGroup);
if (hDst == INVALID_CONTACT_ID) {
AddMessage(LPGENT("Unknown error while adding %S contact %s"), pda->pa->szModuleName, pszUniqueID);
return INVALID_CONTACT_ID;
@@ -896,7 +875,7 @@ static void ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int protoC
else {
if (cc->IsSub())
return;
-
+
bIsMeta = cc->IsMeta();
}
@@ -928,8 +907,8 @@ static void ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int protoC
// check protocols during system history import
if (hDst == NULL) {
bSkipAll = true;
- for (int i = 0; i < protoCount; i++) {
- if (!mir_strcmp(dbei.szModule, protocol[i]->szModuleName)) {
+ for (int k = 0; k < protoCount; k++) {
+ if (!mir_strcmp(dbei.szModule, protocol[k]->szModuleName)) {
bSkipAll = false;
break;
}
@@ -1013,7 +992,8 @@ static void ImportHistory(MCONTACT hContact, PROTOACCOUNT **protocol, int protoC
/////////////////////////////////////////////////////////////////////////////////////////
static int CompareModules(const char *p1, const char *p2)
-{ return mir_strcmpi(p1, p2);
+{
+ return mir_strcmpi(p1, p2);
}
void MirandaImport(HWND hdlg)
diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp
index 4882015f5d..63b33f4709 100644
--- a/plugins/Import/src/main.cpp
+++ b/plugins/Import/src/main.cpp
@@ -47,13 +47,13 @@ PLUGININFOEX pluginInfo =
{0x2d77a746, 0xa6, 0x4343, {0xbf, 0xc5, 0xf8, 0x8, 0xcd, 0xd7, 0x72, 0xea}}
};
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
{
hInst = hinstDLL;
return TRUE;
}
-static INT_PTR ImportCommand(WPARAM wParam,LPARAM lParam)
+static INT_PTR ImportCommand(WPARAM, LPARAM)
{
if (IsWindow(hwndWizard)) {
SetForegroundWindow(hwndWizard);
@@ -67,7 +67,7 @@ static INT_PTR ImportCommand(WPARAM wParam,LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// MirandaPluginInfoEx - returns an information about a plugin
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
@@ -80,7 +80,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_IMPORT,
/////////////////////////////////////////////////////////////////////////////////////////
// Performs a primary set of actions upon plugin loading
-static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
+static int ModulesLoaded(WPARAM, LPARAM)
{
if (db_get_b(NULL, IMPORT_MODULE, IMP_KEY_FR, 0))
return 0;
@@ -96,7 +96,7 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int OnExit(WPARAM wParam, LPARAM lParam)
+static int OnExit(WPARAM, LPARAM)
{
if (hwndWizard)
SendMessage(hwndWizard, WM_CLOSE, 0, 0);
diff --git a/plugins/Import/src/miranda.cpp b/plugins/Import/src/miranda.cpp
index 4fff7dcce1..d4cad24695 100644
--- a/plugins/Import/src/miranda.cpp
+++ b/plugins/Import/src/miranda.cpp
@@ -63,8 +63,10 @@ static void SearchForLists(HWND hwndDlg, const TCHAR *mirandaPath, const TCHAR *
FindClose(hFind);
}
-INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM)
{
+ TCHAR filename[MAX_PATH];
+
switch(message) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
@@ -81,7 +83,6 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM
}
SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETCURSEL, 0, 0);
SendMessage(hwndDlg, WM_COMMAND, MAKELONG(IDC_LIST, LBN_SELCHANGE), 0);
- TCHAR filename[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILENAME, filename, _countof(filename));
if (_taccess(filename, 4))
SendMessage(GetParent(hwndDlg), WIZM_DISABLEBUTTON, 1, 0);
@@ -94,7 +95,6 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM
break;
case IDOK:
- TCHAR filename[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILENAME, filename, _countof(filename));
if (_taccess(filename, 4)) {
MessageBox(hwndDlg, TranslateT("The given file does not exist. Please check that you have entered the name correctly."), TranslateT("Miranda Import"), MB_OK);
@@ -154,7 +154,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM
//=======================================================================================
// Import options dialog
-INT_PTR CALLBACK MirandaOptionsPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK MirandaOptionsPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM)
{
switch (message) {
case WM_INITDIALOG:
@@ -216,7 +216,7 @@ static const UINT InControls[] = { IDC_IN_MSG, IDC_IN_URL, IDC_IN_FT, IDC_IN_OTH
static const UINT OutControls[] = { IDC_OUT_MSG, IDC_OUT_URL, IDC_OUT_FT, IDC_OUT_OTHER };
static const UINT SysControls[] = { IDC_CONTACTS, IDC_SYSTEM };
-INT_PTR CALLBACK MirandaAdvOptionsPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK MirandaAdvOptionsPageProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM)
{
switch (message) {
case WM_INITDIALOG:
@@ -299,9 +299,6 @@ INT_PTR CALLBACK MirandaAdvOptionsPageProc(HWND hwndDlg, UINT message, WPARAM wP
EnableWindow(GetDlgItem(hwndDlg, IDC_DATETIMEPICKER), IsDlgButtonChecked(hwndDlg, IDC_SINCE));
break;
- if (HIWORD(wParam) != STN_CLICKED)
- break;
-
case IDC_ALL:
case IDC_INCOMING:
case IDC_OUTGOING:
diff --git a/plugins/Import/src/stdafx.h b/plugins/Import/src/stdafx.h
index 94b311fbaa..4b6657fc30 100644
--- a/plugins/Import/src/stdafx.h
+++ b/plugins/Import/src/stdafx.h
@@ -99,7 +99,7 @@ bool IsDuplicateEvent(MCONTACT hContact, DBEVENTINFO dbei);
int CreateGroup(const TCHAR* name, MCONTACT hContact);
extern HINSTANCE hInst;
-extern HWND hdlgProgress, hwndAccMerge;
+extern HWND hwndAccMerge;
extern int nImportOptions;
extern TCHAR importFile[];
extern time_t dwSinceDate;
diff --git a/plugins/Import/src/wizard.cpp b/plugins/Import/src/wizard.cpp
index 05328ce8d6..f995663580 100644
--- a/plugins/Import/src/wizard.cpp
+++ b/plugins/Import/src/wizard.cpp
@@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
-INT_PTR CALLBACK WizardIntroPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK WizardIntroPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM)
{
switch (message) {
case WM_INITDIALOG:
@@ -45,7 +45,7 @@ INT_PTR CALLBACK WizardIntroPageProc(HWND hdlg, UINT message, WPARAM wParam, LPA
return FALSE;
}
-INT_PTR CALLBACK FinishedPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK FinishedPageProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM)
{
switch (message) {
case WM_INITDIALOG:
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp
index 24ef35348b..55fe0885c3 100644
--- a/src/mir_app/src/pluginopts.cpp
+++ b/src/mir_app/src/pluginopts.cpp
@@ -75,9 +75,9 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM l
dat->stdPlugin = 0;
if (pi.Interfaces) {
MUUID *piface = pi.Interfaces;
- for (int i=0; !equalUUID(miid_last, piface[i]); i++) {
- int idx = getDefaultPluginIdx( piface[i] );
- if (idx != -1 ) {
+ for (int i = 0; !equalUUID(miid_last, piface[i]); i++) {
+ int idx = getDefaultPluginIdx(piface[i]);
+ if (idx != -1) {
dat->stdPlugin |= (1 << idx);
break;
}
@@ -94,7 +94,7 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM l
it.mask = LVIF_PARAM | LVIF_IMAGE;
it.iImage = (hInst != NULL) ? 2 : 3;
bool bNoCheckbox = (dat->flags & STATIC_PLUGIN) != 0;
- if (bNoCheckbox|| hasMuuid(pi, miid_clist) || hasMuuid(pi, miid_protocol))
+ if (bNoCheckbox || hasMuuid(pi, miid_clist) || hasMuuid(pi, miid_protocol))
it.iImage += 2;
it.lParam = (LPARAM)dat;
int iRow = ListView_InsertItem(hwndList, &it);
@@ -177,7 +177,7 @@ static void RemoveAllItems(HWND hwnd)
mir_free(dat->description);
mir_free(dat->homepage);
mir_free(dat);
- lvi.iItem ++;
+ lvi.iItem++;
}
}
@@ -189,7 +189,7 @@ static bool LoadPluginDynamically(PluginListItemData *dat)
pluginEntry* pPlug = OpenPlugin(dat->fileName, _T("Plugins"), exe);
if (pPlug->pclass & PCLASS_FAILED) {
-LBL_Error:
+ LBL_Error:
Plugin_UnloadDyn(pPlug);
return false;
}
@@ -219,7 +219,7 @@ static bool UnloadPluginDynamically(PluginListItemData *dat)
static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg) {
+ switch (msg) {
case WM_CHAR:
if (wParam == '\b') {
if (szFilter.GetLength() > 0)
@@ -266,7 +266,7 @@ static LRESULT CALLBACK PluginListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LP
ListView_SubItemHitTest(hwnd, &hi);
// Dynamically load/unload a plugin
if ((hi.iSubItem == 0) && (hi.flags & LVHT_ONITEMICON)) {
- LVITEM lvi = {0};
+ LVITEM lvi = { 0 };
lvi.mask = LVIF_IMAGE | LVIF_PARAM;
lvi.stateMask = -1;
lvi.iItem = hi.iItem;
@@ -305,7 +305,7 @@ static int CALLBACK SortPlugins(WPARAM i1, LPARAM i2, LPARAM)
static TCHAR *latin2t(const char *p)
{
if (p == NULL)
- return mir_tstrdup( _T(""));
+ return mir_tstrdup(_T(""));
return mir_a2t_cp(p, 1250);
}
@@ -398,10 +398,10 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
PluginListItemData *dat2 = (PluginListItemData*)dt.lParam;
if (dat2->stdPlugin & dat->stdPlugin) {// mask differs
// the lParam is unset, so when the check is unset the clist block doesnt trigger
- int lParam = dat2->stdPlugin;
+ int iSave = dat2->stdPlugin;
dat2->stdPlugin = 0;
ListView_SetItemState(hwndList, iRow, 0x1000, LVIS_STATEIMAGEMASK);
- dat2->stdPlugin = lParam;
+ dat2->stdPlugin = iSave;
}
}
}
@@ -422,7 +422,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
lvi.iItem = hdr->iItem;
if (ListView_GetItem(hwndList, &lvi)) {
PluginListItemData *dat = (PluginListItemData*)lvi.lParam;
-
+
TCHAR buf[1024];
ListView_GetItemText(hwndList, hdr->iItem, 2, buf, _countof(buf));
SetDlgItemText(hwndDlg, IDC_PLUGININFOFRAME, sel ? buf : _T(""));
@@ -447,8 +447,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
uuidToString(dat->uuid, szUID, sizeof(szUID));
SetDlgItemTextA(hwndDlg, IDC_PLUGINPID, sel ? szUID : "");
}
- else
- SetDlgItemText(hwndDlg, IDC_PLUGINPID, sel ? TranslateT("<none>") : _T(""));
+ else SetDlgItemText(hwndDlg, IDC_PLUGINPID, sel ? TranslateT("<none>") : _T(""));
}
}
}