fix a log of unix warnning- 1) make sure all XPCOM class destructor are virtual and fix warnning in new file

This commit is contained in:
ftang%netscape.com 1999-02-26 16:32:08 +00:00
Родитель 1c109c3cf9
Коммит cfd20ced26
11 изменённых файлов: 16 добавлений и 197 удалений

Просмотреть файл

@ -58,6 +58,7 @@ private:
nsString iso2022jp;
nsString utf8;
nsString xmacroman;
nsString unknown;
};
NS_IMPL_ISUPPORTS(nsCharsetAlias, kICharsetAliasIID);
@ -74,6 +75,7 @@ nsCharsetAlias::nsCharsetAlias()
iso2022jp = "ISO-2022-JP";
xmacroman = "x-mac-roman";
utf8 = "UTF8";
unknown = "";
}
nsCharsetAlias::~nsCharsetAlias()
@ -126,7 +128,7 @@ const nsString& nsCharsetAlias::GetPreferred(
return utf8;
}
return "";
return unknown;
}
NS_IMETHODIMP nsCharsetAlias::GetPreferred(
@ -157,7 +159,7 @@ NS_IMETHODIMP nsCharsetAlias::GetPreferred(
const nsString& res = GetPreferred(aAlias);
if(res.Equals(""))
{
*oResult = NULL;
*oResult = (char) NULL;
return NS_ERROR_NOT_AVAILABLE;
}
res.ToCString(oResult, aBufLength);
@ -202,7 +204,7 @@ public:
NS_INIT_REFCNT();
PR_AtomicIncrement(&g_InstanceCount);
}
~nsCharsetAliasFactory() {
virtual ~nsCharsetAliasFactory() {
PR_AtomicDecrement(&g_InstanceCount);
}

Просмотреть файл

@ -47,7 +47,7 @@ struct ConverterInfo
ConverterInfo() {}
~ConverterInfo()
virtual ~ConverterInfo()
{
if (mCharset != NULL) delete mCharset;
}
@ -141,7 +141,7 @@ public:
/**
* Class destructor.
*/
~nsCharsetConverterManager();
virtual ~nsCharsetConverterManager();
/**
* Unique factory method for this class (the constructor is private).

Просмотреть файл

@ -1,61 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
#ifndef nsCharsetConverterManager_h___
#define nsCharsetConverterManager_h___
#include "nsIFactory.h"
//----------------------------------------------------------------------
// Class nsManagerFactory [declaration]
/**
* Factory class for the nsICharsetConverterManager objects.
*
* @created 18/Nov/1998
* @author Catalin Rotaru [CATA]
*/
class nsManagerFactory : public nsIFactory
{
NS_DECL_ISUPPORTS
public:
/**
* Class constructor.
*/
nsManagerFactory();
/**
* Class destructor.
*/
~nsManagerFactory();
//--------------------------------------------------------------------
// Interface nsIFactory [declaration]
NS_IMETHOD CreateInstance(nsISupports *aDelegate, const nsIID &aIID,
void **aResult);
NS_IMETHOD LockFactory(PRBool aLock);
};
#endif /* nsCharsetConverterManager_h___ */

Просмотреть файл

@ -35,7 +35,7 @@ class nsMacCharset : public nsIPlatformCharset
public:
nsMacCharset();
~nsMacCharset();
virtual ~nsMacCharset();
NS_IMETHOD GetCharset(nsPlatformCharsetSel selector, nsString& oResult);
@ -68,7 +68,7 @@ public:
NS_INIT_REFCNT();
PR_AtomicIncrement(&g_InstanceCount);
}
~nsMacCharsetFactory() {
virtual ~nsMacCharsetFactory() {
PR_AtomicDecrement(&g_InstanceCount);
}

Просмотреть файл

@ -35,7 +35,7 @@ class nsUNIXCharset : public nsIPlatformCharset
public:
nsUNIXCharset();
~nsUNIXCharset();
virtual ~nsUNIXCharset();
NS_IMETHOD GetCharset(nsPlatformCharsetSel selector, nsString& oResult);
@ -68,7 +68,7 @@ public:
NS_INIT_REFCNT();
PR_AtomicIncrement(&g_InstanceCount);
}
~nsUNIXCharsetFactory() {
virtual ~nsUNIXCharsetFactory() {
PR_AtomicDecrement(&g_InstanceCount);
}

Просмотреть файл

@ -38,7 +38,7 @@ public:
*/
nsUnicodeDecodeUtil();
~nsUnicodeDecodeUtil();
virtual ~nsUnicodeDecodeUtil();
public:
NS_IMETHOD Convert(

Просмотреть файл

@ -47,7 +47,7 @@ public:
/**
* Class destructor.
*/
~nsUnicodeEncodeHelper();
virtual ~nsUnicodeEncodeHelper();
//--------------------------------------------------------------------
// Interface nsIUnicodeEncodeHelper [declaration]

Просмотреть файл

@ -1,61 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
#ifndef nsUnicodeEncodeHelper_h___
#define nsUnicodeEncodeHelper_h___
#include "nsIFactory.h"
//----------------------------------------------------------------------
// Class nsEncodeHelperFactory [declaration]
/**
* Factory class for the nsUnicodeEncodeHelper objects.
*
* @created 18/Feb/1999
* @author Catalin Rotaru [CATA]
*/
class nsEncodeHelperFactory : public nsIFactory
{
NS_DECL_ISUPPORTS
public:
/**
* Class constructor.
*/
nsEncodeHelperFactory();
/**
* Class destructor.
*/
~nsEncodeHelperFactory();
//--------------------------------------------------------------------
// Interface nsIFactory [declaration]
NS_IMETHOD CreateInstance(nsISupports *aDelegate, const nsIID &aIID,
void **aResult);
NS_IMETHOD LockFactory(PRBool aLock);
};
#endif /* nsUnicodeEncodeHelper_h___ */

Просмотреть файл

@ -61,7 +61,7 @@ class nsWinCharset : public nsIPlatformCharset
public:
nsWinCharset();
~nsWinCharset();
virtual ~nsWinCharset();
NS_IMETHOD GetCharset(nsPlatformCharsetSel selector, nsString& oResult);
@ -94,7 +94,7 @@ public:
NS_INIT_REFCNT();
PR_AtomicIncrement(&g_InstanceCount);
}
~nsWinCharsetFactory() {
virtual ~nsWinCharsetFactory() {
PR_AtomicDecrement(&g_InstanceCount);
}

Просмотреть файл

@ -47,7 +47,7 @@ public:
/**
* Class destructor.
*/
~nsUnicodeEncodeHelper();
virtual ~nsUnicodeEncodeHelper();
//--------------------------------------------------------------------
// Interface nsIUnicodeEncodeHelper [declaration]

Просмотреть файл

@ -1,61 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
#ifndef nsUnicodeEncodeHelper_h___
#define nsUnicodeEncodeHelper_h___
#include "nsIFactory.h"
//----------------------------------------------------------------------
// Class nsEncodeHelperFactory [declaration]
/**
* Factory class for the nsUnicodeEncodeHelper objects.
*
* @created 18/Feb/1999
* @author Catalin Rotaru [CATA]
*/
class nsEncodeHelperFactory : public nsIFactory
{
NS_DECL_ISUPPORTS
public:
/**
* Class constructor.
*/
nsEncodeHelperFactory();
/**
* Class destructor.
*/
~nsEncodeHelperFactory();
//--------------------------------------------------------------------
// Interface nsIFactory [declaration]
NS_IMETHOD CreateInstance(nsISupports *aDelegate, const nsIID &aIID,
void **aResult);
NS_IMETHOD LockFactory(PRBool aLock);
};
#endif /* nsUnicodeEncodeHelper_h___ */