diff options
author | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-05-11 16:48:28 +0000 |
---|---|---|
committer | tradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2000-05-11 16:48:28 +0000 |
commit | 6d3e5142c183dbb860e99ab55bc700214fad37c2 (patch) | |
tree | deb0e926b788b67ed4c6d7703e71d5e43c24fd5b /src/main/GHExtensions.c | |
parent | a409ec79b887b9799e8cbb0c07396e00f5003d67 (diff) |
Skip already unregistered GH extensions when looping over all handles.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1648 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/GHExtensions.c')
-rw-r--r-- | src/main/GHExtensions.c | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/src/main/GHExtensions.c b/src/main/GHExtensions.c index 5f46dc86..69b72cd8 100644 --- a/src/main/GHExtensions.c +++ b/src/main/GHExtensions.c @@ -383,7 +383,10 @@ int CCTKi_InitGHExtensions(cGH *GH) for(handle = 0; handle < num_extensions; handle++) { extension = (struct GHExtension *)Util_GetHandledData(GHExtensions, handle); - extension->InitGH(GH); + if(extension) + { + extension->InitGH(GH); + } } return 0; @@ -412,7 +415,10 @@ int CCTKi_ScheduleTraverseGHExtensions(cGH *GH, for(handle = 0; handle < num_extensions; handle++) { extension = (struct GHExtension *)Util_GetHandledData(GHExtensions, handle); - extension->ScheduleTraverseGH(GH, where); + if(extension) + { + extension->ScheduleTraverseGH(GH, where); + } } return 0; @@ -451,38 +457,39 @@ static int CheckAllExtensionsSetup(void) for(handle = 0; handle < num_extensions; handle++) { extension = (struct GHExtension *)Util_GetHandledData(GHExtensions, handle); - - /* Check that each function has been registered. - * Print a warning if not, and then register a dummy function. - */ - - /* SetupGH */ - if(!extension->SetupGH) + if(extension) { - CCTK_VWarn(4,__LINE__,__FILE__,"Cactus", - "GH Extension '%s' has not registered a SetupGH routine", - Util_GetHandleName(GHExtensions, handle)); - extension->SetupGH=DummySetupGH; - } + /* Check that each function has been registered. + * Print a warning if not, and then register a dummy function. + */ - /* InitGH */ - if(!extension->InitGH) - { - CCTK_VWarn(4,__LINE__,__FILE__,"Cactus", - "GH Extension '%s' has not registered a InitGH routine", - Util_GetHandleName(GHExtensions, handle)); - extension->InitGH=DummyInitGH; - } + /* SetupGH */ + if(!extension->SetupGH) + { + CCTK_VWarn(4,__LINE__,__FILE__,"Cactus", + "GH Extension '%s' has not registered a SetupGH routine", + Util_GetHandleName(GHExtensions, handle)); + extension->SetupGH=DummySetupGH; + } - /* ScheduleTraverse */ - if(!extension->ScheduleTraverseGH) - { - CCTK_VWarn(4,__LINE__,__FILE__,"Cactus", - "GH Extension '%s' has not registered a ScheduleTraverse routine", - Util_GetHandleName(GHExtensions, handle)); - extension->ScheduleTraverseGH=DummyScheduleTraverseGH; - } + /* InitGH */ + if(!extension->InitGH) + { + CCTK_VWarn(4,__LINE__,__FILE__,"Cactus", + "GH Extension '%s' has not registered a InitGH routine", + Util_GetHandleName(GHExtensions, handle)); + extension->InitGH=DummyInitGH; + } + /* ScheduleTraverse */ + if(!extension->ScheduleTraverseGH) + { + CCTK_VWarn(4,__LINE__,__FILE__,"Cactus", + "GH Extension '%s' has not registered a ScheduleTraverse routine", + Util_GetHandleName(GHExtensions, handle)); + extension->ScheduleTraverseGH=DummyScheduleTraverseGH; + } + } } return return_code; |