Using NS_ENSURE and NS_GET_IID()

git-svn-id: svn://10.0.0.236/trunk@49590 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dp%netscape.com 1999-10-01 20:13:55 +00:00
parent 90f49df885
commit bb72e03927

View File

@ -76,8 +76,6 @@ MAKE_CTOR(Sample)
//----------------------------------------------------------------------
static NS_DEFINE_IID(kIModuleIID, NS_IMODULE_IID);
nsSampleModule::nsSampleModule()
: mInitialized(PR_FALSE)
{
@ -89,7 +87,7 @@ nsSampleModule::~nsSampleModule()
Shutdown();
}
NS_IMPL_ISUPPORTS(nsSampleModule, kIModuleIID)
NS_IMPL_ISUPPORTS(nsSampleModule, NS_GET_IID(nsIModule))
// Perform our one-time intialization for this module
nsresult
@ -254,8 +252,8 @@ extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
{
nsresult rv = NS_OK;
NS_ASSERTION(return_cobj, "Null argument");
NS_ASSERTION(gModule == NULL, "nsSampleModule: Module already created.");
NS_ENSURE_ARG_POINTER(return_cobj);
NS_ENSURE_NOT(gModule, NS_ERROR_FAILURE);
// Create and initialize the module instance
nsSampleModule *m = new nsSampleModule();