diff options
author | knarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2010-09-28 15:34:42 +0000 |
---|---|---|
committer | knarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2010-09-28 15:34:42 +0000 |
commit | 638f96754f31e73d795fe36fad3ea2cfced153f6 (patch) | |
tree | 8f1243c4b894e124611351371597449a970f6218 /src/main | |
parent | a341ebb7b3d7fc1b264c0f9d9e480e3d03a9b813 (diff) |
check return value of CCTK_VarIndex for check of if/while variable in schedule tree, and give corresponding warning message
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4637 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/ScheduleInterface.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/main/ScheduleInterface.c b/src/main/ScheduleInterface.c index 88506e6e..4bd3b892 100644 --- a/src/main/ScheduleInterface.c +++ b/src/main/ScheduleInterface.c @@ -1560,27 +1560,32 @@ int ValidateModifiers(t_sched_modifier *modifier) for (;modifier;modifier=modifier->next) { - if (modifier->type == sched_while) + vindex = CCTK_VarIndex(modifier->argument); + if (vindex < 0) { - vindex = CCTK_VarIndex(modifier->argument); - type = CCTK_VarTypeI(vindex); - if (type != CCTK_VARIABLE_INT) - { - CCTK_VWarn(0,__LINE__,__FILE__,"Cactus", - "While qualifier %s is not a CCTK_INT grid variable", - modifier->argument); - retval = -1; - } + CCTK_VWarn(0,__LINE__,__FILE__,"Cactus", + "While qualifier %s could not be parsed as fully " + "specified grid variable name (e.g. MyThorn::MyVar", + modifier->argument); + retval = -1; } - else if (modifier->type == sched_if) + else { - vindex = CCTK_VarIndex(modifier->argument); type = CCTK_VarTypeI(vindex); if (type != CCTK_VARIABLE_INT) { - CCTK_VWarn(0,__LINE__,__FILE__,"Cactus", - "If qualifier %s is not a CCTK_INT grid variable", - modifier->argument); + if (modifier->type == sched_while) + { + CCTK_VWarn(0,__LINE__,__FILE__,"Cactus", + "While qualifier %s is not a CCTK_INT grid variable", + modifier->argument); + } + else if (modifier->type == sched_if) + { + CCTK_VWarn(0,__LINE__,__FILE__,"Cactus", + "If qualifier %s is not a CCTK_INT grid variable", + modifier->argument); + } retval = -1; } } |