diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-03 16:02:14 +0200 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-03 16:02:14 +0200 |
commit | 3ad2582c4a4a6378f294f9256ecbcbdf0ae88e3a (patch) | |
tree | 412a28ef6a572efc7039df1c363bf47a3dec4b19 /src/mir_core | |
parent | 9a6f750a482d1d1ebf4281bb7bf8133e547ad438 (diff) |
mir_forkThread<typename> - stronger typizatioin for thread function parameter
Diffstat (limited to 'src/mir_core')
-rw-r--r-- | src/mir_core/src/openurl.cpp | 8 | ||||
-rw-r--r-- | src/mir_core/src/timezones.cpp | 2 | ||||
-rw-r--r-- | src/mir_core/src/utils.cpp | 2 |
3 files changed, 5 insertions, 7 deletions
diff --git a/src/mir_core/src/openurl.cpp b/src/mir_core/src/openurl.cpp index 3e0e5e757f..2fcd374dce 100644 --- a/src/mir_core/src/openurl.cpp +++ b/src/mir_core/src/openurl.cpp @@ -36,10 +36,8 @@ struct TOpenUrlInfo int newWindow;
};
-static void OpenURLThread(void *arg)
+static void __cdecl OpenURLThread(TOpenUrlInfo *hUrlInfo)
{
- TOpenUrlInfo *hUrlInfo = (TOpenUrlInfo*)arg;
-
// wack a protocol on it
CMStringW tszUrl;
if ((isalpha(hUrlInfo->szUrl[0]) && hUrlInfo->szUrl[1] == ':') || hUrlInfo->szUrl[0] == '\\')
@@ -68,11 +66,11 @@ static void OpenURLThread(void *arg) MIR_CORE_DLL(void) Utils_OpenUrl(const char *pszUrl, bool bOpenInNewWindow)
{
if (pszUrl)
- mir_forkthread(OpenURLThread, new TOpenUrlInfo(mir_a2u(pszUrl), bOpenInNewWindow));
+ mir_forkThread<TOpenUrlInfo>(OpenURLThread, new TOpenUrlInfo(mir_a2u(pszUrl), bOpenInNewWindow));
}
MIR_CORE_DLL(void) Utils_OpenUrlW(const wchar_t *pszUrl, bool bOpenInNewWindow)
{
if (pszUrl)
- mir_forkthread(OpenURLThread, new TOpenUrlInfo(mir_wstrdup(pszUrl), bOpenInNewWindow));
+ mir_forkThread<TOpenUrlInfo>(OpenURLThread, new TOpenUrlInfo(mir_wstrdup(pszUrl), bOpenInNewWindow));
}
diff --git a/src/mir_core/src/timezones.cpp b/src/mir_core/src/timezones.cpp index a6b972ae38..db0d4f5a1b 100644 --- a/src/mir_core/src/timezones.cpp +++ b/src/mir_core/src/timezones.cpp @@ -496,7 +496,7 @@ void GetLocalizedString(HKEY hSubKey, const wchar_t *szName, wchar_t *szBuf, DWO void RecalculateTime(void)
{
GetTimeZoneInformation(&myInfo.myTZ.tzi);
- myInfo.timestamp = time(nullptr);
+ myInfo.timestamp = time(0);
myInfo.myTZ.offset = INT_MIN;
bool found = false;
diff --git a/src/mir_core/src/utils.cpp b/src/mir_core/src/utils.cpp index a6be2b153e..df90e62d2a 100644 --- a/src/mir_core/src/utils.cpp +++ b/src/mir_core/src/utils.cpp @@ -530,7 +530,7 @@ MIR_CORE_DLL(void) Utils_GetRandom(void *pszDest, size_t cbLen) if (pfnRtlGenRandom != nullptr)
pfnRtlGenRandom(pszDest, (ULONG)cbLen);
else {
- srand(time(nullptr));
+ srand(time(0));
BYTE *p = (BYTE*)pszDest;
for (size_t i = 0; i < cbLen; i++)
p[i] = rand() & 0xFF;
|