Changed error code checking in NSRegisterSelf as suggested by ftang.

This commit is contained in:
nhotta%netscape.com 1999-03-23 22:57:11 +00:00
Родитель 458a079388
Коммит 7a45bc2ab8
3 изменённых файлов: 26 добавлений и 26 удалений

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

@ -122,28 +122,28 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *
//
rv = compMgr->RegisterComponent(kLocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: RegisterFactory failed.");
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
//
// register the collation factory
//
rv = compMgr->RegisterComponent(kCollationFactoryCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register CollationFactory failed.");
if (NS_FAILED(rv)) goto done;
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
//
// register the collation interface
//
rv = compMgr->RegisterComponent(kCollationCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register Collation failed.");
if (NS_FAILED(rv)) goto done;
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
//
// register the date time formatter
//
rv = compMgr->RegisterComponent(kDateTimeFormatCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register DateTimeFormat failed.");
if (NS_FAILED(rv)) goto done;
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
done:
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
@ -164,16 +164,16 @@ extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char
if (NS_FAILED(rv)) return rv;
rv = compMgr->UnregisterFactory(kLocaleFactoryCID, path);
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv)) goto done;
rv = compMgr->UnregisterFactory(kCollationFactoryCID, path);
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv)) goto done;
rv = compMgr->UnregisterFactory(kCollationCID, path);
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv)) goto done;
rv = compMgr->UnregisterFactory(kDateTimeFormatCID, path);
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv)) goto done;
done:
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);

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

@ -120,28 +120,28 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *
//
rv = compMgr->RegisterComponent(kLocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: RegisterFactory failed.");
if (rv!=NS_OK) goto done;
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
//
// register the collation factory
//
rv = compMgr->RegisterComponent(kCollationFactoryCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register CollationFactory failed.");
if (NS_FAILED(rv)) goto done;
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
//
// register the collation interface
//
rv = compMgr->RegisterComponent(kCollationCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register Collation failed.");
if (NS_FAILED(rv)) goto done;
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
//
// register the date time formatter
//
rv = compMgr->RegisterComponent(kDateTimeFormatCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register DateTimeFormat failed.");
if (NS_FAILED(rv)) goto done;
if(NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
done:
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
@ -162,16 +162,16 @@ extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char
if (NS_FAILED(rv)) return rv;
rv = compMgr->UnregisterFactory(kLocaleFactoryCID, path);
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv)) goto done;
rv = compMgr->UnregisterFactory(kCollationFactoryCID, path);
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv)) goto done;
rv = compMgr->UnregisterFactory(kCollationCID, path);
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv)) goto done;
rv = compMgr->UnregisterFactory(kDateTimeFormatCID, path);
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv)) goto done;
done:
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);

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

@ -136,35 +136,35 @@ extern "C" NS_EXPORT nsresult NSRegisterSelf(nsISupports* aServMgr, const char *
//
rv = compMgr->RegisterComponent(kLocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: RegisterFactory failed.");
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
//
// register the windows specific factory
//
rv = compMgr->RegisterComponent(kWin32LocaleFactoryCID,NULL,NULL,path,PR_TRUE,PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register nsIWin32LocaleFactory failed.");
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
//
// register the collation factory
//
rv = compMgr->RegisterComponent(kCollationFactoryCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register CollationFactory failed.");
if (NS_FAILED(rv)) goto done;
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
//
// register the collation interface
//
rv = compMgr->RegisterComponent(kCollationCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register Collation failed.");
if (NS_FAILED(rv)) goto done;
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
//
// register the date time formatter
//
rv = compMgr->RegisterComponent(kDateTimeFormatCID, NULL, NULL, path, PR_TRUE, PR_TRUE);
NS_ASSERTION(rv==NS_OK,"nsLocaleTest: Register DateTimeFormat failed.");
if (NS_FAILED(rv)) goto done;
if (NS_FAILED(rv) && (NS_ERROR_FACTORY_EXISTS != rv)) goto done;
done:
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);
@ -185,19 +185,19 @@ extern "C" NS_EXPORT nsresult NSUnregisterSelf(nsISupports* aServMgr, const char
if (NS_FAILED(rv)) return rv;
rv = compMgr->UnregisterFactory(kLocaleFactoryCID, path);
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv)) goto done;
rv = compMgr->UnregisterFactory(kWin32LocaleFactoryCID, path);
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv)) goto done;
rv = compMgr->UnregisterFactory(kCollationFactoryCID, path);
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv)) goto done;
rv = compMgr->UnregisterFactory(kCollationCID, path);
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv)) goto done;
rv = compMgr->UnregisterFactory(kDateTimeFormatCID, path);
if (rv!=NS_OK) goto done;
if (NS_FAILED(rv)) goto done;
done:
(void)servMgr->ReleaseService(kComponentManagerCID, compMgr);