mailnews/base/search/src/nsMsgFilterList.cpp: In member function 'nsresult nsMsgFilterList::SaveTextFilters(nsIOutputStream*)':
mailnews/base/search/src/nsMsgFilterList.cpp:871:15: warning: variable 'attribStr' set but not used [-Wunused-but-set-variable]
mailnews/base/search/src/nsMsgFilterList.cpp: In member function 'virtual nsresult nsMsgFilterList::MoveFilter(nsIMsgFilter*, nsMsgFilterMotionValue)':
mailnews/base/search/src/nsMsgFilterList.cpp:1043:60: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
From bug 821743: email@example.com 2012-12-22 21:51:03 CET
Comment on attachment 695244 [details] [diff] [review] [diff] [review]
>+ NS_ENSURE_ARG_MAX(aIndex, m_actionList.Length() - 1);
Not sure that this does the right thing for an empty list.
The same problem happens here in nsIMsgFilterList.cpp.
Created attachment 695261 [details] [diff] [review]
Comment on attachment 695261 [details] [diff] [review]
> nsresult nsMsgFilterList::GetFilterAt(uint32_t filterIndex, nsIMsgFilter **filter)
>- uint32_t filterCount = 0;
>- NS_ENSURE_ARG_MAX(filterIndex, filterCount - 1);
>+ NS_ENSURE_ARG(filterIndex < m_filters.Length());
You're trying to fix too many bugs at once and ending up with a mishmash. Although it's a good idea to replace calls to GetFilterCount with direct access to Length() you should file a separate bugs and fix up all the cases at once. Please put this back for now so that it looks like the check in MoveFilterAt below. r=me with that fixed.
I do not want to replace any other occurrence of GetFilterCount in that file. If you see the file history I am the one who put them there originally ;) I just wanted to replace this single one. So I will not file any separate bug for that.
So if you consider the change to be good as you say, either accept it here, or I take it out as you wish, but then it will not be done later (at least not by me).
When I said "calls" I meant "all the internal calls". I didn't mean "one call because I felt like it". I can't see any justification for only changing one call.
Created attachment 695659 [details] [diff] [review]
As you wish.