summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-20 23:15:52 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-20 23:15:52 +0300
commitf75bf6841eb401c3538ddbff7d86e15c10585e32 (patch)
treeea01af59d8715d64872621f6b9ff5ebc493ba5b6
parentbdb505dd61447e73f9a30204c005df5c67b4f6c7 (diff)
не выебывайтесь, Иван Иванович, слушайте вашу любимую песню "Валенки"
-rw-r--r--src/mir_app/src/clistgroups.cpp2
-rw-r--r--src/mir_app/src/clisttray.cpp2
-rw-r--r--src/mir_app/src/clui.cpp2
-rw-r--r--src/mir_app/src/contacts.cpp2
-rw-r--r--src/mir_app/src/db_ini.cpp6
-rw-r--r--src/mir_app/src/ei_groupIcon.cpp2
-rw-r--r--src/mir_app/src/ei_options.cpp4
-rw-r--r--src/mir_app/src/image_utils.cpp10
-rw-r--r--src/mir_app/src/menu_utils.cpp2
-rw-r--r--src/mir_app/src/meta_services.cpp2
-rw-r--r--src/mir_app/src/netlib_http.cpp4
-rw-r--r--src/mir_app/src/netlib_log.cpp2
-rw-r--r--src/mir_app/src/netlib_sock.cpp2
-rw-r--r--src/mir_app/src/netlib_upnp.cpp2
-rw-r--r--src/mir_app/src/proto_opts.cpp8
-rw-r--r--src/mir_app/src/srmm_util.cpp2
-rw-r--r--src/mir_app/src/stdafx.h3
17 files changed, 27 insertions, 30 deletions
diff --git a/src/mir_app/src/clistgroups.cpp b/src/mir_app/src/clistgroups.cpp
index 9e21ae1869..5687c6c44e 100644
--- a/src/mir_app/src/clistgroups.cpp
+++ b/src/mir_app/src/clistgroups.cpp
@@ -471,7 +471,7 @@ MIR_APP_DLL(HMENU) Clist_GroupBuildMenu(int startId)
pNextField = nullptr;
}
else {
- mir_wstrncpy(szThisField, pNextField, std::min(_countof(szThisField), size_t(pBackslash - pNextField + 1)));
+ mir_wstrncpy(szThisField, pNextField, min(_countof(szThisField), size_t(pBackslash - pNextField + 1)));
pNextField = pBackslash + 1;
}
int compareResult = 1;
diff --git a/src/mir_app/src/clisttray.cpp b/src/mir_app/src/clisttray.cpp
index b36d49c0c7..05af7a3e07 100644
--- a/src/mir_app/src/clisttray.cpp
+++ b/src/mir_app/src/clisttray.cpp
@@ -368,7 +368,7 @@ int TrayIconUpdate(HICON hNewIcon, const wchar_t *szNewTip, const char *szPrefer
if (db_get_b(0, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI) {
DWORD time1 = db_get_w(0, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 200;
DWORD time2 = db_get_w(0, "CList", "IconFlashTime", 550) + 1000;
- DWORD time = std::max(std::max(DWORD(2000), time1), time2);
+ DWORD time = max(max(DWORD(2000), time1), time2);
if (RefreshTimerId)
KillTimer(nullptr, RefreshTimerId);
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp
index 611b39e89e..a5e081b0d2 100644
--- a/src/mir_app/src/clui.cpp
+++ b/src/mir_app/src/clui.cpp
@@ -808,7 +808,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (GetMonitorInfo(hMon, &mi))
rcWorkArea = mi.rcWork;
- newHeight = std::max(nmc->pt.y, LONG(9)) + 1 + (rcWindow.bottom - rcWindow.top) - (rcTree.bottom - rcTree.top);
+ newHeight = max(nmc->pt.y, LONG(9)) + 1 + (rcWindow.bottom - rcWindow.top) - (rcTree.bottom - rcTree.top);
if (newHeight > (rcWorkArea.bottom - rcWorkArea.top) * maxHeight / 100)
newHeight = (rcWorkArea.bottom - rcWorkArea.top) * maxHeight / 100;
if (db_get_b(0, "CLUI", "AutoSizeUpward", 0)) {
diff --git a/src/mir_app/src/contacts.cpp b/src/mir_app/src/contacts.cpp
index 7172608ae2..06bedc465d 100644
--- a/src/mir_app/src/contacts.cpp
+++ b/src/mir_app/src/contacts.cpp
@@ -66,7 +66,7 @@ static wchar_t* ProcessDatabaseValueDefault(MCONTACT hContact, const char *szPro
case DBVT_DWORD:
return mir_wstrdup(_itow(dbv.dVal, buf, 10));
case DBVT_BLOB:
- return mir_wstrdup(bin2hexW(dbv.pbVal, std::min(int(dbv.cpbVal), 19), buf));
+ return mir_wstrdup(bin2hexW(dbv.pbVal, min(int(dbv.cpbVal), 19), buf));
}
db_free(&dbv);
diff --git a/src/mir_app/src/db_ini.cpp b/src/mir_app/src/db_ini.cpp
index 7b9de85da1..a792640e5a 100644
--- a/src/mir_app/src/db_ini.cpp
+++ b/src/mir_app/src/db_ini.cpp
@@ -322,7 +322,7 @@ LBL_NewLine:
if (szLine[1] == '!')
szSection[0] = '\0';
else {
- mir_strncpy(szSection, szLine + 1, std::min(sizeof(szSection), (size_t)(szEnd - szLine)));
+ mir_strncpy(szSection, szLine + 1, min(sizeof(szSection), (size_t)(szEnd - szLine)));
switch (secur) {
case 0:
warnThisSection = false;
@@ -343,7 +343,7 @@ LBL_NewLine:
if (secFN) warnThisSection = 0;
}
if (szLine[1] == '?' || szLine[1] == '-') {
- mir_strncpy(szSection, szLine + 2, std::min(sizeof(szSection), (size_t)(szEnd - szLine - 1)));
+ mir_strncpy(szSection, szLine + 2, min(sizeof(szSection), (size_t)(szEnd - szLine - 1)));
db_enum_settings(0, SettingsEnumProc, szSection);
while (setting_items) {
SettingsList *next = setting_items->next;
@@ -366,7 +366,7 @@ LBL_NewLine:
continue;
char szName[128];
- mir_strncpy(szName, szLine, std::min(sizeof(szName), (size_t)(szValue - szLine + 1)));
+ mir_strncpy(szName, szLine, min(sizeof(szName), (size_t)(szValue - szLine + 1)));
szValue++;
{
warnSettingChangeInfo_t warnInfo;
diff --git a/src/mir_app/src/ei_groupIcon.cpp b/src/mir_app/src/ei_groupIcon.cpp
index feb5d1a052..796f50d2f3 100644
--- a/src/mir_app/src/ei_groupIcon.cpp
+++ b/src/mir_app/src/ei_groupIcon.cpp
@@ -77,7 +77,7 @@ int ExtraIconGroup::getPosition() const
{
int pos = INT_MAX;
for (auto &p : m_items)
- pos = std::min(pos, p->getPosition());
+ pos = min(pos, p->getPosition());
return pos;
}
diff --git a/src/mir_app/src/ei_options.cpp b/src/mir_app/src/ei_options.cpp
index 7bc851221b..f9c1f13b6e 100644
--- a/src/mir_app/src/ei_options.cpp
+++ b/src/mir_app/src/ei_options.cpp
@@ -279,9 +279,9 @@ public:
oldSlots[i] = registeredExtraIcons[i]->getSlot();
else // Remove old slot for groups to re-set images
oldSlots[i] = -1;
- lastUsedSlot = std::max(lastUsedSlot, registeredExtraIcons[i]->getSlot());
+ lastUsedSlot = max(lastUsedSlot, registeredExtraIcons[i]->getSlot());
}
- lastUsedSlot = std::min(lastUsedSlot, EXTRA_ICON_COUNT);
+ lastUsedSlot = min(lastUsedSlot, EXTRA_ICON_COUNT);
// Get user data and create new groups
LIST<ExtraIconGroup> groups(1);
diff --git a/src/mir_app/src/image_utils.cpp b/src/mir_app/src/image_utils.cpp
index 4a25f9a73a..313fb2bada 100644
--- a/src/mir_app/src/image_utils.cpp
+++ b/src/mir_app/src/image_utils.cpp
@@ -67,23 +67,23 @@ MIR_APP_DLL(HBITMAP) Image_Resize(HBITMAP hBmp, int fit /* RESIZEBITMAP_*/, int
case RESIZEBITMAP_KEEP_PROPORTIONS:
if (height * widthOrig / heightOrig <= width) {
if (fit & RESIZEBITMAP_FLAG_DONT_GROW)
- height = std::min(height, (int)bminfo.bmHeight);
+ height = min(height, (int)bminfo.bmHeight);
width = height * widthOrig / heightOrig;
}
else {
if (fit & RESIZEBITMAP_FLAG_DONT_GROW)
- width = std::min(width, (int)bminfo.bmWidth);
+ width = min(width, (int)bminfo.bmWidth);
height = width * heightOrig / widthOrig;
}
break;
case RESIZEBITMAP_MAKE_SQUARE:
if (fit & RESIZEBITMAP_FLAG_DONT_GROW) {
- width = std::min(width, (int)bminfo.bmWidth);
- height = std::min(height, (int)bminfo.bmHeight);
+ width = min(width, (int)bminfo.bmWidth);
+ height = min(height, (int)bminfo.bmHeight);
}
- width = height = std::min(width, height);
+ width = height = min(width, height);
// Do not break. Use crop calcs to make size
case RESIZEBITMAP_CROP:
diff --git a/src/mir_app/src/menu_utils.cpp b/src/mir_app/src/menu_utils.cpp
index 57c3d8a142..6d8c142330 100644
--- a/src/mir_app/src/menu_utils.cpp
+++ b/src/mir_app/src/menu_utils.cpp
@@ -123,7 +123,7 @@ MIR_APP_DLL(BOOL) Menu_MeasureItem(LPARAM lParam)
if (pimi->iconId == -1)
return FALSE;
- mis->itemWidth = std::max(0, g_iIconSX - GetSystemMetrics(SM_CXMENUCHECK) + 4);
+ mis->itemWidth = max(0, g_iIconSX - GetSystemMetrics(SM_CXMENUCHECK) + 4);
mis->itemHeight = g_iIconSY + 2;
return TRUE;
}
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp
index eacf7d4745..5c1f4f56e9 100644
--- a/src/mir_app/src/meta_services.cpp
+++ b/src/mir_app/src/meta_services.cpp
@@ -84,7 +84,7 @@ INT_PTR Meta_GetCaps(WPARAM wParam, LPARAM)
INT_PTR Meta_GetName(WPARAM wParam, LPARAM lParam)
{
char *name = (char *)Translate(META_PROTO);
- size_t size = std::min(mir_strlen(name), wParam - 1); // copy only the first size bytes.
+ size_t size = min(mir_strlen(name), wParam - 1); // copy only the first size bytes.
if (strncpy((char *)lParam, name, size) == nullptr)
return 1;
((char *)lParam)[size] = '\0';
diff --git a/src/mir_app/src/netlib_http.cpp b/src/mir_app/src/netlib_http.cpp
index bd479a45db..cea5472038 100644
--- a/src/mir_app/src/netlib_http.cpp
+++ b/src/mir_app/src/netlib_http.cpp
@@ -85,7 +85,7 @@ static int RecvWithTimeoutTime(NetlibConnection *nlc, int dwTimeoutTime, char *b
if (nlc->foreBuf.isEmpty() && !Netlib_SslPending(nlc->hSsl)) {
while ((dwTimeNow = GetTickCount()) < dwTimeoutTime) {
- int dwDeltaTime = std::min(dwTimeoutTime - dwTimeNow, 1000);
+ int dwDeltaTime = min(dwTimeoutTime - dwTimeNow, 1000);
int res = WaitUntilReadable(nlc->s, dwDeltaTime);
switch (res) {
@@ -732,7 +732,7 @@ MIR_APP_DLL(NETLIBHTTPREQUEST*) Netlib_RecvHttpHeaders(HNETLIBCONN hConnection,
}
char *buffer = (char*)_alloca(NHRV_BUF_SIZE + 1);
- int bytesPeeked = Netlib_Recv(nlc, buffer, std::min(firstLineLength, NHRV_BUF_SIZE), flags | MSG_DUMPASTEXT);
+ int bytesPeeked = Netlib_Recv(nlc, buffer, min(firstLineLength, NHRV_BUF_SIZE), flags | MSG_DUMPASTEXT);
if (bytesPeeked != firstLineLength) {
NetlibLeaveNestedCS(&nlc->ncsRecv);
Netlib_FreeHttpRequest(nlhr);
diff --git a/src/mir_app/src/netlib_log.cpp b/src/mir_app/src/netlib_log.cpp
index f4a83fc005..9a3955eeae 100644
--- a/src/mir_app/src/netlib_log.cpp
+++ b/src/mir_app/src/netlib_log.cpp
@@ -511,7 +511,7 @@ MIR_APP_DLL(void) Netlib_Dump(HNETLIBCONN nlc, const void *pBuf, size_t len, boo
else {
for (int line = 0;; line += 16) {
auto *p = buf + line;
- int colsInLine = std::min(16, (int)len - line);
+ int colsInLine = min(16, (int)len - line);
if (colsInLine == 16)
str.AppendFormat("%08X: %02X %02X %02X %02X-%02X %02X %02X %02X-%02X %02X %02X %02X-%02X %02X %02X %02X ",
line, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]);
diff --git a/src/mir_app/src/netlib_sock.cpp b/src/mir_app/src/netlib_sock.cpp
index 821e7e37bc..4cfe8ee4ff 100644
--- a/src/mir_app/src/netlib_sock.cpp
+++ b/src/mir_app/src/netlib_sock.cpp
@@ -58,7 +58,7 @@ MIR_APP_DLL(int) Netlib_Recv(HNETLIBCONN nlc, char *buf, int len, int flags)
int recvResult;
if (!nlc->foreBuf.isEmpty()) {
- recvResult = std::min(len, (int)nlc->foreBuf.length());
+ recvResult = min(len, (int)nlc->foreBuf.length());
memcpy(buf, nlc->foreBuf.data(), recvResult);
nlc->foreBuf.remove(recvResult);
}
diff --git a/src/mir_app/src/netlib_upnp.cpp b/src/mir_app/src/netlib_upnp.cpp
index 693f963020..862d3989a2 100644
--- a/src/mir_app/src/netlib_upnp.cpp
+++ b/src/mir_app/src/netlib_upnp.cpp
@@ -146,7 +146,7 @@ static bool txtParseParam(char* szData, char* presearch,
if (cp1 == nullptr) return false;
while (*(cp1-1) == ' ' && cp1 > cp) --cp1;
- len = std::min((size_t)(cp1 - cp), size-1);
+ len = min((size_t)(cp1 - cp), size-1);
strncpy(param, cp, len);
param[len] = 0;
diff --git a/src/mir_app/src/proto_opts.cpp b/src/mir_app/src/proto_opts.cpp
index 7c6b604672..1c4fd61527 100644
--- a/src/mir_app/src/proto_opts.cpp
+++ b/src/mir_app/src/proto_opts.cpp
@@ -299,7 +299,7 @@ public:
::SelectObject(hdc, hfnt);
::ReleaseDC(m_hwnd, hdc);
- m_normalHeight = 4 + std::max(m_titleHeight, g_iIconSY);
+ m_normalHeight = 4 + max(m_titleHeight, g_iIconSY);
m_selectedHeight = m_normalHeight + 4 + 2 * m_textHeight;
m_name.SendMsg(WM_SETFONT, (WPARAM)m_hfntTitle, 0);
@@ -684,11 +684,11 @@ BOOL CAccountListCtrl::OnDrawItem(DRAWITEMSTRUCT *lps)
SelectObject(lps->hDC, PARENT()->m_hfntTitle);
tmp = lps->rcItem.bottom;
- lps->rcItem.bottom = lps->rcItem.top + std::max(cyIcon, PARENT()->m_titleHeight);
+ lps->rcItem.bottom = lps->rcItem.top + max(cyIcon, PARENT()->m_titleHeight);
DrawText(lps->hDC, text, -1, &lps->rcItem, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS | DT_VCENTER);
lps->rcItem.bottom = tmp;
GetTextExtentPoint32(lps->hDC, text, (int)length, &sz);
- lps->rcItem.top += std::max(cxIcon, (int)sz.cy) + 2;
+ lps->rcItem.top += max(cxIcon, (int)sz.cy) + 2;
}
if (lps->itemID == (unsigned)PARENT()->m_iSelected) {
@@ -951,7 +951,7 @@ void CAccountListCtrl::InitRename()
RECT rc;
GetItemRect(GetCurSel(), &rc);
rc.left += 2 * g_iIconSX + 4;
- rc.bottom = rc.top + std::max(g_iIconSX, PARENT()->m_titleHeight) + 4 - 1;
+ rc.bottom = rc.top + max(g_iIconSX, PARENT()->m_titleHeight) + 4 - 1;
++rc.top; --rc.right;
m_hwndEdit = ::CreateWindow(L"EDIT", pa->tszAccountName, WS_CHILD | WS_BORDER | ES_AUTOHSCROLL, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, m_hwnd, nullptr, g_plugin.getInst(), nullptr);
diff --git a/src/mir_app/src/srmm_util.cpp b/src/mir_app/src/srmm_util.cpp
index 2bc644b6f2..cc805d6070 100644
--- a/src/mir_app/src/srmm_util.cpp
+++ b/src/mir_app/src/srmm_util.cpp
@@ -38,7 +38,7 @@ MIR_APP_DLL(DWORD) CALLBACK Srmm_LogStreamCallback(DWORD_PTR dwCookie, LPBYTE pb
}
// give the RTF to the RE control
- *pcb = std::min(cb, LONG(lstrdat->bufferLen - lstrdat->bufferOffset));
+ *pcb = min(cb, LONG(lstrdat->bufferLen - lstrdat->bufferOffset));
memcpy(pbBuff, lstrdat->buffer + lstrdat->bufferOffset, *pcb);
lstrdat->bufferOffset += *pcb;
diff --git a/src/mir_app/src/stdafx.h b/src/mir_app/src/stdafx.h
index 3f751c679b..f3fc28e0ff 100644
--- a/src/mir_app/src/stdafx.h
+++ b/src/mir_app/src/stdafx.h
@@ -28,8 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
typedef struct SslHandle *HSSL;
#ifdef _WINDOWS
- #define NOMINMAX
-
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
@@ -60,7 +58,6 @@ typedef struct SslHandle *HSSL;
#include <locale.h>
#include <memory>
-#include <utility>
#define __NO_CMPLUGIN_NEEDED
#include <newpluginapi.h>