Fix compilation errors in conformance mode

This commit is contained in:
Stanislav Ershov 2018-10-19 01:51:55 +03:00
parent 5d336eb54f
commit e2e9b8aefc
4 changed files with 12 additions and 13 deletions

View File

@ -538,7 +538,7 @@ private:
BYTE r = 0, g = 0, b = 0;
COLORREF noKeyColor;
static LRESULT CALLBACK _PsShadowWindows::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
};
_PsShadowWindows _psShadowWindows;

View File

@ -213,7 +213,7 @@ class ToastEventHandler : public Implements<DesktopToastActivatedEventHandler, D
DesktopToastFailedEventHandler> {
public:
// We keep a weak pointer to a member field of native notifications manager.
ToastEventHandler::ToastEventHandler(const std::shared_ptr<Manager *> &guarded, const PeerId &peer, MsgId msg)
ToastEventHandler(const std::shared_ptr<Manager *> &guarded, const PeerId &peer, MsgId msg)
: _peerId(peer)
, _msgId(msg)
, _weak(guarded) {}
@ -608,8 +608,8 @@ void queryQuietHours() {
return;
}
LPTSTR lpKeyName = L"Software\\Microsoft\\Windows\\CurrentVersion\\Notifications\\Settings";
LPTSTR lpValueName = L"NOC_GLOBAL_SETTING_TOASTS_ENABLED";
LPCWSTR lpKeyName = L"Software\\Microsoft\\Windows\\CurrentVersion\\Notifications\\Settings";
LPCWSTR lpValueName = L"NOC_GLOBAL_SETTING_TOASTS_ENABLED";
HKEY key;
auto result = RegOpenKeyEx(HKEY_CURRENT_USER, lpKeyName, 0, KEY_READ, &key);
if (result != ERROR_SUCCESS) {

View File

@ -510,15 +510,14 @@ QString SystemLanguage() {
namespace {
void _psLogError(const char *str, LSTATUS code) {
LPTSTR errorText = NULL, errorTextDefault = L"(Unknown error)";
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&errorText, 0, 0);
if (!errorText) {
errorText = errorTextDefault;
}
LOG((str).arg(code).arg(QString::fromStdWString(errorText)));
if (errorText != errorTextDefault) {
LPWSTR errorText = NULL;
if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&errorText, 0, 0) > 0) {
LOG((str).arg(code).arg(QString::fromStdWString(errorText)));
LocalFree(errorText);
} else {
LOG((str).arg(code).arg("(Unknown error)"));
}
}

View File

@ -663,7 +663,7 @@ private:
};
void computeLinkText(const QString &linkData, QString *outLinkText, LinkDisplayStatus *outDisplayStatus) {
QUrl url(linkData), good(url.isValid() ? url.toEncoded() : "");
QUrl url(linkData), good(url.isValid() ? url.toEncoded() : QString());
QString readable = good.isValid() ? good.toDisplayString() : linkData;
*outLinkText = _t->_st->font->elided(readable, st::linkCropLimit);
*outDisplayStatus = (*outLinkText == readable) ? LinkDisplayedFull : LinkDisplayedElided;