summaryrefslogtreecommitdiff
path: root/protocols/Steam/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Steam/src')
-rw-r--r--protocols/Steam/src/request_queue.cpp18
-rw-r--r--protocols/Steam/src/steam_avatars.cpp4
-rw-r--r--protocols/Steam/src/steam_contacts.cpp56
-rw-r--r--protocols/Steam/src/steam_dialogs.cpp10
-rw-r--r--protocols/Steam/src/steam_events.cpp2
-rw-r--r--protocols/Steam/src/steam_history.cpp6
-rw-r--r--protocols/Steam/src/steam_instances.cpp6
-rw-r--r--protocols/Steam/src/steam_login.cpp6
-rw-r--r--protocols/Steam/src/steam_menus.cpp4
-rw-r--r--protocols/Steam/src/steam_polling.cpp14
-rw-r--r--protocols/Steam/src/steam_proto.cpp14
-rw-r--r--protocols/Steam/src/steam_request.cpp6
-rw-r--r--protocols/Steam/src/steam_utils.cpp16
-rw-r--r--protocols/Steam/src/steam_xstatus.cpp6
14 files changed, 84 insertions, 84 deletions
diff --git a/protocols/Steam/src/request_queue.cpp b/protocols/Steam/src/request_queue.cpp
index ca721c55e3..84d6414c40 100644
--- a/protocols/Steam/src/request_queue.cpp
+++ b/protocols/Steam/src/request_queue.cpp
@@ -21,8 +21,8 @@ RequestQueue::RequestQueue(HNETLIBUSER hConnection) :
hConnection(hConnection), requests(1)
{
isTerminated = true;
- hRequestQueueThread = NULL;
- hRequestQueueEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ hRequestQueueThread = nullptr;
+ hRequestQueueEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
}
RequestQueue::~RequestQueue()
@@ -37,7 +37,7 @@ void RequestQueue::Start()
return;
isTerminated = false;
- if (hRequestQueueThread == NULL)
+ if (hRequestQueueThread == nullptr)
hRequestQueueThread = mir_forkthread((pThreadFunc)&RequestQueue::WorkerThread, this);
}
@@ -67,15 +67,15 @@ void RequestQueue::Push(HttpRequest *request, HttpResponseCallback response, voi
void RequestQueue::Send(HttpRequest *request, HttpResponseCallback response, void *arg, HttpFinallyCallback last)
{
RequestQueueItem *item = new RequestQueueItem(request, response, arg, last);
- mir_forkthreadowner((pThreadFuncOwner)&RequestQueue::AsyncSendThread, this, item, 0);
+ mir_forkthreadowner((pThreadFuncOwner)&RequestQueue::AsyncSendThread, this, item, nullptr);
}
void RequestQueue::Execute(RequestQueueItem *item)
{
HttpResponse *response = item->request->Send(hConnection);
- if (item->responseCallback != NULL)
+ if (item->responseCallback != nullptr)
item->responseCallback(response, item->arg);
- if (item->finallyCallback != NULL)
+ if (item->finallyCallback != nullptr)
item->finallyCallback(item->arg);
delete item;
delete response;
@@ -100,7 +100,7 @@ unsigned int RequestQueue::WorkerThread(void *arg)
WaitForSingleObject(queue->hRequestQueueEvent, INFINITE);
while (true)
{
- RequestQueueItem *item = NULL;
+ RequestQueueItem *item = nullptr;
{
mir_cslock lock(queue->requestQueueLock);
@@ -110,11 +110,11 @@ unsigned int RequestQueue::WorkerThread(void *arg)
item = queue->requests[0];
queue->requests.remove(0);
}
- if (item != NULL)
+ if (item != nullptr)
queue->Execute(item);
}
}
- queue->hRequestQueueThread = NULL;
+ queue->hRequestQueueThread = nullptr;
return 0;
} \ No newline at end of file
diff --git a/protocols/Steam/src/steam_avatars.cpp b/protocols/Steam/src/steam_avatars.cpp
index 2faa102476..a4ed74dd27 100644
--- a/protocols/Steam/src/steam_avatars.cpp
+++ b/protocols/Steam/src/steam_avatars.cpp
@@ -13,7 +13,7 @@ wchar_t* CSteamProto::GetAvatarFilePath(MCONTACT hContact)
if (steamId != NULL)
mir_snwprintf(path, MAX_PATH, L"%s\\%s.jpg", path, _A2T(steamId));
else
- return NULL;
+ return nullptr;
return mir_wstrdup(path);
}
@@ -51,7 +51,7 @@ void CSteamProto::CheckAvatarChange(MCONTACT hContact, std::string avatarUrl)
else if (update_required)
{
db_set_b(hContact, "ContactPhoto", "NeedUpdate", 1);
- ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
+ ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, nullptr, 0);
}
}
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp
index 1b3620e736..7546f33d40 100644
--- a/protocols/Steam/src/steam_contacts.cpp
+++ b/protocols/Steam/src/steam_contacts.cpp
@@ -108,7 +108,7 @@ void CSteamProto::UpdateContactDetails(MCONTACT hContact, JSONNode *data)
// set name
node = json_get(data, "realname");
- if (node != NULL)
+ if (node != nullptr)
{
std::wstring realname = (wchar_t*)ptrW(json_as_string(node));
if (!realname.empty())
@@ -140,7 +140,7 @@ void CSteamProto::UpdateContactDetails(MCONTACT hContact, JSONNode *data)
// set country
node = json_get(data, "loccountrycode");
- if (node != NULL)
+ if (node != nullptr)
{
const char *iso = ptrA(mir_u2a(ptrW(json_as_string(node))));
char *country = (char *)CallService(MS_UTILS_GETCOUNTRYBYISOCODE, (WPARAM)iso, 0);
@@ -261,7 +261,7 @@ void CSteamProto::ContactIsRemoved(MCONTACT hContact)
// If this contact was authorized and now is not (and isn't filled time of deletion), notify it
if (!getDword(hContact, "DeletedTS", 0) && getByte(hContact, "Auth", 0) == 0)
{
- setDword(hContact, "DeletedTS", ::time(NULL));
+ setDword(hContact, "DeletedTS", ::time(nullptr));
ptrW nick(getWStringA(hContact, "Nick"));
wchar_t message[MAX_PATH];
@@ -335,7 +335,7 @@ void CSteamProto::ContactIsAskingAuth(MCONTACT hContact)
DB_AUTH_BLOB blob(hContact, nickName, firstName, lastName, steamId, reason);
PROTORECVEVENT recv = { 0 };
- recv.timestamp = time(NULL);
+ recv.timestamp = time(nullptr);
recv.szMessage = blob;
recv.lParam = blob.size();
ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&recv);
@@ -395,7 +395,7 @@ void CSteamProto::UpdateContactRelationship(MCONTACT hContact, JSONNode *data)
db_set_dw(hContact, "UserInfo", "ContactAddTime", json_as_int(node));
node = json_get(data, "relationship");
- if (node == NULL)
+ if (node == nullptr)
return;
ptrA relationship(mir_u2a(ptrW(json_as_string(node))));
@@ -419,7 +419,7 @@ void CSteamProto::OnGotFriendList(const HttpResponse *response)
return;
JSONROOT root(response->pData);
- if (root == NULL)
+ if (root == nullptr)
return;
std::string steamIds = (char*)ptrA(getStringA("SteamID"));
@@ -429,16 +429,16 @@ void CSteamProto::OnGotFriendList(const HttpResponse *response)
// Remember contacts on server
JSONNode *node = json_get(root, "friends");
JSONNode *nroot = json_as_array(node);
- if (nroot != NULL)
+ if (nroot != nullptr)
{
for (size_t i = 0; i < json_size(nroot); i++)
{
JSONNode *child = json_at(nroot, i);
- if (child == NULL)
+ if (child == nullptr)
break;
node = json_get(child, "steamid");
- if (node == NULL)
+ if (node == nullptr)
continue;
std::string steamId = (char*)_T2A(ptrW(json_as_string(node)));
@@ -515,19 +515,19 @@ void CSteamProto::OnGotBlockList(const HttpResponse *response)
return;
JSONROOT root(response->pData);
- if (root == NULL)
+ if (root == nullptr)
return;
//std::string steamIds;
JSONNode *node = json_get(root, "friends");
JSONNode *nroot = json_as_array(node);
- if (nroot != NULL)
+ if (nroot != nullptr)
{
for (size_t i = 0; i < json_size(nroot); i++)
{
JSONNode *child = json_at(nroot, i);
- if (child == NULL)
+ if (child == nullptr)
break;
node = json_get(child, "steamid");
@@ -559,17 +559,17 @@ void CSteamProto::OnGotUserSummaries(const HttpResponse *response)
return;
JSONROOT root(response->pData);
- if (root == NULL)
+ if (root == nullptr)
return;
JSONNode *node = json_get(root, "players");
JSONNode *nroot = json_as_array(node);
- if (nroot != NULL)
+ if (nroot != nullptr)
{
for (size_t i = 0; i < json_size(nroot); i++)
{
JSONNode *item = json_at(nroot, i);
- if (item == NULL)
+ if (item == nullptr)
break;
node = json_get(item, "steamid");
@@ -659,7 +659,7 @@ void CSteamProto::OnFriendRemoved(const HttpResponse *response, void *arg)
}
setByte(hContact, "Auth", 1);
- setDword(hContact, "DeletedTS", ::time(NULL));
+ setDword(hContact, "DeletedTS", ::time(nullptr));
}
void CSteamProto::OnAuthRequested(const HttpResponse *response, void *arg)
@@ -671,14 +671,14 @@ void CSteamProto::OnAuthRequested(const HttpResponse *response, void *arg)
}
JSONROOT root(response->pData);
- if (root == NULL)
+ if (root == nullptr)
return;
JSONNode *node = json_get(root, "players");
JSONNode *nodes = json_as_array(node);
JSONNode *nroot = json_at(nodes, 0);
- if (nroot != NULL)
+ if (nroot != nullptr)
{
node = json_get(nroot, "steamid");
ptrA steamId(mir_u2a(ptrW(json_as_string(node))));
@@ -702,7 +702,7 @@ void CSteamProto::OnPendingApproved(const HttpResponse *response, void *arg)
}
JSONROOT root(response->pData);
- if (root == NULL)
+ if (root == nullptr)
return;
JSONNode *node = json_get(root, "success");
@@ -722,7 +722,7 @@ void CSteamProto::OnPendingIgnoreded(const HttpResponse *response, void *arg)
}
JSONROOT root(response->pData);
- if (root == NULL)
+ if (root == nullptr)
return;
JSONNode *node = json_get(root, "success");
@@ -745,7 +745,7 @@ void CSteamProto::OnSearchResults(const HttpResponse *response, void *arg)
}
JSONROOT root(response->pData);
- if (root == NULL)
+ if (root == nullptr)
{
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_FAILED, searchType, 0);
return;
@@ -753,12 +753,12 @@ void CSteamProto::OnSearchResults(const HttpResponse *response, void *arg)
JSONNode *node = json_get(root, "players");
JSONNode *nroot = json_as_array(node);
- if (nroot != NULL)
+ if (nroot != nullptr)
{
for (size_t i = 0; i < json_size(nroot); i++)
{
JSONNode *child = json_at(nroot, i);
- if (child == NULL)
+ if (child == nullptr)
break;
STEAM_SEARCH_RESULT ssr = { 0 };
@@ -772,7 +772,7 @@ void CSteamProto::OnSearchResults(const HttpResponse *response, void *arg)
ssr.hdr.nick.w = mir_wstrdup(ptrW(json_as_string(node)));
node = json_get(child, "realname");
- if (node != NULL)
+ if (node != nullptr)
{
std::wstring realname = (wchar_t*)ptrW(json_as_string(node));
if (!realname.empty())
@@ -810,7 +810,7 @@ void CSteamProto::OnSearchByNameStarted(const HttpResponse *response, void *arg)
}
JSONROOT root(response->pData);
- if (root == NULL)
+ if (root == nullptr)
{
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_FAILED, (HANDLE)arg, 0);
return;
@@ -824,16 +824,16 @@ void CSteamProto::OnSearchByNameStarted(const HttpResponse *response, void *arg)
JSONNode *node = json_get(root, "results");
JSONNode *nroot = json_as_array(node);
- if (nroot != NULL)
+ if (nroot != nullptr)
{
for (size_t i = 0; i < json_size(nroot); i++)
{
JSONNode *child = json_at(nroot, i);
- if (child == NULL)
+ if (child == nullptr)
break;
node = json_get(child, "steamid");
- if (node == NULL)
+ if (node == nullptr)
continue;
std::string steamId = (char*)_T2A(ptrW(json_as_string(node)));
diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp
index c3099c67c6..c3e3b71931 100644
--- a/protocols/Steam/src/steam_dialogs.cpp
+++ b/protocols/Steam/src/steam_dialogs.cpp
@@ -20,7 +20,7 @@ void CSteamPasswordEditor::OnInitDialog()
void CSteamPasswordEditor::OnOk(CCtrlButton*)
{
- if (m_proto->password != NULL)
+ if (m_proto->password != nullptr)
mir_free(m_proto->password);
m_proto->password = m_password.GetText();
if (m_savePermanently.Enabled())
@@ -117,7 +117,7 @@ const char* CSteamTwoFactorDialog::GetTwoFactorCode()
CSteamCaptchaDialog::CSteamCaptchaDialog(CSteamProto *proto, BYTE *captchaImage, int captchaImageSize)
: CSteamDlgBase(proto, IDD_CAPTCHA, false),
m_ok(this, IDOK), m_text(this, IDC_TEXT),
- m_captchaImage(NULL)
+ m_captchaImage(nullptr)
{
memset(m_captchaText, 0, sizeof(m_captchaText));
m_captchaImageSize = captchaImageSize;
@@ -158,14 +158,14 @@ INT_PTR CSteamCaptchaDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == WM_PAINT)
{
- FI_INTERFACE *fei = 0;
+ FI_INTERFACE *fei = nullptr;
INT_PTR result = CALLSERVICE_NOTFOUND;
if (ServiceExists(MS_IMG_GETINTERFACE))
result = CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&fei);
- if (fei == NULL || result != S_OK) {
- MessageBox(0, TranslateT("Fatal error, image services not found. Avatar services will be disabled."), TranslateT("Avatar Service"), MB_OK);
+ if (fei == nullptr || result != S_OK) {
+ MessageBox(nullptr, TranslateT("Fatal error, image services not found. Avatar services will be disabled."), TranslateT("Avatar Service"), MB_OK);
return 0;
}
diff --git a/protocols/Steam/src/steam_events.cpp b/protocols/Steam/src/steam_events.cpp
index db3b5a054c..3697689ca4 100644
--- a/protocols/Steam/src/steam_events.cpp
+++ b/protocols/Steam/src/steam_events.cpp
@@ -69,7 +69,7 @@ int CSteamProto::OnIdleChanged(WPARAM, LPARAM lParam)
CallService(MS_IDLE_GETIDLEINFO, 0, (LPARAM)&mii);
// Compute time when user really became idle
- m_idleTS = time(0) - mii.idleTime * 60;
+ m_idleTS = time(nullptr) - mii.idleTime * 60;
setDword("IdleTS", m_idleTS);
}
else
diff --git a/protocols/Steam/src/steam_history.cpp b/protocols/Steam/src/steam_history.cpp
index 61b9ae6019..3b62aa21bc 100644
--- a/protocols/Steam/src/steam_history.cpp
+++ b/protocols/Steam/src/steam_history.cpp
@@ -10,14 +10,14 @@ void CSteamProto::OnGotConversations(const HttpResponse *response)
return;
JSONROOT root(response->pData);
- if (root == NULL)
+ if (root == nullptr)
return;
JSONNode *node = json_get(root, "response");
JSONNode *sessions = json_get(node, "message_sessions");
JSONNode *nsessions = json_as_array(sessions);
- if (nsessions != NULL)
+ if (nsessions != nullptr)
{
ptrA token(getStringA("TokenSecret"));
ptrA steamId(getStringA("SteamID"));
@@ -63,7 +63,7 @@ void CSteamProto::OnGotHistoryMessages(const HttpResponse *response, void *arg)
return;
JSONROOT root(response->pData);
- if (root == NULL)
+ if (root == nullptr)
return;
JSONNode *node = json_get(root, "response");
diff --git a/protocols/Steam/src/steam_instances.cpp b/protocols/Steam/src/steam_instances.cpp
index d535e53b09..82da33d4bc 100644
--- a/protocols/Steam/src/steam_instances.cpp
+++ b/protocols/Steam/src/steam_instances.cpp
@@ -33,12 +33,12 @@ void CSteamProto::UninitProtoInstances()
CSteamProto* CSteamProto::GetContactProtoInstance(MCONTACT hContact)
{
char *proto = GetContactProto(hContact);
- if (proto == NULL)
- return NULL;
+ if (proto == nullptr)
+ return nullptr;
for (int i = 0; i < InstanceList.getCount(); i++)
if (!mir_strcmp(proto, InstanceList[i]->m_szModuleName))
return InstanceList[i];
- return NULL;
+ return nullptr;
} \ No newline at end of file
diff --git a/protocols/Steam/src/steam_login.cpp b/protocols/Steam/src/steam_login.cpp
index 1c68e5c647..2f883517e9 100644
--- a/protocols/Steam/src/steam_login.cpp
+++ b/protocols/Steam/src/steam_login.cpp
@@ -27,7 +27,7 @@ bool CSteamProto::Relogin()
if (CheckResponse(response))
{
JSONROOT root(response->pData);
- if (root != NULL) {
+ if (root != nullptr) {
JSONNode *node = json_get(root, "error");
ptrW error(json_as_string(node));
@@ -75,7 +75,7 @@ void CSteamProto::OnGotRsaKey(const HttpResponse *response)
DWORD error = 0;
DWORD encryptedSize = 0;
- if ((error = RsaEncrypt(modulus.c_str(), szPassword, NULL, encryptedSize)) != 0)
+ if ((error = RsaEncrypt(modulus.c_str(), szPassword, nullptr, encryptedSize)) != 0)
{
debugLogA("CSteamProto::OnGotRsaKey: encryption error (%lu)", error);
return;
@@ -400,5 +400,5 @@ void CSteamProto::OnLoggedOn(const HttpResponse *response)
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)ID_STATUS_CONNECTING, m_iStatus = m_iDesiredStatus);
// start polling thread
- m_hPollingThread = ForkThreadEx(&CSteamProto::PollingThread, 0, NULL);
+ m_hPollingThread = ForkThreadEx(&CSteamProto::PollingThread, nullptr, nullptr);
} \ No newline at end of file
diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp
index 9a4430882d..78d675f088 100644
--- a/protocols/Steam/src/steam_menus.cpp
+++ b/protocols/Steam/src/steam_menus.cpp
@@ -110,7 +110,7 @@ void CSteamProto::OnInitStatusMenu()
void CSteamProto::InitMenus()
{
- hChooserMenu = Menu_AddObject("SteamAccountChooser", LPGEN("Steam menu chooser"), 0, "Steam/MenuChoose");
+ hChooserMenu = Menu_AddObject("SteamAccountChooser", LPGEN("Steam menu chooser"), nullptr, "Steam/MenuChoose");
//////////////////////////////////////////////////////////////////////////////////////
// Contact menu initialization
@@ -142,7 +142,7 @@ void CSteamProto::InitMenus()
mi.pszService = MODULE "/JoinToGame";
mi.name.w = LPGENW("Join to game");
mi.position = -200001000 + CMI_JOIN_GAME;
- mi.hIcolibItem = NULL;
+ mi.hIcolibItem = nullptr;
contactMenuItems[CMI_JOIN_GAME] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, GlobalService<&CSteamProto::JoinToGameCommand>);
}
diff --git a/protocols/Steam/src/steam_polling.cpp b/protocols/Steam/src/steam_polling.cpp
index 49407e4e59..ac768f09f7 100644
--- a/protocols/Steam/src/steam_polling.cpp
+++ b/protocols/Steam/src/steam_polling.cpp
@@ -4,7 +4,7 @@
void CSteamProto::ParsePollData(JSONNode *data)
{
- JSONNode *node, *item = NULL;
+ JSONNode *node, *item = nullptr;
// FIXME: Temporary solution for receivng too many duplicated typing events; should be reworked better
std::string typingUser;
@@ -13,7 +13,7 @@ void CSteamProto::ParsePollData(JSONNode *data)
for (size_t i = 0; i < json_size(data); i++)
{
item = json_at(data, i);
- if (item == NULL)
+ if (item == nullptr)
break;
node = json_get(item, "steamid_from");
@@ -38,7 +38,7 @@ void CSteamProto::ParsePollData(JSONNode *data)
PROTORECVEVENT recv = { 0 };
recv.timestamp = timestamp;
recv.szMessage = szMessage;
- if (wcsstr(type, L"my_") == NULL)
+ if (wcsstr(type, L"my_") == nullptr)
{
ProtoChainRecvMsg(hContact, &recv);
}
@@ -169,7 +169,7 @@ void CSteamProto::ParsePollData(JSONNode *data)
dbei.cbBlob = 1;
dbei.eventType = EVENTTYPE_STEAM_CHATSTATES;
dbei.flags = DBEF_READ;
- dbei.timestamp = time(NULL);
+ dbei.timestamp = time(nullptr);
dbei.szModule = m_szModuleName;
db_event_add(hContact, &dbei);
}
@@ -217,7 +217,7 @@ void CSteamProto::PollingThread(void*)
ptrA body((char*)mir_calloc(response->dataLength + 2));
mir_strncpy(body, response->pData, response->dataLength + 1);
JSONROOT root(body);
- if (root == NULL)
+ if (root == nullptr)
{
errors++;
}
@@ -241,7 +241,7 @@ void CSteamProto::PollingThread(void*)
node = json_get(root, "messages");
JSONNode *nroot = json_as_array(node);
- if (nroot != NULL)
+ if (nroot != nullptr)
{
ParsePollData(nroot);
json_delete(nroot);
@@ -307,6 +307,6 @@ void CSteamProto::PollingThread(void*)
SetStatus(ID_STATUS_OFFLINE);
}
- m_hPollingThread = NULL;
+ m_hPollingThread = nullptr;
debugLogW(L"CSteamProto::PollingThread: leaving");
}
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp
index 5ea69328b8..e5fd1b3b89 100644
--- a/protocols/Steam/src/steam_proto.cpp
+++ b/protocols/Steam/src/steam_proto.cpp
@@ -9,9 +9,9 @@ CSteamProto::CSteamProto(const char* protoName, const wchar_t* userName)
m_idleTS = 0;
m_lastMessageTS = 0;
isLoginAgain = false;
- m_hQueueThread = NULL;
- m_pollingConnection = NULL;
- m_hPollingThread = NULL;
+ m_hQueueThread = nullptr;
+ m_pollingConnection = nullptr;
+ m_hPollingThread = nullptr;
// icons
wchar_t filePath[MAX_PATH];
@@ -23,7 +23,7 @@ CSteamProto::CSteamProto(const char* protoName, const wchar_t* userName)
char settingName[100];
mir_snprintf(settingName, "%s_%s", MODULE, "main");
- SKINICONDESC sid = { 0 };
+ SKINICONDESC sid = {};
sid.flags = SIDF_ALL_UNICODE;
sid.defaultFile.w = filePath;
sid.pszName = settingName;
@@ -225,7 +225,7 @@ DWORD_PTR CSteamProto:: GetCaps(int type, MCONTACT)
HANDLE CSteamProto::SearchBasic(const wchar_t* id)
{
if (!this->IsOnline())
- return 0;
+ return nullptr;
ptrA token(getStringA("TokenSecret"));
ptrA steamId(mir_u2a(id));
@@ -241,7 +241,7 @@ HANDLE CSteamProto::SearchBasic(const wchar_t* id)
HANDLE CSteamProto::SearchByName(const wchar_t* nick, const wchar_t* firstName, const wchar_t* lastName)
{
if (!this->IsOnline())
- return 0;
+ return nullptr;
// Combine all fields to single text
wchar_t keywordsT[200];
@@ -262,7 +262,7 @@ int CSteamProto::SendMsg(MCONTACT hContact, int, const char *message)
{
if (!IsOnline())
{
- ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, NULL, (LPARAM)Translate("You cannot send messages when you are offline."));
+ ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, nullptr, (LPARAM)Translate("You cannot send messages when you are offline."));
return 0;
}
diff --git a/protocols/Steam/src/steam_request.cpp b/protocols/Steam/src/steam_request.cpp
index 0254d16db6..508552e232 100644
--- a/protocols/Steam/src/steam_request.cpp
+++ b/protocols/Steam/src/steam_request.cpp
@@ -13,17 +13,17 @@ private:
public:
SteamResponseDelegate(CSteamProto *proto, SteamResponseCallback responseCallback)
- : proto(proto), responseCallback(responseCallback), responseWithArgCallback(NULL), arg(NULL), httpFinallyCallback(NULL), hasArg(false) {}
+ : proto(proto), responseCallback(responseCallback), responseWithArgCallback(nullptr), arg(nullptr), httpFinallyCallback(nullptr), hasArg(false) {}
SteamResponseDelegate(CSteamProto *proto, SteamResponseWithArgCallback responseCallback, void *arg, HttpFinallyCallback httpFinallyCallback)
- : proto(proto), responseCallback(NULL), responseWithArgCallback(responseCallback), arg(arg), httpFinallyCallback(httpFinallyCallback), hasArg(true) { }
+ : proto(proto), responseCallback(nullptr), responseWithArgCallback(responseCallback), arg(arg), httpFinallyCallback(httpFinallyCallback), hasArg(true) { }
void Invoke(const HttpResponse *response)
{
if (hasArg)
{
(proto->*(responseWithArgCallback))(response, arg);
- if (httpFinallyCallback != NULL)
+ if (httpFinallyCallback != nullptr)
httpFinallyCallback(arg);
}
else
diff --git a/protocols/Steam/src/steam_utils.cpp b/protocols/Steam/src/steam_utils.cpp
index 1f3cfdfa8e..4723eb7fd9 100644
--- a/protocols/Steam/src/steam_utils.cpp
+++ b/protocols/Steam/src/steam_utils.cpp
@@ -52,14 +52,14 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, const char *data, BYTE *encr
{
DWORD cchModulus = (DWORD)mir_strlen(pszModulus);
int result = 0;
- BYTE *pbBuffer = 0;
- BYTE *pKeyBlob = 0;
+ BYTE *pbBuffer = nullptr;
+ BYTE *pKeyBlob = nullptr;
HCRYPTKEY phKey = 0;
HCRYPTPROV hCSP = 0;
// convert hex string to byte array
DWORD cbLen = 0, dwSkip = 0, dwFlags = 0;
- if (!CryptStringToBinaryA(pszModulus, cchModulus, CRYPT_STRING_HEX, NULL, &cbLen, &dwSkip, &dwFlags))
+ if (!CryptStringToBinaryA(pszModulus, cchModulus, CRYPT_STRING_HEX, nullptr, &cbLen, &dwSkip, &dwFlags))
{
result = GetLastError();
goto exit;
@@ -81,8 +81,8 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, const char *data, BYTE *encr
pbBuffer[i] = temp;
}
- if (!CryptAcquireContext(&hCSP, NULL, NULL, PROV_RSA_AES, CRYPT_SILENT) &&
- !CryptAcquireContext(&hCSP, NULL, NULL, PROV_RSA_AES, CRYPT_SILENT | CRYPT_NEWKEYSET))
+ if (!CryptAcquireContext(&hCSP, nullptr, nullptr, PROV_RSA_AES, CRYPT_SILENT) &&
+ !CryptAcquireContext(&hCSP, nullptr, nullptr, PROV_RSA_AES, CRYPT_SILENT | CRYPT_NEWKEYSET))
{
result = GetLastError();
goto exit;
@@ -121,10 +121,10 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, const char *data, BYTE *encr
DWORD dataSize = (DWORD)mir_strlen(data);
// if data is not allocated just renurn size
- if (encryptedData == NULL)
+ if (encryptedData == nullptr)
{
// get length of encrypted data
- if (!CryptEncrypt(phKey, 0, TRUE, 0, NULL, &encryptedSize, dataSize))
+ if (!CryptEncrypt(phKey, 0, TRUE, 0, nullptr, &encryptedSize, dataSize))
result = GetLastError();
goto exit;
}
@@ -176,7 +176,7 @@ void CSteamProto::ShowNotification(const wchar_t *caption, const wchar_t *messag
return;
}
- MessageBox(NULL, message, caption, MB_OK | flags);
+ MessageBox(nullptr, message, caption, MB_OK | flags);
}
void CSteamProto::ShowNotification(const wchar_t *message, int flags, MCONTACT hContact)
diff --git a/protocols/Steam/src/steam_xstatus.cpp b/protocols/Steam/src/steam_xstatus.cpp
index bf6812cad4..dc7bf6024d 100644
--- a/protocols/Steam/src/steam_xstatus.cpp
+++ b/protocols/Steam/src/steam_xstatus.cpp
@@ -22,7 +22,7 @@ void SetContactExtraIcon(MCONTACT hContact, int status)
char iconName[100];
mir_snprintf(iconName, "%s_%s", MODULE, "gaming");
- ExtraIcon_SetIcon(hExtraXStatus, hContact, (status > 0) ? IcoLib_GetIconHandle(iconName) : NULL);
+ ExtraIcon_SetIcon(hExtraXStatus, hContact, (status > 0) ? IcoLib_GetIconHandle(iconName) : nullptr);
}
INT_PTR CSteamProto::OnGetXStatusEx(WPARAM wParam, LPARAM lParam)
@@ -40,7 +40,7 @@ INT_PTR CSteamProto::OnGetXStatusEx(WPARAM wParam, LPARAM lParam)
// fill status name member
if (pData->flags & CSSF_MASK_NAME)
{
- int status = (pData->wParam == NULL) ? GetContactXStatus(hContact) : *pData->wParam;
+ int status = (pData->wParam == nullptr) ? GetContactXStatus(hContact) : *pData->wParam;
if (status < 1)
return 1;
@@ -93,7 +93,7 @@ INT_PTR CSteamProto::OnGetXStatusEx(WPARAM wParam, LPARAM lParam)
HICON CSteamProto::GetXStatusIcon(int status, UINT flags)
{
if (status < 1)
- return 0;
+ return nullptr;
char iconName[100];
mir_snprintf(iconName, "%s_%s", MODULE, "gaming");