summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-02-21 18:37:12 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-02-21 18:40:14 +0300
commitb6de8047c1113030b64c81e58c2ba37c062639ae (patch)
tree046dbb4cf9e8cd2f904fef38ca86e00304605ac8 /protocols
parent40dc4c27f7d2ea66ff570281a992415a0e6578a2 (diff)
Skype: C++'11 iterators
Diffstat (limited to 'protocols')
-rw-r--r--protocols/SkypeWeb/src/requests/chatrooms.h6
-rw-r--r--protocols/SkypeWeb/src/requests/contacts.h4
-rw-r--r--protocols/SkypeWeb/src/requests/subscriptions.h4
-rw-r--r--protocols/SkypeWeb/src/skype_accounts.cpp6
-rw-r--r--protocols/SkypeWeb/src/skype_dialogs.cpp8
-rw-r--r--protocols/SkypeWeb/src/skype_popups.cpp4
-rw-r--r--protocols/SkypeWeb/src/skype_proto.h4
-rw-r--r--protocols/SkypeWeb/src/skype_timers.cpp4
-rw-r--r--protocols/SkypeWeb/src/skype_utils.cpp6
9 files changed, 23 insertions, 23 deletions
diff --git a/protocols/SkypeWeb/src/requests/chatrooms.h b/protocols/SkypeWeb/src/requests/chatrooms.h
index feb6461e60..607dd462d1 100644
--- a/protocols/SkypeWeb/src/requests/chatrooms.h
+++ b/protocols/SkypeWeb/src/requests/chatrooms.h
@@ -97,12 +97,12 @@ public:
JSONNode node;
JSONNode members(JSON_ARRAY); members.set_name("members");
- for (int i = 0; i < skypenames.getCount(); i++)
+ for (auto &it : skypenames)
{
JSONNode member;
member
- << JSONNode("id", CMStringA(::FORMAT, "8:%s", skypenames[i]).GetBuffer())
- << JSONNode("role", !mir_strcmpi(skypenames[i], li.szSkypename) ? "Admin" : "User");
+ << JSONNode("id", CMStringA(::FORMAT, "8:%s", it).GetBuffer())
+ << JSONNode("role", !mir_strcmpi(it, li.szSkypename) ? "Admin" : "User");
members << member;
}
node << members;
diff --git a/protocols/SkypeWeb/src/requests/contacts.h b/protocols/SkypeWeb/src/requests/contacts.h
index 39c0278508..40edfcc63d 100644
--- a/protocols/SkypeWeb/src/requests/contacts.h
+++ b/protocols/SkypeWeb/src/requests/contacts.h
@@ -45,8 +45,8 @@ public:
<< CHAR_VALUE("X-Skypetoken", li.api.szToken)
<< CHAR_VALUE("Accept", "application/json");
- for (int i = 0; i < skypenames.getCount(); i++)
- Body << CHAR_VALUE("contacts[]", skypenames[i]);
+ for (auto &it : skypenames)
+ Body << CHAR_VALUE("contacts[]", it);
}
};
diff --git a/protocols/SkypeWeb/src/requests/subscriptions.h b/protocols/SkypeWeb/src/requests/subscriptions.h
index 5b3ea7c4d2..6075228a4e 100644
--- a/protocols/SkypeWeb/src/requests/subscriptions.h
+++ b/protocols/SkypeWeb/src/requests/subscriptions.h
@@ -61,10 +61,10 @@ public:
JSONNode node;
JSONNode contacts(JSON_ARRAY); contacts.set_name("contacts");
- for (int i = 0; i < skypenames.getCount(); i++)
+ for (auto &it : skypenames)
{
JSONNode contact;
- contact << JSONNode("id", CMStringA(::FORMAT, "8:%s", skypenames[i]));
+ contact << JSONNode("id", CMStringA(::FORMAT, "8:%s", it));
contacts << contact;
}
node << contacts;
diff --git a/protocols/SkypeWeb/src/skype_accounts.cpp b/protocols/SkypeWeb/src/skype_accounts.cpp
index bf9dafc745..2016fac51c 100644
--- a/protocols/SkypeWeb/src/skype_accounts.cpp
+++ b/protocols/SkypeWeb/src/skype_accounts.cpp
@@ -43,9 +43,9 @@ int CSkypeProto::UninitAccount(CSkypeProto *proto)
CSkypeProto* CSkypeProto::GetContactAccount(MCONTACT hContact)
{
mir_cslock lck(accountsLock);
- for (int i = 0; i < Accounts.getCount(); i++)
- if (mir_strcmpi(GetContactProto(hContact), Accounts[i]->m_szModuleName) == 0)
- return Accounts[i];
+ for (auto &it : Accounts)
+ if (mir_strcmpi(GetContactProto(hContact), it->m_szModuleName) == 0)
+ return it;
return nullptr;
}
diff --git a/protocols/SkypeWeb/src/skype_dialogs.cpp b/protocols/SkypeWeb/src/skype_dialogs.cpp
index e791fe329d..2af7213b51 100644
--- a/protocols/SkypeWeb/src/skype_dialogs.cpp
+++ b/protocols/SkypeWeb/src/skype_dialogs.cpp
@@ -20,13 +20,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
void CSkypeProto::CloseDialogs()
{
{ mir_cslock lck(m_GCCreateDialogsLock);
- for (int i = 0; i < m_GCCreateDialogs.getCount(); i++)
- m_GCCreateDialogs[i]->Close();
+ for (auto &it : m_GCCreateDialogs)
+ it->Close();
}
{ mir_cslock lck(m_InviteDialogsLock);
- for (int i = 0; i < m_InviteDialogs.getCount(); i++)
- m_InviteDialogs[i]->Close();
+ for (auto &it : m_InviteDialogs)
+ it->Close();
}
}
diff --git a/protocols/SkypeWeb/src/skype_popups.cpp b/protocols/SkypeWeb/src/skype_popups.cpp
index b87d31c223..64fd9b5228 100644
--- a/protocols/SkypeWeb/src/skype_popups.cpp
+++ b/protocols/SkypeWeb/src/skype_popups.cpp
@@ -41,8 +41,8 @@ void CSkypeProto::InitPopups()
void CSkypeProto::UninitPopups()
{
- for (int i = 0; i < m_PopupClasses.getCount(); i++)
- Popup_UnregisterClass(m_PopupClasses[i]);
+ for (auto &it : m_PopupClasses)
+ Popup_UnregisterClass(it);
}
void CSkypeProto::ShowNotification(const wchar_t *caption, const wchar_t *message, MCONTACT hContact, int type)
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h
index 13733383b0..5bdd124995 100644
--- a/protocols/SkypeWeb/src/skype_proto.h
+++ b/protocols/SkypeWeb/src/skype_proto.h
@@ -367,8 +367,8 @@ private:
template <typename T>
__inline static void FreeList(const LIST<T> &lst)
{
- for (int i = 0; i < lst.getCount(); i++)
- mir_free(lst[i]);
+ for (auto &it : lst)
+ mir_free(it);
}
__forceinline bool IsOnline() const
diff --git a/protocols/SkypeWeb/src/skype_timers.cpp b/protocols/SkypeWeb/src/skype_timers.cpp
index 5eaae097f2..7004188d76 100644
--- a/protocols/SkypeWeb/src/skype_timers.cpp
+++ b/protocols/SkypeWeb/src/skype_timers.cpp
@@ -31,8 +31,8 @@ void CSkypeProto::ProcessTimer()
void CALLBACK CSkypeProto::TimerProc(HWND, UINT, UINT_PTR, DWORD)
{
mir_cslock lck(accountsLock);
- for (int i = 0; i < Accounts.getCount(); i++)
- Accounts[i]->ProcessTimer();
+ for (auto &it : Accounts)
+ it->ProcessTimer();
}
void CSkypeProto::SkypeSetTimer()
diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp
index cd85c2db04..6350b40c8c 100644
--- a/protocols/SkypeWeb/src/skype_utils.cpp
+++ b/protocols/SkypeWeb/src/skype_utils.cpp
@@ -593,9 +593,9 @@ INT_PTR CSkypeProto::ParseSkypeUriService(WPARAM, LPARAM lParam)
INT_PTR CSkypeProto::GlobalParseSkypeUriService(WPARAM wParam, LPARAM lParam)
{
mir_cslock lck(accountsLock);
- for (int i = 0; i < Accounts.getCount(); i++)
- if (Accounts[i]->IsOnline())
- return Accounts[i]->ParseSkypeUriService(wParam, lParam);
+ for (auto &it : Accounts)
+ if (it->IsOnline())
+ return it->ParseSkypeUriService(wParam, lParam);
return 1;
}