diff options
author | George Hazan <george.hazan@gmail.com> | 2013-05-16 15:08:49 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-05-16 15:08:49 +0000 |
commit | 2e4abd268c71f15bcf73c49a5005f128ffd8ee96 (patch) | |
tree | 92624c24bafa4a02eb7e7fd2501a988e385ffab3 /protocols | |
parent | 769714b0aa9606e0d94a9d88c7c3ee3064792e4a (diff) |
shortened typedefs for string buffers:
MCBuf -> mir_ptr<char>
MTBuf -> mir_ptr<TCHAR>
MWBuf -> mir_ptr<WCHAR>
git-svn-id: http://svn.miranda-ng.org/main/trunk@4680 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/AimOscar/src/utility.cpp | 2 | ||||
-rw-r--r-- | protocols/EmLanProto/src/mlan.cpp | 7 | ||||
-rw-r--r-- | protocols/FacebookRM/src/proto.cpp | 10 | ||||
-rw-r--r-- | protocols/FacebookRM/src/utils.cpp | 2 | ||||
-rw-r--r-- | protocols/GTalkExt/src/handlers.cpp | 6 | ||||
-rw-r--r-- | protocols/GTalkExt/src/inbox.cpp | 8 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/gg.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/image.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_archive.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_chat.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.cpp | 2 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_xstatus.cpp | 8 | ||||
-rw-r--r-- | protocols/MRA/src/MraSendCommand.cpp | 4 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_svcs.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_commands.cpp | 2 | ||||
-rw-r--r-- | protocols/Omegle/src/utils.cpp | 2 | ||||
-rw-r--r-- | protocols/Twitter/src/chat.cpp | 4 | ||||
-rw-r--r-- | protocols/Twitter/src/http.cpp | 2 | ||||
-rw-r--r-- | protocols/Yahoo/src/im.cpp | 2 | ||||
-rw-r--r-- | protocols/Yahoo/src/proto.cpp | 10 | ||||
-rw-r--r-- | protocols/Yahoo/src/yahoo.cpp | 18 |
21 files changed, 49 insertions, 50 deletions
diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index e2ba0bc4f1..5e08f8f91a 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -182,7 +182,7 @@ HANDLE CAimProto::find_chat_contact(const char* room) HANDLE CAimProto::contact_from_sn(const char* sn, bool addIfNeeded, bool temporary)
{
- mir_ptr<char> norm_sn( normalize_name(sn));
+ MCBuf norm_sn( normalize_name(sn));
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DBVARIANT dbv;
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index 653557e160..a3141fd2bf 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -1006,7 +1006,7 @@ int CMLan::TFileConnection::Recv(bool halt) EMLOGERR();
return FCS_TERMINATE;
}
- if (len >= min(size,FILE_MIN_BLOCK));
+ if (len >= min(size,FILE_MIN_BLOCK))
break;
Sleep(10);
if (m_state == FCS_TERMINATE) {
@@ -1018,7 +1018,7 @@ int CMLan::TFileConnection::Recv(bool halt) Lock();
res = recv(m_socket, (char*)m_buf+csize, size-csize, 0);
Unlock();
- EMLOGERR(res == SOCKET_ERROR);
+ EMLOGERR();
EMLOGIF("Connection was gracefully closed", res==0);
if (res==0 || res==SOCKET_ERROR)
return FCS_TERMINATE;
@@ -1153,7 +1153,6 @@ void CMLan::OnInTCPConnection(u_long addr, SOCKET in_sock) EMLOG("File added to connectionn list");
FileAddToList(conn);
- CCSDATA ccs;
PROTORECVEVENT pre;
int rcTotalSize = *((int*)(conn->m_buf+1));
@@ -1351,7 +1350,7 @@ void CMLan::OnInTCPConnection(u_long addr, SOCKET in_sock) while (fts.currentFileProgress<fts.currentFileSize)
{
EMLOG("Waiting for data");
- bool isErr = conn->Recv();
+ BOOL isErr = conn->Recv();
if (isErr || conn->m_recSize==0 || conn->m_buf[0]!=FCODE_SND_FILEDATA)
{
EMLOGIF("Error conn->Recv()", isErr);
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 59c4261bc9..757ef80093 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -459,7 +459,7 @@ int FacebookProto::VisitProfile(WPARAM wParam,LPARAM lParam) std::string url = FACEBOOK_URL_PROFILE;
- mir_ptr<char> val = db_get_sa(hContact, m_szModuleName, "Homepage");
+ MCBuf val = db_get_sa(hContact, m_szModuleName, "Homepage");
if (val != NULL) {
// Homepage link already present, get it
url = val;
@@ -481,7 +481,7 @@ int FacebookProto::VisitFriendship(WPARAM wParam,LPARAM lParam) if (wParam == 0 || !IsMyContact(hContact))
return 1;
- mir_ptr<char> id = db_get_sa(hContact, m_szModuleName, FACEBOOK_KEY_ID);
+ MCBuf id = db_get_sa(hContact, m_szModuleName, FACEBOOK_KEY_ID);
std::string url = FACEBOOK_URL_PROFILE;
url += facy.self_.user_id;
@@ -520,14 +520,14 @@ int FacebookProto::CancelFriendship(WPARAM wParam,LPARAM lParam) || (deleting && db_get_b(hContact, m_szModuleName, FACEBOOK_KEY_CONTACT_TYPE, 0) != FACEBOOK_CONTACT_FRIEND))
return 0;
- mir_ptr<TCHAR> tname = db_get_tsa(hContact, m_szModuleName, FACEBOOK_KEY_NAME);
+ MTBuf tname = db_get_tsa(hContact, m_szModuleName, FACEBOOK_KEY_NAME);
if (tname == NULL)
tname = db_get_tsa(hContact, m_szModuleName, FACEBOOK_KEY_ID);
TCHAR tstr[256];
if (MessageBox(0, tstr, m_tszUserName, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2) == IDYES) {
- mir_ptr<char> id = db_get_sa(hContact, m_szModuleName, FACEBOOK_KEY_ID);
+ MCBuf id = db_get_sa(hContact, m_szModuleName, FACEBOOK_KEY_ID);
if (id == NULL)
return 1;
@@ -552,7 +552,7 @@ int FacebookProto::RequestFriendship(WPARAM wParam,LPARAM lParam) HANDLE hContact = reinterpret_cast<HANDLE>(wParam);
- mir_ptr<char> id = db_get_sa(hContact, m_szModuleName, FACEBOOK_KEY_ID);
+ MCBuf id = db_get_sa(hContact, m_szModuleName, FACEBOOK_KEY_ID);
if (id == NULL)
return 1;
diff --git a/protocols/FacebookRM/src/utils.cpp b/protocols/FacebookRM/src/utils.cpp index 46c56cafd1..f3b5c62640 100644 --- a/protocols/FacebookRM/src/utils.cpp +++ b/protocols/FacebookRM/src/utils.cpp @@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. std::string utils::url::encode(const std::string &s)
{
- return (char*)mir_ptr<char>(mir_urlEncode(s.c_str()));
+ return (char*)MCBuf(mir_urlEncode(s.c_str()));
}
std::string utils::url::decode(std::string data)
diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp index fecfe82523..cc54281dc4 100644 --- a/protocols/GTalkExt/src/handlers.cpp +++ b/protocols/GTalkExt/src/handlers.cpp @@ -214,10 +214,10 @@ void RequestMail(LPCTSTR jidWithRes, IJabberInterface *ji) xi.addAttr(node, ATTRNAME_FROM, jidWithRes);
UINT uID = ji->Net()->SerialNext();
- mir_ptr<TCHAR> jid( ExtractJid(jidWithRes));
+ MTBuf jid( ExtractJid(jidWithRes));
xi.addAttr(node, ATTRNAME_TO, jid);
- mir_ptr<TCHAR>
+ MTBuf
lastMailTime( ReadJidSetting(LAST_MAIL_TIME_FROM_JID, jid)),
lastThreadId( ReadJidSetting(LAST_THREAD_ID_FROM_JID, jid));
@@ -280,7 +280,7 @@ void SetNotificationSetting(LPCTSTR jidWithResource, IJabberInterface *ji) xi.addAttr(node, ATTRNAME_TYPE, IQTYPE_SET);
xi.addAttr(node, ATTRNAME_FROM, jidWithResource);
- mir_ptr<TCHAR> jid( ExtractJid(jidWithResource));
+ MTBuf jid( ExtractJid(jidWithResource));
xi.addAttr(node, ATTRNAME_TO, jid);
TCHAR id[30];
diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp index d325a90819..60f8896f23 100644 --- a/protocols/GTalkExt/src/inbox.cpp +++ b/protocols/GTalkExt/src/inbox.cpp @@ -91,7 +91,7 @@ LPSTR HttpPost(HANDLE hUser, LPSTR reqUrl, LPSTR reqParams) LPSTR MakeRequest(HANDLE hUser, LPSTR reqUrl, LPSTR reqParamsFormat, LPSTR p1, LPSTR p2)
{
- mir_ptr<char> encodedP1( mir_urlEncode(p1)), encodedP2( mir_urlEncode(p2));
+ MCBuf encodedP1( mir_urlEncode(p1)), encodedP2( mir_urlEncode(p2));
LPSTR reqParams = (LPSTR)alloca(lstrlenA(reqParamsFormat) + 1 + lstrlenA(encodedP1) + lstrlenA(encodedP2));
sprintf(reqParams, reqParamsFormat, encodedP1, encodedP2);
return HttpPost(hUser, reqUrl, reqParams);
@@ -119,7 +119,7 @@ LPSTR FindSid(LPSTR resp, LPSTR *LSID) void DoOpenUrl(LPSTR tokenResp, LPSTR url)
{
- mir_ptr<char> encodedUrl( mir_urlEncode(url)), encodedToken( mir_urlEncode(tokenResp));
+ MCBuf encodedUrl( mir_urlEncode(url)), encodedToken( mir_urlEncode(tokenResp));
LPSTR composedUrl = (LPSTR)alloca(lstrlenA(TOKEN_AUTH_URL) + 1 + lstrlenA(encodedToken) + lstrlenA(encodedUrl));
sprintf(composedUrl, TOKEN_AUTH_URL, encodedToken, encodedUrl);
CallService(MS_UTILS_OPENURL, 0, (LPARAM)composedUrl);
@@ -127,13 +127,13 @@ void DoOpenUrl(LPSTR tokenResp, LPSTR url) BOOL AuthAndOpen(HANDLE hUser, LPSTR url, LPSTR mailbox, LPSTR pwd)
{
- mir_ptr<char> authResp( MakeRequest(hUser, AUTH_REQUEST_URL, AUTH_REQUEST_PARAMS, mailbox, pwd));
+ MCBuf authResp( MakeRequest(hUser, AUTH_REQUEST_URL, AUTH_REQUEST_PARAMS, mailbox, pwd));
if (!authResp)
return FALSE;
LPSTR LSID;
LPSTR SID = FindSid(authResp, &LSID);
- mir_ptr<char> tokenResp( MakeRequest(hUser, ISSUE_TOKEN_REQUEST_URL, ISSUE_TOKEN_REQUEST_PARAMS, SID, LSID));
+ MCBuf tokenResp( MakeRequest(hUser, ISSUE_TOKEN_REQUEST_URL, ISSUE_TOKEN_REQUEST_PARAMS, SID, LSID));
if (!tokenResp)
return FALSE;
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index 1fb4216fc4..c9bbcac8b4 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -158,7 +158,7 @@ void GGPROTO::cleanuplastplugin(DWORD version) TCHAR avatarsPath[MAX_PATH];
if (hAvatarsFolder == NULL || FoldersGetCustomPathT(hAvatarsFolder, avatarsPath, MAX_PATH, _T(""))) {
- mir_ptr<TCHAR> tmpPath( Utils_ReplaceVarsT( _T("%miranda_avatarcache%")));
+ MTBuf tmpPath( Utils_ReplaceVarsT( _T("%miranda_avatarcache%")));
mir_sntprintf(avatarsPath, MAX_PATH, _T("%s\\%s"), (TCHAR*)tmpPath, m_tszUserName);
}
netlog("cleanuplastplugin() 1: miranda_avatarcache = %S", avatarsPath);
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 52e915c845..cb851cab0b 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -1029,7 +1029,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName) dat->lpData = (char*)malloc(dat->nSize);
memcpy(dat->lpData, e->event.image_reply.image, dat->nSize);
- mir_ptr<TCHAR> tmpFileName( mir_a2t(e->event.image_reply.filename));
+ MTBuf tmpFileName( mir_a2t(e->event.image_reply.filename));
if (!gg_img_hasextension(tmpFileName)) {
// Add missing file extension
const TCHAR *szImgType = gg_img_guessfileextension(dat->lpData);
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index 5cfb124a34..9c09b1a1fb 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -292,7 +292,7 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode) if (!tszBody || !tszSecs)
continue;
- mir_ptr<char> szEventText( mir_utf8encodeT(tszBody));
+ MCBuf szEventText( mir_utf8encodeT(tszBody));
DBEVENTINFO dbei = { sizeof(DBEVENTINFO) };
dbei.eventType = EVENTTYPE_MESSAGE;
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 1e423ad091..83ed88f04b 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -1346,7 +1346,7 @@ static void sttLogListHook(CJabberProto* ppro, JABBER_LIST_ITEM* item, GCHOOK* g mir_sntprintf(szCaption, SIZEOF(szCaption), _T("%s %s"), TranslateT("Set topic for"), gch->pDest->ptszID);
{
size_t cbLen = 2048 + lstrlen(item->itemResource.statusMessage)*2;
- mir_ptr<TCHAR> ptszBuf((TCHAR*)mir_alloc( sizeof(TCHAR) * cbLen));
+ MTBuf ptszBuf((TCHAR*)mir_alloc( sizeof(TCHAR) * cbLen));
if (item->itemResource.statusMessage) {
TCHAR *d = ptszBuf;
for (int i = 0; i < (int)cbLen; i++) {
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 535af67828..049c110f05 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -1150,7 +1150,7 @@ static char PGP_EPILOG[] = "\r\n-----END PGP MESSAGE-----\r\n"; int __cdecl CJabberProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc)
{
- mir_ptr<TCHAR> ptszJid( db_get_tsa(hContact, m_szModuleName, "jid"));
+ MTBuf ptszJid( db_get_tsa(hContact, m_szModuleName, "jid"));
if ( !m_bJabberOnline || ptszJid == NULL) {
TFakeAckParams *param = new TFakeAckParams(hContact, Translate("Protocol is offline or no jid"));
JForkThread(&CJabberProto::SendMessageAckThread, param);
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 05f4dc05d1..d21cba9719 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -1383,12 +1383,12 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusEx(WPARAM wParam, LPARAM lParam) else {
*pData->ptszName = 0;
if (pData->flags & CSSF_UNICODE) {
- mir_ptr<TCHAR> title( ReadAdvStatusT(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TITLE));
+ MTBuf title( ReadAdvStatusT(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TITLE));
if (title)
_tcsncpy(pData->ptszName, title, STATUS_TITLE_MAX);
}
else {
- mir_ptr<char> title( ReadAdvStatusA(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TITLE));
+ MCBuf title( ReadAdvStatusA(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TITLE));
if (title)
strncpy(pData->pszName, title, STATUS_TITLE_MAX);
}
@@ -1399,12 +1399,12 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusEx(WPARAM wParam, LPARAM lParam) if (pData->flags & CSSF_MASK_MESSAGE) {
*pData->pszMessage = 0;
if (pData->flags & CSSF_UNICODE) {
- mir_ptr<TCHAR> title( ReadAdvStatusT(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TEXT));
+ MTBuf title( ReadAdvStatusT(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TEXT));
if (title)
_tcsncpy(pData->ptszMessage, title, STATUS_TITLE_MAX);
}
else {
- mir_ptr<char> title( ReadAdvStatusA(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TEXT));
+ MCBuf title( ReadAdvStatusA(hContact, ADVSTATUS_MOOD, ADVSTATUS_VAL_TEXT));
if (title)
strncpy(pData->pszMessage, title, STATUS_TITLE_MAX);
}
diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp index cd38d07c03..1eb45085be 100644 --- a/protocols/MRA/src/MraSendCommand.cpp +++ b/protocols/MRA/src/MraSendCommand.cpp @@ -105,7 +105,7 @@ DWORD CMraProto::MraMessageW(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, dwFlags |= MESSAGE_FLAG_RTF;
lpszMessageRTF = (LPSTR)mir_calloc(dwRFTBuffSize);
- mir_ptr<char> lpbRTFData((char*)mir_calloc(dwRFTBuffSize));
+ MCBuf lpbRTFData((char*)mir_calloc(dwRFTBuffSize));
if (lpszMessageRTF && lpbRTFData) {
DWORD dwBackColour = mraGetDword(NULL, "RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR);
lpbDataCurrent = (LPBYTE)lpszMessageRTF;
@@ -130,7 +130,7 @@ DWORD CMraProto::MraMessageW(BOOL bAddToQueue, HANDLE hContact, DWORD dwAckType, size_t dwRFTBuffSize = (((dwMessageSize*sizeof(WCHAR))*16)+8192), dwRTFDataSize;
lpszMessageRTF = (LPSTR)mir_calloc(dwRFTBuffSize);
- mir_ptr<char> lpbRTFData((char*)mir_calloc(dwRFTBuffSize));
+ MCBuf lpbRTFData((char*)mir_calloc(dwRFTBuffSize));
if (lpszMessageRTF && lpbRTFData) {
if ( !MraConvertToRTFW(lpwszMessage, dwMessageSize, (LPSTR)lpbRTFData, dwRFTBuffSize, &dwRTFDataSize)) {
DWORD dwBackColour = mraGetDword(NULL, "RTFBackgroundColour", MRA_DEFAULT_RTF_BACKGROUND_COLOUR);
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index 075fd72040..0852b973cc 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -186,7 +186,7 @@ INT_PTR CMraProto::MraSendSMS(WPARAM wParam, LPARAM lParam) if (!m_bLoggedIn || !wParam || !lParam)
return 0;
- mir_ptr<WCHAR> lpwszMessageXMLEncoded( mir_utf8decodeW((LPSTR)lParam));
+ MWBuf lpwszMessageXMLEncoded( mir_utf8decodeW((LPSTR)lParam));
size_t dwBuffLen = lstrlenA((LPSTR)lParam) + MAX_PATH;
LPWSTR lpwszMessageXMLDecoded = (LPWSTR)mir_calloc((dwBuffLen*sizeof(WCHAR)));
if (lpwszMessageXMLEncoded && lpwszMessageXMLDecoded) {
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 0d161f53cb..49a10ef339 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -827,7 +827,7 @@ void CMsnProto::sttProcessStatusMessage(char* buf, unsigned len, const char* wli else db_unset(hContact, "CList", "StatusMsg");
{
- mir_ptr<TCHAR> tszStatus( mir_utf8decodeT(szStatMsg));
+ MTBuf tszStatus( mir_utf8decodeT(szStatMsg));
SendBroadcast(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, NULL, tszStatus);
}
diff --git a/protocols/Omegle/src/utils.cpp b/protocols/Omegle/src/utils.cpp index b259fa5933..b530ee84c3 100644 --- a/protocols/Omegle/src/utils.cpp +++ b/protocols/Omegle/src/utils.cpp @@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. std::string utils::url::encode(const std::string &s)
{
- return (char*)mir_ptr<char>( mir_urlEncode( s.c_str()));
+ return (char*)MCBuf( mir_urlEncode( s.c_str()));
}
void utils::text::replace_first( std::string* data, std::string from, std::string to )
diff --git a/protocols/Twitter/src/chat.cpp b/protocols/Twitter/src/chat.cpp index 2f2baf6649..c9a7f319ee 100644 --- a/protocols/Twitter/src/chat.cpp +++ b/protocols/Twitter/src/chat.cpp @@ -69,7 +69,7 @@ int TwitterProto::OnChatOutgoing(WPARAM wParam,LPARAM lParam) case GC_USER_MESSAGE:
LOG ( _T("**Chat - Outgoing message: %s"), hook->ptszText);
{
- mir_ptr<char> text( mir_utf8encodeT(hook->ptszText));
+ MCBuf text( mir_utf8encodeT(hook->ptszText));
std::string tweet(text);
replaceAll(tweet, "%%", "%"); // the chat plugin will turn "%" into "%%", so we have to change it back :/
@@ -81,7 +81,7 @@ int TwitterProto::OnChatOutgoing(WPARAM wParam,LPARAM lParam) case GC_USER_PRIVMESS:
{
- mir_ptr<char> text( mir_t2a(hook->ptszUID));
+ MCBuf text( mir_t2a(hook->ptszUID));
CallService(MS_MSG_SENDMESSAGE, WPARAM(UsernameToHContact(text)), 0);
}
break;
diff --git a/protocols/Twitter/src/http.cpp b/protocols/Twitter/src/http.cpp index 71069d08a4..711aa321ee 100644 --- a/protocols/Twitter/src/http.cpp +++ b/protocols/Twitter/src/http.cpp @@ -23,5 +23,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. std::string http::url_encode(const std::string &s)
{
- return (char*)mir_ptr<char>( mir_urlEncode( s.c_str()));
+ return (char*)MCBuf( mir_urlEncode( s.c_str()));
}
diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp index a0c44aa7d3..30220bdffd 100644 --- a/protocols/Yahoo/src/im.cpp +++ b/protocols/Yahoo/src/im.cpp @@ -180,7 +180,7 @@ int __cdecl CYahooProto::SendMsg( HANDLE hContact, int flags, const char* pszSrc return 1;
}
- mir_ptr<char> msg;
+ MCBuf msg;
if (flags & PREF_UNICODE) /* convert to utf8 */
msg = mir_utf8encodeW(( wchar_t* )&pszSrc[ strlen(pszSrc)+1 ] );
else if ( flags & PREF_UTF )
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index da3c4751d0..f56efaba62 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -209,9 +209,9 @@ int CYahooProto::Authorize( HANDLE hdbe ) /* Need to remove the buddy from our Miranda Lists */
HANDLE hContact = DbGetAuthEventContact(&dbei);
if (hContact != NULL) {
- mir_ptr<char> who( db_get_sa(hContact, m_szModuleName, YAHOO_LOGINID));
+ MCBuf who( db_get_sa(hContact, m_szModuleName, YAHOO_LOGINID));
if (who) {
- mir_ptr<char> myid( db_get_sa(hContact, m_szModuleName, "MyIdentity"));
+ MCBuf myid( db_get_sa(hContact, m_szModuleName, "MyIdentity"));
DebugLog("Accepting buddy:%s", who);
accept(myid, who, GetWord(hContact, "yprotoid", 0));
}
@@ -254,10 +254,10 @@ int CYahooProto::AuthDeny( HANDLE hdbe, const TCHAR* reason ) /* Need to remove the buddy from our Miranda Lists */
HANDLE hContact = DbGetAuthEventContact(&dbei);
if (hContact != NULL) {
- mir_ptr<char> who( db_get_sa(hContact, m_szModuleName, YAHOO_LOGINID));
+ MCBuf who( db_get_sa(hContact, m_szModuleName, YAHOO_LOGINID));
if (who) {
- mir_ptr<char> myid( db_get_sa(hContact, m_szModuleName, "MyIdentity"));
- mir_ptr<char> u_reason( mir_utf8encodeT(reason));
+ MCBuf myid( db_get_sa(hContact, m_szModuleName, "MyIdentity"));
+ MCBuf u_reason( mir_utf8encodeT(reason));
DebugLog("Rejecting buddy:%s msg: %s", who, u_reason);
reject(myid, who, GetWord(hContact, "yprotoid", 0), u_reason);
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index cfbff5ebfd..f3b8d6a438 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -586,7 +586,7 @@ void CYahooProto::ext_got_calendar(const char *url, int type, const char *msg, i {
LOG(("[ext_got_calendar] URL:%s type: %d msg: %s svc: %d", url, type, msg, svc));
- mir_ptr<TCHAR> tszMsg(mir_utf8decodeT(msg));
+ MTBuf tszMsg(mir_utf8decodeT(msg));
if (!ShowPopup( TranslateT("Calendar Reminder"), tszMsg, url))
ShowNotification(TranslateT("Calendar Reminder"), tszMsg, NIIF_INFO);
}
@@ -731,8 +731,8 @@ void CYahooProto::ext_rejected(const char *who, const char *msg) }
else LOG(("[ext_rejected] Buddy not on our buddy list"));
- mir_ptr<TCHAR> tszWho( mir_utf8decodeT(who));
- mir_ptr<TCHAR> tszMsg( mir_utf8decodeT(msg));
+ MTBuf tszWho( mir_utf8decodeT(who));
+ MTBuf tszMsg( mir_utf8decodeT(msg));
TCHAR buff[1024];
mir_sntprintf(buff, SIZEOF(buff), TranslateT("%s has rejected your request and sent the following message:"), (TCHAR*)tszWho);
@@ -991,8 +991,8 @@ void CYahooProto::ext_mail_notify(const char *from, const char *subj, int cnt) else {
mir_sntprintf(title, SIZEOF(title), TranslateT("New Mail (%i msgs)"), cnt);
- mir_ptr<TCHAR> tszFrom( mir_utf8decodeT(from));
- mir_ptr<TCHAR> tszSubj( mir_utf8decodeT(subj));
+ MTBuf tszFrom( mir_utf8decodeT(from));
+ MTBuf tszSubj( mir_utf8decodeT(subj));
mir_sntprintf(z, SIZEOF(z), TranslateT("From: %s\nSubject: %s"), (TCHAR*)tszFrom, (TCHAR*)tszSubj);
}
@@ -1009,8 +1009,8 @@ void CYahooProto::ext_system_message(const char *me, const char *who, const char {
LOG(("[ext_system_message] System Message to: %s from: %s msg: %s", me, who, msg));
- mir_ptr<TCHAR> tszWho( mir_utf8decodeT(who));
- mir_ptr<TCHAR> tszMsg( mir_utf8decodeT(msg));
+ MTBuf tszWho( mir_utf8decodeT(who));
+ MTBuf tszMsg( mir_utf8decodeT(msg));
ShowPopup((who != NULL) ? tszWho : TranslateT("Yahoo System Message"), tszMsg, NULL);
}
@@ -1069,7 +1069,7 @@ void CYahooProto::ext_got_ping(const char *errormsg) if (errormsg) {
LOG(("[ext_got_ping] Error msg: %s", errormsg));
- mir_ptr<TCHAR> tszMsg( mir_utf8decodeT(errormsg));
+ MTBuf tszMsg( mir_utf8decodeT(errormsg));
ShowError( TranslateT("Yahoo Ping Error"), tszMsg);
return;
}
@@ -1168,7 +1168,7 @@ void CYahooProto::ext_login_response(int succ, const char *url) void CYahooProto::ext_error(const char *err, int fatal, int num)
{
- mir_ptr<TCHAR> tszErr( mir_utf8decodeT(err));
+ MTBuf tszErr( mir_utf8decodeT(err));
TCHAR buff[1024];
LOG(("[ext_error] Error: fatal: %d, num: %d, err: %s", fatal, num, err));
|