NS_GET_IID(). Thanks to patch from pp@ludasdesign.com r=dp@netscape.com

git-svn-id: svn://10.0.0.236/trunk@54828 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dp%netscape.com
1999-12-01 00:21:53 +00:00
parent 70d1511ad8
commit 694b0720be
30 changed files with 149 additions and 150 deletions

View File

@@ -18,6 +18,7 @@
* Rights Reserved.
*
* Contributor(s):
* Pierre Phaneuf <pp@ludusdesign.com>
*/
/*
@@ -37,7 +38,7 @@
/**
* IIDs and CIDs (aka CLSIDs) are 32 digit hexadecimal numbers, called Globally
* Unique IDs (GUIDs) as a whole. They should only be generated by a trusted
* guid generator. GUID generatoration algorithms rely on parameters such as
* guid generator. GUID generation algorithms rely on parameters such as
* the MAC address of your NIC, and the date/time of GUID creation to ensure
* that no two GUIDs are ever the same. The Windows program 'uuidgen' is one
* way to create these numbers. The Unix alternative is probably out there
@@ -47,9 +48,9 @@
* that will be used later. IID and CID objects are of the same form, so the
* distinction between InterfaceID and ClassID is made strictly by what the
* ID represents, and not by any binary differences.
*
* Note: NS_DEFINE_IID is now deprecated by NS_GET_IID.
*/
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
static NS_DEFINE_CID(kSampleCID, NS_SAMPLE_CID);
@@ -144,11 +145,11 @@ SampleFactoryImpl::QueryInterface(const nsIID &aIID, void **aResult)
// Always NULL result, in case of failure
*aResult = nsnull;
if (aIID.Equals(kISupportsIID)) {
if (aIID.Equals(NS_GET_IID(nsISupports))) {
*aResult = NS_STATIC_CAST(nsISupports*, this);
AddRef();
return NS_OK;
} else if (aIID.Equals(kIFactoryIID)) {
} else if (aIID.Equals(NS_GET_IID(nsIFactory))) {
*aResult = NS_STATIC_CAST(nsIFactory*, this);
AddRef();
return NS_OK;