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 /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 'src')
-rw-r--r-- | src/mir_core/langpack.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/clistmenus.cpp | 4 | ||||
-rw-r--r-- | src/modules/clist/genmenu.cpp | 2 | ||||
-rw-r--r-- | src/modules/clist/genmenuopt.cpp | 4 | ||||
-rw-r--r-- | src/modules/database/dbutils.cpp | 6 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_utils.cpp | 4 | ||||
-rw-r--r-- | src/modules/netlib/netlibautoproxy.cpp | 6 | ||||
-rw-r--r-- | src/modules/netlib/netlibsock.cpp | 2 | ||||
-rw-r--r-- | src/modules/netlib/netlibupnp.cpp | 6 | ||||
-rw-r--r-- | src/modules/protocols/protoaccs.cpp | 2 | ||||
-rw-r--r-- | src/modules/utils/enterstring.cpp | 4 |
11 files changed, 21 insertions, 21 deletions
diff --git a/src/mir_core/langpack.cpp b/src/mir_core/langpack.cpp index b5488e7d2f..2e0b692cc4 100644 --- a/src/mir_core/langpack.cpp +++ b/src/mir_core/langpack.cpp @@ -330,7 +330,7 @@ static int LoadLangDescr(LANGPACK_INFO &lpinfo, FILE *fp, char *line, int &start *pszColon++ = 0;
if (!mir_strcmp(line, "Language")) {
- mir_snprintf(szLanguage, sizeof(szLanguage), "%s", pszColon);
+ mir_snprintf(szLanguage, SIZEOF(szLanguage), "%s", pszColon);
lrtrim(szLanguage);
}
else if (!mir_strcmp(line, "Last-Modified-Using")) {
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index 0313c030bb..be0f16ef9f 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -432,7 +432,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM) XStatus = 0;
char buf[255];
- mir_snprintf(buf, sizeof(buf), "*XStatus%d", XStatus);
+ mir_snprintf(buf, SIZEOF(buf), "*XStatus%d", XStatus);
bool check = wildcmp(smep->svc, buf) != 0;
bool reset = wildcmp(smep->svc, "*XStatus0") != 0;
@@ -991,7 +991,7 @@ void RebuildMenuOrder(void) }
char buf[ 256 ];
- mir_snprintf(buf, sizeof(buf), "Root2ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
+ mir_snprintf(buf, SIZEOF(buf), "Root2ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
MO_SetOptionsMenuItem(hStatusMainMenuHandles[j], OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
IcoLib_ReleaseIcon(tmi.hIcon, 0);
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index f3ac197a5c..93dd2c0b7e 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -1047,7 +1047,7 @@ static int MO_RegisterIcon(PMO_IntMenuItem pmi, void*) mir_sntprintf(sectionName, SIZEOF(sectionName), LPGENT("Menu icons") _T("/%s"), TranslateTS(pmi->parent->ptszDisplayName));
char iconame[256];
- mir_snprintf(iconame, sizeof(iconame), "genmenu_%s_%s", pmi->parent->pszName, uname && *uname ? uname : descr);
+ mir_snprintf(iconame, SIZEOF(iconame), "genmenu_%s_%s", pmi->parent->pszName, uname && *uname ? uname : descr);
// remove '&'
if (descr) {
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp index c424554842..f5ab36b727 100644 --- a/src/modules/clist/genmenuopt.cpp +++ b/src/modules/clist/genmenuopt.cpp @@ -90,7 +90,7 @@ static int SaveTree(HWND hwndDlg) TIntMenuObject *pimo = g_menus[menupos]; char MenuNameItems[256]; - mir_snprintf(MenuNameItems, sizeof(MenuNameItems), "%s_Items", pimo->pszName); + mir_snprintf(MenuNameItems, SIZEOF(MenuNameItems), "%s_Items", pimo->pszName); int runtimepos = 100; while (tvi.hItem != NULL) { @@ -233,7 +233,7 @@ static int BuildTree(HWND hwndDlg, int MenuObjectId, BOOL bReread) if (pimo->m_items.first == NULL) return FALSE; - mir_snprintf(MenuNameItems, sizeof(MenuNameItems), "%s_Items", pimo->pszName); + mir_snprintf(MenuNameItems, SIZEOF(MenuNameItems), "%s_Items", pimo->pszName); int count = 0; { diff --git a/src/modules/database/dbutils.cpp b/src/modules/database/dbutils.cpp index c4ab423208..378a8535dd 100644 --- a/src/modules/database/dbutils.cpp +++ b/src/modules/database/dbutils.cpp @@ -61,12 +61,12 @@ static INT_PTR DbEventTypeRegister(WPARAM, LPARAM lParam) if (!p->textService) {
char szServiceName[100];
- mir_snprintf(szServiceName, sizeof(szServiceName), "%s/GetEventText%d", p->module, p->eventType);
+ mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s/GetEventText%d", p->module, p->eventType);
p->textService = mir_strdup(szServiceName);
}
if (!p->iconService) {
char szServiceName[100];
- mir_snprintf(szServiceName, sizeof(szServiceName), "%s/GetEventIcon%d", p->module, p->eventType);
+ mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s/GetEventIcon%d", p->module, p->eventType);
p->iconService = mir_strdup(szServiceName);
}
eventTypes.insert(p);
@@ -216,7 +216,7 @@ static INT_PTR DbEventGetIcon(WPARAM wParam, LPARAM lParam) icon = Skin_GetIconByHandle(et->eventIcon);
if (!icon) {
char szName[100];
- mir_snprintf(szName, sizeof(szName), "eventicon_%s%d", dbei->szModule, dbei->eventType);
+ mir_snprintf(szName, SIZEOF(szName), "eventicon_%s%d", dbei->szModule, dbei->eventType);
icon = Skin_GetIcon(szName);
}
diff --git a/src/modules/metacontacts/meta_utils.cpp b/src/modules/metacontacts/meta_utils.cpp index c1bd9551d7..3fc3e26e72 100644 --- a/src/modules/metacontacts/meta_utils.cpp +++ b/src/modules/metacontacts/meta_utils.cpp @@ -491,8 +491,8 @@ int Meta_SetAllNicks() static void SwapValues(MCONTACT hContact, LPCSTR szSetting, int n1, int n2)
{
char buf1[100], buf2[100];
- mir_snprintf(buf1, sizeof(buf1), "%s%d", szSetting, n1);
- mir_snprintf(buf2, sizeof(buf2), "%s%d", szSetting, n2);
+ mir_snprintf(buf1, SIZEOF(buf1), "%s%d", szSetting, n1);
+ mir_snprintf(buf2, SIZEOF(buf2), "%s%d", szSetting, n2);
DBVARIANT dbv1, dbv2;
int ok1 = !db_get(hContact, META_PROTO, buf1, &dbv1);
diff --git a/src/modules/netlib/netlibautoproxy.cpp b/src/modules/netlib/netlibautoproxy.cpp index 6484c010cd..5f3c1280de 100644 --- a/src/modules/netlib/netlibautoproxy.cpp +++ b/src/modules/netlib/netlibautoproxy.cpp @@ -169,14 +169,14 @@ bool NetlibGetIeProxyConn(NetlibConnection *nlc, bool forceHttps) if ((nlc->nloc.flags & (NLOCF_HTTP | NLOCF_HTTPGATEWAY) && nlc->nloc.flags & NLOCF_SSL) ||
nlc->nloc.wPort == 443 || forceHttps)
{
- mir_snprintf(szUrl, sizeof(szUrl), "https://%s", nlc->nloc.szHost);
+ mir_snprintf(szUrl, SIZEOF(szUrl), "https://%s", nlc->nloc.szHost);
usingSsl = true;
}
else if (nlc->nloc.flags & (NLOCF_HTTPGATEWAY | NLOCF_HTTP) || nlc->usingHttpGateway)
- mir_snprintf(szUrl, sizeof(szUrl), "http://%s", nlc->nloc.szHost);
+ mir_snprintf(szUrl, SIZEOF(szUrl), "http://%s", nlc->nloc.szHost);
else
{
- mir_snprintf(szUrl, sizeof(szUrl), "%s", nlc->nloc.szHost);
+ mir_snprintf(szUrl, SIZEOF(szUrl), "%s", nlc->nloc.szHost);
noHttp = true;
}
diff --git a/src/modules/netlib/netlibsock.cpp b/src/modules/netlib/netlibsock.cpp index c494cc5ce4..41db59805a 100644 --- a/src/modules/netlib/netlibsock.cpp +++ b/src/modules/netlib/netlibsock.cpp @@ -218,7 +218,7 @@ char* NetlibAddressToString(SOCKADDR_INET_M* addr) if (addr->si_family == AF_INET) {
char *szIp = inet_ntoa(addr->Ipv4.sin_addr);
if (addr->Ipv4.sin_port != 0) {
- mir_snprintf(saddr, sizeof(saddr), "%s:%d", szIp, htons(addr->Ipv4.sin_port));
+ mir_snprintf(saddr, SIZEOF(saddr), "%s:%d", szIp, htons(addr->Ipv4.sin_port));
return mir_strdup(saddr);
}
return mir_strdup(szIp);
diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp index b10278e1dd..1775bbd886 100644 --- a/src/modules/netlib/netlibupnp.cpp +++ b/src/modules/netlib/netlibupnp.cpp @@ -273,7 +273,7 @@ static int httpTransact(char* szUrl, char* szResult, int resSize, char* szAction char szData1[1024];
szReq = mir_strdup(szResult);
- sz = mir_snprintf (szData1, sizeof(szData1),
+ sz = mir_snprintf (szData1, SIZEOF(szData1),
soap_action, szActionName, szDev, szReq, szActionName);
sz = mir_snprintf (szData, 4096,
@@ -286,7 +286,7 @@ static int httpTransact(char* szUrl, char* szResult, int resSize, char* szAction {
char szData1[1024];
- sz = mir_snprintf (szData1, sizeof(szData1),
+ sz = mir_snprintf (szData1, SIZEOF(szData1),
soap_query, szActionName);
sz = mir_snprintf (szData, 4096,
@@ -551,7 +551,7 @@ static bool getUPnPURLs(char* szUrl, size_t sizeUrl) strncpy(szCtlUrl, szTemp[0] ? szTemp : szUrl, sizeof(szCtlUrl));
szCtlUrl[sizeof(szCtlUrl)-1] = 0;
- mir_snprintf(szTemp, sizeof(szTemp), search_device, szDev);
+ mir_snprintf(szTemp, SIZEOF(szTemp), search_device, szDev);
txtParseParam(szData, szTemp, "<controlURL>", "</controlURL>", szUrl, sizeUrl);
// URL combining per RFC 2396
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp index 30fd40f6da..8ea3b242fb 100644 --- a/src/modules/protocols/protoaccs.cpp +++ b/src/modules/protocols/protoaccs.cpp @@ -424,7 +424,7 @@ static INT_PTR stub45(PROTO_INTERFACE* ppi, WPARAM wParam, LPARAM lParam) static HANDLE CreateProtoServiceEx(const char* szModule, const char* szService, MIRANDASERVICEOBJ pFunc, void* param)
{
char tmp[100];
- mir_snprintf(tmp, sizeof(tmp), "%s%s", szModule, szService);
+ mir_snprintf(tmp, SIZEOF(tmp), "%s%s", szModule, szService);
return CreateServiceFunctionObj(tmp, pFunc, param);
}
diff --git a/src/modules/utils/enterstring.cpp b/src/modules/utils/enterstring.cpp index 1e09a2a125..66bdbbbf32 100644 --- a/src/modules/utils/enterstring.cpp +++ b/src/modules/utils/enterstring.cpp @@ -56,7 +56,7 @@ static void ComboLoadRecentStrings(HWND hwndDlg, EnterStringFormParam *pForm) {
for (int i = 0; i < pForm->recentCount; i++) {
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, sizeof(setting), "%s%d", pForm->szDataPrefix, i);
+ mir_snprintf(setting, SIZEOF(setting), "%s%d", pForm->szDataPrefix, i);
ptrT tszRecent(db_get_tsa(NULL, pForm->szModuleName, setting));
if (tszRecent != NULL)
SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_ADDSTRING, 0, tszRecent);
@@ -82,7 +82,7 @@ static void ComboAddRecentString(HWND hwndDlg, EnterStringFormParam *pForm) id = db_get_b(NULL, pForm->szModuleName, pForm->szDataPrefix, 0);
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, sizeof(setting), "%s%d", pForm->szDataPrefix, id);
+ mir_snprintf(setting, SIZEOF(setting), "%s%d", pForm->szDataPrefix, id);
db_set_ts(NULL, pForm->szModuleName, setting, string);
db_set_b(NULL, pForm->szModuleName, pForm->szDataPrefix, (id + 1) % pForm->idcControl);
}
|