From b7c74cd5b22618d544a3f4ae124985d4837e3a22 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 4 Jun 2015 22:12:13 +0000 Subject: new mir_snprintf templates without SIZEOF git-svn-id: http://svn.miranda-ng.org/main/trunk@14002 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/vk_proto.cpp | 50 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'protocols/VKontakte/src/vk_proto.cpp') diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 887cafdf8c..28f0e88289 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -198,35 +198,35 @@ void CVkProto::InitMenus() mi.flags = CMIF_CHILDPOPUP; mi.hParentMenu = MO_GetProtoRootMenu(m_szModuleName); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_CREATECHAT); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_CREATECHAT); mi.pszService = szService; mi.position = 10009 + PMI_CREATECHAT; mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_JOIN); mi.pszName = LPGEN("Create new chat"); g_hProtoMenuItems[PMI_CREATECHAT] = Menu_AddProtoMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_SETSTATUSMSG); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_SETSTATUSMSG); mi.pszService = szService; mi.position = 10009 + PMI_SETSTATUSMSG; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_STATUS)); mi.pszName = LPGEN("Status message"); g_hProtoMenuItems[PMI_SETSTATUSMSG] = Menu_AddProtoMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_WALLPOST); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_WALLPOST); mi.pszService = szService; mi.position = 10009 + PMI_WALLPOST; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_WALL)); mi.pszName = LPGEN("Send message to my wall"); g_hProtoMenuItems[PMI_WALLPOST] = Menu_AddProtoMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_LOADVKNEWS); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_LOADVKNEWS); mi.pszService = szService; mi.position = 10009 + PMI_LOADVKNEWS; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION)); mi.pszName = LPGEN("Load news from VK"); g_hProtoMenuItems[PMI_LOADVKNEWS] = Menu_AddProtoMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_VISITPROFILE); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_VISITPROFILE); mi.pszService = szService; mi.position = 10009 + PMI_VISITPROFILE; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE)); @@ -241,56 +241,56 @@ void CVkProto::InitMenus() mi.ptszName = LPGENT("Visit profile"); g_hContactMenuItems[CMI_VISITPROFILE] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_WALLPOST); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_WALLPOST); mi.position = -200001000 + CMI_WALLPOST; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_WALL)); mi.ptszName = LPGENT("Send message to user\'s wall"); mi.pszService = szService; g_hContactMenuItems[CMI_WALLPOST] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_ADDASFRIEND); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_ADDASFRIEND); mi.position = -200001000 + CMI_ADDASFRIEND; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_FRIENDADD)); mi.ptszName = LPGENT("Add as friend"); mi.pszService = szService; g_hContactMenuItems[CMI_ADDASFRIEND] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_DELETEFRIEND); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_DELETEFRIEND); mi.position = -200001000 + CMI_DELETEFRIEND; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL)); mi.ptszName = LPGENT("Delete from friend list"); mi.pszService = szService; g_hContactMenuItems[CMI_DELETEFRIEND] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_BANUSER); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_BANUSER); mi.position = -200001000 + CMI_BANUSER; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_BAN)); mi.ptszName = LPGENT("Ban user"); mi.pszService = szService; g_hContactMenuItems[CMI_BANUSER] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_REPORTABUSE); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_REPORTABUSE); mi.position = -200001000 + CMI_REPORTABUSE; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_ABUSE)); mi.ptszName = LPGENT("Report abuse"); mi.pszService = szService; g_hContactMenuItems[CMI_REPORTABUSE] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_DESTROYKICKCHAT); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_DESTROYKICKCHAT); mi.position = -200001000 + CMI_DESTROYKICKCHAT; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL)); mi.ptszName = LPGENT("Destroy room"); mi.pszService = szService; g_hContactMenuItems[CMI_DESTROYKICKCHAT] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_OPENBROADCAST); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_OPENBROADCAST); mi.position = -200001000 + CMI_OPENBROADCAST; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_BROADCAST)); mi.ptszName = LPGENT("Open broadcast"); mi.pszService = szService; g_hContactMenuItems[CMI_OPENBROADCAST] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_LOADVKNEWS); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_LOADVKNEWS); mi.pszService = szService; mi.position = -200001000 + CMI_LOADVKNEWS; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION)); @@ -298,7 +298,7 @@ void CVkProto::InitMenus() g_hContactMenuItems[CMI_LOADVKNEWS] = Menu_AddContactMenuItem(&mi); // Sync history menu - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORY); mi.position = -200001000 + CMI_GETSERVERHISTORY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("Reload messages from vk.com..."); @@ -308,42 +308,42 @@ void CVkProto::InitMenus() mi.flags |= CMIF_CHILDPOPUP; mi.hParentMenu = g_hContactMenuItems[CMI_GETSERVERHISTORY]; - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST1DAY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST1DAY); mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST1DAY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("for last 1 day"); mi.pszService = szService; g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST1DAY] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST3DAY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST3DAY); mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST3DAY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("for last 3 days"); mi.pszService = szService; g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST3DAY] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST7DAY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST7DAY); mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST7DAY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("for last week"); mi.pszService = szService; g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST7DAY] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST30DAY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST30DAY); mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST30DAY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("for last 30 days"); mi.pszService = szService; g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST30DAY] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST90DAY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST90DAY); mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST90DAY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("for last 90 days"); mi.pszService = szService; g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST90DAY] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETALLSERVERHISTORY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETALLSERVERHISTORY); mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETALLSERVERHISTORY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("for all time"); @@ -394,8 +394,8 @@ void CVkProto::InitPopups(void) POPUPCLASS ppc = { sizeof(ppc) }; ppc.flags = PCF_TCHAR; - mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Errors")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Error"); + mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Errors")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Error"); ppc.ptszDescription = desc; ppc.pszName = name; ppc.hIcon = LoadSkinnedIcon(SKINICON_ERROR); @@ -404,8 +404,8 @@ void CVkProto::InitPopups(void) ppc.iSeconds = 60; m_hPopupClassError = Popup_RegisterClass(&ppc); - mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Notification")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Notification"); + mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Notification")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Notification"); ppc.ptszDescription = desc; ppc.pszName = name; ppc.hIcon = Skin_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION)); @@ -425,7 +425,7 @@ void CVkProto::MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTi ppd.ptszText = szMsg; ppd.pszClassName = name; ppd.hContact = hContact; - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, err ? "Error" : "Notification"); + mir_snprintf(name, "%s_%s", m_szModuleName, err ? "Error" : "Notification"); CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd); } -- cgit v1.2.3