aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@ff385933-4943-42dc-877b-ffc776028de6>2004-03-03 20:46:48 +0000
committerschnetter <schnetter@ff385933-4943-42dc-877b-ffc776028de6>2004-03-03 20:46:48 +0000
commit393d33a40c1afcdfdbe32164730890dd6d27e533 (patch)
tree83c69d0e3dd9bd24a6756cb48c1a1e8664e9d702
parenta2b491c1d7fd75f9ed954486c21c586458259ec3 (diff)
Allow passing a NULL pointer as action, as is described in the documentation.
Fix detecting the variable type. git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/NaNChecker/trunk@55 ff385933-4943-42dc-877b-ffc776028de6
-rw-r--r--src/NaNCheck.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/NaNCheck.c b/src/NaNCheck.c
index 1b3c35f..af4da02 100644
--- a/src/NaNCheck.c
+++ b/src/NaNCheck.c
@@ -336,7 +336,7 @@ int NaNChecker_CheckVarsForNaN (const cGH *GH,
"scheduling graceful termination of Cactus");
CCTK_TerminateNext (NULL);
}
- else if (CCTK_Equals (info.action_if_found, "abort"))
+ else if (info.action_if_found && CCTK_Equals (info.action_if_found, "abort"))
{
CCTK_WARN (1, "'action_if_found' parameter is set to 'abort' - "
"aborting Cactus now");
@@ -778,24 +778,24 @@ static void CheckForNaN (int vindex, const char *optstring, void *_info)
/* do the checking according to the variable's type */
nans_found = 0;
- if (vtype == CCTK_VARIABLE_REAL || CCTK_VARIABLE_COMPLEX)
+ if (vtype == CCTK_VARIABLE_REAL || vtype == CCTK_VARIABLE_COMPLEX)
{
CHECK_DATA (CCTK_REAL);
}
#ifdef CCTK_REAL4
- else if (vtype == CCTK_VARIABLE_REAL4 || CCTK_VARIABLE_COMPLEX8)
+ else if (vtype == CCTK_VARIABLE_REAL4 || vtype == CCTK_VARIABLE_COMPLEX8)
{
CHECK_DATA (CCTK_REAL4);
}
#endif
#ifdef CCTK_REAL8
- else if (vtype == CCTK_VARIABLE_REAL8 || CCTK_VARIABLE_COMPLEX16)
+ else if (vtype == CCTK_VARIABLE_REAL8 || vtype == CCTK_VARIABLE_COMPLEX16)
{
CHECK_DATA (CCTK_REAL8);
}
#endif
#ifdef CCTK_REAL16
- else if (vtype == CCTK_VARIABLE_REAL16 || CCTK_VARIABLE_COMPLEX32)
+ else if (vtype == CCTK_VARIABLE_REAL16 || vtype == CCTK_VARIABLE_COMPLEX32)
{
CHECK_DATA (CCTK_REAL16);
}