diff options
author | George Hazan <george.hazan@gmail.com> | 2014-12-14 10:14:51 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-12-14 10:14:51 +0000 |
commit | 09934120a7e3b080f5f79f26da3b3bc2946753ee (patch) | |
tree | 4bdf7b757c5e218a03ef43be51dbd8adf7de4639 /protocols/JabberG | |
parent | cb56b3c8913ff8ea50a92a6b74e0342d6377a235 (diff) |
Jabber: warning level 4
git-svn-id: http://svn.miranda-ng.org/main/trunk@11395 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG')
20 files changed, 68 insertions, 75 deletions
diff --git a/protocols/JabberG/jabber_12.vcxproj b/protocols/JabberG/jabber_12.vcxproj index 085df780e0..c7b9cb9fab 100644 --- a/protocols/JabberG/jabber_12.vcxproj +++ b/protocols/JabberG/jabber_12.vcxproj @@ -87,7 +87,7 @@ <FloatingPointModel>Fast</FloatingPointModel>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>jabber.h</PrecompiledHeaderFile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<ResourceCompile>
@@ -121,7 +121,7 @@ <FloatingPointModel>Fast</FloatingPointModel>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>jabber.h</PrecompiledHeaderFile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<ResourceCompile>
@@ -152,7 +152,7 @@ <FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>jabber.h</PrecompiledHeaderFile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>false</ExceptionHandling>
@@ -184,7 +184,7 @@ <FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>jabber.h</PrecompiledHeaderFile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<ExceptionHandling>false</ExceptionHandling>
</ClCompile>
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 65a5506111..be7998f392 100644 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -85,7 +85,7 @@ BOOL WINAPI DllMain(HINSTANCE hModule, DWORD, LPVOID) return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
diff --git a/protocols/JabberG/src/jabber_api.cpp b/protocols/JabberG/src/jabber_api.cpp index f23bdb1d6c..d1a5d21710 100644 --- a/protocols/JabberG/src/jabber_api.cpp +++ b/protocols/JabberG/src/jabber_api.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "jabber.h"
// Jabber API functions
-INT_PTR __cdecl CJabberProto::JabberGetApi(WPARAM wParam, LPARAM lParam)
+INT_PTR __cdecl CJabberProto::JabberGetApi(WPARAM, LPARAM lParam)
{
IJabberInterface **ji = (IJabberInterface**)lParam;
if (!ji)
@@ -133,19 +133,19 @@ BOOL CJabberProto::ExternalIqHandler(HXML node, CJabberIqInfo *pInfo) return d->Func(this, node, d->pUserData);
}
-BOOL CJabberProto::ExternalMessageHandler(HXML node, ThreadData *pThreadData, CJabberMessageInfo* pInfo)
+BOOL CJabberProto::ExternalMessageHandler(HXML node, ThreadData*, CJabberMessageInfo* pInfo)
{
sHandlerData *d = (sHandlerData*)pInfo->GetUserData();
return d->Func(this, node, d->pUserData);
}
-BOOL CJabberProto::ExternalPresenceHandler(HXML node, ThreadData *pThreadData, CJabberPresenceInfo* pInfo)
+BOOL CJabberProto::ExternalPresenceHandler(HXML node, ThreadData*, CJabberPresenceInfo* pInfo)
{
sHandlerData *d = (sHandlerData*)pInfo->GetUserData();
return d->Func(this, node, d->pUserData);
}
-BOOL CJabberProto::ExternalSendHandler(HXML node, ThreadData *pThreadData, CJabberSendInfo* pInfo)
+BOOL CJabberProto::ExternalSendHandler(HXML node, ThreadData*, CJabberSendInfo* pInfo)
{
sHandlerData *d = (sHandlerData*)pInfo->GetUserData();
return d->Func(this, node, d->pUserData);
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp index e328bbcea5..ed7c20e0c1 100644 --- a/protocols/JabberG/src/jabber_captcha.cpp +++ b/protocols/JabberG/src/jabber_captcha.cpp @@ -181,8 +181,8 @@ void CJabberProto::sendCaptchaResult(TCHAR* buf, ThreadData *info, LPCTSTR from, void CJabberProto::sendCaptchaError(ThreadData *info, LPCTSTR from, LPCTSTR to, LPCTSTR challenge)
{
XmlNode message(_T("message"));
- HXML query= message << XATTR(_T("type"), _T("error")) << XATTR(_T("to"), from) << XATTR(_T("id"), challenge) << XATTR(_T("from"), to)
- << XCHILD(_T("error")) << XATTR(_T("type"), _T("modify"))
- << XCHILD(_T("not-acceptable")) << XATTR(_T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
- info -> send (message);
+ message << XATTR(_T("type"), _T("error")) << XATTR(_T("to"), from) << XATTR(_T("id"), challenge) << XATTR(_T("from"), to)
+ << XCHILD(_T("error")) << XATTR(_T("type"), _T("modify"))
+ << XCHILD(_T("not-acceptable")) << XATTR(_T("xmlns"), _T("urn:ietf:params:xml:ns:xmpp-stanzas"));
+ info->send(message);
}
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 77a96ba14a..78030e9ba6 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -1033,7 +1033,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s/%s"), item->jid, him->m_tszResourceName);
jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT);
- JABBER_LIST_ITEM *item = ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid);
+ ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid);
ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
MCONTACT hContact = (MCONTACT)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
@@ -1173,7 +1173,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* szTitle.Format(_T("%s/%s"), item->jid, resourceName_copy);
XmlNode msg(_T("message"));
- HXML invite = msg << XATTR(_T("to"), szTitle) << XATTRID(ppro->SerialNext())
+ msg << XATTR(_T("to"), szTitle) << XATTRID(ppro->SerialNext())
<< XCHILD(_T("x"), szBuffer)
<< XATTR(_T("xmlns"), JABBER_FEAT_DIRECT_MUC_INVITE)
<< XATTR(_T("jid"), szInviteTo)
@@ -1206,7 +1206,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* if (TCHAR *tmp = _tcschr(jsr.jid, _T('/')))
*tmp = 0;
- JABBER_LIST_ITEM *item = ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid);
+ ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid);
ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
hContact = (MCONTACT)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 5da90ab751..8e92353583 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -200,7 +200,7 @@ void CJabberProto::OnLoggedIn() m_pepServices.ResetPublishAll();
}
-void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo *pInfo)
+void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*)
{
// RECVED: result of the request for authentication method
// ACTION: send account authentication information to log in
@@ -248,7 +248,7 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo *pInfo) m_ThreadInfo = NULL; // To disallow auto reconnect
} }
-void CJabberProto::OnIqResultSetAuth(HXML iqNode, CJabberIqInfo *pInfo)
+void CJabberProto::OnIqResultSetAuth(HXML iqNode, CJabberIqInfo*)
{
const TCHAR *type;
@@ -303,7 +303,7 @@ void CJabberProto::OnIqResultBind(HXML iqNode, CJabberIqInfo *pInfo) }
}
-void CJabberProto::OnIqResultSession(HXML iqNode, CJabberIqInfo *pInfo)
+void CJabberProto::OnIqResultSession(HXML, CJabberIqInfo *pInfo)
{
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT)
OnLoggedIn();
@@ -573,7 +573,7 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode, CJabberIqInfo*) /////////////////////////////////////////////////////////////////////////////////////////
// JabberIqResultGetVcard - processes the server-side v-card
-void CJabberProto::OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, MCONTACT hContact, bool &hasPhoto)
+void CJabberProto::OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasPhoto)
{
debugLogA("JabberIqResultGetVcardPhoto: %d", hasPhoto);
if (hasPhoto)
@@ -991,7 +991,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) }
}
else if (!mir_tstrcmp(xmlGetName(n), _T("PHOTO")))
- OnIqResultGetVcardPhoto(jid, n, hContact, hasPhoto);
+ OnIqResultGetVcardPhoto(n, hContact, hasPhoto);
} }
if (hasFn && !hasNick) {
@@ -1253,7 +1253,7 @@ void CJabberProto::OnIqResultExtSearch(HXML iqNode, CJabberIqInfo*) ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0);
}
-void CJabberProto::OnIqResultSetPassword(HXML iqNode, CJabberIqInfo *pInfo)
+void CJabberProto::OnIqResultSetPassword(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdSetPassword");
@@ -1348,7 +1348,7 @@ void CJabberProto::OnIqResultGetClientAvatar(HXML iqNode, CJabberIqInfo*) m_ThreadInfo->send(iq);
}
-void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo *pInfo)
+void CJabberProto::OnIqResultGetServerAvatar(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdResultGetServerAvatar");
@@ -1449,7 +1449,7 @@ LBL_ErrFormat: /////////////////////////////////////////////////////////////////////////////////////////
// Bookmarks
-void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo *pInfo)
+void CJabberProto::OnIqResultDiscoBookmarks(HXML iqNode, CJabberIqInfo*)
{
// RECVED: list of bookmarks
// ACTION: refresh bookmarks dialog
@@ -1537,7 +1537,7 @@ void CJabberProto::SetBookmarkRequest (XmlNodeIq& iq) }
}
-void CJabberProto::OnIqResultSetBookmarks(HXML iqNode, CJabberIqInfo *pInfo)
+void CJabberProto::OnIqResultSetBookmarks(HXML iqNode, CJabberIqInfo*)
{
// RECVED: server's response
// ACTION: refresh bookmarks list dialog
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp index 30eb6fbc2a..aea25fcca1 100644 --- a/protocols/JabberG/src/jabber_iqid_muc.cpp +++ b/protocols/JabberG/src/jabber_iqid_muc.cpp @@ -39,7 +39,7 @@ void CJabberProto::SetMucConfig(HXML node, void *from) // RECVED: room config form
// ACTION: show the form
-void CJabberProto::OnIqResultGetMuc(HXML iqNode, CJabberIqInfo *pInfo)
+void CJabberProto::OnIqResultGetMuc(HXML iqNode, CJabberIqInfo*)
{
debugLogA("<iq/> iqIdGetMuc");
LPCTSTR type = xmlGetAttrValue(iqNode, _T("type"));
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 78b23f5834..b2aeb5bd86 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -1113,7 +1113,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleResource(WPARAM hContact, LPARAM, LPAR return 0;
}
-INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM hContact, LPARAM lParam, LPARAM res)
+INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM hContact, LPARAM, LPARAM res)
{
if (!m_bJabberOnline || !hContact)
return 0;
diff --git a/protocols/JabberG/src/jabber_message_handlers.cpp b/protocols/JabberG/src/jabber_message_handlers.cpp index 1362e3d9a2..dd816d61d9 100644 --- a/protocols/JabberG/src/jabber_message_handlers.cpp +++ b/protocols/JabberG/src/jabber_message_handlers.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "jabber.h"
-BOOL CJabberProto::OnMessageError(HXML node, ThreadData *pThreadData, CJabberMessageInfo* pInfo)
+BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pInfo)
{
// we check if is message delivery failure
int id = JabberGetPacketID(node);
@@ -55,7 +55,7 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData *pThreadData, CJabberMes return TRUE;
}
-BOOL CJabberProto::OnMessageIbb(HXML node, ThreadData *pThreadData, CJabberMessageInfo* pInfo)
+BOOL CJabberProto::OnMessageIbb(HXML, ThreadData*, CJabberMessageInfo* pInfo)
{
BOOL bOk = FALSE;
const TCHAR *sid = xmlGetAttrValue(pInfo->GetChildNode(), _T("sid"));
@@ -66,13 +66,13 @@ BOOL CJabberProto::OnMessageIbb(HXML node, ThreadData *pThreadData, CJabberMessa return TRUE;
}
-BOOL CJabberProto::OnMessagePubsubEvent(HXML node, ThreadData *pThreadData, CJabberMessageInfo* pInfo)
+BOOL CJabberProto::OnMessagePubsubEvent(HXML node, ThreadData*, CJabberMessageInfo*)
{
OnProcessPubsubEvent(node);
return TRUE;
}
-BOOL CJabberProto::OnMessageGroupchat(HXML node, ThreadData *pThreadData, CJabberMessageInfo* pInfo)
+BOOL CJabberProto::OnMessageGroupchat(HXML node, ThreadData*, CJabberMessageInfo* pInfo)
{
JABBER_LIST_ITEM *chatItem = ListGetItemPtr(LIST_CHATROOM, pInfo->GetFrom());
if (chatItem) // process GC message
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index 90a7c70353..2b5b803ec1 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -396,7 +396,6 @@ public: RECT rcTmp, rc;
GetClientRect(m_hwnd, &rc);
- int maxHeight = rc.bottom - 10;
rc.bottom = 0;
SelectObject(hdc, m_hfntBold);
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index ec1062bc46..e2ac914ba5 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -332,15 +332,7 @@ CCtrlEditJid::CCtrlEditJid(CDlgBase* dlg, int ctrlId): static void sttStoreJidFromUI(CJabberProto *ppro, CCtrlEdit &txtUsername, CCtrlCombo &cbServer)
{
- TCHAR *user = txtUsername.GetText();
- TCHAR *server = cbServer.GetText();
- int len = mir_tstrlen(user) + mir_tstrlen(server) + 2;
- TCHAR *jid = (TCHAR *)mir_alloc(len * sizeof(TCHAR));
- mir_sntprintf(jid, len, _T("%s@%s"), user, server);
- ppro->setTString("jid", jid);
- mir_free(jid);
- mir_free(server);
- mir_free(user);
+ ppro->setTString("jid", CMString(FORMAT, _T("%s@%s"), ptrT(txtUsername.GetText()), ptrT(cbServer.GetText())));
}
class CDlgOptAccount: public CJabberDlgBase
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index b574a33309..f4bfef8a22 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -1441,7 +1441,7 @@ void CJabberDlgPrivacyLists::CListBuildList(HWND hwndList, CPrivacyList *pList) DWORD dwPackets = 0;
HANDLE hItem;
- TCHAR *szJid;
+ TCHAR *szJid = NULL;
pList->RemoveAllRules();
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index de98b94710..fc97ad9c79 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -843,7 +843,7 @@ int __cdecl CJabberProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *evt) {
ptrA szResUtf(mir_utf8encodeT((LPCTSTR)evt->lParam));
evt->pCustomData = szResUtf;
- evt->cbCustomDataSize = mir_strlen(szResUtf);
+ evt->cbCustomDataSize = (DWORD)mir_strlen(szResUtf);
Proto_RecvMessage(hContact, evt);
return 0;
}
@@ -859,7 +859,7 @@ int __cdecl CJabberProto::RecvUrl(MCONTACT, PROTORECVEVENT*) ////////////////////////////////////////////////////////////////////////////////////////
// SendContacts
-int __cdecl CJabberProto::SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList)
+int __cdecl CJabberProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONTACT *hContactsList)
{
if (!m_bJabberOnline)
return 0;
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 5303bc5c5a..e6c9b90e5e 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -556,7 +556,7 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface void OnIqResultMucGetJidList(HXML iqNode, JABBER_MUC_JIDLIST_TYPE listType);
void OnIqResultServerDiscoInfo(HXML iqNode, CJabberIqInfo *pInfo);
- void OnIqResultGetVcardPhoto(const TCHAR *jid, HXML n, MCONTACT hContact, bool &hasPhoto);
+ void OnIqResultGetVcardPhoto(HXML n, MCONTACT hContact, bool &hasPhoto);
void SetBookmarkRequest (XmlNodeIq& iqId);
//---- jabber_menu.cpp ---------------------------------------------------------------
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index aa6cabcbda..0d62603574 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -132,7 +132,7 @@ static int JabberSearchAddField(HWND hwndDlg, Data* FieldDat) //////////////////////////////////////////////////////////////////////////////// // Available search field request result handler (XEP-0055. Examples 2, 7) -void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo *pInfo) +void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*) { if (!searchHandleDlg) return; @@ -302,7 +302,7 @@ TCHAR* CopyKey(TCHAR* key) //////////////////////////////////////////////////////////////////////////////// // Search field request result handler (XEP-0055. Examples 3, 8) -void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo *pInfo) +void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*) { const TCHAR *type; int id; diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp index de6a62609b..d8112927ae 100644 --- a/protocols/JabberG/src/jabber_secur.cpp +++ b/protocols/JabberG/src/jabber_secur.cpp @@ -248,7 +248,7 @@ void TScramAuth::Hi(BYTE* res, char* passw, size_t passwLen, char* salt, size_t char* TScramAuth::getChallenge(const TCHAR *challenge)
{
- unsigned chlLen, saltLen;
+ unsigned chlLen, saltLen = 0;
ptrA snonce, salt;
int ind = -1;
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index e4176528e4..5ac8ba0eb3 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -538,7 +538,6 @@ INT_PTR __cdecl CJabberProto::JabberSendNudge(WPARAM hContact, LPARAM) else
_tcsncpy_s(tszJid, jid, _TRUNCATE);
- JabberCapsBits jcb = GetResourceCapabilites(tszJid, FALSE);
m_ThreadInfo->send(
XmlNode(_T("message")) << XATTR(_T("type"), _T("headline")) << XATTR(_T("to"), tszJid)
<< XCHILDNS(_T("attention"), JABBER_FEAT_ATTENTION));
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 543f6c40f4..14c509c7b2 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -38,8 +38,7 @@ struct UserInfoStringBuf enum { STRINGBUF_INCREMENT = 1024 }; TCHAR *buf; - int size; - int offset; + size_t size, offset; UserInfoStringBuf() { buf = 0; size = 0; offset = 0; } ~UserInfoStringBuf() { mir_free(buf); } @@ -47,7 +46,7 @@ struct UserInfoStringBuf void append(TCHAR *str) { if (!str) return; - int length = mir_tstrlen(str); + size_t length = mir_tstrlen(str); if (size - offset < length + 1) { size += (length + STRINGBUF_INCREMENT); buf = (TCHAR *)mir_realloc(buf, size * sizeof(TCHAR)); @@ -56,7 +55,7 @@ struct UserInfoStringBuf offset += length; } - TCHAR *allocate(int length) { + TCHAR* allocate(int length) { if (size - offset < length) { size += (length + STRINGBUF_INCREMENT); buf = (TCHAR *)mir_realloc(buf, size * sizeof(TCHAR)); @@ -258,8 +257,9 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti // Idle if (r->m_dwIdleStartTime > 0) { mir_tstrncpy(buf, _tctime(&r->m_dwIdleStartTime), SIZEOF(buf)); - int len = mir_tstrlen(buf); - if (len > 0) buf[len-1] = 0; + size_t len = _tcslen(buf); + if (len > 0) + buf[len-1] = 0; } else if (!r->m_dwIdleStartTime) mir_tstrncpy(buf, TranslateT("unknown"), SIZEOF(buf)); @@ -366,8 +366,9 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM JABBER_RESOURCE_STATUS *r = item->getTemp(); if (r->m_dwIdleStartTime > 0) { mir_tstrncpy(buf, _tctime(&r->m_dwIdleStartTime), SIZEOF(buf)); - int len = mir_tstrlen(buf); - if (len > 0) buf[len-1] = 0; + size_t len = _tcslen(buf); + if (len > 0) + buf[len-1] = 0; } else if (!r->m_dwIdleStartTime) mir_tstrncpy(buf, TranslateT("unknown"), SIZEOF(buf)); diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index ea9c7a8519..5af9b42b47 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -986,8 +986,8 @@ const TCHAR *JabberStrIStr(const TCHAR *str, const TCHAR *substr) TCHAR *str_up = NEWTSTR_ALLOCA(str);
TCHAR *substr_up = NEWTSTR_ALLOCA(substr);
- CharUpperBuff(str_up, mir_tstrlen(str_up));
- CharUpperBuff(substr_up, mir_tstrlen(substr_up));
+ CharUpperBuff(str_up, (DWORD)mir_tstrlen(str_up));
+ CharUpperBuff(substr_up, (DWORD)mir_tstrlen(substr_up));
TCHAR *p = _tcsstr(str_up, substr_up);
return p ? (str + (p - str_up)) : NULL;
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 0dcbfca763..4826a73d42 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -317,11 +317,12 @@ BOOL CJabberDlgPepSimple::OnWmDrawItem(UINT, WPARAM, LPARAM lParam) if (lpdis->CtlID != IDC_CB_MODES)
return FALSE;
- if (lpdis->itemData == -1) return FALSE;
+ if (lpdis->itemData == -1)
+ return FALSE;
CStatusMode *mode = &m_modes[lpdis->itemData];
- TEXTMETRIC tm = {0};
+ TEXTMETRIC tm = { 0 };
GetTextMetrics(lpdis->hDC, &tm);
SetBkMode(lpdis->hDC, TRANSPARENT);
@@ -345,14 +346,14 @@ BOOL CJabberDlgPepSimple::OnWmDrawItem(UINT, WPARAM, LPARAM lParam) }
else mir_tstrncpy(text, mode->m_title, SIZEOF(text));
- DrawIconEx(lpdis->hDC, lpdis->rcItem.left+2, (lpdis->rcItem.top+lpdis->rcItem.bottom-16)/2, mode->m_hIcon, 16, 16, 0, NULL, DI_NORMAL);
- TextOut(lpdis->hDC, lpdis->rcItem.left + 23, (lpdis->rcItem.top+lpdis->rcItem.bottom-tm.tmHeight)/2, text, mir_tstrlen(text));
+ DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 2, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2, mode->m_hIcon, 16, 16, 0, NULL, DI_NORMAL);
+ TextOut(lpdis->hDC, lpdis->rcItem.left + 23, (lpdis->rcItem.top + lpdis->rcItem.bottom - tm.tmHeight) / 2, text, (int)mir_tstrlen(text));
}
else {
TCHAR text[128];
mir_sntprintf(text, SIZEOF(text), _T("...%s"), mode->m_title);
- DrawIconEx(lpdis->hDC, lpdis->rcItem.left+23, (lpdis->rcItem.top+lpdis->rcItem.bottom-16)/2, mode->m_hIcon, 16, 16, 0, NULL, DI_NORMAL);
- TextOut(lpdis->hDC, lpdis->rcItem.left + 44, (lpdis->rcItem.top+lpdis->rcItem.bottom-tm.tmHeight)/2, text, mir_tstrlen(text));
+ DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 23, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2, mode->m_hIcon, 16, 16, 0, NULL, DI_NORMAL);
+ TextOut(lpdis->hDC, lpdis->rcItem.left + 44, (lpdis->rcItem.top + lpdis->rcItem.bottom - tm.tmHeight) / 2, text, (int)mir_tstrlen(text));
}
return TRUE;
@@ -446,7 +447,7 @@ void CPepGuiService::InitGui() char szService[128];
mir_snprintf(szService, SIZEOF(szService), "%s/AdvStatusSet/%s", m_proto->m_szModuleName, m_name);
- int (__cdecl CPepGuiService::*serviceProc)(WPARAM, LPARAM);
+ int(__cdecl CPepGuiService::*serviceProc)(WPARAM, LPARAM);
serviceProc = &CPepGuiService::OnMenuItemClick;
m_hMenuService = CreateServiceFunctionObj(szService, (MIRANDASERVICEOBJ)*(void **)&serviceProc, this);
@@ -902,16 +903,18 @@ static int ActivityCheck(LPCTSTR szFirstNode, LPCTSTR szSecondNode) return nFirst;
}
-char *returnActivity (int id){
+char* returnActivity(int id)
+{
if (g_arrActivities[id].szFirst)
- return g_arrActivities[id].szFirst;
+ return g_arrActivities[id].szFirst;
if (g_arrActivities[id].szSecond)
- return g_arrActivities[id].szSecond;
- return NULL;}
+ return g_arrActivities[id].szSecond;
+ return NULL;
+}
-char *ActivityGetFirst(int id)
+char* ActivityGetFirst(int id)
{
- if (id >= SIZEOF(g_arrActivities)-1)
+ if (id >= SIZEOF(g_arrActivities) - 1)
return NULL;
while (id >= 0) {
@@ -1105,7 +1108,7 @@ void CPepActivity::SetActivity(MCONTACT hContact, LPCTSTR szFirst, LPCTSTR szSec else m_proto->ResetAdvStatus(hContact, ADVSTATUS_ACTIVITY);
}
-void CPepActivity::ShowSetDialog(BYTE bQuiet)
+void CPepActivity::ShowSetDialog(BYTE)
{
CJabberDlgPepSimple dlg(m_proto, TranslateT("Set Activity"));
for (int i=0; i < SIZEOF(g_arrActivities); i++)
@@ -1139,7 +1142,6 @@ void CPepActivity::ShowSetDialog(BYTE bQuiet) HICON CJabberProto::GetXStatusIcon(int bStatus, UINT flags)
{
- CPepMood *pepMood = (CPepMood*)m_pepServices.Find(JABBER_FEAT_USER_MOOD);
HICON icon = g_MoodIcons.GetIcon(g_arrMoods[bStatus].szTag, (flags & LR_BIGICON) != 0);
return (flags & LR_SHARED) ? icon : CopyIcon(icon);
}
@@ -1409,7 +1411,7 @@ INT_PTR __cdecl CJabberProto::OnGetXStatusEx(WPARAM hContact, LPARAM lParam) return 0;
}
-INT_PTR __cdecl CJabberProto::OnSetXStatusEx(WPARAM wParam, LPARAM lParam)
+INT_PTR __cdecl CJabberProto::OnSetXStatusEx(WPARAM, LPARAM lParam)
{
if (!m_bPepSupported || !m_bJabberOnline)
return 1;
|