From 6ca41482bf9a63687551fc6ee792d7b6165f23bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Sun, 3 Nov 2013 14:58:30 +0000 Subject: MirandaG15: warning fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@6754 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirandaG15/src/CAppletManager.cpp | 42 ++++---- plugins/MirandaG15/src/CConfig.cpp | 154 +++++++++++++++--------------- plugins/MirandaG15/src/CContactList.cpp | 2 +- 3 files changed, 98 insertions(+), 100 deletions(-) (limited to 'plugins/MirandaG15') diff --git a/plugins/MirandaG15/src/CAppletManager.cpp b/plugins/MirandaG15/src/CAppletManager.cpp index 5307d78765..099e929ab2 100644 --- a/plugins/MirandaG15/src/CAppletManager.cpp +++ b/plugins/MirandaG15/src/CAppletManager.cpp @@ -205,7 +205,7 @@ bool CAppletManager::Shutdown() // delete the protocol information CProtocolData *pProtoData; - for(int i=0;i::size_type i = 0; i < m_vProtocolData.size(); i++) { pProtoData = m_vProtocolData[i]; delete pProtoData; @@ -248,9 +248,8 @@ bool CAppletManager::IsIRCHookEnabled() //************************************************************************ CProtocolData* CAppletManager::GetProtocolData(tstring strProtocol) { - for(int i=0;istrProtocol == strProtocol) + for (vector::size_type i = 0; i < m_vProtocolData.size(); i++) { + if (m_vProtocolData[i]->strProtocol == strProtocol) return m_vProtocolData[i]; } return NULL; @@ -468,7 +467,7 @@ tstring CAppletManager::GetContactDisplayname(HANDLE hContact,bool bShortened) return (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR); tstring strNick = GetContactDisplayname(hContact,false); - if(strNick.length() > CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + if(strNick.length() > (tstring::size_type)CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) return strNick.erase(CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + _T("..."); return strNick; @@ -1100,22 +1099,21 @@ bool CAppletManager::TranslateDBEvent(CEvent *pEvent,WPARAM wParam, LPARAM lPara //************************************************************************ tstring CAppletManager::StripIRCFormatting(tstring strText) { - tstring::size_type End=0,Start=0; + tstring::size_type end = 0, start = 0, i = 0; tstring strEntity = _T(""); tstring strReplace = _T(""); tstring::size_type len = strText.length(); - int i = 0; while(i < strText.length()) { - Start = strText.find(_T("%"),i); - if(Start != string::npos && Start < strText.length() - 1) + start = strText.find(_T("%"),i); + if(start != string::npos && start < strText.length() - 1) { - strEntity = strText[Start+1]; + strEntity = strText[start+1]; if(strEntity == _T("%")) { - strText.replace(Start,2,_T("%")); - i = Start +1; + strText.replace(start,2,_T("%")); + i = start + 1; } /* else if(strEntity == _T("b") || strEntity == _T("B") || @@ -1123,19 +1121,19 @@ tstring CAppletManager::StripIRCFormatting(tstring strText) strEntity ==_T("u") || strEntity == _T("U") || strEntity == _T("C") ||strEntity == _T("F")) { - strText.erase(Start,2); - i = Start; + strText.erase(start,2); + i = start; } */ else if(strEntity == _T("c") || strEntity == _T("f")) { - strText.erase(Start,4); - i = Start; + strText.erase(start,4); + i = start; } else { - strText.erase(Start,2); - i = Start; + strText.erase(start,2); + i = start; } } else @@ -1370,7 +1368,7 @@ int CAppletManager::HookChatInbound(WPARAM wParam,LPARAM lParam) tstring strNick = toTstring(gce->ptszNick); tstring strStatus = toTstring(gce->ptszStatus); - if(CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF) && strNick.length() > CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + if(CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF) && strNick.length() > (tstring::size_type)CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) strNick = strNick.erase(CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + _T("..."); TRACE(_T("\t Handling event...\t")); @@ -1447,7 +1445,7 @@ int CAppletManager::HookChatInbound(WPARAM wParam,LPARAM lParam) Event.bNotification = true; tstring strFullNick = toTstring(gce->ptszNick); - if(CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF) && strText.length() > CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + if(CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF) && strText.length() > (tstring::size_type)CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) strText = strText.erase(CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + _T("..."); Event.strValue = TranslateString(_T("%s is now known as %s"),strNick.c_str(),strText.c_str()); @@ -1479,7 +1477,7 @@ int CAppletManager::HookChatInbound(WPARAM wParam,LPARAM lParam) if(CConfig::GetBoolSetting(NOTIFY_IRC_STATUS)) Event.bNotification = true; tstring strNick2 = toTstring(gce->ptszStatus); - if(CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF) && strNick2.length() > CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + if(CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF) && strNick2.length() > (tstring::size_type)CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) strNick2 = strNick2.erase(CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + _T("..."); Event.strValue = TranslateString(_T("%s enables '%s' for %s"),strText.c_str(),strNick2.c_str(),strNick.c_str()); @@ -1490,7 +1488,7 @@ int CAppletManager::HookChatInbound(WPARAM wParam,LPARAM lParam) if(CConfig::GetBoolSetting(NOTIFY_IRC_STATUS)) Event.bNotification = true; tstring strNick2 = toTstring(gce->ptszStatus); - if(CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF) && strNick2.length() > CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + if(CConfig::GetBoolSetting(NOTIFY_NICKCUTOFF) && strNick2.length() > (tstring::size_type)CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) strNick2 = strNick2.erase(CConfig::GetIntSetting(NOTIFY_NICKCUTOFF_OFFSET)) + _T("..."); Event.strValue = TranslateString(_T("%s disables '%s' for %s"),strText.c_str(),strNick2.c_str(),strNick.c_str()); diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index c41e3d8029..b303a81a7a 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -34,67 +34,67 @@ void CConfig::Shutdown() void CConfig::LoadSettings() { - m_abBoolSettings[SKIP_DRIVER_ERROR] = db_get_dw(NULL, "MirandaG15", "SkipDriverError",0); - - m_abBoolSettings[SCREENSAVER_LOCK] = db_get_dw(NULL, "MirandaG15", "ScreensaverLock",1); - m_abBoolSettings[NOTIFY_SHOWPROTO] = db_get_dw(NULL, "MirandaG15", "NotifyShowProto",0); - m_abBoolSettings[NOTIFY_NICKCUTOFF] = db_get_dw(NULL, "MirandaG15", "NotifyNickCutoff",0); - m_abBoolSettings[NOTIFY_CHANNELCUTOFF] = db_get_dw(NULL, "MirandaG15", "NotifyChannelCutoff",0); - - m_abBoolSettings[TRANSITIONS] = db_get_dw(NULL, "MirandaG15", "Transitions",0); - m_abBoolSettings[TIMESTAMP_SECONDS] = db_get_dw(NULL, "MirandaG15", "TimestampSeconds",0); - m_abBoolSettings[SESSION_TIMESTAMPS] = db_get_dw(NULL, "MirandaG15", "SessionTimestamps",0); - m_abBoolSettings[NOTIFY_TIMESTAMPS] = db_get_dw(NULL, "MirandaG15", "NotifyTimestamps",0); - - m_abBoolSettings[CONTROL_BACKLIGHTS] = db_get_dw(NULL, "MirandaG15", "ControlBacklights",0); - m_abBoolSettings[HOOK_VOLUMEWHEEL] = db_get_dw(NULL, "MirandaG15", "HookVolumeWheel",0); - - m_abBoolSettings[CLIST_SELECTION] = db_get_dw(NULL, "MirandaG15", "CListSelection",1); - m_abBoolSettings[CLIST_COLUMNS] = db_get_dw(NULL, "MirandaG15", "CListColumns",0); - m_abBoolSettings[CLIST_HIDEOFFLINE] = db_get_dw(NULL, "MirandaG15", "CListHideOffline",1); - m_abBoolSettings[CLIST_USEIGNORE] = db_get_dw(NULL, "MirandaG15", "CListUseIgnore",1); - m_abBoolSettings[CLIST_USEGROUPS] = db_get_dw(NULL, "MirandaG15", "CListUseGroups",1); - m_abBoolSettings[CLIST_SHOWPROTO] = db_get_dw(NULL, "MirandaG15", "CListShowProto",1); - m_abBoolSettings[CLIST_DRAWLINES] = db_get_dw(NULL, "MirandaG15", "CListDrawLines",1); - m_abBoolSettings[CLIST_COUNTERS] = db_get_dw(NULL, "MirandaG15", "CListCounters",1); - m_abBoolSettings[CLIST_POSITION] = db_get_dw(NULL, "MirandaG15", "CListPosition",0); - - m_abBoolSettings[NOTIFY_IRC_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCMessages", 1); - m_abBoolSettings[NOTIFY_IRC_USERS] = db_get_dw(NULL, "MirandaG15", "NotifyIRCUsers", 0); - m_abBoolSettings[NOTIFY_IRC_EMOTES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCEmotes", 0); - m_abBoolSettings[NOTIFY_IRC_NOTICES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCNotices", 1); - m_abBoolSettings[NOTIFY_IRC_CHANNEL] = db_get_dw(NULL, "MirandaG15", "NotifyIRCChannel", 0); - m_abBoolSettings[NOTIFY_IRC_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyIRCStatus", 0); - - m_abBoolSettings[NOTIFY_PROTO_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyProtoStatus", 0); - m_abBoolSettings[NOTIFY_PROTO_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifyProtoSignOn", 1); - m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] =db_get_dw(NULL, "MirandaG15", "NotifyProtoSignOff", 1); - m_abBoolSettings[NOTIFY_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifyMessages", 1); - m_abBoolSettings[NOTIFY_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifySignOn", 1); - m_abBoolSettings[NOTIFY_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifySignOff", 1); - m_abBoolSettings[NOTIFY_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyStatus", 0); - m_abBoolSettings[NOTIFY_SKIP_MESSAGES] =db_get_dw(NULL, "MirandaG15", "NotifySkipMessages", 1); - m_abBoolSettings[NOTIFY_SKIP_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifySkipSignOn", 0); - m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifySkipSignOff", 0); - m_abBoolSettings[NOTIFY_SKIP_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifySkipStatus", 1); - m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] = db_get_dw(NULL, "MirandaG15", "NotifyNoSkipReply",1); - m_abBoolSettings[NOTIFY_URL] = db_get_dw(NULL, "MirandaG15", "NotifyURL", 1); - m_abBoolSettings[NOTIFY_FILE] = db_get_dw(NULL, "MirandaG15", "NotifyFile", 1); - m_abBoolSettings[NOTIFY_CONTACTS] = db_get_dw(NULL, "MirandaG15", "NotifyContacts", 1); + m_abBoolSettings[SKIP_DRIVER_ERROR] = db_get_dw(NULL, "MirandaG15", "SkipDriverError",0) != 0; + + m_abBoolSettings[SCREENSAVER_LOCK] = db_get_dw(NULL, "MirandaG15", "ScreensaverLock",1) != 0; + m_abBoolSettings[NOTIFY_SHOWPROTO] = db_get_dw(NULL, "MirandaG15", "NotifyShowProto",0) != 0; + m_abBoolSettings[NOTIFY_NICKCUTOFF] = db_get_dw(NULL, "MirandaG15", "NotifyNickCutoff",0) != 0; + m_abBoolSettings[NOTIFY_CHANNELCUTOFF] = db_get_dw(NULL, "MirandaG15", "NotifyChannelCutoff",0) != 0; + + m_abBoolSettings[TRANSITIONS] = db_get_dw(NULL, "MirandaG15", "Transitions",0) != 0; + m_abBoolSettings[TIMESTAMP_SECONDS] = db_get_dw(NULL, "MirandaG15", "TimestampSeconds",0) != 0; + m_abBoolSettings[SESSION_TIMESTAMPS] = db_get_dw(NULL, "MirandaG15", "SessionTimestamps",0) != 0; + m_abBoolSettings[NOTIFY_TIMESTAMPS] = db_get_dw(NULL, "MirandaG15", "NotifyTimestamps",0) != 0; + + m_abBoolSettings[CONTROL_BACKLIGHTS] = db_get_dw(NULL, "MirandaG15", "ControlBacklights",0) != 0; + m_abBoolSettings[HOOK_VOLUMEWHEEL] = db_get_dw(NULL, "MirandaG15", "HookVolumeWheel",0) != 0; + + m_abBoolSettings[CLIST_SELECTION] = db_get_dw(NULL, "MirandaG15", "CListSelection",1) != 0; + m_abBoolSettings[CLIST_COLUMNS] = db_get_dw(NULL, "MirandaG15", "CListColumns",0) != 0; + m_abBoolSettings[CLIST_HIDEOFFLINE] = db_get_dw(NULL, "MirandaG15", "CListHideOffline",1) != 0; + m_abBoolSettings[CLIST_USEIGNORE] = db_get_dw(NULL, "MirandaG15", "CListUseIgnore",1) != 0; + m_abBoolSettings[CLIST_USEGROUPS] = db_get_dw(NULL, "MirandaG15", "CListUseGroups",1) != 0; + m_abBoolSettings[CLIST_SHOWPROTO] = db_get_dw(NULL, "MirandaG15", "CListShowProto",1) != 0; + m_abBoolSettings[CLIST_DRAWLINES] = db_get_dw(NULL, "MirandaG15", "CListDrawLines",1) != 0; + m_abBoolSettings[CLIST_COUNTERS] = db_get_dw(NULL, "MirandaG15", "CListCounters",1) != 0; + m_abBoolSettings[CLIST_POSITION] = db_get_dw(NULL, "MirandaG15", "CListPosition",0) != 0; + + m_abBoolSettings[NOTIFY_IRC_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCMessages", 1) != 0; + m_abBoolSettings[NOTIFY_IRC_USERS] = db_get_dw(NULL, "MirandaG15", "NotifyIRCUsers", 0) != 0; + m_abBoolSettings[NOTIFY_IRC_EMOTES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCEmotes", 0) != 0; + m_abBoolSettings[NOTIFY_IRC_NOTICES] = db_get_dw(NULL, "MirandaG15", "NotifyIRCNotices", 1) != 0; + m_abBoolSettings[NOTIFY_IRC_CHANNEL] = db_get_dw(NULL, "MirandaG15", "NotifyIRCChannel", 0) != 0; + m_abBoolSettings[NOTIFY_IRC_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyIRCStatus", 0) != 0; + + m_abBoolSettings[NOTIFY_PROTO_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyProtoStatus", 0) != 0; + m_abBoolSettings[NOTIFY_PROTO_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifyProtoSignOn", 1) != 0; + m_abBoolSettings[NOTIFY_PROTO_SIGNOFF] =db_get_dw(NULL, "MirandaG15", "NotifyProtoSignOff", 1) != 0; + m_abBoolSettings[NOTIFY_MESSAGES] = db_get_dw(NULL, "MirandaG15", "NotifyMessages", 1) != 0; + m_abBoolSettings[NOTIFY_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifySignOn", 1) != 0; + m_abBoolSettings[NOTIFY_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifySignOff", 1) != 0; + m_abBoolSettings[NOTIFY_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifyStatus", 0) != 0; + m_abBoolSettings[NOTIFY_SKIP_MESSAGES] =db_get_dw(NULL, "MirandaG15", "NotifySkipMessages", 1) != 0; + m_abBoolSettings[NOTIFY_SKIP_SIGNON] = db_get_dw(NULL, "MirandaG15", "NotifySkipSignOn", 0) != 0; + m_abBoolSettings[NOTIFY_SKIP_SIGNOFF] = db_get_dw(NULL, "MirandaG15", "NotifySkipSignOff", 0) != 0; + m_abBoolSettings[NOTIFY_SKIP_STATUS] = db_get_dw(NULL, "MirandaG15", "NotifySkipStatus", 1) != 0; + m_abBoolSettings[NOTIFY_NO_SKIP_REPLY] = db_get_dw(NULL, "MirandaG15", "NotifyNoSkipReply",1) != 0; + m_abBoolSettings[NOTIFY_URL] = db_get_dw(NULL, "MirandaG15", "NotifyURL", 1) != 0; + m_abBoolSettings[NOTIFY_FILE] = db_get_dw(NULL, "MirandaG15", "NotifyFile", 1) != 0; + m_abBoolSettings[NOTIFY_CONTACTS] = db_get_dw(NULL, "MirandaG15", "NotifyContacts", 1) != 0; - m_abBoolSettings[SESSION_SCROLL_MAXIMIZED] = db_get_dw(NULL, "MirandaG15", "SessionScrollMaximized", 1); - m_abBoolSettings[SESSION_REPLY_MAXIMIZED] = db_get_dw(NULL, "MirandaG15", "SessionReplyMaximized", 1); - m_abBoolSettings[SESSION_LOADDB] = db_get_dw(NULL, "MirandaG15", "SessionLoadDB", 0); - m_abBoolSettings[SESSION_MARKREAD] = db_get_dw(NULL, "MirandaG15", "SessionMarkRead", 1); - m_abBoolSettings[SESSION_SENDRETURN] = db_get_dw(NULL, "MirandaG15", "SessionSendReturn",0); - m_abBoolSettings[SESSION_SHOWTYPING] = db_get_dw(NULL, "MirandaG15", "SessionShowTyping",1); - m_abBoolSettings[SESSION_SENDTYPING] = db_get_dw(NULL, "MirandaG15", "SessionSendTyping",1); - m_abBoolSettings[SESSION_SYMBOLS] = db_get_dw(NULL, "MirandaG15", "SessionSymbols",0); - m_abBoolSettings[SESSION_CLOSE] = db_get_dw(NULL, "MirandaG15", "SessionClose",1); + m_abBoolSettings[SESSION_SCROLL_MAXIMIZED] = db_get_dw(NULL, "MirandaG15", "SessionScrollMaximized", 1) != 0; + m_abBoolSettings[SESSION_REPLY_MAXIMIZED] = db_get_dw(NULL, "MirandaG15", "SessionReplyMaximized", 1) != 0; + m_abBoolSettings[SESSION_LOADDB] = db_get_dw(NULL, "MirandaG15", "SessionLoadDB", 0) != 0; + m_abBoolSettings[SESSION_MARKREAD] = db_get_dw(NULL, "MirandaG15", "SessionMarkRead", 1) != 0; + m_abBoolSettings[SESSION_SENDRETURN] = db_get_dw(NULL, "MirandaG15", "SessionSendReturn",0) != 0; + m_abBoolSettings[SESSION_SHOWTYPING] = db_get_dw(NULL, "MirandaG15", "SessionShowTyping",1) != 0; + m_abBoolSettings[SESSION_SENDTYPING] = db_get_dw(NULL, "MirandaG15", "SessionSendTyping",1) != 0; + m_abBoolSettings[SESSION_SYMBOLS] = db_get_dw(NULL, "MirandaG15", "SessionSymbols",0) != 0; + m_abBoolSettings[SESSION_CLOSE] = db_get_dw(NULL, "MirandaG15", "SessionClose",1) != 0; - m_abBoolSettings[SHOW_LABELS] = db_get_dw(NULL, "MirandaG15", "ShowLabels", 1); - m_abBoolSettings[MAXIMIZED_TITLE] = db_get_dw(NULL, "MirandaG15", "MaximizedTitle", 0); - m_abBoolSettings[MAXIMIZED_LABELS] = db_get_dw(NULL, "MirandaG15", "MaximizedLabels", 1); + m_abBoolSettings[SHOW_LABELS] = db_get_dw(NULL, "MirandaG15", "ShowLabels", 1) != 0; + m_abBoolSettings[MAXIMIZED_TITLE] = db_get_dw(NULL, "MirandaG15", "MaximizedTitle", 0) != 0; + m_abBoolSettings[MAXIMIZED_LABELS] = db_get_dw(NULL, "MirandaG15", "MaximizedLabels", 1) != 0; m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET] = db_get_dw(NULL, "MirandaG15", "NotifyChannelCutoffOffset", 10); m_aiIntSettings[NOTIFY_NICKCUTOFF_OFFSET] = db_get_dw(NULL, "MirandaG15", "NotifyNickCutoffOffset", 10); @@ -130,9 +130,9 @@ void CConfig::LoadSettings() pProtoFilter->strName = toTstring(ppAccounts[i]->szModuleName); strSetting = _T("ProtoFilter_") + pProtoFilter->strName; - pProtoFilter->bNotificationFilter = db_get_dw(NULL,"MirandaG15",toNarrowString(strSetting).c_str(),1); + pProtoFilter->bNotificationFilter = db_get_dw(NULL,"MirandaG15",toNarrowString(strSetting).c_str(),1) != 0; strSetting = _T("ProtoCListFilter_") + pProtoFilter->strName; - pProtoFilter->bContactlistFilter = db_get_dw(NULL,"MirandaG15",toNarrowString(strSetting).c_str(),1); + pProtoFilter->bContactlistFilter = db_get_dw(NULL,"MirandaG15",toNarrowString(strSetting).c_str(),1) != 0; m_ProtoList.push_back(pProtoFilter); } } @@ -299,7 +299,7 @@ void CConfig::SaveFontSettings(int iFont) char szSetting[128]; // Height - sprintf(szSetting,"Font%dHeight",iFont); + mir_snprintf(szSetting,SIZEOF(szSetting),"Font%dHeight",iFont); db_set_b(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfHeight); // Style int style = 0; @@ -307,13 +307,13 @@ void CConfig::SaveFontSettings(int iFont) style |= FONTF_BOLD; if(m_logfont[iFont].lfItalic) style |= FONTF_ITALIC; - sprintf(szSetting,"Font%dStyle",iFont); + mir_snprintf(szSetting,SIZEOF(szSetting),"Font%dStyle",iFont); db_set_b(NULL, "MirandaG15", szSetting, style); // Charset - sprintf(szSetting,"Font%dCharset",iFont); + mir_snprintf(szSetting,SIZEOF(szSetting),"Font%dCharset",iFont); db_set_b(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfCharSet); // Name - sprintf(szSetting,"Font%dName",iFont); + mir_snprintf(szSetting,SIZEOF(szSetting),"Font%dName",iFont); db_set_ts(NULL, "MirandaG15", szSetting, m_logfont[iFont].lfFaceName); UpdateFontSettings(iFont); @@ -332,18 +332,18 @@ void CConfig::LoadFontSettings(int iFont) m_logfont[iFont].lfQuality = DEFAULT_QUALITY; m_logfont[iFont].lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; // Height - sprintf(szSetting,"Font%dHeight",iFont); + mir_snprintf(szSetting,SIZEOF(szSetting),"Font%dHeight",iFont); m_logfont[iFont].lfHeight = (char) db_get_b(NULL, "MirandaG15", szSetting, -MulDiv(6, 96, 72)); // Style - sprintf(szSetting,"Font%dStyle",iFont); + mir_snprintf(szSetting,SIZEOF(szSetting),"Font%dStyle",iFont); int style = db_get_b(NULL, "MirandaG15", szSetting, 0); m_logfont[iFont].lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL; m_logfont[iFont].lfItalic = style & FONTF_ITALIC ? 1 : 0; // Charset - sprintf(szSetting,"Font%dCharset",iFont); + mir_snprintf(szSetting,SIZEOF(szSetting),"Font%dCharset",iFont); m_logfont[iFont].lfCharSet = db_get_b(NULL, "MirandaG15", szSetting, DEFAULT_CHARSET); // Name - sprintf(szSetting,"Font%dName",iFont); + mir_snprintf(szSetting,SIZEOF(szSetting),"Font%dName",iFont); DBVARIANT dbv; if (db_get_ts(NULL, "MirandaG15", szSetting, &dbv)) lstrcpy(m_logfont[iFont].lfFaceName,_T("Small Fonts")); @@ -517,10 +517,10 @@ INT_PTR CALLBACK CConfig::ChatDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLFIRST, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_FIRST? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_SESSION_SCROLLLAST, m_aiIntSettings[SESSION_AUTOSCROLL] == SESSION_AUTOSCROLL_LAST? BST_CHECKED : BST_UNCHECKED); - itoa(m_aiIntSettings[SESSION_LOGSIZE], buf, 10); + _itoa_s(m_aiIntSettings[SESSION_LOGSIZE], buf, SIZEOF(buf), 10); SetDlgItemTextA(hwndDlg, IDC_SESSION_LOGSIZE, buf); - itoa(m_aiIntSettings[SESSION_CLOSETIMER], buf, 10); + _itoa_s(m_aiIntSettings[SESSION_CLOSETIMER], buf, SIZEOF(buf), 10); SetDlgItemTextA(hwndDlg, IDC_SESSION_CLOSETIMER, buf); m_bInitializingDialog = false; @@ -632,16 +632,16 @@ INT_PTR CALLBACK CConfig::NotificationsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM w CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_STATUS, m_abBoolSettings[NOTIFY_SKIP_STATUS] ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_NOTIFY_SKIP_MESSAGES, m_abBoolSettings[NOTIFY_SKIP_MESSAGES] ? BST_CHECKED : BST_UNCHECKED); - itoa(m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET], buf, 10); + _itoa_s(m_aiIntSettings[NOTIFY_CHANNELCUTOFF_OFFSET], buf, SIZEOF(buf), 10); SetDlgItemTextA(hwndDlg, IDC_NOTIFY_CHANNELCUTOFF_OFFSET, buf); - itoa(m_aiIntSettings[NOTIFY_NICKCUTOFF_OFFSET], buf, 10); + _itoa_s(m_aiIntSettings[NOTIFY_NICKCUTOFF_OFFSET], buf, SIZEOF(buf), 10); SetDlgItemTextA(hwndDlg, IDC_NOTIFY_NICKCUTOFF_OFFSET, buf); - itoa(m_aiIntSettings[NOTIFY_LOGSIZE], buf, 10); + _itoa_s(m_aiIntSettings[NOTIFY_LOGSIZE], buf, SIZEOF(buf), 10); SetDlgItemTextA(hwndDlg, IDC_NOTIFY_LOGSIZE, buf); - itoa(m_aiIntSettings[NOTIFY_DURATION], buf, 10); + _itoa_s(m_aiIntSettings[NOTIFY_DURATION], buf, SIZEOF(buf), 10); SetDlgItemTextA(hwndDlg, IDC_NOTIFY_DURATION, buf); CheckDlgButton(hwndDlg, IDC_NOTIFY_TITLEHIDE, m_aiIntSettings[NOTIFY_TITLE] == NOTIFY_TITLE_HIDE? BST_CHECKED : BST_UNCHECKED); @@ -669,7 +669,7 @@ INT_PTR CALLBACK CConfig::NotificationsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM w tvi.hItem=hti.hItem; TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi); tvi.iImage=tvi.iSelectedImage=!tvi.iImage; - ((CProtoFilter *)tvi.lParam)->bTempNotificationFilter=tvi.iImage; + ((CProtoFilter *)tvi.lParam)->bTempNotificationFilter=tvi.iImage != 0; TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); @@ -816,7 +816,7 @@ INT_PTR CALLBACK CConfig::ContactlistDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wPa tvi.hItem=hti.hItem; TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi); tvi.iImage=tvi.iSelectedImage=!tvi.iImage; - ((CProtoFilter *)tvi.lParam)->bTempContactlistFilter=tvi.iImage; + ((CProtoFilter *)tvi.lParam)->bTempContactlistFilter=tvi.iImage != 0; TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); } diff --git a/plugins/MirandaG15/src/CContactList.cpp b/plugins/MirandaG15/src/CContactList.cpp index 280c9e66bc..e22f1a868d 100644 --- a/plugins/MirandaG15/src/CContactList.cpp +++ b/plugins/MirandaG15/src/CContactList.cpp @@ -206,7 +206,7 @@ bool CContactList::IsVisible(CContactListEntry *pEntry) { DWORD dwNumContacts = (DWORD)CallService(MS_MC_GETNUMCONTACTS,(WPARAM)pEntry->hHandle,0); HANDLE hSubContact = NULL; char *szProto; - for(int i=0;ihHandle,i); szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(UINT)hSubContact,0); if(db_get_w(hSubContact,szProto,"Status",ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) { -- cgit v1.2.3