summaryrefslogtreecommitdiff
path: root/plugins/TipperYM/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-26 20:31:39 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-26 20:31:39 +0300
commitcddcd7483a7c472598af098e759e5d309024f606 (patch)
treeb0a227d6e087c41958cc84d27bc323353248aae5 /plugins/TipperYM/src
parent1039b2829a264280493ba0fa979214fe024dc70c (diff)
DWORD -> uint32_t
Diffstat (limited to 'plugins/TipperYM/src')
-rw-r--r--plugins/TipperYM/src/bitmap_func.cpp2
-rw-r--r--plugins/TipperYM/src/message_pump.h2
-rw-r--r--plugins/TipperYM/src/options.cpp14
-rw-r--r--plugins/TipperYM/src/popwin.cpp2
-rw-r--r--plugins/TipperYM/src/subst.cpp26
-rw-r--r--plugins/TipperYM/src/tipper.cpp2
-rw-r--r--plugins/TipperYM/src/translations.cpp36
7 files changed, 42 insertions, 42 deletions
diff --git a/plugins/TipperYM/src/bitmap_func.cpp b/plugins/TipperYM/src/bitmap_func.cpp
index 3915087916..1cfad4ac46 100644
--- a/plugins/TipperYM/src/bitmap_func.cpp
+++ b/plugins/TipperYM/src/bitmap_func.cpp
@@ -460,7 +460,7 @@ BOOL IsAlphaTransparent(HBITMAP hBitmap)
if (bmp.bmBitsPixel != 32)
return FALSE;
- DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
+ uint32_t dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
uint8_t *p = (uint8_t *)mir_calloc(dwLen);
if (p == nullptr)
return FALSE;
diff --git a/plugins/TipperYM/src/message_pump.h b/plugins/TipperYM/src/message_pump.h
index 9bb7d755b2..5b4df9c742 100644
--- a/plugins/TipperYM/src/message_pump.h
+++ b/plugins/TipperYM/src/message_pump.h
@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA.
struct DWM_BLURBEHIND
{
- DWORD dwFlags;
+ uint32_t dwFlags;
BOOL fEnable;
HRGN hRgnBlur;
BOOL fTransitionOnMaximized;
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp
index ad60f95536..20b97c1b5b 100644
--- a/plugins/TipperYM/src/options.cpp
+++ b/plugins/TipperYM/src/options.cpp
@@ -163,12 +163,12 @@ bool LoadDS(DISPLAYSUBST *ds, int index)
}
mir_snprintf(setting, "TransFuncId%d", index);
- ds->iTranslateFuncId = db_get_dw(0, MODULE_ITEMS, setting, (DWORD)-1);
+ ds->iTranslateFuncId = db_get_dw(0, MODULE_ITEMS, setting, (uint32_t)-1);
// a little backward compatibility
- if ((DWORD)ds->iTranslateFuncId == (DWORD)-1) {
+ if ((uint32_t)ds->iTranslateFuncId == (uint32_t)-1) {
mir_snprintf(setting, "TransFunc%d", index);
- ds->iTranslateFuncId = (DWORD)db_get_w(0, MODULE_ITEMS, setting, 0);
+ ds->iTranslateFuncId = (uint32_t)db_get_w(0, MODULE_ITEMS, setting, 0);
}
return true;
@@ -282,9 +282,9 @@ void SaveOptions()
g_plugin.setWord("InnerAvatarPadding", opt.iInnerAvatarPadding);
g_plugin.setWord("TextPadding", opt.iTextPadding);
g_plugin.setByte("Position", (uint8_t)opt.pos);
- g_plugin.setDword("MinWidth", (DWORD)opt.iMinWidth);
- g_plugin.setDword("MinHeight", (DWORD)opt.iMinHeight);
- g_plugin.setDword("SidebarWidth", (DWORD)opt.iSidebarWidth);
+ g_plugin.setDword("MinWidth", (uint32_t)opt.iMinWidth);
+ g_plugin.setDword("MinHeight", (uint32_t)opt.iMinHeight);
+ g_plugin.setDword("SidebarWidth", (uint32_t)opt.iSidebarWidth);
g_plugin.setByte("MouseTollerance", (uint8_t)opt.iMouseTollerance);
g_plugin.setByte("SBarTips", (opt.bStatusBarTips ? 1 : 0));
@@ -352,7 +352,7 @@ void LoadObsoleteSkinSetting()
}
mir_snprintf(setting, "SGlyphMargins%d", i);
- DWORD margins = g_plugin.getDword(setting, 0);
+ uint32_t margins = g_plugin.getDword(setting, 0);
opt.margins[i].top = LOBYTE(LOWORD(margins));
opt.margins[i].right = HIBYTE(LOWORD(margins));
opt.margins[i].bottom = LOBYTE(HIWORD(margins));
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp
index 65e75e48b4..799dc9bee7 100644
--- a/plugins/TipperYM/src/popwin.cpp
+++ b/plugins/TipperYM/src/popwin.cpp
@@ -1433,7 +1433,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
pwd->rows = nullptr;
pwd->iRowCount = 0;
- DWORD dwItems = (wParam == 0) ? opt.iFirstItems : opt.iSecondItems;
+ uint32_t dwItems = (wParam == 0) ? opt.iFirstItems : opt.iSecondItems;
bool bFirstItem = true;
wchar_t buff[64];
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp
index efa18fbd4a..45e7abd4d5 100644
--- a/plugins/TipperYM/src/subst.cpp
+++ b/plugins/TipperYM/src/subst.cpp
@@ -119,7 +119,7 @@ void StripBBCodesInPlace(wchar_t *ptszText)
}
}
-DWORD LastMessageTimestamp(MCONTACT hContact, bool received)
+uint32_t LastMessageTimestamp(MCONTACT hContact, bool received)
{
for (MEVENT hDbEvent = db_event_last(hContact); hDbEvent; hDbEvent = db_event_prev(hContact, hDbEvent)) {
DBEVENTINFO dbei = {};
@@ -131,7 +131,7 @@ DWORD LastMessageTimestamp(MCONTACT hContact, bool received)
return 0;
}
-void FormatTimestamp(DWORD ts, char *szFormat, wchar_t *buff, int bufflen)
+void FormatTimestamp(uint32_t ts, char *szFormat, wchar_t *buff, int bufflen)
{
wchar_t swzForm[16];
a2t(szFormat, swzForm, 16);
@@ -324,22 +324,22 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int
return GetSysSubstText(hSubContact, L"account", buff, bufflen);
}
else if ((recv = !mir_wstrcmp(swzRawSpec, L"last_msg_time")) || !mir_wstrcmp(swzRawSpec, L"last_msg_out_time")) {
- DWORD ts = LastMessageTimestamp(hContact, recv);
+ uint32_t ts = LastMessageTimestamp(hContact, recv);
if (ts == 0) return false;
FormatTimestamp(ts, "t", buff, bufflen);
return true;
}
else if ((recv = !mir_wstrcmp(swzRawSpec, L"last_msg_date")) || !mir_wstrcmp(swzRawSpec, L"last_msg_out_date")) {
- DWORD ts = LastMessageTimestamp(hContact, recv);
+ uint32_t ts = LastMessageTimestamp(hContact, recv);
if (ts == 0) return false;
FormatTimestamp(ts, "d", buff, bufflen);
return true;
}
else if ((recv = !mir_wstrcmp(swzRawSpec, L"last_msg_reltime")) || !mir_wstrcmp(swzRawSpec, L"last_msg_out_reltime")) {
- DWORD ts = LastMessageTimestamp(hContact, recv);
+ uint32_t ts = LastMessageTimestamp(hContact, recv);
if (ts == 0) return false;
- DWORD t = (DWORD)time(0);
- DWORD diff = (t - ts);
+ uint32_t t = (uint32_t)time(0);
+ uint32_t diff = (t - ts);
int d = (diff / 60 / 60 / 24);
int h = (diff - d * 60 * 60 * 24) / 60 / 60;
int m = (diff - d * 60 * 60 * 24 - h * 60 * 60) / 60;
@@ -349,10 +349,10 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int
return true;
}
else if (!mir_wstrcmp(swzRawSpec, L"msg_count_all") || !mir_wstrcmp(swzRawSpec, L"msg_count_out") || !mir_wstrcmp(swzRawSpec, L"msg_count_in")) {
- DWORD dwCountOut, dwCountIn;
- DWORD dwMetaCountOut = 0, dwMetaCountIn = 0;
- DWORD dwLastTs, dwNewTs, dwRecountTs;
- DWORD dwTime, dwDiff;
+ uint32_t dwCountOut, dwCountIn;
+ uint32_t dwMetaCountOut = 0, dwMetaCountIn = 0;
+ uint32_t dwLastTs, dwNewTs, dwRecountTs;
+ uint32_t dwTime, dwDiff;
int iNumber = 1;
MCONTACT hTmpContact = hContact;
@@ -366,7 +366,7 @@ bool GetSysSubstText(MCONTACT hContact, wchar_t *swzRawSpec, wchar_t *buff, int
if (i > 0)
hTmpContact = db_mc_getSub(hContact, i);
dwRecountTs = g_plugin.getDword(hTmpContact, "LastCountTS");
- dwTime = (DWORD)time(0);
+ dwTime = (uint32_t)time(0);
dwDiff = (dwTime - dwRecountTs);
if (dwDiff > (60 * 60 * 24 * 3)) {
g_plugin.setDword(hTmpContact, "LastCountTS", dwTime);
@@ -422,7 +422,7 @@ bool GetSubstText(MCONTACT hContact, const DISPLAYSUBST &ds, wchar_t *buff, int
{
TranslateFunc *transFunc = nullptr;
for (int i = 0; i < iTransFuncsCount; i++)
- if (translations[i].id == (DWORD)ds.iTranslateFuncId) {
+ if (translations[i].id == (uint32_t)ds.iTranslateFuncId) {
transFunc = translations[i].transFunc;
break;
}
diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp
index 4c67fbe5c3..aabbdfe388 100644
--- a/plugins/TipperYM/src/tipper.cpp
+++ b/plugins/TipperYM/src/tipper.cpp
@@ -241,7 +241,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
CallService(MS_CLC_SETINFOTIPHOVERTIME, opt.iTimeIn, 0);
// set Miranda start timestamp
- g_plugin.setDword("MirandaStartTS", (DWORD)time(0));
+ g_plugin.setDword("MirandaStartTS", (uint32_t)time(0));
return 0;
}
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp
index d5b301ff95..32431f8991 100644
--- a/plugins/TipperYM/src/translations.cpp
+++ b/plugins/TipperYM/src/translations.cpp
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA.
int iTransFuncsCount = 0;
DBVTranslation *translations = nullptr;
-DWORD dwNextFuncId;
+uint32_t dwNextFuncId;
HANDLE hServiceAdd;
static LISTTYPEDATAITEM languages[] =
@@ -131,7 +131,7 @@ void AddTranslation(DBVTranslation *newTrans)
translations[iTransFuncsCount - 1].id = 0;
}
else {
- DWORD id = db_get_dw(0, MODULE_ITEMS, szSetting, 0);
+ uint32_t id = db_get_dw(0, MODULE_ITEMS, szSetting, 0);
if (id != 0) {
translations[iTransFuncsCount - 1].id = id;
if (dwNextFuncId <= id) dwNextFuncId = id + 1;
@@ -156,7 +156,7 @@ wchar_t *NullTranslation(MCONTACT hContact, const char *szModuleName, const char
wchar_t* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
- DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
+ uint32_t ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
return nullptr;
@@ -165,7 +165,7 @@ wchar_t* TimestampToShortDate(MCONTACT hContact, const char *szModuleName, const
wchar_t* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
- DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
+ uint32_t ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
return nullptr;
@@ -174,7 +174,7 @@ wchar_t* TimestampToLongDate(MCONTACT hContact, const char *szModuleName, const
wchar_t* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
- DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
+ uint32_t ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
return nullptr;
@@ -183,7 +183,7 @@ wchar_t* TimestampToTime(MCONTACT hContact, const char *szModuleName, const char
wchar_t* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
- DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
+ uint32_t ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0)
return nullptr;
@@ -192,11 +192,11 @@ wchar_t* TimestampToTimeNoSecs(MCONTACT hContact, const char *szModuleName, cons
wchar_t* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
- DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
- DWORD t = (DWORD)time(0);
+ uint32_t ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
+ uint32_t t = (uint32_t)time(0);
if (ts == 0) return nullptr;
- DWORD diff = (ts > t) ? 0 : (t - ts);
+ uint32_t diff = (ts > t) ? 0 : (t - ts);
int d = (diff / 60 / 60 / 24);
int h = (diff - d * 60 * 60 * 24) / 60 / 60;
int m = (diff - d * 60 * 60 * 24 - h * 60 * 60) / 60;
@@ -212,7 +212,7 @@ wchar_t* TimestampToTimeDifference(MCONTACT hContact, const char *szModuleName,
wchar_t *SecondsToTimeDifference(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
- DWORD diff = db_get_dw(hContact, szModuleName, szSettingName, 0);
+ uint32_t diff = db_get_dw(hContact, szModuleName, szSettingName, 0);
int d = (diff / 60 / 60 / 24);
int h = (diff - d * 60 * 60 * 24) / 60 / 60;
int m = (diff - d * 60 * 60 * 24 - h * 60 * 60) / 60;
@@ -282,7 +282,7 @@ wchar_t *WordToCountry(MCONTACT hContact, const char *szModuleName, const char *
wchar_t *DwordToIp(MCONTACT hContact, const char *szModuleName, const char *szSettingName, wchar_t *buff, int bufflen)
{
- DWORD ip = db_get_dw(hContact, szModuleName, szSettingName, 0);
+ uint32_t ip = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ip) {
unsigned char *ipc = (unsigned char*)&ip;
mir_snwprintf(buff, bufflen, L"%u.%u.%u.%u", ipc[3], ipc[2], ipc[1], ipc[0]);
@@ -718,23 +718,23 @@ static DBVTranslation internalTranslations[] =
{
{ NullTranslation, LPGENW("[No translation]") },
{ WordToStatusDesc, LPGENW("uint16_t to status description") },
- { TimestampToTime, LPGENW("DWORD timestamp to time") },
- { TimestampToTimeDifference, LPGENW("DWORD timestamp to time difference") },
+ { TimestampToTime, LPGENW("uint32_t timestamp to time") },
+ { TimestampToTimeDifference, LPGENW("uint32_t timestamp to time difference") },
{ ByteToYesNo, LPGENW("uint8_t to Yes/No") },
{ ByteToGender, LPGENW("uint8_t to Male/Female (ICQ)") },
{ WordToCountry, LPGENW("uint16_t to country name") },
- { DwordToIp, LPGENW("DWORD to IP address") },
+ { DwordToIp, LPGENW("uint32_t to IP address") },
{ DayMonthYearToDate, LPGENW("<prefix>Day|Month|Year to date") },
{ DayMonthYearToAge, LPGENW("<prefix>Day|Month|Year to age") },
{ HoursMinutesSecondsToTime, LPGENW("<prefix>Hours|Minutes|Seconds to time") },
{ DmyToTimeDifference, LPGENW("<prefix>Day|Month|Year|Hours|Minutes|Seconds to time difference") },
{ DayMonthToDaysToNextBirthday, LPGENW("<prefix>Day|Month to days to next birthday") },
- { TimestampToTimeNoSecs, LPGENW("DWORD timestamp to time (no seconds)") },
+ { TimestampToTimeNoSecs, LPGENW("uint32_t timestamp to time (no seconds)") },
{ HoursMinutesToTime, LPGENW("<prefix>Hours|Minutes to time") },
- { TimestampToShortDate, LPGENW("DWORD timestamp to date (short)") },
- { TimestampToLongDate, LPGENW("DWORD timestamp to date (long)") },
+ { TimestampToShortDate, LPGENW("uint32_t timestamp to date (short)") },
+ { TimestampToLongDate, LPGENW("uint32_t timestamp to date (long)") },
{ EmptyXStatusToDefaultName, LPGENW("xStatus: empty xStatus name to default name") },
- { SecondsToTimeDifference, LPGENW("DWORD seconds to time difference") },
+ { SecondsToTimeDifference, LPGENW("uint32_t seconds to time difference") },
{ TimezoneToTime, LPGENW("uint8_t timezone to time") },
{ ByteToDay, LPGENW("uint16_t to name of a day (0..6, 0 is Sunday)") },
{ ByteToMonth, LPGENW("uint16_t to name of a month (1..12, 1 is January)") },