diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
commit | 4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch) | |
tree | 9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /protocols/Tox/src/tox_icons.cpp | |
parent | f0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (diff) |
SIZEOF replaced with more secure analog - _countof
git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_icons.cpp')
-rw-r--r-- | protocols/Tox/src/tox_icons.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/protocols/Tox/src/tox_icons.cpp b/protocols/Tox/src/tox_icons.cpp index e1b00b2688..3bb4302513 100644 --- a/protocols/Tox/src/tox_icons.cpp +++ b/protocols/Tox/src/tox_icons.cpp @@ -23,10 +23,10 @@ void CToxProto::InitIcons() sid.pszName = szSettingName;
sid.section.t = szSectionName;
- mir_sntprintf(szSectionName, SIZEOF(szSectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE));
- for (int i = 0; i < SIZEOF(Icons); i++)
+ mir_sntprintf(szSectionName, _countof(szSectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE));
+ for (int i = 0; i < _countof(Icons); i++)
{
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MODULE, Icons[i].Name);
+ mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", MODULE, Icons[i].Name);
sid.description.t = Icons[i].Description;
sid.iDefaultIndex = -Icons[i].IconId;
@@ -36,7 +36,7 @@ void CToxProto::InitIcons() HICON CToxProto::GetIcon(const char *name, bool size)
{
- for (size_t i = 0; i < SIZEOF(Icons); i++)
+ for (size_t i = 0; i < _countof(Icons); i++)
if (mir_strcmpi(Icons[i].Name, name) == 0)
return IcoLib_GetIconByHandle(Icons[i].Handle, size);
@@ -45,7 +45,7 @@ HICON CToxProto::GetIcon(const char *name, bool size) HANDLE CToxProto::GetIconHandle(const char *name)
{
- for (size_t i = 0; i < SIZEOF(Icons); i++)
+ for (size_t i = 0; i < _countof(Icons); i++)
if (mir_strcmpi(Icons[i].Name, name) == 0)
return Icons[i].Handle;
@@ -55,7 +55,7 @@ HANDLE CToxProto::GetIconHandle(const char *name) HANDLE CToxProto::Skin_GetIconHandle(const char *name)
{
char iconName[100];
- mir_snprintf(iconName, SIZEOF(iconName), "%s_%s", MODULE, name);
+ mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, name);
HANDLE hIcon = IcoLib_GetIconHandle(iconName);
if (hIcon == NULL)
hIcon = GetIconHandle(name);
@@ -65,6 +65,6 @@ HANDLE CToxProto::Skin_GetIconHandle(const char *name) void CToxProto::UninitIcons()
{
- for (size_t i = 0; i < SIZEOF(Icons); i++)
+ for (size_t i = 0; i < _countof(Icons); i++)
IcoLib_RemoveIcon(Icons[i].Name);
}
\ No newline at end of file |