diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-04 22:12:13 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-04 22:12:13 +0000 |
commit | b7c74cd5b22618d544a3f4ae124985d4837e3a22 (patch) | |
tree | 468d9610a590685322ad2159a9bd2d9e2ba83f89 /protocols/Tox/src | |
parent | 7de513f180c429859e246d1033d745b394e1fc28 (diff) |
new mir_snprintf templates without SIZEOF
git-svn-id: http://svn.miranda-ng.org/main/trunk@14002 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src')
-rw-r--r-- | protocols/Tox/src/tox_multimedia.cpp | 2 | ||||
-rw-r--r-- | protocols/Tox/src/tox_network.cpp | 8 | ||||
-rw-r--r-- | protocols/Tox/src/tox_options.cpp | 24 |
3 files changed, 17 insertions, 17 deletions
diff --git a/protocols/Tox/src/tox_multimedia.cpp b/protocols/Tox/src/tox_multimedia.cpp index 2068b64a44..ff55177d1a 100644 --- a/protocols/Tox/src/tox_multimedia.cpp +++ b/protocols/Tox/src/tox_multimedia.cpp @@ -321,7 +321,7 @@ INT_PTR CToxProto::OnRecvAudioCall(WPARAM hContact, LPARAM lParam) cle.ptszTooltip = szTooltip;
char szService[MAX_PATH];
- mir_snprintf(szService, SIZEOF(szService), "%s/Audio/Ring", GetContactProto(hContact));
+ mir_snprintf(szService, "%s/Audio/Ring", GetContactProto(hContact));
cle.pszService = szService;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index 860f5c5798..26958fbeef 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -27,16 +27,16 @@ void CToxProto::BootstrapNodesFromDb(bool isIPv6) char setting[MAX_PATH];
for (int i = 0; i < nodeCount; i++)
{
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV4, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, i);
ptrA address(db_get_sa(NULL, module, setting));
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PORT, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, i);
int port = db_get_w(NULL, module, setting, 33445);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PKEY, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, i);
ptrA pubKey(db_get_sa(NULL, module, setting));
BootstrapNode(address, port, pubKey);
if (isIPv6)
{
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV6, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, i);
address = db_get_sa(NULL, module, setting);
BootstrapNode(address, port, pubKey);
}
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 0023c60141..1e5d270231 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -428,15 +428,15 @@ void CToxOptionsNodeList::OnInitDialog() int nodeCount = db_get_w(NULL, module, TOX_SETTINGS_NODE_COUNT, 0);
for (int i = 0; i < nodeCount; i++)
{
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV4, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, i);
ptrT value(db_get_tsa(NULL, module, setting));
iItem = m_nodes.AddItem(value, -1, NULL, 1);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV6, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, i);
value = db_get_tsa(NULL, module, setting);
m_nodes.SetItem(iItem, 1, value);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PORT, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, i);
int port = db_get_w(NULL, module, setting, 0);
if (port > 0)
{
@@ -445,7 +445,7 @@ void CToxOptionsNodeList::OnInitDialog() m_nodes.SetItem(iItem, 2, mir_a2t(portNum));
}
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PKEY, i);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, i);
value = db_get_tsa(NULL, module, setting);
m_nodes.SetItem(iItem, 3, value);
@@ -547,22 +547,22 @@ void CToxOptionsNodeList::OnApply() lvi.mask = LVIF_TEXT;
lvi.iSubItem = 0;
m_nodes.GetItem(&lvi);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV4, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, iItem);
db_set_s(NULL, module, setting, _T2A(lvi.pszText));
lvi.iSubItem = 1;
m_nodes.GetItem(&lvi);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV6, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, iItem);
db_set_s(NULL, module, setting, _T2A(lvi.pszText));
lvi.iSubItem = 2;
m_nodes.GetItem(&lvi);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PORT, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, iItem);
db_set_w(NULL, module, setting, _ttoi(lvi.pszText));
lvi.iSubItem = 3;
m_nodes.GetItem(&lvi);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PKEY, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, iItem);
db_set_s(NULL, module, setting, _T2A(lvi.pszText));
iItem++;
@@ -571,13 +571,13 @@ void CToxOptionsNodeList::OnApply() int nodeCount = db_get_b(NULL, module, TOX_SETTINGS_NODE_COUNT, 0);
for (iItem = itemCount; iItem < nodeCount; iItem++)
{
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV4, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, iItem);
db_unset(NULL, module, setting);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV6, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, iItem);
db_unset(NULL, module, setting);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PORT, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, iItem);
db_unset(NULL, module, setting);
- mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PKEY, iItem);
+ mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, iItem);
db_unset(NULL, module, setting);
}
db_set_b(NULL, module, TOX_SETTINGS_NODE_COUNT, itemCount);
|