summaryrefslogtreecommitdiff
path: root/protocols/Non-IM Contact/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-26 17:06:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-26 17:06:04 +0300
commit1039b2829a264280493ba0fa979214fe024dc70c (patch)
tree8fa6a60eb46627582c372b56a4a1d4754d6732c3 /protocols/Non-IM Contact/src
parent62a186697df33c96dc1a6dac0f4dfc38652fb96f (diff)
WORD -> uint16_t
Diffstat (limited to 'protocols/Non-IM Contact/src')
-rw-r--r--protocols/Non-IM Contact/src/contactinfo.cpp10
-rw-r--r--protocols/Non-IM Contact/src/dialog.cpp21
-rw-r--r--protocols/Non-IM Contact/src/files.cpp4
-rw-r--r--protocols/Non-IM Contact/src/namereplacing.cpp6
-rw-r--r--protocols/Non-IM Contact/src/services.cpp12
-rw-r--r--protocols/Non-IM Contact/src/stdafx.h16
-rw-r--r--protocols/Non-IM Contact/src/timer.cpp2
7 files changed, 19 insertions, 52 deletions
diff --git a/protocols/Non-IM Contact/src/contactinfo.cpp b/protocols/Non-IM Contact/src/contactinfo.cpp
index 47effee3e7..551bee412b 100644
--- a/protocols/Non-IM Contact/src/contactinfo.cpp
+++ b/protocols/Non-IM Contact/src/contactinfo.cpp
@@ -242,11 +242,11 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
for (int i = ID_STATUS_ONLINE; i <= ID_STATUS_MAX; i++)
if (IsDlgButtonChecked(hwnd, i))
- g_plugin.setWord(hContact, "Icon", (WORD)i);
+ g_plugin.setWord(hContact, "Icon", (uint16_t)i);
/* set correct status */
if (status == ID_STATUS_ONLINE || status == ID_STATUS_AWAY || (status == g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)))
- g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
+ g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
else
g_plugin.setWord(hContact, "Status", ID_STATUS_OFFLINE);
@@ -254,7 +254,7 @@ INT_PTR CALLBACK DlgProcOtherStuff(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
if (GetWindowTextLength(GetDlgItem(hwnd, IDC_TIMER))) {
wchar_t text[512];
GetDlgItemText(hwnd, IDC_TIMER, text, _countof(text));
- g_plugin.setWord(hContact, "Timer", (WORD)_wtoi(text));
+ g_plugin.setWord(hContact, "Timer", (uint16_t)_wtoi(text));
}
else g_plugin.setWord(hContact, "Timer", 15);
}
@@ -645,9 +645,9 @@ INT_PTR ImportContacts(WPARAM, LPARAM)
// timer
g_plugin.setByte(hContact, "UseTimer", (uint8_t)usetimer);
g_plugin.setByte(hContact, "Minutes", (uint8_t)minutes);
- g_plugin.setWord(hContact, "Timer", (WORD)timer);
+ g_plugin.setWord(hContact, "Timer", (uint16_t)timer);
//icon
- g_plugin.setWord(hContact, "Icon", (WORD)icon);
+ g_plugin.setWord(hContact, "Icon", (uint16_t)icon);
replaceAllStrings(hContact);
}
free(msg);
diff --git a/protocols/Non-IM Contact/src/dialog.cpp b/protocols/Non-IM Contact/src/dialog.cpp
index 8549d7cecc..1676198969 100644
--- a/protocols/Non-IM Contact/src/dialog.cpp
+++ b/protocols/Non-IM Contact/src/dialog.cpp
@@ -61,7 +61,7 @@ INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
g_plugin.setByte("AwayAsStatus", (uint8_t)IsDlgButtonChecked(hwnd, IDC_AWAYISNOTONLINE));
if (BST_UNCHECKED == IsDlgButtonChecked(hwnd, IDC_DISABLETIMER) && GetWindowTextLength(GetDlgItem(hwnd, IDC_TIMER_INT))) {
GetDlgItemText(hwnd, IDC_TIMER_INT, tmp, _countof(tmp));
- g_plugin.setWord("Timer", (WORD)_wtoi(tmp));
+ g_plugin.setWord("Timer", (uint16_t)_wtoi(tmp));
}
else g_plugin.setWord("Timer", 0);
return TRUE;
@@ -217,22 +217,6 @@ INT_PTR LoadFilesDlg(WPARAM, LPARAM)
/////////////////////////////////////////////////////////////////////////////////////////
-static int CALLBACK PropSheetProc(HWND, UINT uMsg, LPARAM lParam)
-{
- if (uMsg == PSCB_PRECREATE) {
- // Remove the DS_CONTEXTHELP style from the
- // dialog box template
- if (((DLGTEMPLATEEX*)lParam)->signature == 0xFFFF)
- ((DLGTEMPLATEEX*)lParam)->style &= ~DS_CONTEXTHELP;
- else
- ((LPDLGTEMPLATE)lParam)->style &= ~DS_CONTEXTHELP;
-
- return TRUE;
- }
-
- return 0;
-}
-
void DoPropertySheet(MCONTACT hContact)
{
char nick[256];
@@ -294,9 +278,6 @@ void DoPropertySheet(MCONTACT hContact)
}
psh.nPages = _countof(psp);
psh.ppsp = (LPCPROPSHEETPAGEA)&psp;
- psh.pfnCallback = PropSheetProc;
-
- // Now do it and return
PropertySheetA(&psh);
}
diff --git a/protocols/Non-IM Contact/src/files.cpp b/protocols/Non-IM Contact/src/files.cpp
index 17a11edd3c..76302f3b9f 100644
--- a/protocols/Non-IM Contact/src/files.cpp
+++ b/protocols/Non-IM Contact/src/files.cpp
@@ -193,7 +193,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
timer = atoi(text);
}
mir_snprintf(fn, "fn%d_timer", i);
- g_plugin.setWord(fn, (WORD)timer);
+ g_plugin.setWord(fn, (uint16_t)timer);
SendMessage(hwnd, WM_RELOADWINDOW, 0, 0);
}
break;
@@ -302,7 +302,7 @@ INT_PTR CALLBACK DlgProcFiles(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (!db_get_static(NULL, MODNAME, fn, string, _countof(string)))
if (!strncmp("http://", string, mir_strlen("http://")) || !strncmp("https://", string, mir_strlen("https://"))) {
mir_snprintf(fn, "fn%d_timer", i);
- g_plugin.setWord(fn, (WORD)timer);
+ g_plugin.setWord(fn, (uint16_t)timer);
}
return TRUE;
diff --git a/protocols/Non-IM Contact/src/namereplacing.cpp b/protocols/Non-IM Contact/src/namereplacing.cpp
index 00a9ca07ab..d1a678d446 100644
--- a/protocols/Non-IM Contact/src/namereplacing.cpp
+++ b/protocols/Non-IM Contact/src/namereplacing.cpp
@@ -306,7 +306,7 @@ void checkStringForSaveN(CMStringA &str)
break;
case '1':
case 'w':
- db_set_w(0, A, B, (WORD)atoi(C));
+ db_set_w(0, A, B, (uint16_t)atoi(C));
break;
case '2':
case 'd':
@@ -433,7 +433,7 @@ void checkIcon(MCONTACT hContact, char* string)
if (str) {
int icon = getNumber(str + 5);
if (icon >= 0)
- g_plugin.setWord(hContact, "Status", (WORD)(ID_STATUS_OFFLINE + icon));
+ g_plugin.setWord(hContact, "Status", (uint16_t)(ID_STATUS_OFFLINE + icon));
}
}
@@ -606,7 +606,7 @@ void WriteSetting(MCONTACT hContact, char* module1, char* setting1, char* module
if ((status == ID_STATUS_ONLINE) || (status == ID_STATUS_AWAY) ||
(status == g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE)) ||
g_plugin.getByte(hContact, "AlwaysVisible", 0))
- g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
+ g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
else
g_plugin.setWord(hContact, "Status", ID_STATUS_OFFLINE);
}
diff --git a/protocols/Non-IM Contact/src/services.cpp b/protocols/Non-IM Contact/src/services.cpp
index 4a584e653a..4fda75ac4a 100644
--- a/protocols/Non-IM Contact/src/services.cpp
+++ b/protocols/Non-IM Contact/src/services.cpp
@@ -55,7 +55,7 @@ int SetLCStatus(WPARAM wParam, LPARAM)
{
int oldStatus = LCStatus;
LCStatus = wParam;
- g_plugin.setWord("Status", (WORD)wParam);
+ g_plugin.setWord("Status", (uint16_t)wParam);
g_plugin.setWord("timerCount", 0);
if (LCStatus == ID_STATUS_OFFLINE || (LCStatus == ID_STATUS_AWAY && !g_plugin.getByte("AwayAsStatus", 0)) || !g_plugin.getWord("Timer", 1))
killTimer();
@@ -69,27 +69,27 @@ int SetLCStatus(WPARAM wParam, LPARAM)
switch (LCStatus) {
case ID_STATUS_OFFLINE:
if (g_plugin.getByte(hContact, "AlwaysVisible", 0) && !g_plugin.getByte(hContact, "VisibleUnlessOffline", 1))
- g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
+ g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
else
g_plugin.setWord(hContact, "Status", ID_STATUS_OFFLINE);
break;
case ID_STATUS_ONLINE:
- g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
+ g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
break;
case ID_STATUS_AWAY:
if (g_plugin.getByte("AwayAsStatus", 0) && (g_plugin.getByte(hContact, "AlwaysVisible", 0) || (g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE) == ID_STATUS_AWAY)))
- g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
+ g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
else if (!g_plugin.getByte("AwayAsStatus", 0))
- g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
+ g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
else
g_plugin.setWord(hContact, "Status", ID_STATUS_OFFLINE);
break;
default:
if (g_plugin.getByte(hContact, "AlwaysVisible", 0) || LCStatus == g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE))
- g_plugin.setWord(hContact, "Status", (WORD)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
+ g_plugin.setWord(hContact, "Status", (uint16_t)g_plugin.getWord(hContact, "Icon", ID_STATUS_ONLINE));
break;
}
}
diff --git a/protocols/Non-IM Contact/src/stdafx.h b/protocols/Non-IM Contact/src/stdafx.h
index d98b8e9607..eea3c27698 100644
--- a/protocols/Non-IM Contact/src/stdafx.h
+++ b/protocols/Non-IM Contact/src/stdafx.h
@@ -16,20 +16,6 @@
#include <process.h>
#include <string.h>
-struct DLGTEMPLATEEX
-{
- WORD dlgVer;
- WORD signature;
- DWORD helpID;
- DWORD exStyle;
- DWORD style;
- WORD cDlgItems;
- short x;
- short y;
- short cx;
- short cy;
-};
-
#include <newpluginapi.h>
#include <m_clistint.h>
#include <m_skin.h>
@@ -50,7 +36,7 @@ struct DLGTEMPLATEEX
//=======================================================
// Definitions
//=======================================================
-#define MODNAME "NIM_Contact"
+#define MODNAME "NIM_Contact"
#define modFullname "Non-IM Contact"
#define MAXLINES 10000
#define MAX_STRING_LENGTH 10000
diff --git a/protocols/Non-IM Contact/src/timer.cpp b/protocols/Non-IM Contact/src/timer.cpp
index c0c292dcc9..91359ef387 100644
--- a/protocols/Non-IM Contact/src/timer.cpp
+++ b/protocols/Non-IM Contact/src/timer.cpp
@@ -19,7 +19,7 @@ void timerFunc(void*)
killTimer();
return;
}
- g_plugin.setWord("timerCount", (WORD)timerCount);
+ g_plugin.setWord("timerCount", (uint16_t)timerCount);
/* update the web pages*/
for (int i = 0;; i++) {