summaryrefslogtreecommitdiff
path: root/src/modules/protocols/protocols.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-31 11:46:05 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-31 11:46:05 +0000
commit1ce3da1cca093143d9629bc46e221dd8be962e12 (patch)
treeb99d12d635a65f8c78499137137df2bd591b50be /src/modules/protocols/protocols.cpp
parent03512ff2ed0f3d1ed6857ee85b0eb7268931ec3f (diff)
- MAllStrings: a handy union to hold an incoming string parameter of any type;
- FNAMECHAR: atavism extincted; - PROTOSEARCHRESULT: structure prepared to use results of any type, including utf git-svn-id: http://svn.miranda-ng.org/main/trunk@13932 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/protocols/protocols.cpp')
-rw-r--r--src/modules/protocols/protocols.cpp39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/modules/protocols/protocols.cpp b/src/modules/protocols/protocols.cpp
index a3108365bf..b209ce9d38 100644
--- a/src/modules/protocols/protocols.cpp
+++ b/src/modules/protocols/protocols.cpp
@@ -356,21 +356,19 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char
return (INT_PTR)ppi->AddToList(wParam, (PROTOSEARCHRESULT*)lParam);
else {
PROTOSEARCHRESULT *psr = (PROTOSEARCHRESULT*)lParam;
- PROTOSEARCHRESULT *psra = (PROTOSEARCHRESULT*)mir_alloc(psr->cbSize);
+ PROTOSEARCHRESULT *psra = (PROTOSEARCHRESULT*)_alloca(psr->cbSize);
memcpy(psra, psr, psr->cbSize);
- psra->nick = (PROTOCHAR*)mir_u2a(psr->nick);
- psra->firstName = (PROTOCHAR*)mir_u2a(psr->firstName);
- psra->lastName = (PROTOCHAR*)mir_u2a(psr->lastName);
- psra->email = (PROTOCHAR*)mir_u2a(psr->email);
+ psra->nick.a = mir_u2a(psr->nick.t);
+ psra->firstName.a = mir_u2a(psr->firstName.t);
+ psra->lastName.a = mir_u2a(psr->lastName.t);
+ psra->email.a = mir_u2a(psr->email.t);
INT_PTR res = (INT_PTR)ppi->AddToList(wParam, psra);
- mir_free(psra->nick);
- mir_free(psra->firstName);
- mir_free(psra->lastName);
- mir_free(psra->email);
- mir_free(psra);
-
+ mir_free(psra->nick.a);
+ mir_free(psra->firstName.a);
+ mir_free(psra->lastName.a);
+ mir_free(psra->email.a);
return res;
}
@@ -516,20 +514,19 @@ INT_PTR CallProtoServiceInt(MCONTACT hContact, const char *szModule, const char
if (!mir_strcmp(szService, PS_ADDTOLIST)) {
PROTOSEARCHRESULT *psr = (PROTOSEARCHRESULT*)lParam;
if (!(psr->flags & PSR_UNICODE)) {
- PROTOSEARCHRESULT *psra = (PROTOSEARCHRESULT*)mir_alloc(psr->cbSize);
+ PROTOSEARCHRESULT *psra = (PROTOSEARCHRESULT*)_alloca(psr->cbSize);
memcpy(psra, psr, psr->cbSize);
- psra->nick = (PROTOCHAR*)mir_u2a(psr->nick);
- psra->firstName = (PROTOCHAR*)mir_u2a(psr->firstName);
- psra->lastName = (PROTOCHAR*)mir_u2a(psr->lastName);
- psra->email = (PROTOCHAR*)mir_u2a(psr->email);
+ psra->nick.a = mir_u2a(psr->nick.t);
+ psra->firstName.a = mir_u2a(psr->firstName.t);
+ psra->lastName.a = mir_u2a(psr->lastName.t);
+ psra->email.a = mir_u2a(psr->email.t);
INT_PTR res = ProtoCallService(szModule, szService, wParam, (LPARAM)psra);
- mir_free(psra->nick);
- mir_free(psra->firstName);
- mir_free(psra->lastName);
- mir_free(psra->email);
- mir_free(psra);
+ mir_free(psra->nick.a);
+ mir_free(psra->firstName.a);
+ mir_free(psra->lastName.a);
+ mir_free(psra->email.a);
return res;
}
}