summaryrefslogtreecommitdiff
path: root/src/main/Parameters.c
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-05-20 22:26:09 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>2002-05-20 22:26:09 +0000
commit6a9bdcc53491660dff1443904142e3ddf7a5eacf (patch)
tree2fd6a8b3bd4fca53db2cd731ab7b94e07e2efc7e /src/main/Parameters.c
parent5784e5fc433e446acddcc8fe740d838d64678def (diff)
Give error message if tried to set an array parameter without the [number].
Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@2836 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/Parameters.c')
-rw-r--r--src/main/Parameters.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/Parameters.c b/src/main/Parameters.c
index 519150ce..6633eb0a 100644
--- a/src/main/Parameters.c
+++ b/src/main/Parameters.c
@@ -528,6 +528,7 @@ void CCTKi_ParameterAccumulatorBase(const char *thorn,
-3 if trying to steer a non-steerable parameter<br>
-6 if not a valid integer or float<br>
-7 if tried to set an accumulator parameter directly<br>
+ -8 if tried to set an accumulator parameter directly<br>
-9 if final value of accumulator out of range<br>
@endreturndesc
@@*/
@@ -546,6 +547,7 @@ int CCTK_ParameterSet (const char *name, const char *thorn, const char *value)
CCTK_VWarn (1, __LINE__, __FILE__, "Cactus",
"CCTK_ParameterSet: Cannot set base array parameter '%s::%s' "
, thorn, name);
+ retval = -8;
}
else if(param->props->accumulator_expression)
{
@@ -1137,7 +1139,7 @@ static t_param *ParameterFind (const char *name,
if(list)
{
- if(list->param->array)
+ if(list->param->array && array_index > -1)
{
if(array_index < list->param->props->array_size)
{
@@ -2254,7 +2256,7 @@ static void GetBaseName(const char *name, char **basename, int *array_index)
else
{
baselen = strlen(name);
- *array_index = 0;
+ *array_index = -1;
}
*basename = (char *)malloc(baselen+1);