diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 04:50:22 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 04:50:22 +0000 |
commit | 41a7300678e4bb3cd703e2c236e57af4a31962c7 (patch) | |
tree | 36318f807498cf15b405eda5c451fd37bfe1b675 /protocols/AimOscar/src | |
parent | 97e0ada5c34d6e7eba1cf47a8d8ac029197be6de (diff) |
mir_snprintf(..., sizeof() -> SIZEOF(), ...)
small fixs cleanups
git-svn-id: http://svn.miranda-ng.org/main/trunk@11188 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/AimOscar/src')
-rw-r--r-- | protocols/AimOscar/src/client.cpp | 2 | ||||
-rw-r--r-- | protocols/AimOscar/src/proto.cpp | 4 | ||||
-rw-r--r-- | protocols/AimOscar/src/server.cpp | 14 | ||||
-rw-r--r-- | protocols/AimOscar/src/theme.cpp | 18 | ||||
-rw-r--r-- | protocols/AimOscar/src/utility.cpp | 12 |
5 files changed, 25 insertions, 25 deletions
diff --git a/protocols/AimOscar/src/client.cpp b/protocols/AimOscar/src/client.cpp index 8c725810a5..69577e8cc2 100644 --- a/protocols/AimOscar/src/client.cpp +++ b/protocols/AimOscar/src/client.cpp @@ -53,7 +53,7 @@ int CAimProto::aim_auth_request(HANDLE hServerConn,unsigned short &seqno,const c char client_id[64], mirver[64];
CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(mirver), (LPARAM)mirver);
- int client_id_len = mir_snprintf(client_id, sizeof(client_id), "Miranda AIM, version %s", mirver);
+ int client_id_len = mir_snprintf(client_id, SIZEOF(client_id), "Miranda AIM, version %s", mirver);
char* buf=(char*)alloca(SNAC_SIZE+TLV_HEADER_SIZE*14+MD5_HASH_LENGTH+strlen(username)+client_id_len+30+strlen(language)+strlen(country));
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index 6bf94c926c..ec60663c33 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -57,7 +57,7 @@ CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) : m_hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
char szP2P[128];
- mir_snprintf(szP2P, sizeof(szP2P), "%sP2P", m_szModuleName);
+ mir_snprintf(szP2P, SIZEOF(szP2P), "%sP2P", m_szModuleName);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s Client-to-client connection"), m_tszUserName);
nlu.szSettingsModule = szP2P;
@@ -824,7 +824,7 @@ int __cdecl CAimProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l case EV_PROTO_ONERASE:
{
char szDbsettings[64];
- mir_snprintf(szDbsettings, sizeof(szDbsettings), "%sP2P", m_szModuleName);
+ mir_snprintf(szDbsettings, SIZEOF(szDbsettings), "%sP2P", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbsettings);
}
break;
diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp index c2b74f219d..743966c18a 100644 --- a/protocols/AimOscar/src/server.cpp +++ b/protocols/AimOscar/src/server.cpp @@ -316,7 +316,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f =cap[13];
char g =cap[14];
char h =cap[15];
- mir_snprintf(client,sizeof(client),CLIENT_OSCARJ,a&0x7f,b,c,d,alpha_cap_str(a),e&0x7f,f,g,h,alpha_cap_str(e));
+ mir_snprintf(client,SIZEOF(client),CLIENT_OSCARJ,a&0x7f,b,c,d,alpha_cap_str(a),e&0x7f,f,g,h,alpha_cap_str(e));
}
else if (memcmp(cap, "MirandaA", 8) == 0)
{
@@ -328,7 +328,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f =cap[13];
char g =cap[14];
char h =cap[15];
- mir_snprintf(client,sizeof(client),CLIENT_AIMOSCAR,a,b,c,d,e,f,g,h);
+ mir_snprintf(client,SIZEOF(client),CLIENT_AIMOSCAR,a,b,c,d,e,f,g,h);
}
if (memcmp(cap, "sinj", 4) == 0)
{
@@ -340,7 +340,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f =cap[9];
char g =cap[10];
char h =cap[11];
- mir_snprintf(client,sizeof(client),CLIENT_OSCARSN,a&0x7f,b,c,d,alpha_cap_str(a),e&0x7f,f,g,h,alpha_cap_str(e),secure_cap_str(&cap[12]));
+ mir_snprintf(client,SIZEOF(client),CLIENT_OSCARSN,a&0x7f,b,c,d,alpha_cap_str(a),e&0x7f,f,g,h,alpha_cap_str(e),secure_cap_str(&cap[12]));
}
if (memcmp(cap, "icqp", 4) == 0)
{
@@ -352,7 +352,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f =cap[9];
char g =cap[10];
char h =cap[11];
- mir_snprintf(client,sizeof(client),CLIENT_OSCARPL,a&0x7f,b,c,d,alpha_cap_str(a),e&0x7f,f,g,h,alpha_cap_str(e),secure_cap_str(&cap[12]));
+ mir_snprintf(client,SIZEOF(client),CLIENT_OSCARPL,a&0x7f,b,c,d,alpha_cap_str(a),e&0x7f,f,g,h,alpha_cap_str(e),secure_cap_str(&cap[12]));
}
else if (memcmp(cap, "Kopete ICQ", 10) == 0)
{
@@ -1588,7 +1588,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013 default:
char msg[64];
- mir_snprintf(msg, sizeof(msg), "Error removing buddy from list. Error code %#x", code);
+ mir_snprintf(msg, SIZEOF(msg), "Error removing buddy from list. Error code %#x", code);
ShowPopup(msg, ERROR_POPUP);
break;
}
@@ -1623,7 +1623,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013 default:
char msg[64];
- mir_snprintf(msg, sizeof(msg), Translate("Unknown error when adding buddy to list. Error code %#x"), code);
+ mir_snprintf(msg, SIZEOF(msg), Translate("Unknown error when adding buddy to list. Error code %#x"), code);
ShowPopup(msg, ERROR_POPUP);
break;
}
@@ -1643,7 +1643,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013 default:
char msg[64];
- mir_snprintf(msg, sizeof(msg), Translate("Unknown error when attempting to modify a group. Error code %#x"), code);
+ mir_snprintf(msg, SIZEOF(msg), Translate("Unknown error when attempting to modify a group. Error code %#x"), code);
ShowPopup(msg, ERROR_POPUP);
break;
}
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp index baacf678f0..0e4b6b69b5 100644 --- a/protocols/AimOscar/src/theme.cpp +++ b/protocols/AimOscar/src/theme.cpp @@ -63,7 +63,7 @@ void InitIcons(void) HICON LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName), "AIM_%s", name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName), "AIM_%s", name);
return Skin_GetIcon(szSettingName, big);
}
@@ -79,7 +79,7 @@ HANDLE GetIconHandle(const char* name) void ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, sizeof(szSettingName ), "%s_%s", "AIM", name);
+ mir_snprintf(szSettingName, SIZEOF(szSettingName ), "%s_%s", "AIM", name);
Skin_ReleaseIcon(szSettingName, big);
}
@@ -245,21 +245,21 @@ void CAimProto::InitMainMenus(void) mi.hParentMenu = hRoot;
mi.flags = CMIF_CHILDPOPUP;
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/ManageAccount");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/ManageAccount");
CreateProtoService("/ManageAccount", &CAimProto::ManageAccount);
mi.position = 201001;
mi.icolibItem = GetIconHandle("aim");
mi.pszName = LPGEN("Manage Account");
hMainMenu[0] = Menu_AddProtoMenuItem(&mi);
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/InstantIdle");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/InstantIdle");
CreateProtoService("/InstantIdle",&CAimProto::InstantIdle);
mi.position = 201002;
mi.icolibItem = GetIconHandle("idle");
mi.pszName = LPGEN("Instant Idle");
hMainMenu[1] = Menu_AddProtoMenuItem(&mi);
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/JoinChatRoom");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/JoinChatRoom");
CreateProtoService("/JoinChatRoom", &CAimProto::JoinChatUI);
mi.position = 201003;
mi.icolibItem = GetIconHandle("aol");
@@ -276,7 +276,7 @@ void CAimProto::InitContactMenus(void) mi.pszService = service_name;
mi.pszContactOwner = m_szModuleName;
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/GetHTMLAwayMsg");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/GetHTMLAwayMsg");
CreateProtoService("/GetHTMLAwayMsg",&CAimProto::GetHTMLAwayMsg);
mi.position = -2000006000;
mi.icolibItem = GetIconHandle("away");
@@ -284,7 +284,7 @@ void CAimProto::InitContactMenus(void) mi.flags = CMIF_NOTOFFLINE | CMIF_HIDDEN;
hHTMLAwayContextMenuItem = Menu_AddContactMenuItem(&mi);
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/GetProfile");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/GetProfile");
CreateProtoService("/GetProfile", &CAimProto::GetProfile);
mi.position = -2000005090;
mi.icolibItem = GetIconHandle("profile");
@@ -292,7 +292,7 @@ void CAimProto::InitContactMenus(void) mi.flags = CMIF_NOTOFFLINE;
hReadProfileMenuItem = Menu_AddContactMenuItem(&mi);
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/AddToServerList");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/AddToServerList");
CreateProtoService("/AddToServerList", &CAimProto::AddToServerList);
mi.position = -2000005080;
mi.icolibItem = GetIconHandle("add");
@@ -300,7 +300,7 @@ void CAimProto::InitContactMenus(void) mi.flags = CMIF_NOTONLINE | CMIF_HIDDEN;
hAddToServerListContextMenuItem = Menu_AddContactMenuItem(&mi);
- mir_snprintf(service_name, sizeof(service_name), "%s%s", m_szModuleName, "/BlockCommand");
+ mir_snprintf(service_name, SIZEOF(service_name), "%s%s", m_szModuleName, "/BlockCommand");
CreateProtoService("/BlockCommand", &CAimProto::BlockBuddy);
mi.position = -2000005060;
mi.icolibItem = GetIconHandle("block");
diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index 28678182a4..dfd9677ca3 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -498,42 +498,42 @@ void BdList::remove_by_id(unsigned short id) unsigned short CAimProto::getBuddyId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_BI)+10];
- mir_snprintf(item, sizeof(AIM_KEY_BI)+10, AIM_KEY_BI"%d", i);
+ mir_snprintf(item, SIZEOF(item), AIM_KEY_BI"%d", i);
return getWord(hContact, item, 0);
}
void CAimProto::setBuddyId(MCONTACT hContact, int i, unsigned short id)
{
char item[sizeof(AIM_KEY_BI)+10];
- mir_snprintf(item, sizeof(AIM_KEY_BI)+10, AIM_KEY_BI"%d", i);
+ mir_snprintf(item, SIZEOF(item), AIM_KEY_BI"%d", i);
setWord(hContact, item, id);
}
int CAimProto::deleteBuddyId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_BI)+10];
- mir_snprintf(item, sizeof(AIM_KEY_BI)+10, AIM_KEY_BI"%d", i);
+ mir_snprintf(item, SIZEOF(item), AIM_KEY_BI"%d", i);
return delSetting(hContact, item);
}
unsigned short CAimProto::getGroupId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_GI)+10];
- mir_snprintf(item, sizeof(AIM_KEY_GI)+10, AIM_KEY_GI"%d", i);
+ mir_snprintf(item, SIZEOF(item), AIM_KEY_GI"%d", i);
return getWord(hContact, item, 0);
}
void CAimProto::setGroupId(MCONTACT hContact, int i, unsigned short id)
{
char item[sizeof(AIM_KEY_GI)+10];
- mir_snprintf(item, sizeof(AIM_KEY_GI)+10, AIM_KEY_GI"%d", i);
+ mir_snprintf(item, SIZEOF(item), AIM_KEY_GI"%d", i);
setWord(hContact, item, id);
}
int CAimProto::deleteGroupId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_GI)+10];
- mir_snprintf(item, sizeof(AIM_KEY_GI)+10, AIM_KEY_GI"%d", i);
+ mir_snprintf(item, SIZEOF(item), AIM_KEY_GI"%d", i);
return delSetting(hContact, item);
}
|