Bug 1487082 - Resolve potential for build bustage regarding bad implicit conversion constructors

* Part 1: make conversion CTORs explicit.
  Minor tweaks to conform with new(ish) static analysis rule which flags up implicit single-argument conversion constructors.
* Part 2: fix a couple of double-mRefCnt declaration errors.
* Part 3: Fix unsafe use of NS_ConvertASCIItoUTF16().

Tag #1273
This commit is contained in:
Matt A. Tobin 2019-11-10 19:11:03 -05:00 committed by Roy Tam
commit eaac1c967d
57 changed files with 71 additions and 69 deletions

View file

@ -56,7 +56,7 @@ public:
NS_DECL_NSIAUTOSYNCSTATE
NS_DECL_NSIURLLISTENER
nsAutoSyncState(nsImapMailFolder *aOwnerFolder, PRTime aLastSyncTime = 0UL);
explicit nsAutoSyncState(nsImapMailFolder *aOwnerFolder, PRTime aLastSyncTime = 0UL);
/// Called by owner folder when new headers are fetched from the server
void OnNewHeaderFetchCompleted(const nsTArray<nsMsgKey> &aMsgKeyList);

View file

@ -20,7 +20,7 @@ class nsImapFlagAndUidState : public nsIImapFlagAndUidState
{
public:
NS_DECL_THREADSAFE_ISUPPORTS
nsImapFlagAndUidState(int numberOfMessages);
explicit nsImapFlagAndUidState(int numberOfMessages);
NS_DECL_NSIIMAPFLAGANDUIDSTATE

View file

@ -6363,7 +6363,7 @@ NS_IMETHODIMP nsImapMailFolder::GetOtherUsersWithAccess(
class AdoptUTF8StringEnumerator final : public nsIUTF8StringEnumerator
{
public:
AdoptUTF8StringEnumerator(nsTArray<nsCString>* array) :
explicit AdoptUTF8StringEnumerator(nsTArray<nsCString>* array) :
mStrings(array), mIndex(0)
{}

View file

@ -115,7 +115,7 @@ class nsImapMailFolder;
class nsMsgIMAPFolderACL
{
public:
nsMsgIMAPFolderACL(nsImapMailFolder *folder);
explicit nsMsgIMAPFolderACL(nsImapMailFolder *folder);
~nsMsgIMAPFolderACL();
bool SetFolderRightsForUser(const nsACString& userName, const nsACString& rights);

View file

@ -1057,7 +1057,7 @@ void nsImapProtocol::ReleaseUrlState(bool rerunning)
class nsImapThreadShutdownEvent : public mozilla::Runnable {
public:
nsImapThreadShutdownEvent(nsIThread *thread) : mThread(thread) {
explicit nsImapThreadShutdownEvent(nsIThread *thread) : mThread(thread) {
}
NS_IMETHOD Run() {
mThread->Shutdown();
@ -9580,7 +9580,7 @@ nsresult nsImapMockChannel::ReadFromMemCache(nsICacheEntry *entry)
class nsReadFromImapConnectionFailure : public mozilla::Runnable
{
public:
nsReadFromImapConnectionFailure(nsImapMockChannel *aChannel)
explicit nsReadFromImapConnectionFailure(nsImapMockChannel *aChannel)
: mImapMockChannel(aChannel)
{}

View file

@ -25,7 +25,7 @@ private:
class nsImapSearchResultIterator {
public:
nsImapSearchResultIterator(nsImapSearchResultSequence &sequence);
explicit nsImapSearchResultIterator(nsImapSearchResultSequence &sequence);
virtual ~nsImapSearchResultIterator();
void ResetIterator();

View file

@ -28,7 +28,7 @@ class nsCString;
class nsImapServerResponseParser : public nsIMAPGenericParser
{
public:
nsImapServerResponseParser(nsImapProtocol &imapConnection);
explicit nsImapServerResponseParser(nsImapProtocol &imapConnection);
virtual ~nsImapServerResponseParser();
// Overridden from the base parser class

View file

@ -27,7 +27,7 @@
class StreamListenerProxy final : public nsIStreamListener
{
public:
StreamListenerProxy(nsIStreamListener* receiver)
explicit StreamListenerProxy(nsIStreamListener* receiver)
: mReceiver(receiver)
{ }
@ -45,7 +45,7 @@ private:
class ImapMailFolderSinkProxy final : public nsIImapMailFolderSink
{
public:
ImapMailFolderSinkProxy(nsIImapMailFolderSink* receiver)
explicit ImapMailFolderSinkProxy(nsIImapMailFolderSink* receiver)
: mReceiver(receiver)
{
NS_ASSERTION(receiver, "Don't allow receiver is nullptr");
@ -64,7 +64,7 @@ private:
class ImapServerSinkProxy final : public nsIImapServerSink
{
public:
ImapServerSinkProxy(nsIImapServerSink* receiver)
explicit ImapServerSinkProxy(nsIImapServerSink* receiver)
: mReceiver(receiver)
{ }
@ -82,7 +82,7 @@ private:
class ImapMessageSinkProxy final : public nsIImapMessageSink
{
public:
ImapMessageSinkProxy(nsIImapMessageSink* receiver)
explicit ImapMessageSinkProxy(nsIImapMessageSink* receiver)
: mReceiver(receiver)
{ }
@ -99,7 +99,7 @@ private:
class ImapProtocolSinkProxy final : public nsIImapProtocolSink
{
public:
ImapProtocolSinkProxy(nsIImapProtocolSink* receiver)
explicit ImapProtocolSinkProxy(nsIImapProtocolSink* receiver)
: mReceiver(receiver)
{ }