summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-10-20 17:38:06 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-10-20 17:38:06 +0000
commit6183362250af373372830fbd5d4d952b0038bbfc (patch)
tree986e7c937720b5d93e00dcc2e7ee3b2f47a7286d
parent7e4a5794928702bf435f3d7be339a6c553fe618a (diff)
more warning fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@6558 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/AVS/src/options.cpp3
-rw-r--r--plugins/BasicHistory/src/BasicHistory.cpp3
-rw-r--r--plugins/Boltun/src/Engine/Mind.cpp30
-rw-r--r--plugins/Boltun/src/Engine/TalkEngine.cpp13
-rw-r--r--plugins/Boltun/src/Engine/UnrecentChooser.cpp2
-rw-r--r--plugins/Boltun/src/Engine/WordsList.cpp10
-rw-r--r--plugins/Boltun/src/actionQueue.cpp8
-rw-r--r--plugins/Boltun/src/boltun.cpp7
-rw-r--r--plugins/BossKeyPlus/src/Options.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp7
-rw-r--r--plugins/Clist_modern/src/modern_clcmsgs.cpp15
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp14
-rw-r--r--plugins/Clist_modern/src/modern_clistsettings.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp26
-rw-r--r--plugins/Clist_modern/src/modern_cluiframes.cpp3
-rw-r--r--plugins/Clist_modern/src/modern_docking.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_row.cpp28
-rw-r--r--plugins/Clist_modern/src/modern_rowheight_funcs.cpp3
-rw-r--r--plugins/Clist_modern/src/modern_skineditor.cpp52
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp29
-rw-r--r--plugins/Clist_modern/src/modern_skinopt.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_skinselector.cpp17
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_statusbar_options.cpp1
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_xptheme.cpp5
-rw-r--r--protocols/AimOscar/src/ui.cpp10
28 files changed, 116 insertions, 224 deletions
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp
index 8b1212e04d..b4907b8efa 100644
--- a/plugins/AVS/src/options.cpp
+++ b/plugins/AVS/src/options.cpp
@@ -903,8 +903,7 @@ static INT_PTR CALLBACK DlgProcAvatarUserInfo(HWND hwndDlg, UINT msg, WPARAM wPa
break;
case WM_NCDESTROY:
- if (dat)
- free(dat);
+ free(dat);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
break;
}
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp
index bb2a360756..2542a43364 100644
--- a/plugins/BasicHistory/src/BasicHistory.cpp
+++ b/plugins/BasicHistory/src/BasicHistory.cpp
@@ -306,8 +306,7 @@ extern "C" int __declspec(dllexport) Unload(void)
Options::instance = NULL;
}
- if (hEventIcons != NULL)
- delete [] hEventIcons;
+ delete [] hEventIcons;
return 0;
}
diff --git a/plugins/Boltun/src/Engine/Mind.cpp b/plugins/Boltun/src/Engine/Mind.cpp
index 6f558e002b..d497da606d 100644
--- a/plugins/Boltun/src/Engine/Mind.cpp
+++ b/plugins/Boltun/src/Engine/Mind.cpp
@@ -266,7 +266,7 @@ void Mind::Load(tstring filename)
delete c;
vector<tstring> strs = Parse(s1);
data->raliases.insert(make_pair(sc, strs));
- for (vector<tstring>::const_iterator it = strs.begin(); it != strs.end(); it++)
+ for (vector<tstring>::const_iterator it = strs.begin(); it != strs.end(); ++it)
data->aliases.insert(make_pair(*it, sc));
}
break;
@@ -316,72 +316,72 @@ void Mind::Save(tstring filename) const
if (fileTypeMark)
file << TCHAR(65279);
- for (string_mmap::iterator it = data->study.begin(); it != data->study.end(); it++)
+ for (string_mmap::iterator it = data->study.begin(); it != data->study.end(); ++it)
{
file << (*it).first << _T('\r') << endl;
file << (*it).second << _T('\r') << endl;
}
- for (multimap<WordsList, tstring>::iterator it = data->keywords.begin(); it != data->keywords.end(); it++)
+ for (multimap<WordsList, tstring>::iterator it = data->keywords.begin(); it != data->keywords.end(); ++it)
{
file << _T(" (") << (tstring)(*it).first << _T(")") << _T('\r') << endl;
file << (*it).second << _T('\r') << endl;
}
- for (multimap<WordsList, tstring>::iterator it = data->qkeywords.begin(); it != data->qkeywords.end(); it++)
+ for (multimap<WordsList, tstring>::iterator it = data->qkeywords.begin(); it != data->qkeywords.end(); ++it)
{
file << _T(" (") << (tstring)(*it).first << _T(")") << _T('\r') << endl;
file << (*it).second << _T('\r') << endl;
}
- for (multimap<WordsList, tstring>::iterator it = data->specialEscapes.begin(); it != data->specialEscapes.end(); it++)
+ for (multimap<WordsList, tstring>::iterator it = data->specialEscapes.begin(); it != data->specialEscapes.end(); ++it)
{
file << _T(" {") << (tstring)(*it).first << _T("}") << _T('\r') << endl;
file << (*it).second << _T('\r') << endl;
}
- for (multimap<WordsList, tstring>::iterator it = data->qspecialEscapes.begin(); it != data->qspecialEscapes.end(); it++)
+ for (multimap<WordsList, tstring>::iterator it = data->qspecialEscapes.begin(); it != data->qspecialEscapes.end(); ++it)
{
file << _T(" {") << (tstring)(*it).first << _T("}") << _T('\r') << endl;
file << (*it).second << _T('\r') << endl;
}
- for (string_mmap::iterator it = data->widelyUsed.begin(); it != data->widelyUsed.end(); it++)
+ for (string_mmap::iterator it = data->widelyUsed.begin(); it != data->widelyUsed.end(); ++it)
{
file << _T(" [") << (*it).first << _T("]") << _T('\r') << endl;
file << (*it).second << _T('\r') << endl;
}
- for (set<tstring>::iterator it = data->question.begin(); it != data->question.end(); it++)
+ for (set<tstring>::iterator it = data->question.begin(); it != data->question.end(); ++it)
{
file << _T(" <QUESTION>") << _T('\r') << endl;
file << (*it) << _T('\r') << endl;
}
- for (set<tstring>::iterator it = data->special.begin(); it != data->special.end(); it++)
+ for (set<tstring>::iterator it = data->special.begin(); it != data->special.end(); ++it)
{
file << _T(" <IGNORED>") << _T('\r') << endl;
file << (*it) << _T('\r') << endl;
}
- for (string_vec::iterator it = data->escape.begin(); it != data->escape.end(); it++)
+ for (string_vec::iterator it = data->escape.begin(); it != data->escape.end(); ++it)
{
file << _T(" <ESCAPE>") << _T('\r') << endl;
file << (*it) << _T('\r') << endl;
}
- for (string_vec::iterator it = data->initial.begin(); it != data->initial.end(); it++)
+ for (string_vec::iterator it = data->initial.begin(); it != data->initial.end(); ++it)
{
file << _T(" <INITIAL>") << _T('\r') << endl;
file << (*it) << _T('\r') << endl;
}
- for (string_vec::iterator it = data->failure.begin(); it != data->failure.end(); it++)
+ for (string_vec::iterator it = data->failure.begin(); it != data->failure.end(); ++it)
{
file << _T(" <FAILURE>") << _T('\r') << endl;
file << (*it) << _T('\r') << endl;
}
- for (string_vec::iterator it = data->repeats.begin(); it != data->repeats.end(); it++)
+ for (string_vec::iterator it = data->repeats.begin(); it != data->repeats.end(); ++it)
{
file << _T(" <REPEAT>") << _T('\r') << endl;
file << (*it) << _T('\r') << endl;
}
- for (map<tstring,vector<tstring>>::const_iterator it = data->raliases.begin(); it != data->raliases.end(); it++)
+ for (map<tstring,vector<tstring>>::const_iterator it = data->raliases.begin(); it != data->raliases.end(); ++it)
{
tstring s;
const vector<tstring>& v = (*it).second;
bool first = true;
- for (vector<tstring>::const_iterator it1 = v.begin(); it1 != v.end(); it1++)
+ for (vector<tstring>::const_iterator it1 = v.begin(); it1 != v.end(); ++it1)
{
if (first)
{
diff --git a/plugins/Boltun/src/Engine/TalkEngine.cpp b/plugins/Boltun/src/Engine/TalkEngine.cpp
index 0c711ab652..a72bbdeb80 100644
--- a/plugins/Boltun/src/Engine/TalkEngine.cpp
+++ b/plugins/Boltun/src/Engine/TalkEngine.cpp
@@ -98,7 +98,6 @@ tstring TalkBot::ReplaceAliases(const tstring &message)
tstring sentence = message;
tstring result;
int len = (int)sentence.length();
- vector<tstring> words;
map<int, tstring> sm;
//Find smiles
for (size_t i = 0; i < sentence.length() - 1; i++)
@@ -280,7 +279,7 @@ TalkBot::MessageInfo* TalkBot::Reply(void* contact, tstring incomingMessage, boo
_tcscpy(str, incomingMessage.c_str());
CharLower(str);
incomingMessage = str;
- delete str;
+ delete [] str;
ContactData* contactData = contactDatas->GetData(contact);
if (incomingMessage == contactData->lastMessage && GetTickCount() < contactData->lastMessageTime + 30*60*1000)
@@ -366,7 +365,7 @@ bool TalkBot::FindExact(ContactData* contactData, const tstring &incomingMessage
return false;
}
pair<mm_cit, mm_cit> range = map.equal_range(incomingMessage);
- for (mm_cit it = range.first; it != range.second; it++)
+ for (mm_cit it = range.first; it != range.second; ++it)
contactData->chooser.AddChoice((*it).second);
res = contactData->chooser.Choose();
return true;
@@ -461,7 +460,7 @@ tstring TalkBot::ChooseResult(ContactData* contactData, Level maxValue, const mu
}*/
typedef multimap<Level, tstring>::const_iterator lt_cit;
pair<lt_cit,lt_cit> range = mm.equal_range(target);
- for (lt_cit it = range.first; it != range.second; it++)
+ for (lt_cit it = range.first; it != range.second; ++it)
contactData->chooser.AddChoice((*it).second);
#ifdef DEBUG_SHOW_LEVEL
tstring lev = LevelToStr(target);
@@ -478,7 +477,7 @@ void TalkBot::FindByKeywords(ContactData* contactData, const vector<tstring> &ke
return;
const multimap<WordsList, tstring> &keys = isQuestion ? mind.GetData()->qkeywords :
mind.GetData()->keywords;
- for (multimap<WordsList, tstring>::const_iterator it = keys.begin(); it != keys.end(); it++)
+ for (multimap<WordsList, tstring>::const_iterator it = keys.begin(); it != keys.end(); ++it)
{
float prio;
if ((*it).first.MatchesAll(keywords/*, strict*/, prio))
@@ -497,7 +496,7 @@ bool TalkBot::FindByOthers(ContactData* contactData, const vector<tstring> &othe
const multimap<WordsList, tstring> &specs = isQuestion ? mind.GetData()->qspecialEscapes :
mind.GetData()->specialEscapes;
for (multimap<WordsList, tstring>::const_iterator it = specs.begin();
- it != specs.end(); it++)
+ it != specs.end(); ++it)
if ((*it).first.MatchesAny(otherwords))
{
#ifdef DEBUG_SHOW_SOLUTION_REASON
@@ -575,7 +574,7 @@ void TalkBot::SplitAndSortWords(tstring sentence, vector<tstring>& keywords,
words.push_back(str);
}
isQuestion = hadQuestionSigns;
- for (vector<tstring>::iterator it = words.begin(); it != words.end(); it++)
+ for (vector<tstring>::iterator it = words.begin(); it != words.end(); ++it)
{
if (!isQuestion)
{
diff --git a/plugins/Boltun/src/Engine/UnrecentChooser.cpp b/plugins/Boltun/src/Engine/UnrecentChooser.cpp
index d11806503b..5a3d4f7fd1 100644
--- a/plugins/Boltun/src/Engine/UnrecentChooser.cpp
+++ b/plugins/Boltun/src/Engine/UnrecentChooser.cpp
@@ -83,7 +83,7 @@ void UnRecentChooser::SaveChoice(tstring choice)
//Add answer
if (items.find(choice) != items.end())
{
- for (vector<tstring>::iterator it = itemsList.begin(); it != itemsList.end(); it++)
+ for (vector<tstring>::iterator it = itemsList.begin(); it != itemsList.end(); ++it)
if (*it == choice)
{
itemsList.erase(it);
diff --git a/plugins/Boltun/src/Engine/WordsList.cpp b/plugins/Boltun/src/Engine/WordsList.cpp
index 08cd150aaf..d9ba65aa90 100644
--- a/plugins/Boltun/src/Engine/WordsList.cpp
+++ b/plugins/Boltun/src/Engine/WordsList.cpp
@@ -37,7 +37,7 @@ WordsList::operator tstring() const
while (true)
{
res += *it;
- it++;
+ ++it;
if (it != words.end())
res += _T(" ");
else
@@ -92,7 +92,7 @@ bool WordsList::MatchesAll(const vector<tstring>& s/*, bool& WasStrict*/, float&
{
std::set<tstring> temp;
//WasStrict = true;
- for (vector<tstring>::const_iterator it = s.begin(); it != s.end(); it++)
+ for (vector<tstring>::const_iterator it = s.begin(); it != s.end(); ++it)
{
/* if (words.find(*it) == words.end())
if (unstrict)
@@ -114,7 +114,7 @@ bool WordsList::MatchesAll(const vector<tstring>& s/*, bool& WasStrict*/, float&
bool WordsList::MatchesAny(const vector<tstring>& s) const
{
- for (vector<tstring>::const_iterator it = s.begin(); it != s.end(); it++)
+ for (vector<tstring>::const_iterator it = s.begin(); it != s.end(); ++it)
if (words.find(*it) != words.end())
return true;
return false;
@@ -123,7 +123,7 @@ bool WordsList::MatchesAny(const vector<tstring>& s) const
vector<tstring> WordsList::ConsistsOf(const set<tstring>& list) const
{
vector<tstring> res;
- for (set<tstring>::const_iterator it = words.begin(); it != words.end(); it++)
+ for (set<tstring>::const_iterator it = words.begin(); it != words.end(); ++it)
if (list.find(*it) == list.end())
res.push_back(*it);
return res;
@@ -132,7 +132,7 @@ vector<tstring> WordsList::ConsistsOf(const set<tstring>& list) const
vector<tstring> WordsList::DoesntIncludeAny(const set<tstring>& list) const
{
vector<tstring> res;
- for (set<tstring>::const_iterator it = words.begin(); it != words.end(); it++)
+ for (set<tstring>::const_iterator it = words.begin(); it != words.end(); ++it)
if (list.find(*it) != list.end())
res.push_back(*it);
return res;
diff --git a/plugins/Boltun/src/actionQueue.cpp b/plugins/Boltun/src/actionQueue.cpp
index 014e8919ba..3514ae994b 100644
--- a/plugins/Boltun/src/actionQueue.cpp
+++ b/plugins/Boltun/src/actionQueue.cpp
@@ -111,7 +111,7 @@ static void TimerAnswer(HANDLE hContact, const TalkBot::MessageInfo* info)
bot->AnswerGiven(hContact, *info);
delete info;
- delete msg;
+ delete [] msg;
typingContactsLock.Enter();
typingContacts.erase(hContact);
@@ -169,7 +169,7 @@ void DoAnswer(HANDLE hContact, const TalkBot::MessageInfo *info, bool sticky = f
if (!actionQueue.empty())
{
list<QueueElement>::iterator it = actionQueue.end();
- it--;
+ --it;
while (true)
{
if ((*it).hContact == hContact)
@@ -178,7 +178,7 @@ void DoAnswer(HANDLE hContact, const TalkBot::MessageInfo *info, bool sticky = f
break;
list<QueueElement>::iterator tmp = it;
if (tmp != actionQueue.begin())
- tmp--;
+ --tmp;
actionQueue.erase(it);
it = tmp;
if (actionQueue.empty())
@@ -186,7 +186,7 @@ void DoAnswer(HANDLE hContact, const TalkBot::MessageInfo *info, bool sticky = f
}
if (it == actionQueue.begin())
break;
- it--;
+ --it;
}
}
typingContactsLock.Enter();
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp
index 4ad9379bb5..26a370b50e 100644
--- a/plugins/Boltun/src/boltun.cpp
+++ b/plugins/Boltun/src/boltun.cpp
@@ -163,8 +163,7 @@ static bool LoadMind(const TCHAR* filename, int &line)
delete mind;
return false;
}
- if (bot)
- delete bot;
+ delete bot;
bot = new TalkBot(*mind);
delete mind;
UpdateEngine();
@@ -408,7 +407,7 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
ofn.lpstrInitialDir = path;
if (!GetOpenFileName(&ofn))
{
- delete filename;
+ delete[] filename;
delete[] filt;
break;
}
@@ -427,7 +426,7 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
filename = f;
Config.MindFileName = filename;
SetDlgItemText(hwndDlg, IDC_MINDFILE, filename);
- delete origf;
+ delete[] origf;
}
case IDC_BTNRELOAD:
{
diff --git a/plugins/BossKeyPlus/src/Options.cpp b/plugins/BossKeyPlus/src/Options.cpp
index 63eb25d851..68d5916204 100644
--- a/plugins/BossKeyPlus/src/Options.cpp
+++ b/plugins/BossKeyPlus/src/Options.cpp
@@ -105,7 +105,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
{
TCHAR tszMsg[1025];
GetDlgItemText(hwndDlg,IDC_MAINOPT_STATMSG,tszMsg,1024);
- if (lstrlen(tszMsg) != 0)
+ if (tszMsg[0] != 0)
db_set_ts(NULL,MOD_NAME,"statmsg",tszMsg);
else // delete current setting
db_unset(NULL,MOD_NAME,"statmsg");
@@ -118,7 +118,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
{
char szPass[MAXPASSLEN+1];
GetDlgItemTextA(hwndDlg,IDC_MAINOPT_PASS,szPass,MAXPASSLEN+1);
- if (strlen(szPass) != 0){
+ if (szPass[0] != 0){
CallService(MS_DB_CRYPT_ENCODESTRING, MAXPASSLEN+1, ( LPARAM )szPass );
db_set_s(NULL,MOD_NAME,"password",szPass);
wMask |= OPT_REQPASS;
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 35a4eed2fe..1bcac75ec1 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -57,7 +57,7 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup)
p.iImage = corecli.pfnGetContactIcon(cacheEntry->hContact);
memset(p.iExtraImage, 0xFF, sizeof(p.iExtraImage));
- p.proto = cacheEntry->m_cache_cszProto;
+ p.proto = cacheEntry->m_cache_cszProto;
p.type = CLCIT_CONTACT;
p.flags = 0;//CONTACTF_ONLINE;
p.isSubcontact = i+1;
@@ -71,8 +71,7 @@ void AddSubcontacts(ClcData *dat, ClcContact *cont, BOOL showOfflineHereGroup)
char *szProto = cacheEntry->m_cache_cszProto;
if (szProto != NULL && !pcli->pfnIsHiddenMode(dat,wStatus))
p.flags |= CONTACTF_ONLINE;
- int apparentMode = szProto != NULL?cacheEntry->ApparentMode:0;
- apparentMode = szProto != NULL?cacheEntry->ApparentMode:0;
+ int apparentMode = szProto != NULL ? cacheEntry->ApparentMode : 0;
if (apparentMode == ID_STATUS_OFFLINE) p.flags |= CONTACTF_INVISTO;
else if (apparentMode == ID_STATUS_ONLINE) p.flags |= CONTACTF_VISTO;
else if (apparentMode) p.flags |= CONTACTF_VISTO|CONTACTF_INVISTO;
@@ -565,7 +564,7 @@ void cli_SaveStateAndRebuildList(HWND hwnd, ClcData *dat)
group->expanded = savedGroup[i].expanded;
break;
}
- continue;
+ continue;
}
else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) {
for (i=0; i < savedContact.getCount(); i++)
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp
index 7875ba21ff..d31016b09f 100644
--- a/plugins/Clist_modern/src/modern_clcmsgs.cpp
+++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp
@@ -49,7 +49,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara
return 0;
case CLM_SETFONT:
- if (HIWORD(lParam) < 0 || HIWORD(lParam)>FONTID_MODERN_MAX) return 0;
+ if (HIWORD(lParam)>FONTID_MODERN_MAX) return 0;
dat->fontModernInfo[HIWORD(lParam)].hFont = (HFONT)wParam;
dat->fontModernInfo[HIWORD(lParam)].changed = 1;
@@ -62,18 +62,19 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara
case CLM_SETHIDEEMPTYGROUPS:
{
- BOOL old = ((GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_HIDEEMPTYGROUPS) != 0);
- BOOL newval = old;
- if (wParam) SetWindowLongPtr(hwnd,GWL_STYLE,GetWindowLongPtr(hwnd,GWL_STYLE)|CLS_HIDEEMPTYGROUPS);
- else SetWindowLongPtr(hwnd,GWL_STYLE,GetWindowLongPtr(hwnd,GWL_STYLE)&~CLS_HIDEEMPTYGROUPS);
- newval = ((GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_HIDEEMPTYGROUPS) != 0);
+ BOOL old = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0);
+ if (wParam)
+ SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | CLS_HIDEEMPTYGROUPS);
+ else
+ SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) &~ CLS_HIDEEMPTYGROUPS);
+ BOOL newval = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0);
if (newval != old)
SendMessage(hwnd,CLM_AUTOREBUILD, 0, 0);
}
return 0;
case CLM_SETTEXTCOLOR:
- if (wParam < 0 || wParam>FONTID_MODERN_MAX) break;
+ if (wParam > FONTID_MODERN_MAX) break;
dat->fontModernInfo[wParam].colour = lParam;
dat->force_in_dialog = TRUE;
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp
index 50392aba60..18b29d54df 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.cpp
+++ b/plugins/Clist_modern/src/modern_clcpaint.cpp
@@ -1006,11 +1006,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
{
ChangeToFont( hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
if ( dat->text_rtl != 0 ) _RTLRect( &counts_rc, free_row_rc.right, dx );
- if ( InClistWindow && g_CluiData.fLayered )
- ske_DrawTextA( hdcMem, szCounts, lstrlenA( szCounts ), &counts_rc, uTextFormat );
- else
- //88
- ske_DrawTextA( hdcMem, szCounts, lstrlenA( szCounts ), &counts_rc, uTextFormat );
+ ske_DrawTextA( hdcMem, szCounts, lstrlenA( szCounts ), &counts_rc, uTextFormat );
if ( dat->text_rtl == 0 )
text_rect.right = counts_rc.right;
else
@@ -3186,8 +3182,6 @@ void CLCPaint::_DrawContactLine( HDC hdcMem, ClcData *dat, ClcContact *Drawing,
void CLCPaint::_DrawContactItems( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *row_rc, RECT *free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint )
{
- int i;
- RECT text_rc = {0};
UINT uTextFormat = DT_NOPREFIX |
/*DT_VCENTER |*/
DT_SINGLELINE |
@@ -3196,12 +3190,12 @@ void CLCPaint::_DrawContactItems( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContac
( gl_TrimText?DT_END_ELLIPSIS:0 )|
(( dat->force_in_dialog || dat->bkChanged ) ? DT_FORCENATIVERENDER:0 );
- text_rc = *row_rc;
+ RECT text_rc = *row_rc;
text_rc.right = row_rc->left;
text_rc.left = row_rc->right;
- for ( i=0; i < Drawing->ext_nItemsNum; i++ )
+ for (int i=0; i < Drawing->ext_nItemsNum; i++ )
{
RECT *prcItem = &( Drawing->ext_mpItemsDesc[i].itemRect );
if ( __IsVisible( rcPaint, prcItem ) || ( Drawing->ext_mpItemsDesc[i].itemType == CIT_AVATAR && Drawing->avatar_pos == AVATAR_POS_ANIMATED ))
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp
index 69eb2ddd9e..3fb5c65ab8 100644
--- a/plugins/Clist_modern/src/modern_clcutils.cpp
+++ b/plugins/Clist_modern/src/modern_clcutils.cpp
@@ -181,11 +181,8 @@ void cliScrollTo(HWND hwnd,ClcData *dat,int desty,int noSmooth)
}
}
dat->yScroll = desty;
- if ((dat->backgroundBmpUse&CLBF_SCROLL || dat->hBmpBackground == NULL) && FALSE)
- ScrollWindowEx(hwnd, 0, previousy-dat->yScroll,NULL,NULL,NULL,NULL,SW_INVALIDATE);
- else
- CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
- SetScrollPos(hwnd,SB_VERT,dat->yScroll,TRUE);
+ CLUI__cliInvalidateRect(hwnd, NULL, FALSE);
+ SetScrollPos(hwnd, SB_VERT, dat->yScroll, TRUE);
}
@@ -400,11 +397,8 @@ int GetDropTargetInformation(HWND hwnd,ClcData *dat,POINT pt)
{
if (bottomItem == -1 && contact->type != CLCIT_GROUP && contact->groupId == 0)
{
- if (contact->type != CLCIT_GROUP && contact->groupId == 0)
- {
- bottomItem = topItem;
- cliGetRowByIndex(dat,bottomItem,&bottomcontact,&bottomgroup);
- }
+ bottomItem = topItem;
+ cliGetRowByIndex(dat,bottomItem,&bottomcontact,&bottomgroup);
}
if (bottomItem != -1 && bottomcontact->type != CLCIT_GROUP)
{
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp
index 4dd9db47cb..77464992ef 100644
--- a/plugins/Clist_modern/src/modern_clistsettings.cpp
+++ b/plugins/Clist_modern/src/modern_clistsettings.cpp
@@ -228,8 +228,6 @@ void cliCheckCacheItem(ClcCacheEntry *pdnce)
pdnce->m_cache_cszProto = GetProtoForContact(pdnce->hContact);
if (pdnce->m_cache_cszProto == NULL)
pdnce->m_cache_bProtoNotExists = FALSE;
- else if (CallService(MS_PROTO_ISPROTOCOLLOADED, 0, (LPARAM)pdnce->m_cache_cszProto) == (int)NULL && 0)
- pdnce->m_cache_bProtoNotExists = TRUE;
else if (pdnce->m_cache_cszProto && pdnce->tszName)
pdnce->freeName();
}
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index c86934b64c..da0679328b 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -447,9 +447,9 @@ HRESULT CLUI::CreateCLC()
else
CallService(MS_CLIST_SETHIDEOFFLINE, 0, 0);
if (bOldUseGroups != (BYTE)-1)
- CallService(MS_CLIST_SETUSEGROUPS ,(WPARAM)bOldUseGroups, 0);
+ CallService(MS_CLIST_SETUSEGROUPS, (WPARAM)bOldUseGroups, 0);
else
- CallService(MS_CLIST_SETUSEGROUPS ,(WPARAM)bOldUseGroups, 0);
+ CallService(MS_CLIST_SETUSEGROUPS, 0, 0);
}
nLastRequiredHeight = 0;
mutex_bDisableAutoUpdate = 0;
@@ -1537,15 +1537,6 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam)
}
return 0;
}
- if (g_CluiData.bCurrentAlpha == GoalAlpha && 0)
- {
- if (mutex_bAnimationInProgress)
- {
- KillTimer(hwnd,TM_SMOTHALPHATRANSITION);
- mutex_bAnimationInProgress = 0;
- }
- return 0;
- }
if (mutex_bShowHideCalledFromAnimation)
return 0;
@@ -2160,7 +2151,6 @@ LRESULT CLUI::OnAutoAlphaTimer(UINT msg, WPARAM wParam, LPARAM lParam)
POINT pt = UNPACK_POINT(GetMessagePos());
HWND hwndPt = WindowFromPoint(pt);
- inwnd = FALSE;
inwnd = CLUI_CheckOwnedByClui(hwndPt);
if ( ! inwnd )
inwnd = ( GetCapture() == pcli->hwndContactList );
@@ -2262,11 +2252,10 @@ LRESULT CLUI::OnTimer(UINT msg, WPARAM wParam, LPARAM lParam)
LRESULT CLUI::OnActivate(UINT msg, WPARAM wParam, LPARAM lParam)
{
- BOOL IsOption = FALSE;
SetCursor(LoadCursor(NULL, IDC_ARROW));
SendMessage(pcli->hwndContactTree, WM_ACTIVATE, wParam, lParam);
if ( db_get_b(NULL, "ModernData", "HideBehind", SETTING_HIDEBEHIND_DEFAULT)) {
- if (wParam == WA_INACTIVE && ((HWND)lParam != m_hWnd) && GetParent((HWND)lParam) != m_hWnd && !IsOption)
+ if (wParam == WA_INACTIVE && ((HWND)lParam != m_hWnd) && GetParent((HWND)lParam) != m_hWnd)
{
if ( !g_bCalledFromShowHide) CLUI_UpdateTimer(0);
}
@@ -2279,7 +2268,7 @@ LRESULT CLUI::OnActivate(UINT msg, WPARAM wParam, LPARAM lParam)
return 0;
}
- if (wParam == WA_INACTIVE && ((HWND)lParam != m_hWnd) && !CLUI_CheckOwnedByClui((HWND)lParam) && !IsOption) {
+ if (wParam == WA_INACTIVE && ((HWND)lParam != m_hWnd) && !CLUI_CheckOwnedByClui((HWND)lParam)) {
if (g_bTransparentFlag && bTransparentFocus)
CLUI_SafeSetTimer(m_hWnd, TM_AUTOALPHA,250, NULL);
}
@@ -2295,13 +2284,12 @@ LRESULT CLUI::OnActivate(UINT msg, WPARAM wParam, LPARAM lParam)
RedrawWindow(m_hWnd,NULL,NULL,RDW_INVALIDATE|RDW_ALLCHILDREN);
if (g_bTransparentFlag) {
BYTE alpha;
- if (wParam != WA_INACTIVE || CLUI_CheckOwnedByClui((HWND)lParam) || IsOption || ((HWND)lParam == m_hWnd) || GetParent((HWND)lParam) == m_hWnd)
+ if (wParam != WA_INACTIVE || CLUI_CheckOwnedByClui((HWND)lParam) || ((HWND)lParam == m_hWnd) || GetParent((HWND)lParam) == m_hWnd)
alpha = db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT);
else
alpha = g_bTransparentFlag ? db_get_b(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT) : 255;
CLUI_SmoothAlphaTransition(m_hWnd, alpha, 1);
- if (IsOption) DefWindowProc(m_hWnd,msg,wParam,lParam);
- else return 1;
+ return 1;
}
return DefWindowProc(m_hWnd,msg,wParam,lParam);
}
@@ -2672,7 +2660,7 @@ LRESULT CLUI::OnDrawItem(UINT msg, WPARAM wParam, LPARAM lParam)
CLUI_DrawMenuBackGround(m_hWnd, dis->hDC, 3, dis->itemState);
mir_snprintf(buf,SIZEOF(buf),"Main,ID=MainMenu,Selected=%s,Hot=%s",(dis->itemState&ODS_SELECTED)?"True":"False",(dis->itemState&ODS_HOTLIGHT)?"True":"False");
SkinDrawGlyph(dis->hDC,&dis->rcItem,&dis->rcItem,buf);
- DrawState(dis->hDC,NULL,NULL,(LPARAM)hIcon, 0, (dis->rcItem.right+dis->rcItem.left-GetSystemMetrics(SM_CXSMICON))/2+dx,(dis->rcItem.bottom+dis->rcItem.top-GetSystemMetrics(SM_CYSMICON))/2+dx, 0, 0, DST_ICON|(dis->itemState&ODS_INACTIVE && FALSE?DSS_DISABLED:DSS_NORMAL));
+ DrawState(dis->hDC, NULL, NULL, (LPARAM)hIcon, 0, (dis->rcItem.right + dis->rcItem.left - GetSystemMetrics(SM_CXSMICON)) / 2 + dx, (dis->rcItem.bottom + dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2 + dx, 0, 0, DST_ICON);
Skin_ReleaseIcon(hIcon);
nMirMenuState = dis->itemState;
}
diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp
index bce3cc73a3..24ac15f196 100644
--- a/plugins/Clist_modern/src/modern_cluiframes.cpp
+++ b/plugins/Clist_modern/src/modern_cluiframes.cpp
@@ -188,8 +188,6 @@ int CLUIFrames_ActivateSubContainers( BOOL active)
for (i=0;i < g_nFramesCount;i++)
if (active && !g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != (HWND)0 && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide )
{
- HWND hwnd = g_pfwFrames[i].OwnerWindow;
- hwnd = g_pfwFrames[i].hWnd;//OwnerWindow;
if ( db_get_b(NULL,"CList","OnDesktop",SETTING_ONDESKTOP_DEFAULT))
{
SetWindowPos(g_pfwFrames[i].OwnerWindow,HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
@@ -2201,7 +2199,6 @@ static int CLUIFramesResizeFrames(const RECT newsize)
g_CluiData.nGapBetweenTitlebar = (int)db_get_dw(NULL,"CLUIFrames","GapBetweenTitleBar",SETTING_GAPTITLEBAR_DEFAULT);
GapBetweenFrames = db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
- sepw = GapBetweenFrames;
if (g_nFramesCount < 1) return 0;
newheight = newsize.bottom-newsize.top;
diff --git a/plugins/Clist_modern/src/modern_docking.cpp b/plugins/Clist_modern/src/modern_docking.cpp
index 616c7af1c1..24ed62d9f9 100644
--- a/plugins/Clist_modern/src/modern_docking.cpp
+++ b/plugins/Clist_modern/src/modern_docking.cpp
@@ -231,18 +231,6 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam)
case WM_MOVE:
{
-
- if (g_CluiData.fDocked && 0) {
- RECT rc, rcMonitor;
- Docking_GetMonitorRectFromWindow(msg->hwnd,&rcMonitor);
- GetWindowRect(msg->hwnd,&rc);
- Docking_AdjustPosition(msg->hwnd,&rcMonitor,&rc);
- MoveWindow(msg->hwnd,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,TRUE);
- Sync(CLUIFrames_OnMoving,msg->hwnd,&rc);
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);// -= -= -=
-
- return 1;
- }
ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_ALT_DRAW, NULL);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_row.cpp b/plugins/Clist_modern/src/modern_row.cpp
index a83ef4ffae..058b48f2e8 100644
--- a/plugins/Clist_modern/src/modern_row.cpp
+++ b/plugins/Clist_modern/src/modern_row.cpp
@@ -668,33 +668,7 @@ void rowPositioning(pROWCELL cell, int &dist)
w -= size;
if (curchild->sizing)
{
- if ((0&!curchild->fitwidth) || r>1) //пока отключено -проблемы с выравниванием
- {
- if (curchild->hasfixed)
- fixedsized -= curchild->fixed_width;
- switch (cell->halign)
- {
- case TC_RIGHT:
- size = (w-fixedsized)-(autosized-max(curchild->full_width,curchild->w));
- break;
- case TC_LEFT:
- size = min(w-fixedsized,max(curchild->full_width,curchild->w));
- break;
- case TC_HCENTER:
- if (autosized) {size = max(curchild->full_width,curchild->w)*w/autosized; break;}
- default:
- size = w / r;
- }
- autosized -= (max(curchild->full_width,curchild->w));
- if (autosized < 0) autosized = 0;
- if (size < 0) size = 0;
- }
- else size = w;
- /* пока отключено ибо параметр влияет на выравнивание включается по левому краю
- if (0 && !curchild->fitwidth)
- if (size>max(curchild->full_width,curchild->w))
- size = max(curchild->full_width,curchild->w);
- */
+ size = w;
r--;
}
else
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
index b8d4940024..c8e4e54783 100644
--- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
+++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
@@ -229,7 +229,6 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
contact->type == CLCIT_CONTACT &&
(hasAvatar || (dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && contact->iImage != -1)))
{
- SIZE sz = {0};
int iW = 0, iH = 0;
if (dat->use_avatar_service) {
if (contact->avatar_data) {
@@ -241,7 +240,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
iW = dat->avatar_cache.nodes[contact->avatar_pos].width;
iH = dat->avatar_cache.nodes[contact->avatar_pos].height;
}
- sz = GetAvatarSize(iW,iH,dat->avatars_maxwidth_size,dat->avatars_maxheight_size);
+ SIZE sz = GetAvatarSize(iW,iH,dat->avatars_maxwidth_size,dat->avatars_maxheight_size);
if ((sz.cx == 0 || sz.cy == 0) && dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && contact->iImage != -1)
sz.cx = ICON_HEIGHT, sz.cy = ICON_HEIGHT;
diff --git a/plugins/Clist_modern/src/modern_skineditor.cpp b/plugins/Clist_modern/src/modern_skineditor.cpp
index 76ae48cb3f..14d81f762d 100644
--- a/plugins/Clist_modern/src/modern_skineditor.cpp
+++ b/plugins/Clist_modern/src/modern_skineditor.cpp
@@ -244,13 +244,10 @@ void SetControls(HWND hwndDlg, TCHAR *str)
{
case 1:
{
- int r,g,b,a;
- r = g = b = 200;
- a = 255;
- r = _ttoi(GetParamN(str,buf,SIZEOF(buf),2,',',TRUE));
- g = _ttoi(GetParamN(str,buf,SIZEOF(buf),3,',',TRUE));
- b = _ttoi(GetParamN(str,buf,SIZEOF(buf),4,',',TRUE));
- a = _ttoi(GetParamN(str,buf,SIZEOF(buf),5,',',TRUE));
+ int r = _ttoi(GetParamN(str,buf,SIZEOF(buf),2,',',TRUE));
+ int g = _ttoi(GetParamN(str,buf,SIZEOF(buf),3,',',TRUE));
+ int b = _ttoi(GetParamN(str,buf,SIZEOF(buf),4,',',TRUE));
+ int a = _ttoi(GetParamN(str,buf,SIZEOF(buf),5,',',TRUE));
SendDlgItemMessage(hwndDlg,IDC_COLOR,CPM_SETCOLOUR, 0, (LPARAM)RGB(r,g,b));
SendDlgItemMessage(hwndDlg,IDC_COLOR,CPM_SETDEFAULTCOLOUR, 0, (LPARAM)RGB(r,g,b));
SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_SETPOS, 0, MAKELONG(a,0));
@@ -258,17 +255,13 @@ void SetControls(HWND hwndDlg, TCHAR *str)
break;
case 2:
{
- int a;
- int l,t,r,b;
int fitmode = 0;
- l = t = r = b = 0;
- a = 255;
- l = _ttoi(GetParamN(str,buf,SIZEOF(buf),4,',',TRUE));
- t = _ttoi(GetParamN(str,buf,SIZEOF(buf),5,',',TRUE));
- r = _ttoi(GetParamN(str,buf,SIZEOF(buf),6,',',TRUE));
- b = _ttoi(GetParamN(str,buf,SIZEOF(buf),7,',',TRUE));
- a = _ttoi(GetParamN(str,buf,SIZEOF(buf),8,',',TRUE));
+ int l = _ttoi(GetParamN(str,buf,SIZEOF(buf),4,',',TRUE));
+ int t = _ttoi(GetParamN(str,buf,SIZEOF(buf),5,',',TRUE));
+ int r = _ttoi(GetParamN(str,buf,SIZEOF(buf),6,',',TRUE));
+ int b = _ttoi(GetParamN(str,buf,SIZEOF(buf),7,',',TRUE));
+ int a = _ttoi(GetParamN(str,buf,SIZEOF(buf),8,',',TRUE));
SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_SETPOS, 0, MAKELONG(a,0));
SendDlgItemMessage(hwndDlg,IDC_SPIN_LEFT,UDM_SETPOS, 0, MAKELONG(l,0));
@@ -290,24 +283,18 @@ void SetControls(HWND hwndDlg, TCHAR *str)
break;
case 3:
{
- int a;
- int l,t,r,b;
- int x,y,w,h;
int fitmode = 0;
- l = t = r = b = 0;
- x = y = w = h = 0;
- a = 255;
- x = _ttoi(GetParamN(str,buf,SIZEOF(buf),3,',',TRUE));
- y = _ttoi(GetParamN(str,buf,SIZEOF(buf),4,',',TRUE));
- w = _ttoi(GetParamN(str,buf,SIZEOF(buf),5,',',TRUE));
- h = _ttoi(GetParamN(str,buf,SIZEOF(buf),6,',',TRUE));
-
- l = _ttoi(GetParamN(str,buf,SIZEOF(buf),8,',',TRUE));
- t = _ttoi(GetParamN(str,buf,SIZEOF(buf),9,',',TRUE));
- r = _ttoi(GetParamN(str,buf,SIZEOF(buf),10, ',',TRUE));
- b = _ttoi(GetParamN(str,buf,SIZEOF(buf),11,',',TRUE));
- a = _ttoi(GetParamN(str,buf,SIZEOF(buf),12,',',TRUE));
+ int x = _ttoi(GetParamN(str,buf,SIZEOF(buf),3,',',TRUE));
+ int y = _ttoi(GetParamN(str,buf,SIZEOF(buf),4,',',TRUE));
+ int w = _ttoi(GetParamN(str,buf,SIZEOF(buf),5,',',TRUE));
+ int h = _ttoi(GetParamN(str,buf,SIZEOF(buf),6,',',TRUE));
+
+ int l = _ttoi(GetParamN(str,buf,SIZEOF(buf),8,',',TRUE));
+ int t = _ttoi(GetParamN(str,buf,SIZEOF(buf),9,',',TRUE));
+ int r = _ttoi(GetParamN(str,buf,SIZEOF(buf),10, ',',TRUE));
+ int b = _ttoi(GetParamN(str,buf,SIZEOF(buf),11,',',TRUE));
+ int a = _ttoi(GetParamN(str,buf,SIZEOF(buf),12,',',TRUE));
SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_SETPOS, 0, MAKELONG(a,0));
SendDlgItemMessage(hwndDlg,IDC_SPIN_LEFT,UDM_SETPOS, 0, MAKELONG(l,0));
@@ -631,7 +618,6 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (HIWORD(wParam) == BN_CLICKED) {
TCHAR str[MAX_PATH] = {0};
OPENFILENAME ofn = {0};
- TCHAR filter[512] = {0};
int res = 0;
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index cfe4f3e1a5..cba4682996 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -212,7 +212,7 @@ int IniParser::GetSkinFolder( IN const TCHAR * szFileName, OUT TCHAR * pszFolder
*b3 = _T('\0');
GetPrivateProfileString(_T("Skin_Description_Section"),_T("SkinFolder"),_T(""),cus,SIZEOF(custom_folder),szFileName);
- if ( cus && _tcslen(cus)>0)
+ if (cus[0] != 0)
mir_sntprintf(pszFolderName, MAX_PATH, _T("%s\\%s"), custom_folder, cus);
mir_free(szBuff);
@@ -1662,7 +1662,7 @@ void ske_PreMultiplyChanells(HBITMAP hbmp,BYTE Mult)
return;
}
-int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder,BOOL madeAbsolute)
+int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder, BOOL madeAbsolute)
{
TCHAR *SkinPlace = db_get_tsa(NULL,SKIN,"SkinFolder");
if (SkinPlace == NULL)
@@ -1680,7 +1680,7 @@ int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder,BOOL ma
else
PathToAbsoluteT(b2, buf);
}
- else _tcsncpy(buf, b2, SIZEOF(buf));
+ else _tcsncpy(buf, b2, MAX_PATH);
mir_free(SkinPlace);
return 0;
@@ -1877,7 +1877,7 @@ static HBITMAP ske_LoadGlyphImage_Png2Dib(const TCHAR *tszFilename)
}
else {
BYTE *ptPixels = pt;
- HBITMAP hBitmap = CreateDIBSection(NULL,bi, DIB_RGB_COLORS, (void **)&ptPixels, NULL, 0);
+ hBitmap = CreateDIBSection(NULL,bi, DIB_RGB_COLORS, (void **)&ptPixels, NULL, 0);
memcpy(ptPixels,pt,bi->bmiHeader.biSizeImage);
}
GlobalFree( pDib );
@@ -2478,9 +2478,6 @@ static BOOL ske_DrawTextEffect(BYTE* destPt,BYTE* maskPt, DWORD width, DWORD hei
rl = GetRValue(effect->EffectColor1);
gl = GetGValue(effect->EffectColor1);
bl = GetBValue(effect->EffectColor1);
- rd = GetRValue(effect->EffectColor2);
- gd = GetGValue(effect->EffectColor2);
- bd = GetBValue(effect->EffectColor2);
ad = 255-((BYTE)(effect->EffectColor2>>24));
rd = GetRValue(effect->EffectColor2);
gd = GetGValue(effect->EffectColor2);
@@ -2534,9 +2531,8 @@ static BOOL ske_DrawTextEffect(BYTE* destPt,BYTE* maskPt, DWORD width, DWORD hei
for (matrixHor = mcLeftStart; matrixHor < mcRightEnd;matrixHor++)
{
- int a = as;
buflineTop = buflineTopS;
- a = x+matrixHor-2;
+ int a = x+matrixHor-2;
if (buflineTop && a >= 0 && (DWORD)a < width) buflineTop += matrixHor-2;
else buflineTop = NULL;
if (buflineTop)
@@ -3079,21 +3075,6 @@ BOOL ske_DrawIconEx(HDC hdcDst,int xLeft,int yTop,HICON hIcon,int cxWidth,int cy
SelectObject(tempDC1,otBmp);
DeleteDC(tempDC1);
}
- /*
- if (imbt.bmBitsPixel != 32)
- {
- HDC tempDC1;
- HBITMAP otBmp;
- no32bit = TRUE;
- tempDC1 = ske_RequestBufferDC(hdcDst,BUFFER_DRAWICON,imbt.bmWidth,imbt.bmHeight);
- if (tempDC1)
- {
- DrawIconEx(tempDC1, 0, 0, hIcon,imbt.bmWidth,imbt.bmHeight,istepIfAniCur,hbrFlickerFreeDraw,DI_IMAGE);
- noMirrorMask = TRUE;
- ske_ReleaseBufferDC(tempDC1,2000); //keep buffer for 2 seconds
- }
- }
- */
if (imbt.bmBits == NULL)
{
NoDIBImage = TRUE;
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp
index 7fb29421e3..aa5a246e9c 100644
--- a/plugins/Clist_modern/src/modern_skinopt.cpp
+++ b/plugins/Clist_modern/src/modern_skinopt.cpp
@@ -208,7 +208,6 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
{
//TODO:Draw hPreviewBitmap here
int mWidth, mHeight;
- RECT workRect = {0};
HBRUSH hbr = CreateSolidBrush( GetSysColor( COLOR_3DFACE ));
DRAWITEMSTRUCT *dis = ( DRAWITEMSTRUCT * )lParam;
mWidth = dis->rcItem.right-dis->rcItem.left;
@@ -216,7 +215,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
HDC memDC = CreateCompatibleDC( dis->hDC );
HBITMAP hbmp = ske_CreateDIB32( mWidth, mHeight );
HBITMAP holdbmp = ( HBITMAP )SelectObject( memDC, hbmp );
- workRect = dis->rcItem;
+ RECT workRect = dis->rcItem;
OffsetRect( &workRect, -workRect.left, -workRect.top );
FillRect( memDC, &workRect, hbr );
DeleteObject( hbr );
@@ -540,12 +539,9 @@ INT_PTR SvcApplySkin(WPARAM wParam, LPARAM lParam)
INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam)
{
DRAWITEMSTRUCT *dis = ( DRAWITEMSTRUCT * )wParam;
-
- int mWidth, mHeight;
- RECT workRect = {0};
- mWidth = dis->rcItem.right-dis->rcItem.left;
- mHeight = dis->rcItem.bottom-dis->rcItem.top;
- workRect = dis->rcItem;
+ int mWidth = dis->rcItem.right-dis->rcItem.left;
+ int mHeight = dis->rcItem.bottom-dis->rcItem.top;
+ RECT workRect = dis->rcItem;
OffsetRect( &workRect, -workRect.left, -workRect.top );
if (lParam) {
diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp
index 6b8a71e8c4..eb1221ccf1 100644
--- a/plugins/Clist_modern/src/modern_skinselector.cpp
+++ b/plugins/Clist_modern/src/modern_skinselector.cpp
@@ -166,16 +166,17 @@ int ClearMaskList(LISTMODERNMASK * mmTemplateList)
mmTemplateList->dwMaskCnt = 0;
return 0;
}
-int DeleteMaskByItID(DWORD mID,LISTMODERNMASK * mmTemplateList)
+
+int DeleteMaskByItID(DWORD mID, LISTMODERNMASK *mmTemplateList)
{
if ( !mmTemplateList) return -1;
- if (mID < 0 || mID >= mmTemplateList->dwMaskCnt) return -1;
+ if (mID >= mmTemplateList->dwMaskCnt) return -1;
if (mmTemplateList->dwMaskCnt == 1)
{
SkinSelector_DeleteMask(&(mmTemplateList->pl_Masks[0]));
mir_free_and_nil(mmTemplateList->pl_Masks);
mmTemplateList->pl_Masks = NULL;
- mmTemplateList->dwMaskCnt;
+ mmTemplateList->dwMaskCnt--;
}
else
{
@@ -200,8 +201,8 @@ int DeleteMaskByItID(DWORD mID,LISTMODERNMASK * mmTemplateList)
int ExchangeMasksByID(DWORD mID1, DWORD mID2, LISTMODERNMASK * mmTemplateList)
{
if ( !mmTemplateList) return 0;
- if (mID1 < 0 || mID1 >= mmTemplateList->dwMaskCnt) return 0;
- if (mID2 < 0 || mID2 >= mmTemplateList->dwMaskCnt) return 0;
+ if (mID1 >= mmTemplateList->dwMaskCnt) return 0;
+ if (mID2 >= mmTemplateList->dwMaskCnt) return 0;
if (mID1 == mID2) return 0;
{
MODERNMASK mm;
@@ -211,6 +212,7 @@ int ExchangeMasksByID(DWORD mID1, DWORD mID2, LISTMODERNMASK * mmTemplateList)
}
return 1;
}
+
int SortMaskList(LISTMODERNMASK * mmList)
{
DWORD pos = 1;
@@ -394,13 +396,12 @@ int ParseToModernMask(MODERNMASK *mm, char * szText)
return 0;
};
-BOOL CompareModernMask(MODERNMASK *mmValue,MODERNMASK *mmTemplate)
+BOOL CompareModernMask(MODERNMASK *mmValue, MODERNMASK *mmTemplate)
{
//TODO
BOOL res = TRUE;
- BOOL exit = FALSE;
BYTE pVal = 0, pTemp = 0;
- while (pTemp < mmTemplate->dwParamCnt && pVal < mmValue->dwParamCnt && !exit)
+ while (pTemp < mmTemplate->dwParamCnt && pVal < mmValue->dwParamCnt)
{
// find pTemp parameter in mValue
DWORD vh, ph;
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index 95609a3105..c0aa02a0d9 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -455,7 +455,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
}
if (hIcon == NULL && (hxIcon == NULL || ((p.xStatusMode & 3) == 3))) {
- if (hIcon == NULL && (p.connectingIcon == 1) && p.ProtoStatus >= ID_STATUS_CONNECTING && p.ProtoStatus <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) {
+ if ((p.connectingIcon == 1) && p.ProtoStatus >= ID_STATUS_CONNECTING && p.ProtoStatus <= ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) {
hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)p.AccountName,0);
if (hIcon)
NeedDestroy = TRUE;
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp
index 3fce815114..729814fc7d 100644
--- a/plugins/Clist_modern/src/modern_statusbar_options.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp
@@ -475,7 +475,6 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
db_set_b(NULL, "CLUI", "SBarPerProto", IsDlgButtonChecked(hwndDlg, IDC_STATUSBAR_PER_PROTO));
for (int i=0; i < count; i++) {
- HWND hwndComboBox = GetDlgItem( hwndDlg, IDC_STATUSBAR_PROTO_LIST );
StatusBarProtocolOptions sbpo = dat[i];
char *defProto = sbpo.szName;
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index f2f8a77b0c..f2374775e2 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -403,8 +403,8 @@ void SaveState()
item.cchTextMax = 255;
item.iItem = i;
SendMessageA(hwndList, LVM_GETITEMA, 0, (LPARAM)&item);
- strncat(newProtoFilter, szTemp, 2048);
- strncat(newProtoFilter, "|", 2048);
+ strncat(newProtoFilter, szTemp, SIZEOF(newProtoFilter));
+ strncat(newProtoFilter, "|", SIZEOF(newProtoFilter));
newProtoFilter[2047] = 0;
}
}
@@ -424,8 +424,8 @@ void SaveState()
item.cchTextMax = 255;
item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
- _tcsncat(newGroupFilter, szTemp, 2048);
- _tcsncat(newGroupFilter, _T("|"), 2048);
+ _tcsncat(newGroupFilter, szTemp, SIZEOF(newGroupFilter));
+ _tcsncat(newGroupFilter, _T("|"), SIZEOF(newGroupFilter));
newGroupFilter[2047] = 0;
}
}
@@ -820,7 +820,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
GetDlgItemText(hwndDlg, IDC_NEWVIEMODE, szBuf, 256);
szBuf[255] = 0;
- if (lstrlen(szBuf) > 0) {
+ if (szBuf[0] != 0) {
char *szUTF8Buf = mir_utf8encodeT(szBuf);
if (db_get_dw(NULL, CLVM_MODULE, szUTF8Buf, -1) != -1)
diff --git a/plugins/Clist_modern/src/modern_xptheme.cpp b/plugins/Clist_modern/src/modern_xptheme.cpp
index 89cc699c56..c4d54d0e1a 100644
--- a/plugins/Clist_modern/src/modern_xptheme.cpp
+++ b/plugins/Clist_modern/src/modern_xptheme.cpp
@@ -153,9 +153,10 @@ HRESULT xpt_DrawTheme(XPTHANDLE xptHandle, HWND hwnd, HDC hdc, int type, int sta
xptlock();
if (xpt_IsThemed(xptHandle))
{
- if (IsThemeBackgroundPartiallyTransparent(((XPTObject*)xptHandle)->hThemeHandle, type, state))
- res = DrawThemeParentBackground(hwnd,hdc,sizeRect);
+ if (IsThemeBackgroundPartiallyTransparent(((XPTObject*)xptHandle)->hThemeHandle, type, state)) {
+ DrawThemeParentBackground(hwnd,hdc,sizeRect);
res = DrawThemeBackground(((XPTObject*)xptHandle)->hThemeHandle, hdc, type, state, sizeRect, clipRect);
+ }
}
xptunlock();
return res;
diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp
index fe5b2f256f..ea80e9be76 100644
--- a/protocols/AimOscar/src/ui.cpp
+++ b/protocols/AimOscar/src/ui.cpp
@@ -714,7 +714,7 @@ INT_PTR CALLBACK admin_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
GetDlgItemTextA(hwndDlg, IDC_CPW, cpw, sizeof(cpw));
GetDlgItemTextA(hwndDlg, IDC_NPW1, npw1, sizeof(npw1));
GetDlgItemTextA(hwndDlg, IDC_NPW2, npw2, sizeof(npw2));
- if (strlen(cpw) > 0 && strlen(npw1) > 0 && strlen(npw2) > 0)
+ if (cpw[0] != 0 && npw1[0] != 0 && npw2[0] != 0)
{
// AOL only requires that you send the current password and a (single) new password.
// Let's allow the client to type (two) new passwords incase they make a mistake so we
@@ -873,7 +873,7 @@ static INT_PTR CALLBACK options_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP
char str[128];
//SN
GetDlgItemTextA(hwndDlg, IDC_SN, str, sizeof(str));
- if (strlen(str)>0)
+ if (str[0] != 0)
ppro->setString(AIM_KEY_SN, str);
else
ppro->delSetting(AIM_KEY_SN);
@@ -891,7 +891,7 @@ static INT_PTR CALLBACK options_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP
//PW
GetDlgItemTextA(hwndDlg, IDC_PW, str, sizeof(str));
- if (strlen(str)>0)
+ if (str[0] != 0)
{
CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(str), (LPARAM) str);
ppro->setString(AIM_KEY_PW, str);
@@ -901,7 +901,7 @@ static INT_PTR CALLBACK options_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP
//HN
GetDlgItemTextA(hwndDlg, IDC_HN, str, sizeof(str));
- if (strlen(str)>0 && strcmp(str, AIM_DEFAULT_SERVER))
+ if (str[0] != 0 && strcmp(str, AIM_DEFAULT_SERVER))
ppro->setString(AIM_KEY_HN, str);
else
ppro->delSetting(AIM_KEY_HN);
@@ -1329,7 +1329,7 @@ INT_PTR CALLBACK join_chat_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case IDOK:
char room[128];
GetDlgItemTextA(hwndDlg, IDC_ROOM, room, sizeof(room));
- if (ppro->state==1 && strlen(room) > 0)
+ if (ppro->state == 1 && room[0] != 0)
{
chatnav_param* par = new chatnav_param(room, 4);
ppro->ForkThread(&CAimProto::chatnav_request_thread, par);